diff --git a/toolchain/check/custom_witness.cpp b/toolchain/check/custom_witness.cpp index 020b2af3e384..520cb3c530b2 100644 --- a/toolchain/check/custom_witness.cpp +++ b/toolchain/check/custom_witness.cpp @@ -64,54 +64,258 @@ static auto MakeCopyOpFunction(Context& context, SemIR::LocId loc_id, // Returns the body for `Destroy.Op`. This will return `None` if using the // builtin `NoOp` is appropriate. +// Returns a FacetType that contains only the query interface. +static auto GetFacetTypeForQuerySpecificInterface( + Context& context, SemIR::LocId loc_id, + SemIR::SpecificInterfaceId query_specific_interface_id) + -> SemIR::ConstantId { + const auto query_specific_interface = + context.specific_interfaces().Get(query_specific_interface_id); + + // The Self facet will have type FacetType, for the query interface. + auto const_id = EvalOrAddInst( + context, loc_id, + FacetTypeFromInterface(context, query_specific_interface.interface_id, + query_specific_interface.specific_id)); + return const_id; +} + +// Starts a block for lookup-related instructions, and returns the `FacetType` +// for lookups in `HasWitnessForRepeatedField`. +static auto PrepareForHasWitness( + Context& context, SemIR::LocId loc_id, + SemIR::SpecificInterfaceId query_specific_interface_id) + -> SemIR::ConstantId { + context.inst_block_stack().Push(); + StartGenericDecl(context); + + return GetFacetTypeForQuerySpecificInterface(context, loc_id, + query_specific_interface_id); +} + +// Cleans up state `PrepareForHasWitness`. +static auto CleanupAfterHasWitness(Context& context) -> void { + DiscardGenericDecl(context); + context.inst_block_stack().PopAndDiscard(); +} + +// Returns true if `type_inst_id` has a witness for the query interface, which +// comes from `PrepareForHasWitness`. +static auto HasWitnessForRepeatedField( + Context& context, SemIR::LocId loc_id, SemIR::InstId type_inst_id, + SemIR::ConstantId query_facet_type_const_id) -> bool { + auto type_const_id = context.constant_values().Get(type_inst_id); + auto block_or_err = LookupImplWitness(context, loc_id, type_const_id, + query_facet_type_const_id); + return block_or_err.has_value(); +} + +// The format for `Destroy.Op`. +enum class DestroyFormat { + NoDestroy, + Trivial, + NonTrivial, +}; + +// Similar to `HasWitnessForRepeatedField`, but for cases where there's only one +// field, this can handle the call to `PrepareForHasWitness`. +static auto HasWitnessForOneField( + Context& context, SemIR::LocId loc_id, SemIR::InstId field_inst_id, + SemIR::SpecificInterfaceId query_specific_interface_id) -> DestroyFormat { + auto query_facet_type_const_id = + PrepareForHasWitness(context, loc_id, query_specific_interface_id); + auto has_witness = HasWitnessForRepeatedField(context, loc_id, field_inst_id, + query_facet_type_const_id); + CleanupAfterHasWitness(context); + return has_witness ? DestroyFormat::NonTrivial : DestroyFormat::NoDestroy; +} + +// Returns true if `class_type` should impl `Destroy`. +static auto CanDestroyClass( + Context& context, SemIR::LocId loc_id, SemIR::ClassType class_type, + SemIR::SpecificInterfaceId query_specific_interface_id, bool is_partial) + -> DestroyFormat { + auto class_info = context.classes().Get(class_type.class_id); + // Incomplete and abstract classes can't be destroyed. + if (!class_info.is_complete() || + (!is_partial && class_info.inheritance_kind == + SemIR::Class::InheritanceKind::Abstract)) { + return DestroyFormat::NoDestroy; + } + + // `LookupCppImpl` handles C++ types. + if (context.name_scopes().Get(class_info.scope_id).is_cpp_scope()) { + return DestroyFormat::NoDestroy; + } + + auto object_repr_id = + class_info.GetObjectRepr(context.sem_ir(), class_type.specific_id); + return HasWitnessForOneField(context, loc_id, + context.types().GetTypeInstId(object_repr_id), + query_specific_interface_id); +} + +// Returns true if the `Self` should impl `Destroy`. This will recurse into impl +// lookup of `Destroy` for members, similar to `where .Self.members each impls +// Destroy`. +static auto CanDestroyType( + Context& context, SemIR::LocId loc_id, + SemIR::ConstantId query_self_const_id, + SemIR::SpecificInterfaceId query_specific_interface_id) -> DestroyFormat { + auto query_specific_interface = + context.specific_interfaces().Get(query_specific_interface_id); + auto destroy_interface_id = query_specific_interface.interface_id; + + auto inst = context.insts().Get(context.constant_values().GetInstId( + GetCanonicalFacetOrTypeValue(context, query_self_const_id))); + + CARBON_KIND_SWITCH(inst) { + case SemIR::ImplWitnessAccess::Kind: + case SemIR::SymbolicBinding::Kind: { + // These are symbolic, so should never reach `MakeDestroyOpBody`. + // For facet values, look if the FacetType provides the same. + if (auto facet_type = + context.types().TryGetAs(inst.type_id())) { + const auto& info = context.facet_types().Get(facet_type->facet_type_id); + for (auto interface : info.extend_constraints) { + if (interface.interface_id == destroy_interface_id) { + return DestroyFormat::Trivial; + } + } + } + return DestroyFormat::NoDestroy; + } + + case CARBON_KIND(SemIR::ArrayType array_type): { + // A zero element array is always trivially destructible. + if (auto int_bound = + context.sem_ir().GetArrayBoundValue(array_type.bound_id); + !int_bound || *int_bound == 0) { + return DestroyFormat::Trivial; + } + + // Verify the element can be destroyed. + return HasWitnessForOneField(context, loc_id, + array_type.element_type_inst_id, + query_specific_interface_id); + } + + case SemIR::Call::Kind: + // TODO: These seem like they shouldn't be getting directly queried for + // destroy. The use is in a test that was TODO before this TODO. + return DestroyFormat::NoDestroy; + + case CARBON_KIND(SemIR::ClassType class_type): { + return CanDestroyClass(context, loc_id, class_type, + query_specific_interface_id, + /*is_partial=*/false); + } + + case CARBON_KIND(SemIR::ConstType const_type): { + return HasWitnessForOneField(context, loc_id, const_type.inner_id, + query_specific_interface_id); + } + + case CARBON_KIND(SemIR::MaybeUnformedType maybe_unformed_type): { + return HasWitnessForOneField(context, loc_id, + maybe_unformed_type.inner_id, + query_specific_interface_id); + } + + case CARBON_KIND(SemIR::PartialType partial_type): { + // In contrast with something like `const`, need to treat the inner + // class differently based on the `partial` modifier. + auto class_type = + context.insts().GetAs(partial_type.inner_id); + return CanDestroyClass(context, loc_id, class_type, + query_specific_interface_id, + /*is_partial=*/true); + } + + case CARBON_KIND(SemIR::StructType struct_type): { + auto fields = context.struct_type_fields().Get(struct_type.fields_id); + if (fields.empty()) { + return DestroyFormat::Trivial; + } + auto query_facet_type_const_id = + PrepareForHasWitness(context, loc_id, query_specific_interface_id); + bool has_witness = true; + for (const auto& field : fields) { + if (!HasWitnessForRepeatedField(context, loc_id, field.type_inst_id, + query_facet_type_const_id)) { + has_witness = false; + break; + } + } + CleanupAfterHasWitness(context); + return has_witness ? DestroyFormat::NonTrivial : DestroyFormat::NoDestroy; + } + + case CARBON_KIND(SemIR::SymbolicBindingType sym_binding): { + return HasWitnessForOneField(context, loc_id, + sym_binding.facet_value_inst_id, + query_specific_interface_id); + } + + case CARBON_KIND(SemIR::TupleType tuple_type): { + auto block = context.inst_blocks().Get(tuple_type.type_elements_id); + if (block.empty()) { + return DestroyFormat::Trivial; + } + auto query_facet_type_const_id = + PrepareForHasWitness(context, loc_id, query_specific_interface_id); + bool has_witness = true; + for (const auto& element_id : block) { + if (!HasWitnessForRepeatedField(context, loc_id, element_id, + query_facet_type_const_id)) { + has_witness = false; + break; + } + } + CleanupAfterHasWitness(context); + return has_witness ? DestroyFormat::NonTrivial : DestroyFormat::NoDestroy; + } + + case SemIR::BoolType::Kind: + case SemIR::FloatType::Kind: + case SemIR::IntType::Kind: + case SemIR::PointerType::Kind: + case SemIR::TypeType::Kind: + // Trivially destructible. + return DestroyFormat::Trivial; + + default: + CARBON_FATAL("Unexpected type for CanDestroyType: {0}", inst.kind()); + } +} + +// Returns the body for `Destroy.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`. -// TODO: This mirrors `TypeCanDestroy` below, think about ways to share what's -// handled. static auto MakeDestroyOpBody(Context& context, SemIR::LocId loc_id, - SemIR::TypeId self_type_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); - while (auto class_type = inst.TryAs()) { - // Switch to looking at the object representation. - auto class_info = context.classes().Get(class_type->class_id); - CARBON_CHECK(class_info.is_complete()); - inst = context.types().GetAsInst( - class_info.GetObjectRepr(context.sem_ir(), class_type->specific_id)); - } - CARBON_KIND_SWITCH(inst) { case SemIR::ArrayType::Kind: + case SemIR::ClassType::Kind: case SemIR::ConstType::Kind: case SemIR::MaybeUnformedType::Kind: case SemIR::PartialType::Kind: case SemIR::StructType::Kind: case SemIR::TupleType::Kind: - // TODO: Implement iterative destruction of types. - break; - case SemIR::BoolType::Kind: - case SemIR::FloatType::Kind: - case SemIR::IntType::Kind: - case SemIR::PointerType::Kind: - // For trivially destructible types, we don't generate anything, so that - // this can collapse to a noop implementation when possible. - break; - case SemIR::ErrorInst::Kind: - // Errors can't be destroyed, but we'll still try to generate calls for - // other members. + (void)self_param_id; + // TODO: Implement destruction of the type. break; default: - CARBON_FATAL("Unexpected type for destroy: {0}", inst); + CARBON_FATAL("Unexpected type for MakeDestroyOpBody: {0}", inst); } - if (context.inst_block_stack().PeekCurrentBlockContents().empty()) { - context.inst_block_stack().PopAndDiscard(); - return SemIR::InstBlockId::None; - } AddInst(context, loc_id, SemIR::Return{}); return context.inst_block_stack().Pop(); } @@ -120,8 +324,8 @@ 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::NameScopeId parent_scope_id) - -> SemIR::InstId { + SemIR::NameScopeId parent_scope_id, + DestroyFormat format) -> SemIR::InstId { auto name_id = context.core_identifiers().AddNameId(CoreIdentifier::Op); auto [decl_id, function_id] = @@ -132,12 +336,14 @@ static auto MakeDestroyOpFunction(Context& context, SemIR::LocId loc_id, auto& function = context.functions().Get(function_id); - auto body_id = MakeDestroyOpBody(context, loc_id, self_type_id); - if (body_id.has_value()) { - function.SetCoreWitness(); - function.body_block_ids.push_back(body_id); - } else { + if (format == DestroyFormat::Trivial) { function.SetCoreWitness(SemIR::BuiltinFunctionKind::NoOp); + } else { + CARBON_CHECK(format == DestroyFormat::NonTrivial); + function.SetCoreWitness(SemIR::BuiltinFunctionKind::None); + auto body_id = MakeDestroyOpBody(context, loc_id, self_type_id, + function.self_param_id); + function.body_block_ids.push_back(body_id); } return decl_id; @@ -169,17 +375,11 @@ static auto GetTypesForSelfFacet( SemIR::ConstantId query_self_const_id, SemIR::SpecificInterfaceId query_specific_interface_id) -> TypesForSelfFacet { - const auto query_specific_interface = - context.specific_interfaces().Get(query_specific_interface_id); - // The Self facet will have type FacetType, for the query interface. auto facet_type_for_query_specific_interface = context.types().GetTypeIdForTypeConstantId( - EvalOrAddInst( - context, loc_id, - FacetTypeFromInterface(context, - query_specific_interface.interface_id, - query_specific_interface.specific_id))); + GetFacetTypeForQuerySpecificInterface(context, loc_id, + query_specific_interface_id)); // The Self facet needs to point to a type value. If it's not one already, // convert to type. auto query_self_as_type_id = GetFacetAsType(context, query_self_const_id); @@ -248,6 +448,8 @@ auto BuildCustomWitness(Context& context, SemIR::LocId loc_id, auto interface_with_self_specific_id = MakeSpecificWithInnerSelf( context, loc_id, interface.generic_id, interface.generic_with_self_id, query_specific_interface.specific_id, self_facet); + CARBON_CHECK( + !context.specifics().Get(interface_with_self_specific_id).HasError()); auto decl_id = context.constant_values().GetInstId(SemIR::GetConstantValueInSpecific( @@ -350,93 +552,33 @@ auto BuildPrimitiveCopyWitness( return BuildCustomWitness(context, loc_id, query_self_const_id, query_specific_interface_id, {op_id}); } - -// Returns true if the `Self` should impl `Destroy`. -static auto TypeCanDestroy(Context& context, - SemIR::ConstantId query_self_const_id, - SemIR::InterfaceId destroy_interface_id) -> bool { - auto inst = context.insts().Get(context.constant_values().GetInstId( - GetCanonicalFacetOrTypeValue(context, query_self_const_id))); - - // For facet values, look if the FacetType provides the same. - if (auto facet_type = - context.types().TryGetAs(inst.type_id())) { - const auto& info = context.facet_types().Get(facet_type->facet_type_id); - for (auto interface : info.extend_constraints) { - if (interface.interface_id == destroy_interface_id) { - return true; - } - } - } - - CARBON_KIND_SWITCH(inst) { - case CARBON_KIND(SemIR::ClassType class_type): { - auto class_info = context.classes().Get(class_type.class_id); - // Incomplete and abstract classes can't be destroyed. - if (!class_info.is_complete() || - class_info.inheritance_kind == - SemIR::Class::InheritanceKind::Abstract) { - return false; - } - - // `LookupCppImpl` handles C++ types. - if (context.name_scopes().Get(class_info.scope_id).is_cpp_scope()) { - return false; - } - - // TODO: Return false if the object repr doesn't impl `Destroy`. - return true; - } - case SemIR::ArrayType::Kind: - case SemIR::ConstType::Kind: - case SemIR::MaybeUnformedType::Kind: - case SemIR::PartialType::Kind: - case SemIR::StructType::Kind: - case SemIR::TupleType::Kind: - // TODO: Return false for types that indirectly reference a type that - // doesn't impl `Destroy`. - return true; - case SemIR::BoolType::Kind: - case SemIR::FloatType::Kind: - case SemIR::IntType::Kind: - case SemIR::PointerType::Kind: - // Trivially destructible. - return true; - default: - return false; - } -} - static auto MakeDestroyWitness( Context& context, SemIR::LocId loc_id, SemIR::ConstantId query_self_const_id, SemIR::SpecificInterfaceId query_specific_interface_id, bool build_witness) -> std::optional { - auto query_specific_interface = - context.specific_interfaces().Get(query_specific_interface_id); - - if (!TypeCanDestroy(context, query_self_const_id, - query_specific_interface.interface_id)) { + auto format = CanDestroyType(context, loc_id, query_self_const_id, + query_specific_interface_id); + if (format == DestroyFormat::NoDestroy) { return std::nullopt; } - if (!build_witness) { + if (!build_witness || query_self_const_id.is_symbolic()) { + // The type can be destroyed, but we shouldn't make a witness right now. return SemIR::InstId::None; } - if (query_self_const_id.is_symbolic()) { - return SemIR::InstId::None; - } - - // Mark functions with the interface's scope as a hint to mangling. This does - // not add them to the scope. + // Mark functions with the interface's scope as a hint to mangling. This + // does not add them to the scope. + auto query_specific_interface = + context.specific_interfaces().Get(query_specific_interface_id); auto parent_scope_id = context.interfaces() .Get(query_specific_interface.interface_id) .scope_without_self_id; auto self_type_id = GetFacetAsType(context, query_self_const_id); - auto op_id = - MakeDestroyOpFunction(context, loc_id, self_type_id, parent_scope_id); + auto op_id = MakeDestroyOpFunction(context, loc_id, self_type_id, + parent_scope_id, format); return BuildCustomWitness(context, loc_id, query_self_const_id, query_specific_interface_id, {op_id}); } diff --git a/toolchain/check/import_ref.cpp b/toolchain/check/import_ref.cpp index a1bd609d8862..487a173b6ff7 100644 --- a/toolchain/check/import_ref.cpp +++ b/toolchain/check/import_ref.cpp @@ -2349,7 +2349,7 @@ static auto TryResolveTypedInst(ImportRefResolver& resolver, break; } case SemIR::Function::SpecialFunctionKind::CoreWitness: { - new_function.SetCoreWitness(); + new_function.SetCoreWitness(import_function.builtin_function_kind()); break; } case SemIR::Function::SpecialFunctionKind::Thunk: { diff --git a/toolchain/check/testdata/array/basics.carbon b/toolchain/check/testdata/array/basics.carbon index 9d6731e3f58c..854b263cf475 100644 --- a/toolchain/check/testdata/array/basics.carbon +++ b/toolchain/check/testdata/array/basics.carbon @@ -167,6 +167,7 @@ var a: array(1, 1); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %tuple.type.ff9: type = tuple_type (type, type, type) [concrete] // CHECK:STDOUT: %tuple: %tuple.type.ff9 = tuple_value (%C, %C, %C) [concrete] // CHECK:STDOUT: %tuple.type.e56: type = tuple_type (%C, %C, %C) [concrete] @@ -179,8 +180,8 @@ var a: array(1, 1); // CHECK:STDOUT: %tuple.type.708: type = tuple_type (%tuple.type.e56, %tuple.type.e56) [concrete] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc10_3.4 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G() { @@ -216,12 +217,27 @@ var a: array(1, 1); // CHECK:STDOUT: %array_type: type = array_type %int_2, %.loc10_31.2 [concrete = constants.%array_type] // CHECK:STDOUT: } // CHECK:STDOUT: %v: ref %array_type = ref_binding v, %v.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %v.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %v.var, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%v.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc10_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_3.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_3.3(%self.param: ref %tuple.type.e56) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_3.4(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- array_vs_tuple.carbon // CHECK:STDOUT: @@ -242,10 +258,10 @@ var a: array(1, 1); // CHECK:STDOUT: %pattern_type.8c1: type = pattern_type %tuple.type [concrete] // CHECK:STDOUT: %DefaultOrUnformed.impl_witness.032: = impl_witness imports.%DefaultOrUnformed.impl_witness_table.349, @T.as.DefaultOrUnformed.impl(%tuple.type) [concrete] // CHECK:STDOUT: %DefaultOrUnformed.facet.1ea: %DefaultOrUnformed.type = facet_value %tuple.type, (%DefaultOrUnformed.impl_witness.032) [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc8 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc7 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8_3.2 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc7 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -299,16 +315,24 @@ var a: array(1, 1); // CHECK:STDOUT: %.loc8_28.6: type = converted %.loc8_28.2, constants.%tuple.type [concrete = constants.%tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %b: ref %tuple.type = ref_binding b, %b.var -// CHECK:STDOUT: %Destroy.Op.bound.loc8: = bound_method %b.var, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.bound.loc8: = bound_method %b.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc8: init %empty_tuple.type = call %Destroy.Op.bound.loc8(%b.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc7: = bound_method %a.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc7: = bound_method %a.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call.loc7: init %empty_tuple.type = call %Destroy.Op.bound.loc7(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc8(%self.param: ref %tuple.type) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.1(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc7(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.2(%self.param: ref %tuple.type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc7(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- assign_return_value.carbon // CHECK:STDOUT: @@ -323,10 +347,10 @@ var a: array(1, 1); // CHECK:STDOUT: %pattern_type.fe8: type = pattern_type %array_type [concrete] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%empty_tuple) [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc8_34 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8_3 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8_34.2 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc8_3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { @@ -355,16 +379,24 @@ var a: array(1, 1); // CHECK:STDOUT: %array_type: type = array_type %int_1, %.loc8_24.2 [concrete = constants.%array_type] // CHECK:STDOUT: } // CHECK:STDOUT: %t: ref %array_type = ref_binding t, %t.var -// CHECK:STDOUT: %Destroy.Op.bound.loc8_34: = bound_method %.loc8_34.2, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.bound.loc8_34: = bound_method %.loc8_34.2, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc8_34: init %empty_tuple.type = call %Destroy.Op.bound.loc8_34(%.loc8_34.2) -// CHECK:STDOUT: %Destroy.Op.bound.loc8_3: = bound_method %t.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc8_3: = bound_method %t.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call.loc8_3: init %empty_tuple.type = call %Destroy.Op.bound.loc8_3(%t.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc8_34(%self.param: ref %tuple.type) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_34.1(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc8_3(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_34.2(%self.param: ref %tuple.type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- nine_elements.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/import.carbon b/toolchain/check/testdata/array/import.carbon index aad5df0e7ea2..5434cba87e80 100644 --- a/toolchain/check/testdata/array/import.carbon +++ b/toolchain/check/testdata/array/import.carbon @@ -57,6 +57,7 @@ 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: %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] @@ -71,8 +72,8 @@ fn F() -> i32 { // CHECK:STDOUT: %Copy.WithSelf.Op.type.081: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet) [concrete] // CHECK:STDOUT: %.8e2: type = fn_type_with_self_type %Copy.WithSelf.Op.type.081, %Copy.facet [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.664, @Int.as.Copy.impl.Op(%int_32) [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc6_12.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -95,12 +96,22 @@ 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.Op.bound: = bound_method %.loc6_12.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc6_12.2, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc6_12.2) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc6_12.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc6_12.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc6_12.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_symbolic_decl.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/index_not_literal.carbon b/toolchain/check/testdata/array/index_not_literal.carbon index 827951aabcee..67c396e8a3df 100644 --- a/toolchain/check/testdata/array/index_not_literal.carbon +++ b/toolchain/check/testdata/array/index_not_literal.carbon @@ -50,12 +50,14 @@ fn F(a: array({}, 3)) -> {} { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] +// 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: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete] // CHECK:STDOUT: %array_type: type = array_type %int_3.1ba, %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] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.824: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] // CHECK:STDOUT: %Int.as.Copy.impl.Op.9b9: %Int.as.Copy.impl.Op.type.824 = struct_value () [symbolic] @@ -93,6 +95,9 @@ fn F(a: array({}, 3)) -> {} { // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_1.5d2, %int_2.ef8, %int_3.822) [concrete] // CHECK:STDOUT: %.fd3: ref %array_type = temporary invalid, %array [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc10_20.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.fd3, %Destroy.Op.651ba6.3 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -165,10 +170,21 @@ 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.5d2] // CHECK:STDOUT: %.loc10_23.2: %i32 = converted %int_1.loc10_23, %.loc10_23.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %F.call: init %i32 = call %F.ref(%.loc10_20.15, %.loc10_23.2) +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.fd3) // CHECK:STDOUT: return %F.call // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc10_20.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_20.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_20.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- index_non_literal.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/as/basics.carbon b/toolchain/check/testdata/as/basics.carbon index 75a1c2a3da35..57016e3a2ec1 100644 --- a/toolchain/check/testdata/as/basics.carbon +++ b/toolchain/check/testdata/as/basics.carbon @@ -202,6 +202,7 @@ let n: {.x: ()} = {.x = ()} as {.x = ()}; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %X: type = class_type @X [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [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] @@ -209,10 +210,10 @@ let n: {.x: ()} = {.x = ()} as {.x = ()}; // CHECK:STDOUT: %tuple: %tuple.type.24b = tuple_value (%X, %X) [concrete] // CHECK:STDOUT: %tuple.type.2de: type = tuple_type (%X, %X) [concrete] // CHECK:STDOUT: %pattern_type.e9d: type = pattern_type %tuple.type.2de [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc13 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc20 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc13_40.2 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc20 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Let() { @@ -244,14 +245,19 @@ let n: {.x: ()} = {.x = ()} as {.x = ()}; // CHECK:STDOUT: %tuple: %tuple.type.2de = tuple_value (%.loc13_32.3, %.loc13_40.3) // CHECK:STDOUT: %.loc13_41.2: %tuple.type.2de = converted %.loc13_41.1, %tuple // CHECK:STDOUT: %a: %tuple.type.2de = value_binding a, %.loc13_41.2 -// CHECK:STDOUT: %Destroy.Op.bound.loc13_40: = bound_method %.loc13_40.2, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.bound.loc13_40: = bound_method %.loc13_40.2, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc13_40: init %empty_tuple.type = call %Destroy.Op.bound.loc13_40(%.loc13_40.2) -// CHECK:STDOUT: %Destroy.Op.bound.loc13_32: = bound_method %.loc13_32.2, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.bound.loc13_32: = bound_method %.loc13_32.2, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc13_32: init %empty_tuple.type = call %Destroy.Op.bound.loc13_32(%.loc13_32.2) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc13(%self.param: ref %X) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc13_40.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc13_40.2(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Var() { // CHECK:STDOUT: !entry: @@ -281,25 +287,29 @@ let n: {.x: ()} = {.x = ()} as {.x = ()}; // CHECK:STDOUT: %.loc20_22.3: type = converted %.loc20_22.2, constants.%tuple.type.2de [concrete = constants.%tuple.type.2de] // CHECK:STDOUT: } // CHECK:STDOUT: %b: ref %tuple.type.2de = ref_binding b, %b.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %b.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %b.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%b.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc20(%self.param: ref %tuple.type.2de) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc20(%self.param: ref %tuple.type.2de) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- identity.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %X: type = class_type @X [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %pattern_type.05f: type = pattern_type %X [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %ptr.2a9: type = ptr_type %X [concrete] // CHECK:STDOUT: %pattern_type.37f: type = pattern_type %ptr.2a9 [concrete] // CHECK:STDOUT: %Make.type: type = fn_type @Make [concrete] // CHECK:STDOUT: %Make: %Make.type = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc24_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Value(%n.param: %X) { @@ -345,12 +355,17 @@ let n: {.x: ()} = {.x = ()} as {.x = ()}; // CHECK:STDOUT: assign %x.var, %Make.call // CHECK:STDOUT: %X.ref.loc24_17: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %x: ref %X = ref_binding x, %x.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %x.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %x.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%x.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %X) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc24_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc24_3.2(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- overloaded.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/as/const.carbon b/toolchain/check/testdata/as/const.carbon index 998e97b051cd..4135df3b49bf 100644 --- a/toolchain/check/testdata/as/const.carbon +++ b/toolchain/check/testdata/as/const.carbon @@ -96,6 +96,7 @@ fn Use() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %X: type = class_type @X [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [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] @@ -106,8 +107,8 @@ fn Use() { // CHECK:STDOUT: %pattern_type.bf1: type = pattern_type %ptr.d4c [concrete] // CHECK:STDOUT: %reference.var: ref %const = var file.%reference.var_patt [concrete] // CHECK:STDOUT: %addr.160: %ptr.d4c = addr_of %reference.var [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc14_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Use() { @@ -173,12 +174,22 @@ fn Use() { // CHECK:STDOUT: %ptr.loc17_24: type = ptr_type %const.loc17_17 [concrete = constants.%ptr.d4c] // CHECK:STDOUT: } // CHECK:STDOUT: %b: %ptr.d4c = value_binding b, %.loc17_32.2 -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %i.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %i.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%i.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %const) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc14_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc14_3.2(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc14_3.3(%self.param: ref %const) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: @@ -189,13 +200,14 @@ fn Use() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %X: type = class_type @X [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %const: type = const_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] // CHECK:STDOUT: %pattern_type.05f: type = pattern_type %X [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc12_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Use() { @@ -223,12 +235,17 @@ fn Use() { // CHECK:STDOUT: %.loc13_27.2: %X = converted %value.ref, %.loc13_27.1 // CHECK:STDOUT: %X.ref.loc13_17: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %v: %X = value_binding v, %.loc13_27.2 -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %i.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %i.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%i.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %X) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc12_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc12_3.2(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/as/maybe_unformed.carbon b/toolchain/check/testdata/as/maybe_unformed.carbon index c4be49b76745..e0367fea89fd 100644 --- a/toolchain/check/testdata/as/maybe_unformed.carbon +++ b/toolchain/check/testdata/as/maybe_unformed.carbon @@ -211,6 +211,7 @@ fn Use() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %X: type = class_type @X [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [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] @@ -221,8 +222,8 @@ fn Use() { // CHECK:STDOUT: %As.type.90f: type = generic_interface_type @As [concrete] // CHECK:STDOUT: %As.generic: %As.type.90f = struct_value () [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc19_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -277,12 +278,22 @@ fn Use() { // CHECK:STDOUT: %MaybeUnformed.loc27_37: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.b49] // CHECK:STDOUT: } // CHECK:STDOUT: %v: %MaybeUnformed.b49 = value_binding v, [concrete = ] -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %i.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %i.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%i.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %MaybeUnformed.b49) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc19_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc19_3.2(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc19_3.3(%self.param: ref %MaybeUnformed.b49) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/as/partial.carbon b/toolchain/check/testdata/as/partial.carbon index 3c9fcfb843cc..3103ac41083a 100644 --- a/toolchain/check/testdata/as/partial.carbon +++ b/toolchain/check/testdata/as/partial.carbon @@ -110,6 +110,7 @@ fn Use() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %X: type = class_type @X [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [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] @@ -120,8 +121,8 @@ fn Use() { // CHECK:STDOUT: %pattern_type.408: type = pattern_type %ptr.314 [concrete] // CHECK:STDOUT: %reference.var: ref %.4b5 = var file.%reference.var_patt [concrete] // CHECK:STDOUT: %addr.315: %ptr.314 = addr_of %reference.var [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc14_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Use() { @@ -187,12 +188,17 @@ fn Use() { // CHECK:STDOUT: %ptr.loc17_26: type = ptr_type %.loc17_17 [concrete = constants.%ptr.314] // CHECK:STDOUT: } // CHECK:STDOUT: %b: %ptr.314 = value_binding b, %.loc17_34.2 -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %i.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %i.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%i.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %.4b5) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc14_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc14_3.2(%self.param: ref %.4b5) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: @@ -203,13 +209,14 @@ fn Use() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %X: type = class_type @X [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %.4b5: type = partial_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] // CHECK:STDOUT: %pattern_type.05f: type = pattern_type %X [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc12_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Use() { @@ -255,16 +262,21 @@ fn Use() { // CHECK:STDOUT: assign %k.var, %.loc12_35.2 // CHECK:STDOUT: %X.ref.loc12_17: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %k: ref %X = ref_binding k, %k.var -// CHECK:STDOUT: %Destroy.Op.bound.loc12: = bound_method %k.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc12: = bound_method %k.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc12: init %empty_tuple.type = call %Destroy.Op.bound.loc12(%k.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc11: = bound_method %j.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc11: = bound_method %j.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc11: init %empty_tuple.type = call %Destroy.Op.bound.loc11(%j.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc10: = bound_method %i.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc10: = bound_method %i.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc10: init %empty_tuple.type = call %Destroy.Op.bound.loc10(%i.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %X) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc12_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc12_3.2(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- unsafe_remove_partial.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/as/var_init.carbon b/toolchain/check/testdata/as/var_init.carbon index 14df3c22079a..55c1f09d7b51 100644 --- a/toolchain/check/testdata/as/var_init.carbon +++ b/toolchain/check/testdata/as/var_init.carbon @@ -40,10 +40,11 @@ fn Convert(unused t: ()) { // CHECK:STDOUT: %empty_tuple.type.as.ImplicitAs.impl.Convert: %empty_tuple.type.as.ImplicitAs.impl.Convert.type = struct_value () [concrete] // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.062 = facet_value %empty_tuple.type, (%ImplicitAs.impl_witness) [concrete] // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.73b: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%X, %ImplicitAs.facet) [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %.1bd: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.73b, %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: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc12_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Convert(%t.param: %empty_tuple.type) { @@ -64,10 +65,15 @@ fn Convert(unused t: ()) { // CHECK:STDOUT: assign %x.var, %.loc12_3.2 // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %x: ref %X = ref_binding x, %x.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %x.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %x.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%x.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %X) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc12_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc12_3.2(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/access/access_modifers.carbon b/toolchain/check/testdata/class/access/access_modifers.carbon index da7582c05490..f52ba5e6b464 100644 --- a/toolchain/check/testdata/class/access/access_modifers.carbon +++ b/toolchain/check/testdata/class/access/access_modifers.carbon @@ -159,6 +159,7 @@ class A { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // 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: %Circle.elem: type = unbound_element_type %Circle, %i32 [concrete] // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %int_5.64b: Core.IntLiteral = int_value 5 [concrete] @@ -197,8 +198,8 @@ class A { // CHECK:STDOUT: %Run.type: type = fn_type @Run [concrete] // CHECK:STDOUT: %Run: %Run.type = struct_value () [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc18_36.4 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -329,12 +330,27 @@ class A { // CHECK:STDOUT: %SOME_INTERNAL_CONSTANT.ref: = name_ref SOME_INTERNAL_CONSTANT, [concrete = ] // CHECK:STDOUT: %circle.ref.loc51: %Circle = name_ref circle, %circle // CHECK:STDOUT: %SomeInternalFunction.ref: = name_ref SomeInternalFunction, [concrete = ] -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc18_36.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc18_36.2, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc18_36.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Circle) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc18_36.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc18_36.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc18_36.3(%self.param: ref %struct_type.radius.251) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc18_36.4(%self.param: ref %Circle) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_protected_field_access.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/adapter/adapt_copy.carbon b/toolchain/check/testdata/class/adapter/adapt_copy.carbon index d54778be9159..dfb10ff4bae4 100644 --- a/toolchain/check/testdata/class/adapter/adapt_copy.carbon +++ b/toolchain/check/testdata/class/adapter/adapt_copy.carbon @@ -182,8 +182,8 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc16 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc16_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = 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] @@ -194,8 +194,9 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %.5d1: Core.Form = init_form %tuple.type.d78 [concrete] // CHECK:STDOUT: %InTuple.type: type = fn_type @InTuple [concrete] // CHECK:STDOUT: %InTuple: %InTuple.type = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc35 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %u32.builtin: type = int_type unsigned, %int_32 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.5: type = fn_type @Destroy.Op.loc35_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.5: %Destroy.Op.type.bae255.5 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -283,12 +284,17 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %d: ref %AdaptCopyable = ref_binding d, %d.var // CHECK:STDOUT: %d.ref: ref %AdaptCopyable = name_ref d, %d // CHECK:STDOUT: %.loc24: %AdaptCopyable = acquire_value %d.ref -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %d.var, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %d.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%d.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc16(%self.param: ref %AdaptCopyable) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc16_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc16_3.2(%self.param: ref %AdaptCopyable) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @InTuple(%c.param: %tuple.type.d78) -> out %return.param: %tuple.type.d78 { // CHECK:STDOUT: !entry: @@ -310,12 +316,22 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %d.ref: ref %tuple.type.d78 = 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.Op.bound: = bound_method %d.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %d.var, constants.%Destroy.Op.651ba6.5 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%d.var) // CHECK:STDOUT: return to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc35(%self.param: ref %tuple.type.d78) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc35_3.1(%self.param: ref %u32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc35_3.2(%self.param: ref %u32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc35_3.3(%self.param: ref %tuple.type.d78) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- adapt_copyable_tuple.carbon // CHECK:STDOUT: @@ -330,6 +346,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete] // CHECK:STDOUT: %tuple.95a: %tuple.type.24b = tuple_value (%i32, %i32) [concrete] // CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %complete_type.65d: = complete_type_witness %tuple.type.d07 [concrete] // CHECK:STDOUT: %pattern_type.6cd: type = pattern_type %AdaptTuple [concrete] // CHECK:STDOUT: %.52a: Core.Form = init_form %AdaptTuple [concrete] @@ -346,8 +363,8 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %.8e2: type = fn_type_with_self_type %Copy.WithSelf.Op.type.081, %Copy.facet.de4 [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.664, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc9 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc9_3.4 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.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] @@ -357,6 +374,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %.709: Core.Form = init_form %tuple.type.3c7 [concrete] // CHECK:STDOUT: %InTuple.type: type = fn_type @InTuple [concrete] // CHECK:STDOUT: %InTuple: %InTuple.type = struct_value () [concrete] +// CHECK:STDOUT: %u32.builtin: type = int_type unsigned, %int_32 [concrete] // CHECK:STDOUT: %UInt.as.Copy.impl.Op.type.68f: type = fn_type @UInt.as.Copy.impl.Op, @UInt.as.Copy.impl(%N) [symbolic] // CHECK:STDOUT: %UInt.as.Copy.impl.Op.576: %UInt.as.Copy.impl.Op.type.68f = struct_value () [symbolic] // CHECK:STDOUT: %Copy.impl_witness.514: = impl_witness imports.%Copy.impl_witness_table.bd0, @UInt.as.Copy.impl(%int_32) [concrete] @@ -366,8 +384,8 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %Copy.WithSelf.Op.type.ad7: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.10b) [concrete] // CHECK:STDOUT: %.38c: type = fn_type_with_self_type %Copy.WithSelf.Op.type.ad7, %Copy.facet.10b [concrete] // CHECK:STDOUT: %UInt.as.Copy.impl.Op.specific_fn: = specific_function %UInt.as.Copy.impl.Op.c10, @UInt.as.Copy.impl.Op(%int_32) [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc14 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.7: type = fn_type @Destroy.Op.loc14_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.7: %Destroy.Op.type.bae255.7 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -505,12 +523,27 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %.loc10_11.7: init %tuple.type.d07 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.Op.bound: = bound_method %d.var, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %d.var, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%d.var) // CHECK:STDOUT: return %.loc10_11.9 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc9(%self.param: ref %AdaptTuple) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.3(%self.param: ref %tuple.type.d07) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.4(%self.param: ref %AdaptTuple) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @InTuple(%c.param: %tuple.type.3c7) -> out %return.param: %tuple.type.3c7 { // CHECK:STDOUT: !entry: @@ -598,12 +631,22 @@ 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.3c7 to %return.param = tuple_init (%.loc15_10.9, %.loc15_10.11) // CHECK:STDOUT: %.loc15_11: init %tuple.type.3c7 = converted %d.ref, %.loc15_10.12 -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %d.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %d.var, constants.%Destroy.Op.651ba6.7 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%d.var) // CHECK:STDOUT: return %.loc15_11 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc14(%self.param: ref %tuple.type.3c7) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc14_3.1(%self.param: ref %u32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc14_3.2(%self.param: ref %u32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc14_3.3(%self.param: ref %tuple.type.3c7) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_adapt_not_copyable.carbon // CHECK:STDOUT: @@ -619,8 +662,8 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc20_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -692,12 +735,17 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %b: ref %AdaptNoncopyable = ref_binding b, %b.var // CHECK:STDOUT: %b.ref: ref %AdaptNoncopyable = name_ref b, %b // CHECK:STDOUT: %.loc28: %AdaptNoncopyable = acquire_value %b.ref -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %b.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %b.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%b.var) // CHECK:STDOUT: return to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %AdaptNoncopyable) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc20_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc20_3.2(%self.param: ref %AdaptNoncopyable) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_adapt_not_copyable_indirect.carbon // CHECK:STDOUT: @@ -715,6 +763,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %tuple.type.ff9: type = tuple_type (type, type, type) [concrete] // CHECK:STDOUT: %tuple.19a: %tuple.type.ff9 = tuple_value (%i32, %Noncopyable, %i32) [concrete] // CHECK:STDOUT: %tuple.type.7f9: type = tuple_type (%i32, %Noncopyable, %i32) [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %complete_type.381: = complete_type_witness %tuple.type.7f9 [concrete] // CHECK:STDOUT: %pattern_type.ca6: type = pattern_type %AdaptNoncopyableIndirect [concrete] // CHECK:STDOUT: %.ae4: Core.Form = init_form %AdaptNoncopyableIndirect [concrete] @@ -731,8 +780,8 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %.8e2: type = fn_type_with_self_type %Copy.WithSelf.Op.type.081, %Copy.facet [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.664, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.6: type = fn_type @Destroy.Op.loc23_3.6 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.6: %Destroy.Op.type.bae255.6 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -835,12 +884,34 @@ 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.Op.bound: = bound_method %b.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %b.var, constants.%Destroy.Op.651ba6.6 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%b.var) // CHECK:STDOUT: return to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %AdaptNoncopyableIndirect) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc23_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc23_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc23_3.3(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc23_3.4(%self.param: ref %Noncopyable) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc23_3.5(%self.param: ref %tuple.type.7f9) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc23_3.6(%self.param: ref %AdaptNoncopyableIndirect) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- adapt_copyable_struct.carbon // CHECK:STDOUT: @@ -853,6 +924,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %struct_type.e.f: type = struct_type {.e: %i32, .f: %i32} [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %complete_type.511: = complete_type_witness %struct_type.e.f [concrete] // CHECK:STDOUT: %pattern_type.341: type = pattern_type %AdaptStruct [concrete] // CHECK:STDOUT: %.8e3: Core.Form = init_form %AdaptStruct [concrete] @@ -869,8 +941,8 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %.8e2: type = fn_type_with_self_type %Copy.WithSelf.Op.type.081, %Copy.facet.de4 [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.664, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc9 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc9_3.4 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.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] @@ -881,6 +953,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %.174: Core.Form = init_form %tuple.type.691 [concrete] // CHECK:STDOUT: %InTuple.type: type = fn_type @InTuple [concrete] // CHECK:STDOUT: %InTuple: %InTuple.type = struct_value () [concrete] +// CHECK:STDOUT: %u32.builtin: type = int_type unsigned, %int_32 [concrete] // CHECK:STDOUT: %UInt.as.Copy.impl.Op.type.68f: type = fn_type @UInt.as.Copy.impl.Op, @UInt.as.Copy.impl(%N) [symbolic] // CHECK:STDOUT: %UInt.as.Copy.impl.Op.576: %UInt.as.Copy.impl.Op.type.68f = struct_value () [symbolic] // CHECK:STDOUT: %Copy.impl_witness.514: = impl_witness imports.%Copy.impl_witness_table.bd0, @UInt.as.Copy.impl(%int_32) [concrete] @@ -890,8 +963,8 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %Copy.WithSelf.Op.type.ad7: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.10b) [concrete] // CHECK:STDOUT: %.38c: type = fn_type_with_self_type %Copy.WithSelf.Op.type.ad7, %Copy.facet.10b [concrete] // CHECK:STDOUT: %UInt.as.Copy.impl.Op.specific_fn: = specific_function %UInt.as.Copy.impl.Op.c10, @UInt.as.Copy.impl.Op(%int_32) [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc14 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.7: type = fn_type @Destroy.Op.loc14_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.7: %Destroy.Op.type.bae255.7 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1028,12 +1101,27 @@ 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.Op.bound: = bound_method %h.var, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %h.var, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%h.var) // CHECK:STDOUT: return %.loc10_11.13 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc9(%self.param: ref %AdaptStruct) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.3(%self.param: ref %struct_type.e.f) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.4(%self.param: ref %AdaptStruct) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @InTuple(%c.param: %tuple.type.691) -> out %return.param: %tuple.type.691 { // CHECK:STDOUT: !entry: @@ -1121,10 +1209,20 @@ 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.691 to %return.param = tuple_init (%.loc15_10.13, %.loc15_10.15) // CHECK:STDOUT: %.loc15_11: init %tuple.type.691 = converted %d.ref, %.loc15_10.16 -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %d.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %d.var, constants.%Destroy.Op.651ba6.7 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%d.var) // CHECK:STDOUT: return %.loc15_11 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc14(%self.param: ref %tuple.type.691) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc14_3.1(%self.param: ref %u32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc14_3.2(%self.param: ref %u32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc14_3.3(%self.param: ref %tuple.type.691) { +// CHECK:STDOUT: !entry: +// 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 bbad58bd1d24..c1bae1b83c04 100644 --- a/toolchain/check/testdata/class/destroy_calls.carbon +++ b/toolchain/check/testdata/class/destroy_calls.carbon @@ -105,12 +105,12 @@ fn G() { F({}); } // CHECK:STDOUT: %B.val: %B = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.7c7: type = pattern_type %C [concrete] // CHECK:STDOUT: %C.val: %C = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc12 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc11 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc12_3.2 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc10 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc11 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc10 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -152,20 +152,31 @@ fn G() { F({}); } // CHECK:STDOUT: assign %c.var, %.loc12_3 // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %c: ref %C = ref_binding c, %c.var -// CHECK:STDOUT: %Destroy.Op.bound.loc12: = bound_method %c.var, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.bound.loc12: = bound_method %c.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc12: init %empty_tuple.type = call %Destroy.Op.bound.loc12(%c.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc11: = bound_method %b.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc11: = bound_method %b.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call.loc11: init %empty_tuple.type = call %Destroy.Op.bound.loc11(%b.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc10: = bound_method %a.var, constants.%Destroy.Op.651ba6.3 +// CHECK:STDOUT: %Destroy.Op.bound.loc10: = bound_method %a.var, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call.loc10: init %empty_tuple.type = call %Destroy.Op.bound.loc10(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc12(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc12_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc11(%self.param: ref %B) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc12_3.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc10(%self.param: ref %A) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc11(%self.param: ref %B) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10(%self.param: ref %A) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- nested_scope.carbon // CHECK:STDOUT: @@ -185,12 +196,12 @@ fn G() { F({}); } // CHECK:STDOUT: %true: bool = bool_literal true [concrete] // CHECK:STDOUT: %pattern_type.7c7: type = pattern_type %C [concrete] // CHECK:STDOUT: %C.val: %C = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc13 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc11 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc13_5.2 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc10 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc11 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc10 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -239,20 +250,31 @@ fn G() { F({}); } // CHECK:STDOUT: br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.else: -// CHECK:STDOUT: %Destroy.Op.bound.loc13: = bound_method %c.var, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.bound.loc13: = bound_method %c.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc13: init %empty_tuple.type = call %Destroy.Op.bound.loc13(%c.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc11: = bound_method %b.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc11: = bound_method %b.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call.loc11: init %empty_tuple.type = call %Destroy.Op.bound.loc11(%b.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc10: = bound_method %a.var, constants.%Destroy.Op.651ba6.3 +// CHECK:STDOUT: %Destroy.Op.bound.loc10: = bound_method %a.var, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call.loc10: init %empty_tuple.type = call %Destroy.Op.bound.loc10(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc13(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc13_5.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc11(%self.param: ref %B) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc13_5.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc10(%self.param: ref %A) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc11(%self.param: ref %B) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10(%self.param: ref %A) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- temp.carbon // CHECK:STDOUT: @@ -261,6 +283,7 @@ fn G() { F({}); } // 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: %B.Make.type: type = fn_type @B.Make [concrete] // CHECK:STDOUT: %B.Make: %B.Make.type = struct_value () [concrete] @@ -269,12 +292,12 @@ fn G() { F({}); } // 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: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc14 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc13 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc14_10.2 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc12 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc13 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc12 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -298,20 +321,31 @@ fn G() { F({}); } // CHECK:STDOUT: %.loc14_10.1: ref %C = temporary_storage // CHECK:STDOUT: %C.Make.call: init %C to %.loc14_10.1 = call %Make.ref.loc14() // CHECK:STDOUT: %.loc14_10.2: ref %C = temporary %.loc14_10.1, %C.Make.call -// CHECK:STDOUT: %Destroy.Op.bound.loc14: = bound_method %.loc14_10.2, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.bound.loc14: = bound_method %.loc14_10.2, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc14: init %empty_tuple.type = call %Destroy.Op.bound.loc14(%.loc14_10.2) -// CHECK:STDOUT: %Destroy.Op.bound.loc13: = bound_method %.loc13_10.2, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc13: = bound_method %.loc13_10.2, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call.loc13: init %empty_tuple.type = call %Destroy.Op.bound.loc13(%.loc13_10.2) -// CHECK:STDOUT: %Destroy.Op.bound.loc12: = bound_method %.loc12_10.2, constants.%Destroy.Op.651ba6.3 +// CHECK:STDOUT: %Destroy.Op.bound.loc12: = bound_method %.loc12_10.2, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call.loc12: init %empty_tuple.type = call %Destroy.Op.bound.loc12(%.loc12_10.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc14(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc14_10.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc13(%self.param: ref %B) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc14_10.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc12(%self.param: ref %A) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc13(%self.param: ref %B) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc12(%self.param: ref %A) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- generic_class.carbon // CHECK:STDOUT: @@ -327,8 +361,8 @@ fn G() { F({}); } // CHECK:STDOUT: %pattern_type.002: type = pattern_type %D.213 [concrete] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: %D.val: %D.213 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -352,12 +386,17 @@ fn G() { F({}); } // CHECK:STDOUT: %D: type = class_type @D, @D(constants.%C) [concrete = constants.%D.213] // CHECK:STDOUT: } // CHECK:STDOUT: %a: ref %D.213 = ref_binding a, %a.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %D.213) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.2(%self.param: ref %D.213) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- generic_use_inside_generic.carbon // CHECK:STDOUT: @@ -386,10 +425,10 @@ fn G() { F({}); } // CHECK:STDOUT: %C.850: type = class_type @C, @C(%empty_struct_type) [concrete] // CHECK:STDOUT: %pattern_type.526: type = pattern_type %C.850 [concrete] // CHECK:STDOUT: %C.val.09d: %C.850 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.8d7: = custom_witness (%Destroy.Op), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.81b: %Destroy.type = facet_value %C.850, (%custom_witness.8d7) [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc7_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.8d7fae.2: = custom_witness (%Destroy.Op.651ba6.2), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.81b: %Destroy.type = facet_value %C.850, (%custom_witness.8d7fae.2) [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.599: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.81b) [concrete] // CHECK:STDOUT: %.540: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.599, %Destroy.facet.81b [concrete] // CHECK:STDOUT: } @@ -447,7 +486,12 @@ fn G() { F({}); } // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %C.850) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc7_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc7_3.2(%self.param: ref %C.850) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { // CHECK:STDOUT: %T.loc6_16.1 => constants.%T @@ -461,11 +505,11 @@ fn G() { F({}); } // CHECK:STDOUT: %require_complete => constants.%complete_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.526 // CHECK:STDOUT: %C.val => constants.%C.val.09d -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.8d7 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.8d7fae.2 // CHECK:STDOUT: %Destroy.facet => constants.%Destroy.facet.81b // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.599 // CHECK:STDOUT: %.loc7_3.2 => constants.%.540 -// CHECK:STDOUT: %impl.elem0.loc7_3.2 => constants.%Destroy.Op -// CHECK:STDOUT: %specific_impl_fn.loc7_3.2 => constants.%Destroy.Op +// CHECK:STDOUT: %impl.elem0.loc7_3.2 => constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %specific_impl_fn.loc7_3.2 => constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/field/field_access.carbon b/toolchain/check/testdata/class/field/field_access.carbon index 82ff5ffd13b8..5326e197ee96 100644 --- a/toolchain/check/testdata/class/field/field_access.carbon +++ b/toolchain/check/testdata/class/field/field_access.carbon @@ -35,6 +35,7 @@ fn Run() { // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // 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: %Class.elem: type = unbound_element_type %Class, %i32 [concrete] // CHECK:STDOUT: %struct_type.j.k: type = struct_type {.j: %i32, .k: %i32} [concrete] // CHECK:STDOUT: %complete_type.cf7: = complete_type_witness %struct_type.j.k [concrete] @@ -83,10 +84,10 @@ fn Run() { // CHECK:STDOUT: %.8e2: type = fn_type_with_self_type %Copy.WithSelf.Op.type.081, %Copy.facet [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.664, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc25 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc21 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc25_3.2 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc21_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -210,16 +211,29 @@ fn Run() { // CHECK:STDOUT: assign %ck.var, %Int.as.Copy.impl.Op.call.loc25 // CHECK:STDOUT: %i32.loc25: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %ck: ref %i32 = ref_binding ck, %ck.var -// CHECK:STDOUT: %Destroy.Op.bound.loc25: = bound_method %ck.var, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.bound.loc25: = bound_method %ck.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc25: init %empty_tuple.type = call %Destroy.Op.bound.loc25(%ck.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc24: = bound_method %cj.var, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.bound.loc24: = bound_method %cj.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc24: init %empty_tuple.type = call %Destroy.Op.bound.loc24(%cj.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc21: = bound_method %c.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc21: = bound_method %c.var, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call.loc21: init %empty_tuple.type = call %Destroy.Op.bound.loc21(%c.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc25(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc25_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc21(%self.param: ref %Class) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc25_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc21_3.1(%self.param: ref %struct_type.j.k) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc21_3.2(%self.param: ref %Class) { +// CHECK:STDOUT: !entry: +// 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 79c782de55f9..768b140cbde9 100644 --- a/toolchain/check/testdata/class/field/field_access_in_value.carbon +++ b/toolchain/check/testdata/class/field/field_access_in_value.carbon @@ -36,6 +36,7 @@ fn Test() { // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // 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: %Class.elem: type = unbound_element_type %Class, %i32 [concrete] // CHECK:STDOUT: %struct_type.j.k: type = struct_type {.j: %i32, .k: %i32} [concrete] // CHECK:STDOUT: %complete_type.cf7: = complete_type_witness %struct_type.j.k [concrete] @@ -84,10 +85,10 @@ fn Test() { // CHECK:STDOUT: %.8e2: type = fn_type_with_self_type %Copy.WithSelf.Op.type.081, %Copy.facet [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.664, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc26 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc21 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc26_3.2 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc21_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -218,16 +219,29 @@ fn Test() { // CHECK:STDOUT: assign %ck.var, %Int.as.Copy.impl.Op.call.loc26 // CHECK:STDOUT: %i32.loc26: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %ck: ref %i32 = ref_binding ck, %ck.var -// CHECK:STDOUT: %Destroy.Op.bound.loc26: = bound_method %ck.var, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.bound.loc26: = bound_method %ck.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc26: init %empty_tuple.type = call %Destroy.Op.bound.loc26(%ck.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc25: = bound_method %cj.var, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.bound.loc25: = bound_method %cj.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc25: init %empty_tuple.type = call %Destroy.Op.bound.loc25(%cj.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc21: = bound_method %cv.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc21: = bound_method %cv.var, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call.loc21: init %empty_tuple.type = call %Destroy.Op.bound.loc21(%cv.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc26(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc26_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc21(%self.param: ref %Class) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc26_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc21_3.1(%self.param: ref %struct_type.j.k) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc21_3.2(%self.param: ref %Class) { +// CHECK:STDOUT: !entry: +// 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 0eab923581d3..01c4355ac87b 100644 --- a/toolchain/check/testdata/class/generic/import.carbon +++ b/toolchain/check/testdata/class/generic/import.carbon @@ -476,6 +476,7 @@ class Class(U:! type) { // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %UseMethod.type: type = fn_type @UseMethod [concrete] // CHECK:STDOUT: %UseMethod: %UseMethod.type = struct_value () [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %CompleteClass.type: type = generic_class_type @CompleteClass [concrete] // CHECK:STDOUT: %CompleteClass.generic: %CompleteClass.type = struct_value () [concrete] // CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %i32} [concrete] @@ -494,8 +495,8 @@ class Class(U:! type) { // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %CompleteClass.F.specific_fn: = specific_function %CompleteClass.F.456, @CompleteClass.F(%i32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc6_3.4 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.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] @@ -607,7 +608,7 @@ class Class(U:! type) { // CHECK:STDOUT: %F.ref.loc7: %CompleteClass.F.type.942 = name_ref F, %.loc7 [concrete = constants.%CompleteClass.F.456] // 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.Op.bound: = bound_method %v.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %v.var, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%v.var) // CHECK:STDOUT: return %CompleteClass.F.call // CHECK:STDOUT: } @@ -620,7 +621,22 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: fn @F [from "foo.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %CompleteClass.d85) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc6_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc6_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc6_3.3(%self.param: ref %struct_type.n) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc6_3.4(%self.param: ref %CompleteClass.d85) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @UseField() -> out %return.param: %i32 { // CHECK:STDOUT: !entry: @@ -648,7 +664,7 @@ 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.Op.bound: = bound_method %v.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %v.var, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%v.var) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } @@ -691,6 +707,7 @@ class Class(U:! type) { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %i32} [concrete] // CHECK:STDOUT: %complete_type.a68: = complete_type_witness %struct_type.n [concrete] // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic] @@ -713,8 +730,8 @@ class Class(U:! type) { // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc14_3.4 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -790,7 +807,7 @@ class Class(U:! type) { // CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(constants.%ptr.9e1) [concrete = constants.%CompleteClass.582] // CHECK:STDOUT: } // CHECK:STDOUT: %v: ref %CompleteClass.582 = ref_binding v, %v.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %v.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %v.var, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%v.var) // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -803,7 +820,22 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: fn @F [from "foo.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %CompleteClass.582) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc14_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc14_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc14_3.3(%self.param: ref %struct_type.n) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc14_3.4(%self.param: ref %CompleteClass.582) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @CompleteClass(constants.%T) { // CHECK:STDOUT: %T => constants.%T diff --git a/toolchain/check/testdata/class/generic/init.carbon b/toolchain/check/testdata/class/generic/init.carbon index 3ed962e03486..69e7b940a988 100644 --- a/toolchain/check/testdata/class/generic/init.carbon +++ b/toolchain/check/testdata/class/generic/init.carbon @@ -14,12 +14,12 @@ library "[[@TEST_NAME]]"; -class Class(T:! type) { +class Class(T:! Core.Destroy) { var k: T; } //@dump-sem-ir-begin -fn InitFromStructGeneric(T:! Core.Copy, x: T) -> T { +fn InitFromStructGeneric(T:! Core.Copy & Core.Destroy, x: T) -> T { var v: Class(T) = {.k = x}; return v.k; } @@ -51,35 +51,49 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: --- from_struct.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Class.type: type = generic_class_type @Class [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %Class.type: type = generic_class_type @Class [concrete] // CHECK:STDOUT: %Class.generic: %Class.type = struct_value () [concrete] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] -// CHECK:STDOUT: %pattern_type.ce2: type = pattern_type %Copy.type [concrete] -// CHECK:STDOUT: %T.035: %Copy.type = symbolic_binding T, 0 [symbolic] -// CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.035 [symbolic] -// CHECK:STDOUT: %pattern_type.9b9f0c.2: type = pattern_type %T.binding.as_type [symbolic] -// CHECK:STDOUT: %.076a48.2: Core.Form = init_form %T.binding.as_type [symbolic] +// CHECK:STDOUT: %BitAndWith.type.f2e: type = generic_interface_type @BitAndWith [concrete] +// CHECK:STDOUT: %BitAndWith.generic: %BitAndWith.type.f2e = struct_value () [concrete] +// CHECK:STDOUT: %BitAndWith.type.b10: type = facet_type <@BitAndWith, @BitAndWith(type)> [concrete] +// CHECK:STDOUT: %BitAndWith.impl_witness: = impl_witness imports.%BitAndWith.impl_witness_table [concrete] +// CHECK:STDOUT: %BitAndWith.facet: %BitAndWith.type.b10 = facet_value type, (%BitAndWith.impl_witness) [concrete] +// CHECK:STDOUT: %BitAndWith.WithSelf.Op.type.4bd: type = fn_type @BitAndWith.WithSelf.Op, @BitAndWith.WithSelf(type, %BitAndWith.facet) [concrete] +// CHECK:STDOUT: %.d15: type = fn_type_with_self_type %BitAndWith.WithSelf.Op.type.4bd, %BitAndWith.facet [concrete] +// CHECK:STDOUT: %type.as.BitAndWith.impl.Op.type: type = fn_type @type.as.BitAndWith.impl.Op [concrete] +// CHECK:STDOUT: %type.as.BitAndWith.impl.Op: %type.as.BitAndWith.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %type.as.BitAndWith.impl.Op.bound: = bound_method %Copy.type, %type.as.BitAndWith.impl.Op [concrete] +// CHECK:STDOUT: %facet_type: type = facet_type <@Destroy & @Copy> [concrete] +// CHECK:STDOUT: %pattern_type.b13: type = pattern_type %facet_type [concrete] +// CHECK:STDOUT: %T.65f: %facet_type = symbolic_binding T, 0 [symbolic] +// CHECK:STDOUT: %T.binding.as_type.b77: type = symbolic_binding_type T, 0, %T.65f [symbolic] +// CHECK:STDOUT: %pattern_type.2a5: type = pattern_type %T.binding.as_type.b77 [symbolic] +// CHECK:STDOUT: %.e39: Core.Form = init_form %T.binding.as_type.b77 [symbolic] // CHECK:STDOUT: %InitFromStructGeneric.type: type = fn_type @InitFromStructGeneric [concrete] // CHECK:STDOUT: %InitFromStructGeneric: %InitFromStructGeneric.type = struct_value () [concrete] -// CHECK:STDOUT: %require_complete.67c: = require_complete_type %T.binding.as_type [symbolic] -// CHECK:STDOUT: %Class.316: type = class_type @Class, @Class(%T.binding.as_type) [symbolic] -// CHECK:STDOUT: %Class.elem.765: type = unbound_element_type %Class.316, %T.binding.as_type [symbolic] -// CHECK:STDOUT: %struct_type.k.436: type = struct_type {.k: %T.binding.as_type} [symbolic] -// CHECK:STDOUT: %require_complete.ae7: = require_complete_type %Class.316 [symbolic] -// CHECK:STDOUT: %pattern_type.c54: type = pattern_type %Class.316 [symbolic] -// CHECK:STDOUT: %Copy.lookup_impl_witness.58d: = lookup_impl_witness %T.035, @Copy [symbolic] -// CHECK:STDOUT: %Copy.WithSelf.Op.type.735e75.2: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%T.035) [symbolic] -// CHECK:STDOUT: %.023: type = fn_type_with_self_type %Copy.WithSelf.Op.type.735e75.2, %T.035 [symbolic] -// CHECK:STDOUT: %impl.elem0.594: %.023 = impl_witness_access %Copy.lookup_impl_witness.58d, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.bdc: = specific_impl_function %impl.elem0.594, @Copy.WithSelf.Op(%T.035) [symbolic] -// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Class.316, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.facet.88b: %Destroy.type = facet_value %Class.316, (%Destroy.lookup_impl_witness) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.5c9: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.88b) [symbolic] -// CHECK:STDOUT: %.0dd: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.5c9, %Destroy.facet.88b [symbolic] -// CHECK:STDOUT: %impl.elem0.799: %.0dd = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.d17: = specific_impl_function %impl.elem0.799, @Destroy.WithSelf.Op(%Destroy.facet.88b) [symbolic] +// CHECK:STDOUT: %require_complete.a83: = require_complete_type %T.binding.as_type.b77 [symbolic] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.84a: = lookup_impl_witness %T.65f, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.facet.2ff: %Destroy.type = facet_value %T.binding.as_type.b77, (%Destroy.lookup_impl_witness.84a) [symbolic] +// CHECK:STDOUT: %Class.26e: type = class_type @Class, @Class(%Destroy.facet.2ff) [symbolic] +// CHECK:STDOUT: %Class.elem.851: type = unbound_element_type %Class.26e, %T.binding.as_type.b77 [symbolic] +// CHECK:STDOUT: %struct_type.k.a50: type = struct_type {.k: %T.binding.as_type.b77} [symbolic] +// CHECK:STDOUT: %require_complete.7ab: = require_complete_type %Class.26e [symbolic] +// CHECK:STDOUT: %pattern_type.dda: type = pattern_type %Class.26e [symbolic] +// CHECK:STDOUT: %Copy.lookup_impl_witness.322: = lookup_impl_witness %T.65f, @Copy [symbolic] +// CHECK:STDOUT: %Copy.facet.e72: %Copy.type = facet_value %T.binding.as_type.b77, (%Copy.lookup_impl_witness.322) [symbolic] +// CHECK:STDOUT: %Copy.WithSelf.Op.type.3b4: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.e72) [symbolic] +// CHECK:STDOUT: %.db9: type = fn_type_with_self_type %Copy.WithSelf.Op.type.3b4, %Copy.facet.e72 [symbolic] +// CHECK:STDOUT: %impl.elem0.4f5: %.db9 = impl_witness_access %Copy.lookup_impl_witness.322, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.6bf: = specific_impl_function %impl.elem0.4f5, @Copy.WithSelf.Op(%Copy.facet.e72) [symbolic] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.59d: = lookup_impl_witness %Class.26e, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.facet.735: %Destroy.type = facet_value %Class.26e, (%Destroy.lookup_impl_witness.59d) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.29a: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.735) [symbolic] +// CHECK:STDOUT: %.c77: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.29a, %Destroy.facet.735 [symbolic] +// CHECK:STDOUT: %impl.elem0.6f8: %.c77 = impl_witness_access %Destroy.lookup_impl_witness.59d, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.40b: = specific_impl_function %impl.elem0.6f8, @Destroy.WithSelf.Op(%Destroy.facet.735) [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] @@ -89,33 +103,42 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %.ff5: Core.Form = init_form %i32 [concrete] // CHECK:STDOUT: %InitFromStructSpecific.type: type = fn_type @InitFromStructSpecific [concrete] // CHECK:STDOUT: %InitFromStructSpecific: %InitFromStructSpecific.type = struct_value () [concrete] -// CHECK:STDOUT: %Class.805: type = class_type @Class, @Class(%i32) [concrete] -// CHECK:STDOUT: %Class.elem.927: type = unbound_element_type %Class.805, %i32 [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc15_19.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.8d7fae.2: = custom_witness (%Destroy.Op.651ba6.2), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.0fd: %Destroy.type = facet_value %i32, (%custom_witness.8d7fae.2) [concrete] +// CHECK:STDOUT: %Class.02d: type = class_type @Class, @Class(%Destroy.facet.0fd) [concrete] +// CHECK:STDOUT: %Class.elem.2a7: type = unbound_element_type %Class.02d, %i32 [concrete] // CHECK:STDOUT: %struct_type.k.0bf: type = struct_type {.k: %i32} [concrete] -// CHECK:STDOUT: %pattern_type.1c2: type = pattern_type %Class.805 [concrete] +// CHECK:STDOUT: %pattern_type.f2b: type = pattern_type %Class.02d [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.824: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] // CHECK:STDOUT: %Int.as.Copy.impl.Op.9b9: %Int.as.Copy.impl.Op.type.824 = struct_value () [symbolic] // CHECK:STDOUT: %Copy.impl_witness.f17: = impl_witness imports.%Copy.impl_witness_table.e76, @Int.as.Copy.impl(%int_32) [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.546: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.664: %Int.as.Copy.impl.Op.type.546 = struct_value () [concrete] -// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %i32, (%Copy.impl_witness.f17) [concrete] -// CHECK:STDOUT: %Copy.WithSelf.Op.type.081: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet) [concrete] -// CHECK:STDOUT: %.8e2: type = fn_type_with_self_type %Copy.WithSelf.Op.type.081, %Copy.facet [concrete] +// CHECK:STDOUT: %Copy.facet.de4: %Copy.type = facet_value %i32, (%Copy.impl_witness.f17) [concrete] +// CHECK:STDOUT: %Copy.WithSelf.Op.type.081: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.de4) [concrete] +// CHECK:STDOUT: %.8e2: type = fn_type_with_self_type %Copy.WithSelf.Op.type.081, %Copy.facet.de4 [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.664, @Int.as.Copy.impl.Op(%int_32) [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc15_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { -// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: .Destroy = %Core.Destroy +// CHECK:STDOUT: .Copy = %Core.Copy +// CHECK:STDOUT: .BitAndWith = %Core.BitAndWith // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.BitAndWith: %BitAndWith.type.f2e = import_ref Core//prelude/parts/as, BitAndWith, loaded [concrete = constants.%BitAndWith.generic] +// CHECK:STDOUT: %Core.import_ref.8d3: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude/parts/as, loc{{\d+_\d+}}, loaded [concrete = constants.%type.as.BitAndWith.impl.Op] +// CHECK:STDOUT: %BitAndWith.impl_witness_table = impl_witness_table (%Core.import_ref.8d3), @type.as.BitAndWith.impl [concrete] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.import_ref.18d: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.824) = 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.9b9)] // CHECK:STDOUT: %Copy.impl_witness_table.e76 = impl_witness_table (%Core.import_ref.18d), @Int.as.Copy.impl [concrete] @@ -123,31 +146,38 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %InitFromStructGeneric.decl: %InitFromStructGeneric.type = fn_decl @InitFromStructGeneric [concrete = constants.%InitFromStructGeneric] { -// CHECK:STDOUT: %T.patt: %pattern_type.ce2 = symbolic_binding_pattern T, 0 [concrete] -// CHECK:STDOUT: %x.param_patt: @InitFromStructGeneric.%pattern_type.loc9 (%pattern_type.9b9f0c.2) = value_param_pattern [concrete] -// CHECK:STDOUT: %x.patt: @InitFromStructGeneric.%pattern_type.loc9 (%pattern_type.9b9f0c.2) = at_binding_pattern x, %x.param_patt [concrete] -// CHECK:STDOUT: %return.param_patt: @InitFromStructGeneric.%pattern_type.loc9 (%pattern_type.9b9f0c.2) = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: @InitFromStructGeneric.%pattern_type.loc9 (%pattern_type.9b9f0c.2) = return_slot_pattern %return.param_patt, %.loc9_50.3 [concrete] +// CHECK:STDOUT: %T.patt: %pattern_type.b13 = symbolic_binding_pattern T, 0 [concrete] +// CHECK:STDOUT: %x.param_patt: @InitFromStructGeneric.%pattern_type.loc9 (%pattern_type.2a5) = value_param_pattern [concrete] +// CHECK:STDOUT: %x.patt: @InitFromStructGeneric.%pattern_type.loc9 (%pattern_type.2a5) = at_binding_pattern x, %x.param_patt [concrete] +// CHECK:STDOUT: %return.param_patt: @InitFromStructGeneric.%pattern_type.loc9 (%pattern_type.2a5) = out_param_pattern [concrete] +// CHECK:STDOUT: %return.patt: @InitFromStructGeneric.%pattern_type.loc9 (%pattern_type.2a5) = return_slot_pattern %return.param_patt, %.loc9_65.3 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc9_50: %Copy.type = name_ref T, %T.loc9_27.2 [symbolic = %T.loc9_27.1 (constants.%T.035)] -// CHECK:STDOUT: %T.as_type.loc9_50: type = facet_access_type %T.ref.loc9_50 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %.loc9_50.3: type = converted %T.ref.loc9_50, %T.as_type.loc9_50 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %.loc9_50.4: Core.Form = init_form %.loc9_50.3 [symbolic = %.loc9_50.2 (constants.%.076a48.2)] -// CHECK:STDOUT: %.loc9_34: type = splice_block %Copy.ref [concrete = constants.%Copy.type] { +// CHECK:STDOUT: %T.ref.loc9_65: %facet_type = name_ref T, %T.loc9_27.2 [symbolic = %T.loc9_27.1 (constants.%T.65f)] +// CHECK:STDOUT: %T.as_type.loc9_65: type = facet_access_type %T.ref.loc9_65 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.b77)] +// CHECK:STDOUT: %.loc9_65.3: type = converted %T.ref.loc9_65, %T.as_type.loc9_65 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.b77)] +// CHECK:STDOUT: %.loc9_65.4: Core.Form = init_form %.loc9_65.3 [symbolic = %.loc9_65.2 (constants.%.e39)] +// CHECK:STDOUT: %.loc9_40.1: type = splice_block %.loc9_40.3 [concrete = constants.%facet_type] { // CHECK:STDOUT: -// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %Core.ref.loc9_30: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %Copy.ref: type = name_ref Copy, imports.%Core.Copy [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.ref.loc9_42: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %Destroy.ref: type = name_ref Destroy, imports.%Core.Destroy [concrete = constants.%Destroy.type] +// CHECK:STDOUT: %impl.elem0.loc9: %.d15 = impl_witness_access constants.%BitAndWith.impl_witness, element0 [concrete = constants.%type.as.BitAndWith.impl.Op] +// CHECK:STDOUT: %bound_method.loc9: = bound_method %Copy.ref, %impl.elem0.loc9 [concrete = constants.%type.as.BitAndWith.impl.Op.bound] +// CHECK:STDOUT: %type.as.BitAndWith.impl.Op.call: init type = call %bound_method.loc9(%Copy.ref, %Destroy.ref) [concrete = constants.%facet_type] +// CHECK:STDOUT: %.loc9_40.2: type = value_of_initializer %type.as.BitAndWith.impl.Op.call [concrete = constants.%facet_type] +// CHECK:STDOUT: %.loc9_40.3: type = converted %type.as.BitAndWith.impl.Op.call, %.loc9_40.2 [concrete = constants.%facet_type] // CHECK:STDOUT: } -// CHECK:STDOUT: %T.loc9_27.2: %Copy.type = symbolic_binding T, 0 [symbolic = %T.loc9_27.1 (constants.%T.035)] -// CHECK:STDOUT: %x.param: @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc9_44.1: type = splice_block %.loc9_44.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] { -// CHECK:STDOUT: %T.ref.loc9_44: %Copy.type = name_ref T, %T.loc9_27.2 [symbolic = %T.loc9_27.1 (constants.%T.035)] -// CHECK:STDOUT: %T.as_type.loc9_44: type = facet_access_type %T.ref.loc9_44 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %.loc9_44.2: type = converted %T.ref.loc9_44, %T.as_type.loc9_44 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] +// CHECK:STDOUT: %T.loc9_27.2: %facet_type = symbolic_binding T, 0 [symbolic = %T.loc9_27.1 (constants.%T.65f)] +// CHECK:STDOUT: %x.param: @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type.b77) = value_param call_param0 +// CHECK:STDOUT: %.loc9_59.1: type = splice_block %.loc9_59.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.b77)] { +// CHECK:STDOUT: %T.ref.loc9_59: %facet_type = name_ref T, %T.loc9_27.2 [symbolic = %T.loc9_27.1 (constants.%T.65f)] +// CHECK:STDOUT: %T.as_type.loc9_59: type = facet_access_type %T.ref.loc9_59 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.b77)] +// CHECK:STDOUT: %.loc9_59.2: type = converted %T.ref.loc9_59, %T.as_type.loc9_59 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.b77)] // CHECK:STDOUT: } -// CHECK:STDOUT: %x: @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type) = value_binding x, %x.param -// CHECK:STDOUT: %return.param: ref @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type) = out_param call_param1 -// CHECK:STDOUT: %return: ref @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type) = return_slot %return.param +// CHECK:STDOUT: %x: @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type.b77) = value_binding x, %x.param +// CHECK:STDOUT: %return.param: ref @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type.b77) = out_param call_param1 +// CHECK:STDOUT: %return: ref @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type.b77) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %InitFromStructSpecific.decl: %InitFromStructSpecific.type = fn_decl @InitFromStructSpecific [concrete = constants.%InitFromStructSpecific] { // CHECK:STDOUT: %x.param_patt: %pattern_type.7ce = value_param_pattern [concrete] @@ -165,71 +195,75 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @InitFromStructGeneric(%T.loc9_27.2: %Copy.type) { -// CHECK:STDOUT: %T.loc9_27.1: %Copy.type = symbolic_binding T, 0 [symbolic = %T.loc9_27.1 (constants.%T.035)] -// CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc9_27.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %pattern_type.loc9: type = pattern_type %T.binding.as_type [symbolic = %pattern_type.loc9 (constants.%pattern_type.9b9f0c.2)] -// CHECK:STDOUT: %.loc9_50.2: Core.Form = init_form %T.binding.as_type [symbolic = %.loc9_50.2 (constants.%.076a48.2)] +// CHECK:STDOUT: generic fn @InitFromStructGeneric(%T.loc9_27.2: %facet_type) { +// CHECK:STDOUT: %T.loc9_27.1: %facet_type = symbolic_binding T, 0 [symbolic = %T.loc9_27.1 (constants.%T.65f)] +// CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc9_27.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.b77)] +// CHECK:STDOUT: %pattern_type.loc9: type = pattern_type %T.binding.as_type [symbolic = %pattern_type.loc9 (constants.%pattern_type.2a5)] +// CHECK:STDOUT: %.loc9_65.2: Core.Form = init_form %T.binding.as_type [symbolic = %.loc9_65.2 (constants.%.e39)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc9: = require_complete_type %T.binding.as_type [symbolic = %require_complete.loc9 (constants.%require_complete.67c)] -// CHECK:STDOUT: %Class.loc10_17.2: type = class_type @Class, @Class(%T.binding.as_type) [symbolic = %Class.loc10_17.2 (constants.%Class.316)] -// CHECK:STDOUT: %require_complete.loc10: = require_complete_type %Class.loc10_17.2 [symbolic = %require_complete.loc10 (constants.%require_complete.ae7)] -// CHECK:STDOUT: %pattern_type.loc10: type = pattern_type %Class.loc10_17.2 [symbolic = %pattern_type.loc10 (constants.%pattern_type.c54)] -// CHECK:STDOUT: %struct_type.k: type = struct_type {.k: @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type)} [symbolic = %struct_type.k (constants.%struct_type.k.436)] -// CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%T.loc9_27.1) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.735e75.2)] -// CHECK:STDOUT: %.loc10_27: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %T.loc9_27.1 [symbolic = %.loc10_27 (constants.%.023)] -// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %T.loc9_27.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.58d)] -// CHECK:STDOUT: %impl.elem0.loc10_27.2: @InitFromStructGeneric.%.loc10_27 (%.023) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_27.2 (constants.%impl.elem0.594)] -// CHECK:STDOUT: %specific_impl_fn.loc10_27.2: = specific_impl_function %impl.elem0.loc10_27.2, @Copy.WithSelf.Op(%T.loc9_27.1) [symbolic = %specific_impl_fn.loc10_27.2 (constants.%specific_impl_fn.bdc)] -// CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class.loc10_17.2, %T.binding.as_type [symbolic = %Class.elem (constants.%Class.elem.765)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Class.loc10_17.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %Class.loc10_17.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.88b)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.5c9)] -// CHECK:STDOUT: %.loc10_3.2: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet [symbolic = %.loc10_3.2 (constants.%.0dd)] -// CHECK:STDOUT: %impl.elem0.loc10_3.2: @InitFromStructGeneric.%.loc10_3.2 (%.0dd) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_3.2 (constants.%impl.elem0.799)] -// CHECK:STDOUT: %specific_impl_fn.loc10_3.2: = specific_impl_function %impl.elem0.loc10_3.2, @Destroy.WithSelf.Op(%Destroy.facet) [symbolic = %specific_impl_fn.loc10_3.2 (constants.%specific_impl_fn.d17)] +// CHECK:STDOUT: %require_complete.loc9: = require_complete_type %T.binding.as_type [symbolic = %require_complete.loc9 (constants.%require_complete.a83)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc10_17: = lookup_impl_witness %T.loc9_27.1, @Destroy [symbolic = %Destroy.lookup_impl_witness.loc10_17 (constants.%Destroy.lookup_impl_witness.84a)] +// CHECK:STDOUT: %Destroy.facet.loc10_17.2: %Destroy.type = facet_value %T.binding.as_type, (%Destroy.lookup_impl_witness.loc10_17) [symbolic = %Destroy.facet.loc10_17.2 (constants.%Destroy.facet.2ff)] +// CHECK:STDOUT: %Class.loc10_17.2: type = class_type @Class, @Class(%Destroy.facet.loc10_17.2) [symbolic = %Class.loc10_17.2 (constants.%Class.26e)] +// CHECK:STDOUT: %require_complete.loc10: = require_complete_type %Class.loc10_17.2 [symbolic = %require_complete.loc10 (constants.%require_complete.7ab)] +// CHECK:STDOUT: %pattern_type.loc10: type = pattern_type %Class.loc10_17.2 [symbolic = %pattern_type.loc10 (constants.%pattern_type.dda)] +// CHECK:STDOUT: %struct_type.k: type = struct_type {.k: @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type.b77)} [symbolic = %struct_type.k (constants.%struct_type.k.a50)] +// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %T.loc9_27.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.322)] +// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %T.binding.as_type, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet.e72)] +// CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.3b4)] +// CHECK:STDOUT: %.loc10_27: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet [symbolic = %.loc10_27 (constants.%.db9)] +// CHECK:STDOUT: %impl.elem0.loc10_27.2: @InitFromStructGeneric.%.loc10_27 (%.db9) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_27.2 (constants.%impl.elem0.4f5)] +// CHECK:STDOUT: %specific_impl_fn.loc10_27.2: = specific_impl_function %impl.elem0.loc10_27.2, @Copy.WithSelf.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc10_27.2 (constants.%specific_impl_fn.6bf)] +// CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class.loc10_17.2, %T.binding.as_type [symbolic = %Class.elem (constants.%Class.elem.851)] +// 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.59d)] +// CHECK:STDOUT: %Destroy.facet.loc10_3: %Destroy.type = facet_value %Class.loc10_17.2, (%Destroy.lookup_impl_witness.loc10_3) [symbolic = %Destroy.facet.loc10_3 (constants.%Destroy.facet.735)] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc10_3) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.29a)] +// CHECK:STDOUT: %.loc10_3.2: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet.loc10_3 [symbolic = %.loc10_3.2 (constants.%.c77)] +// CHECK:STDOUT: %impl.elem0.loc10_3.2: @InitFromStructGeneric.%.loc10_3.2 (%.c77) = impl_witness_access %Destroy.lookup_impl_witness.loc10_3, element0 [symbolic = %impl.elem0.loc10_3.2 (constants.%impl.elem0.6f8)] +// CHECK:STDOUT: %specific_impl_fn.loc10_3.2: = specific_impl_function %impl.elem0.loc10_3.2, @Destroy.WithSelf.Op(%Destroy.facet.loc10_3) [symbolic = %specific_impl_fn.loc10_3.2 (constants.%specific_impl_fn.40b)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%x.param: @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type)) -> out %return.param: @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type) { +// CHECK:STDOUT: fn(%x.param: @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type.b77)) -> out %return.param: @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type.b77) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %v.patt: @InitFromStructGeneric.%pattern_type.loc10 (%pattern_type.c54) = ref_binding_pattern v [concrete] -// CHECK:STDOUT: %v.var_patt: @InitFromStructGeneric.%pattern_type.loc10 (%pattern_type.c54) = var_pattern %v.patt [concrete] +// CHECK:STDOUT: %v.patt: @InitFromStructGeneric.%pattern_type.loc10 (%pattern_type.dda) = ref_binding_pattern v [concrete] +// CHECK:STDOUT: %v.var_patt: @InitFromStructGeneric.%pattern_type.loc10 (%pattern_type.dda) = var_pattern %v.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %v.var: ref @InitFromStructGeneric.%Class.loc10_17.2 (%Class.316) = var %v.var_patt -// CHECK:STDOUT: %x.ref: @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type) = name_ref x, %x -// CHECK:STDOUT: %.loc10_28.1: @InitFromStructGeneric.%struct_type.k (%struct_type.k.436) = struct_literal (%x.ref) -// CHECK:STDOUT: %impl.elem0.loc10_27.1: @InitFromStructGeneric.%.loc10_27 (%.023) = impl_witness_access constants.%Copy.lookup_impl_witness.58d, element0 [symbolic = %impl.elem0.loc10_27.2 (constants.%impl.elem0.594)] +// CHECK:STDOUT: %v.var: ref @InitFromStructGeneric.%Class.loc10_17.2 (%Class.26e) = var %v.var_patt +// CHECK:STDOUT: %x.ref: @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type.b77) = name_ref x, %x +// CHECK:STDOUT: %.loc10_28.1: @InitFromStructGeneric.%struct_type.k (%struct_type.k.a50) = struct_literal (%x.ref) +// CHECK:STDOUT: %impl.elem0.loc10_27.1: @InitFromStructGeneric.%.loc10_27 (%.db9) = impl_witness_access constants.%Copy.lookup_impl_witness.322, element0 [symbolic = %impl.elem0.loc10_27.2 (constants.%impl.elem0.4f5)] // CHECK:STDOUT: %bound_method.loc10_27.1: = bound_method %x.ref, %impl.elem0.loc10_27.1 -// CHECK:STDOUT: %specific_impl_fn.loc10_27.1: = specific_impl_function %impl.elem0.loc10_27.1, @Copy.WithSelf.Op(constants.%T.035) [symbolic = %specific_impl_fn.loc10_27.2 (constants.%specific_impl_fn.bdc)] +// CHECK:STDOUT: %specific_impl_fn.loc10_27.1: = specific_impl_function %impl.elem0.loc10_27.1, @Copy.WithSelf.Op(constants.%Copy.facet.e72) [symbolic = %specific_impl_fn.loc10_27.2 (constants.%specific_impl_fn.6bf)] // CHECK:STDOUT: %bound_method.loc10_27.2: = bound_method %x.ref, %specific_impl_fn.loc10_27.1 -// CHECK:STDOUT: %.loc10_28.2: ref @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type) = class_element_access %v.var, element0 -// CHECK:STDOUT: %Copy.WithSelf.Op.call.loc10: init @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type) to %.loc10_28.2 = call %bound_method.loc10_27.2(%x.ref) -// CHECK:STDOUT: %.loc10_28.3: init @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type) to %.loc10_28.2 = in_place_init %Copy.WithSelf.Op.call.loc10 -// CHECK:STDOUT: %.loc10_28.4: init @InitFromStructGeneric.%Class.loc10_17.2 (%Class.316) to %v.var = class_init (%.loc10_28.3) -// CHECK:STDOUT: %.loc10_3.1: init @InitFromStructGeneric.%Class.loc10_17.2 (%Class.316) = converted %.loc10_28.1, %.loc10_28.4 +// CHECK:STDOUT: %.loc10_28.2: ref @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type.b77) = class_element_access %v.var, element0 +// CHECK:STDOUT: %Copy.WithSelf.Op.call.loc10: init @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type.b77) to %.loc10_28.2 = call %bound_method.loc10_27.2(%x.ref) +// CHECK:STDOUT: %.loc10_28.3: init @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type.b77) to %.loc10_28.2 = in_place_init %Copy.WithSelf.Op.call.loc10 +// CHECK:STDOUT: %.loc10_28.4: init @InitFromStructGeneric.%Class.loc10_17.2 (%Class.26e) to %v.var = class_init (%.loc10_28.3) +// CHECK:STDOUT: %.loc10_3.1: init @InitFromStructGeneric.%Class.loc10_17.2 (%Class.26e) = converted %.loc10_28.1, %.loc10_28.4 // CHECK:STDOUT: assign %v.var, %.loc10_3.1 -// CHECK:STDOUT: %.loc10_17.1: type = splice_block %Class.loc10_17.1 [symbolic = %Class.loc10_17.2 (constants.%Class.316)] { +// CHECK:STDOUT: %.loc10_17.1: type = splice_block %Class.loc10_17.1 [symbolic = %Class.loc10_17.2 (constants.%Class.26e)] { // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [concrete = constants.%Class.generic] -// CHECK:STDOUT: %T.ref.loc10: %Copy.type = name_ref T, %T.loc9_27.2 [symbolic = %T.loc9_27.1 (constants.%T.035)] -// CHECK:STDOUT: %T.as_type.loc10: type = facet_access_type %T.ref.loc10 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %.loc10_17.2: type = converted %T.ref.loc10, %T.as_type.loc10 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %Class.loc10_17.1: type = class_type @Class, @Class(constants.%T.binding.as_type) [symbolic = %Class.loc10_17.2 (constants.%Class.316)] +// CHECK:STDOUT: %T.ref.loc10: %facet_type = name_ref T, %T.loc9_27.2 [symbolic = %T.loc9_27.1 (constants.%T.65f)] +// CHECK:STDOUT: %T.as_type.loc10: type = facet_access_type %T.ref.loc10 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.b77)] +// CHECK:STDOUT: %Destroy.facet.loc10_17.1: %Destroy.type = facet_value %T.as_type.loc10, (constants.%Destroy.lookup_impl_witness.84a) [symbolic = %Destroy.facet.loc10_17.2 (constants.%Destroy.facet.2ff)] +// CHECK:STDOUT: %.loc10_17.2: %Destroy.type = converted %T.ref.loc10, %Destroy.facet.loc10_17.1 [symbolic = %Destroy.facet.loc10_17.2 (constants.%Destroy.facet.2ff)] +// CHECK:STDOUT: %Class.loc10_17.1: type = class_type @Class, @Class(constants.%Destroy.facet.2ff) [symbolic = %Class.loc10_17.2 (constants.%Class.26e)] // CHECK:STDOUT: } -// CHECK:STDOUT: %v: ref @InitFromStructGeneric.%Class.loc10_17.2 (%Class.316) = ref_binding v, %v.var -// CHECK:STDOUT: %v.ref: ref @InitFromStructGeneric.%Class.loc10_17.2 (%Class.316) = name_ref v, %v -// CHECK:STDOUT: %k.ref: @InitFromStructGeneric.%Class.elem (%Class.elem.765) = name_ref k, @Class.%.loc5 [concrete = @Class.%.loc5] -// CHECK:STDOUT: %.loc11_11.1: ref @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type) = class_element_access %v.ref, element0 -// CHECK:STDOUT: %.loc11_11.2: @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type) = acquire_value %.loc11_11.1 -// CHECK:STDOUT: %impl.elem0.loc11: @InitFromStructGeneric.%.loc10_27 (%.023) = impl_witness_access constants.%Copy.lookup_impl_witness.58d, element0 [symbolic = %impl.elem0.loc10_27.2 (constants.%impl.elem0.594)] +// CHECK:STDOUT: %v: ref @InitFromStructGeneric.%Class.loc10_17.2 (%Class.26e) = ref_binding v, %v.var +// CHECK:STDOUT: %v.ref: ref @InitFromStructGeneric.%Class.loc10_17.2 (%Class.26e) = name_ref v, %v +// CHECK:STDOUT: %k.ref: @InitFromStructGeneric.%Class.elem (%Class.elem.851) = name_ref k, @Class.%.loc5_8 [concrete = @Class.%.loc5_8] +// CHECK:STDOUT: %.loc11_11.1: ref @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type.b77) = class_element_access %v.ref, element0 +// CHECK:STDOUT: %.loc11_11.2: @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type.b77) = acquire_value %.loc11_11.1 +// CHECK:STDOUT: %impl.elem0.loc11: @InitFromStructGeneric.%.loc10_27 (%.db9) = impl_witness_access constants.%Copy.lookup_impl_witness.322, element0 [symbolic = %impl.elem0.loc10_27.2 (constants.%impl.elem0.4f5)] // CHECK:STDOUT: %bound_method.loc11_11.1: = bound_method %.loc11_11.2, %impl.elem0.loc11 -// CHECK:STDOUT: %specific_impl_fn.loc11: = specific_impl_function %impl.elem0.loc11, @Copy.WithSelf.Op(constants.%T.035) [symbolic = %specific_impl_fn.loc10_27.2 (constants.%specific_impl_fn.bdc)] +// CHECK:STDOUT: %specific_impl_fn.loc11: = specific_impl_function %impl.elem0.loc11, @Copy.WithSelf.Op(constants.%Copy.facet.e72) [symbolic = %specific_impl_fn.loc10_27.2 (constants.%specific_impl_fn.6bf)] // CHECK:STDOUT: %bound_method.loc11_11.2: = bound_method %.loc11_11.2, %specific_impl_fn.loc11 -// CHECK:STDOUT: %.loc9_50.1: ref @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type) = splice_block %return.param {} -// CHECK:STDOUT: %Copy.WithSelf.Op.call.loc11: init @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type) to %.loc9_50.1 = call %bound_method.loc11_11.2(%.loc11_11.2) -// CHECK:STDOUT: %impl.elem0.loc10_3.1: @InitFromStructGeneric.%.loc10_3.2 (%.0dd) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_3.2 (constants.%impl.elem0.799)] +// CHECK:STDOUT: %.loc9_65.1: ref @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type.b77) = splice_block %return.param {} +// CHECK:STDOUT: %Copy.WithSelf.Op.call.loc11: init @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type.b77) to %.loc9_65.1 = call %bound_method.loc11_11.2(%.loc11_11.2) +// CHECK:STDOUT: %impl.elem0.loc10_3.1: @InitFromStructGeneric.%.loc10_3.2 (%.c77) = impl_witness_access constants.%Destroy.lookup_impl_witness.59d, element0 [symbolic = %impl.elem0.loc10_3.2 (constants.%impl.elem0.6f8)] // CHECK:STDOUT: %bound_method.loc10_3.1: = bound_method %v.var, %impl.elem0.loc10_3.1 -// CHECK:STDOUT: %specific_impl_fn.loc10_3.1: = specific_impl_function %impl.elem0.loc10_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.88b) [symbolic = %specific_impl_fn.loc10_3.2 (constants.%specific_impl_fn.d17)] +// CHECK:STDOUT: %specific_impl_fn.loc10_3.1: = specific_impl_function %impl.elem0.loc10_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.735) [symbolic = %specific_impl_fn.loc10_3.2 (constants.%specific_impl_fn.40b)] // 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: return %Copy.WithSelf.Op.call.loc11 to %return.param @@ -239,10 +273,10 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: fn @InitFromStructSpecific(%x.param: %i32) -> out %return.param: %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %v.patt: %pattern_type.1c2 = ref_binding_pattern v [concrete] -// CHECK:STDOUT: %v.var_patt: %pattern_type.1c2 = var_pattern %v.patt [concrete] +// CHECK:STDOUT: %v.patt: %pattern_type.f2b = ref_binding_pattern v [concrete] +// CHECK:STDOUT: %v.var_patt: %pattern_type.f2b = var_pattern %v.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %v.var: ref %Class.805 = var %v.var_patt +// CHECK:STDOUT: %v.var: ref %Class.02d = var %v.var_patt // CHECK:STDOUT: %x.ref: %i32 = name_ref x, %x // CHECK:STDOUT: %.loc15_30.1: %struct_type.k.0bf = struct_literal (%x.ref) // CHECK:STDOUT: %impl.elem0.loc15: %.8e2 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] @@ -252,17 +286,19 @@ 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.805 to %v.var = class_init (%.loc15_30.3) -// CHECK:STDOUT: %.loc15_3: init %Class.805 = converted %.loc15_30.1, %.loc15_30.4 +// CHECK:STDOUT: %.loc15_30.4: init %Class.02d to %v.var = class_init (%.loc15_30.3) +// CHECK:STDOUT: %.loc15_3: init %Class.02d = converted %.loc15_30.1, %.loc15_30.4 // CHECK:STDOUT: assign %v.var, %.loc15_3 -// CHECK:STDOUT: %.loc15_19: type = splice_block %Class [concrete = constants.%Class.805] { +// CHECK:STDOUT: %.loc15_19.1: type = splice_block %Class [concrete = constants.%Class.02d] { // 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: %Class: type = class_type @Class, @Class(constants.%i32) [concrete = constants.%Class.805] +// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %i32.loc15, (constants.%custom_witness.8d7fae.2) [concrete = constants.%Destroy.facet.0fd] +// CHECK:STDOUT: %.loc15_19.2: %Destroy.type = converted %i32.loc15, %Destroy.facet [concrete = constants.%Destroy.facet.0fd] +// CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%Destroy.facet.0fd) [concrete = constants.%Class.02d] // CHECK:STDOUT: } -// CHECK:STDOUT: %v: ref %Class.805 = ref_binding v, %v.var -// CHECK:STDOUT: %v.ref: ref %Class.805 = name_ref v, %v -// CHECK:STDOUT: %k.ref: %Class.elem.927 = name_ref k, @Class.%.loc5 [concrete = @Class.%.loc5] +// CHECK:STDOUT: %v: ref %Class.02d = ref_binding v, %v.var +// CHECK:STDOUT: %v.ref: ref %Class.02d = name_ref v, %v +// CHECK:STDOUT: %k.ref: %Class.elem.2a7 = name_ref k, @Class.%.loc5_8 [concrete = @Class.%.loc5_8] // 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: %.8e2 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] @@ -270,18 +306,33 @@ 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.Op.bound: = bound_method %v.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %v.var, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%v.var) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call.loc16 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Class.805) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc15_19.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: specific @InitFromStructGeneric(constants.%T.035) { -// CHECK:STDOUT: %T.loc9_27.1 => constants.%T.035 -// CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type -// CHECK:STDOUT: %pattern_type.loc9 => constants.%pattern_type.9b9f0c.2 -// CHECK:STDOUT: %.loc9_50.2 => constants.%.076a48.2 +// CHECK:STDOUT: fn @Destroy.Op.loc15_19.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc15_3.1(%self.param: ref %struct_type.k.0bf) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc15_3.2(%self.param: ref %Class.02d) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @InitFromStructGeneric(constants.%T.65f) { +// CHECK:STDOUT: %T.loc9_27.1 => constants.%T.65f +// CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type.b77 +// CHECK:STDOUT: %pattern_type.loc9 => constants.%pattern_type.2a5 +// CHECK:STDOUT: %.loc9_65.2 => constants.%.e39 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- adapt.carbon diff --git a/toolchain/check/testdata/class/generic/member_type.carbon b/toolchain/check/testdata/class/generic/member_type.carbon index a95e1bccce52..168a0b6292ab 100644 --- a/toolchain/check/testdata/class/generic/member_type.carbon +++ b/toolchain/check/testdata/class/generic/member_type.carbon @@ -137,8 +137,8 @@ fn Test() -> i32 { // CHECK:STDOUT: %.8e2: type = fn_type_with_self_type %Copy.WithSelf.Op.type.081, %Copy.facet.de4 [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.664, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc13_3.4 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -337,12 +337,27 @@ 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.Op.bound: = bound_method %c.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %c.var, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%c.var) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Inner.74c) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc13_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc13_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc13_3.3(%self.param: ref %struct_type.n.033) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc13_3.4(%self.param: ref %Inner.74c) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Outer(constants.%T.035) { // CHECK:STDOUT: %T.loc4_14.1 => constants.%T.035 @@ -494,8 +509,8 @@ fn Test() -> i32 { // CHECK:STDOUT: %.fd6: type = fn_type_with_self_type %Inner.WithSelf.F.type.96b, %Inner.facet.ac9 [concrete] // CHECK:STDOUT: %C.as.Inner.impl.F.specific_fn: = specific_function %C.as.Inner.impl.F.356, @C.as.Inner.impl.F(%i32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc23_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -791,12 +806,17 @@ fn Test() -> i32 { // CHECK:STDOUT: %bound_method.loc24_33: = bound_method %c.ref, %specific_fn // CHECK:STDOUT: %.loc24_10: %C.d3f = acquire_value %c.ref // CHECK:STDOUT: %C.as.Inner.impl.F.call: init %i32 = call %bound_method.loc24_33(%.loc24_10) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %c.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %c.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%c.var) // CHECK:STDOUT: return %C.as.Inner.impl.F.call // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %C.d3f) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc23_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc23_3.2(%self.param: ref %C.d3f) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Outer(constants.%T) { // CHECK:STDOUT: %T.loc4_14.1 => constants.%T diff --git a/toolchain/check/testdata/class/generic/method_deduce.carbon b/toolchain/check/testdata/class/generic/method_deduce.carbon index 8eda27a512b5..050e9206d55b 100644 --- a/toolchain/check/testdata/class/generic/method_deduce.carbon +++ b/toolchain/check/testdata/class/generic/method_deduce.carbon @@ -40,6 +40,7 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Class.generic: %Class.type = struct_value () [concrete] // CHECK:STDOUT: %Class.0db: type = class_type @Class, @Class(%T) [symbolic] // CHECK:STDOUT: %U: type = symbolic_binding U, 1 [symbolic] @@ -78,6 +79,9 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %A.val: %A = struct_value () [concrete] // CHECK:STDOUT: %.33f: ref %A = temporary invalid, %A.val [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc28_25.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.33f, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: %complete_type.f71: = complete_type_witness %tuple.type.e87 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -314,10 +318,16 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %.loc28_25.5: ref %A = temporary %.loc28_25.2, %.loc28_25.4 [concrete = constants.%.33f] // CHECK:STDOUT: %.loc28_25.6: %A = acquire_value %.loc28_25.5 [concrete = constants.%A.val] // CHECK:STDOUT: %Class.GetNoDeduce.call: init %tuple.type.e87 to %.loc27_62.1 = call %Class.GetNoDeduce.specific_fn(%.loc28_25.6) +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.33f) // CHECK:STDOUT: return %Class.GetNoDeduce.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %A) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc28_25.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc28_25.2(%self.param: ref %A) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { // CHECK:STDOUT: %T.loc18_14.1 => constants.%T diff --git a/toolchain/check/testdata/class/generic/self.carbon b/toolchain/check/testdata/class/generic/self.carbon index 16a4cd6ca445..58d4bcda02a4 100644 --- a/toolchain/check/testdata/class/generic/self.carbon +++ b/toolchain/check/testdata/class/generic/self.carbon @@ -51,11 +51,11 @@ class Class(T:! type) { // 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: %Destroy.type = facet_value %Class, (%Destroy.lookup_impl_witness) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.609: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet) [symbolic] -// CHECK:STDOUT: %.2f5: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.609, %Destroy.facet [symbolic] +// CHECK:STDOUT: %Destroy.facet.bb2: %Destroy.type = facet_value %Class, (%Destroy.lookup_impl_witness) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.609: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.bb2) [symbolic] +// CHECK:STDOUT: %.2f5: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.609, %Destroy.facet.bb2 [symbolic] // CHECK:STDOUT: %impl.elem0: %.2f5 = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @Destroy.WithSelf.Op(%Destroy.facet) [symbolic] +// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @Destroy.WithSelf.Op(%Destroy.facet.bb2) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -182,7 +182,7 @@ class Class(T:! 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.facet: %Destroy.type = facet_value %Class.loc21_26.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet)] +// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %Class.loc21_26.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.bb2)] // CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.609)] // CHECK:STDOUT: %.loc22_5.2: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet [symbolic = %.loc22_5.2 (constants.%.2f5)] // CHECK:STDOUT: %impl.elem0.loc22_5.2: @Class.F.%.loc22_5.2 (%.2f5) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc22_5.2 (constants.%impl.elem0)] @@ -225,18 +225,20 @@ class Class(T:! type) { // CHECK:STDOUT: %s: ref @Class.F.%Class.loc21_26.2 (%Class) = ref_binding s, %s.var // CHECK:STDOUT: %impl.elem0.loc22_5.1: @Class.F.%.loc22_5.2 (%.2f5) = 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: %specific_impl_fn.loc22_5.1: = specific_impl_function %impl.elem0.loc22_5.1, @Destroy.WithSelf.Op(constants.%Destroy.facet) [symbolic = %specific_impl_fn.loc22_5.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %specific_impl_fn.loc22_5.1: = specific_impl_function %impl.elem0.loc22_5.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.bb2) [symbolic = %specific_impl_fn.loc22_5.2 (constants.%specific_impl_fn)] // 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.2 (%.2f5) = 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: %specific_impl_fn.loc21: = specific_impl_function %impl.elem0.loc21, @Destroy.WithSelf.Op(constants.%Destroy.facet) [symbolic = %specific_impl_fn.loc22_5.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %specific_impl_fn.loc21: = specific_impl_function %impl.elem0.loc21, @Destroy.WithSelf.Op(constants.%Destroy.facet.bb2) [symbolic = %specific_impl_fn.loc22_5.2 (constants.%specific_impl_fn)] // 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: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { // CHECK:STDOUT: %T.loc15_14.1 => constants.%T // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/import.carbon b/toolchain/check/testdata/class/import.carbon index c08dde66acd1..31ab658b1be1 100644 --- a/toolchain/check/testdata/class/import.carbon +++ b/toolchain/check/testdata/class/import.carbon @@ -167,6 +167,7 @@ fn Run() { // CHECK:STDOUT: %Field: type = class_type @Field [concrete] // 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: %struct_type.x.767: type = struct_type {.x: %i32} [concrete] // CHECK:STDOUT: %complete_type.c07: = complete_type_witness %struct_type.x.767 [concrete] // CHECK:STDOUT: %pattern_type.729: type = pattern_type %Field [concrete] @@ -231,12 +232,12 @@ fn Run() { // CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc16 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc12 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc9 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc12_3.2 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.5: type = fn_type @Destroy.Op.loc7 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.5: %Destroy.Op.type.bae255.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.8: type = fn_type @Destroy.Op.loc9_3.4 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.8: %Destroy.Op.type.bae255.8 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.9: type = fn_type @Destroy.Op.loc7 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.9: %Destroy.Op.type.bae255.9 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -430,11 +431,11 @@ fn Run() { // CHECK:STDOUT: %Destroy.Op.call.loc18: init %empty_tuple.type = call %Destroy.Op.bound.loc18(%e.var) // CHECK:STDOUT: %Destroy.Op.bound.loc16: = bound_method %d.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc16: init %empty_tuple.type = call %Destroy.Op.bound.loc16(%d.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc12: = bound_method %c.var, constants.%Destroy.Op.651ba6.3 +// CHECK:STDOUT: %Destroy.Op.bound.loc12: = bound_method %c.var, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call.loc12: init %empty_tuple.type = call %Destroy.Op.bound.loc12(%c.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc9: = bound_method %b.var, constants.%Destroy.Op.651ba6.4 +// CHECK:STDOUT: %Destroy.Op.bound.loc9: = bound_method %b.var, constants.%Destroy.Op.651ba6.8 // CHECK:STDOUT: %Destroy.Op.call.loc9: init %empty_tuple.type = call %Destroy.Op.bound.loc9(%b.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc7: = bound_method %a.var, constants.%Destroy.Op.651ba6.5 +// CHECK:STDOUT: %Destroy.Op.bound.loc7: = bound_method %a.var, constants.%Destroy.Op.651ba6.9 // CHECK:STDOUT: %Destroy.Op.call.loc7: init %empty_tuple.type = call %Destroy.Op.bound.loc7(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -447,9 +448,32 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.Op.loc16(%self.param: ref %ptr.006) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc12(%self.param: ref %ForwardDeclared.20f323.1) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc12_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc9(%self.param: ref %Field) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc12_3.2(%self.param: ref %ForwardDeclared.20f323.1) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc7(%self.param: ref %Empty) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.3(%self.param: ref %struct_type.x.767) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.4(%self.param: ref %Field) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc7(%self.param: ref %Empty) { +// CHECK:STDOUT: !entry: +// 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 45a22a850919..db1ae989fd09 100644 --- a/toolchain/check/testdata/class/inheritance/derived_to_base.carbon +++ b/toolchain/check/testdata/class/inheritance/derived_to_base.carbon @@ -121,9 +121,14 @@ fn PassConstB(p: const B) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [concrete] // 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: %i32.builtin: type = int_type signed, %int_32 [concrete] +// CHECK:STDOUT: %struct_type.a.ba9: type = struct_type {.a: %i32} [concrete] // CHECK:STDOUT: %B: type = class_type @B [concrete] +// CHECK:STDOUT: %struct_type.base.b.933: type = struct_type {.base: %A, .b: %i32} [concrete] // CHECK:STDOUT: %C: type = class_type @C [concrete] +// CHECK:STDOUT: %struct_type.base.c.766: type = struct_type {.base: %B, .c: %i32} [concrete] // CHECK:STDOUT: %ptr.31e: type = ptr_type %C [concrete] // CHECK:STDOUT: %pattern_type.506: type = pattern_type %ptr.31e [concrete] // CHECK:STDOUT: %ptr.27c: type = ptr_type %B [concrete] @@ -203,6 +208,9 @@ fn PassConstB(p: const B) { // CHECK:STDOUT: %.6f9: ref %C = temporary invalid, %C.val [concrete] // CHECK:STDOUT: %.797: ref %B = class_element_access %.6f9, element0 [concrete] // CHECK:STDOUT: %.e51: ref %A = class_element_access %.797, element0 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.8: type = fn_type @Destroy.Op.loc32_66.8 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.8: %Destroy.Op.type.bae255.8 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.6f9, %Destroy.Op.651ba6.8 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -428,10 +436,46 @@ fn PassConstB(p: const B) { // CHECK:STDOUT: %.loc32_66.5: ref %A = converted %.loc32_66.1, %.loc32_66.4 [concrete = constants.%.e51] // CHECK:STDOUT: %.loc32_66.6: %A = acquire_value %.loc32_66.5 // CHECK:STDOUT: %a: %A = value_binding a, %.loc32_66.6 +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.6f9) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc32_66.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc32_66.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc32_66.3(%self.param: ref %struct_type.a.ba9) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc32_66.4(%self.param: ref %A) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc32_66.5(%self.param: ref %struct_type.base.b.933) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc32_66.6(%self.param: ref %B) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc32_66.7(%self.param: ref %struct_type.base.c.766) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc32_66.8(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- qualified.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/inheritance/import_base.carbon b/toolchain/check/testdata/class/inheritance/import_base.carbon index 1c2876f658d8..1142910d2fef 100644 --- a/toolchain/check/testdata/class/inheritance/import_base.carbon +++ b/toolchain/check/testdata/class/inheritance/import_base.carbon @@ -141,6 +141,7 @@ fn Run() { // CHECK:STDOUT: %Base: type = class_type @Base [concrete] // 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: %struct_type.x.unused_y.9fc: type = struct_type {.x: %i32, .unused_y: %i32} [concrete] // CHECK:STDOUT: %complete_type.2da: = complete_type_witness %struct_type.x.unused_y.9fc [concrete] // CHECK:STDOUT: %struct_type.base.27a: type = struct_type {.base: %Base} [concrete] @@ -183,8 +184,8 @@ fn Run() { // CHECK:STDOUT: %Base.F.type: type = fn_type @Base.F [concrete] // CHECK:STDOUT: %Base.F: %Base.F.type = struct_value () [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.6: type = fn_type @Destroy.Op.loc7_3.6 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.6: %Destroy.Op.type.bae255.6 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -303,12 +304,37 @@ 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.Op.bound: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.651ba6.6 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Base.F [from "a.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Child) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc7_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc7_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc7_3.3(%self.param: ref %struct_type.x.unused_y.9fc) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc7_3.4(%self.param: ref %Base) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc7_3.5(%self.param: ref %struct_type.base.27a) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc7_3.6(%self.param: ref %Child) { +// CHECK:STDOUT: !entry: +// 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 4825df2763f7..a410fb9fe6c4 100644 --- a/toolchain/check/testdata/class/init_as.carbon +++ b/toolchain/check/testdata/class/init_as.carbon @@ -36,7 +36,9 @@ fn G() -> 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: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %i32 [concrete] +// CHECK:STDOUT: %struct_type.a.b.501: type = struct_type {.a: %i32, .b: %i32} [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %struct_type.a.b.cfd: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [concrete] @@ -72,8 +74,9 @@ fn G() -> i32 { // CHECK:STDOUT: %.8e2: type = fn_type_with_self_type %Copy.WithSelf.Op.type.081, %Copy.facet [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.664, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %pattern_type.904: type = pattern_type %Class [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc20_28.4 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.950, %Destroy.Op.651ba6.4 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -117,10 +120,26 @@ 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.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.950) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Class) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc20_28.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc20_28.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc20_28.3(%self.param: ref %struct_type.a.b.501) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc20_28.4(%self.param: ref %Class) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G() -> out %return.param: %i32 { // CHECK:STDOUT: !entry: @@ -156,7 +175,7 @@ fn G() -> i32 { // CHECK:STDOUT: %Class.ref.loc26_10: type = name_ref Class, file.%Class.decl [concrete = constants.%Class] // CHECK:STDOUT: %v: ref %Class = ref_binding v, %v.var // CHECK:STDOUT: -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %v.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %v.var, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%v.var) // CHECK:STDOUT: // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/local.carbon b/toolchain/check/testdata/class/local.carbon index 078d5387c16c..5329e24503f1 100644 --- a/toolchain/check/testdata/class/local.carbon +++ b/toolchain/check/testdata/class/local.carbon @@ -43,6 +43,7 @@ class A { // CHECK:STDOUT: %A.F: %A.F.type = struct_value () [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %B: type = class_type @B [concrete] // CHECK:STDOUT: %.18e: Core.Form = init_form %B [concrete] // CHECK:STDOUT: %pattern_type.971: type = pattern_type %B [concrete] @@ -82,8 +83,8 @@ class A { // CHECK:STDOUT: %.8e2: type = fn_type_with_self_type %Copy.WithSelf.Op.type.081, %Copy.facet [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.664, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc26_19.4 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -169,7 +170,7 @@ 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.Op.bound: = bound_method %.loc26_19.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc26_19.2, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc26_19.2) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } @@ -198,5 +199,20 @@ class A { // CHECK:STDOUT: return %b to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %B) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc26_19.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc26_19.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc26_19.3(%self.param: ref %struct_type.n.033) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc26_19.4(%self.param: ref %B) { +// CHECK:STDOUT: !entry: +// 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 5093003fbc15..fef27cb96ddd 100644 --- a/toolchain/check/testdata/class/method/method.carbon +++ b/toolchain/check/testdata/class/method/method.carbon @@ -79,6 +79,7 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %Class.F: %Class.F.type = struct_value () [concrete] // CHECK:STDOUT: %Class.G.type: type = fn_type @Class.G [concrete] // CHECK:STDOUT: %Class.G: %Class.G.type = struct_value () [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %i32 [concrete] // CHECK:STDOUT: %struct_type.k.0bf: type = struct_type {.k: %i32} [concrete] // CHECK:STDOUT: %complete_type.954: = complete_type_witness %struct_type.k.0bf [concrete] @@ -122,8 +123,9 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %.ae5: ref %Class = temporary invalid, %Class.val [concrete] // CHECK:STDOUT: %Class.F.bound: = bound_method %.ae5, %Class.F [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc39_20.4 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.ae5, %Destroy.Op.651ba6.4 [concrete] // CHECK:STDOUT: %CallWithRef.type: type = fn_type @CallWithRef [concrete] // CHECK:STDOUT: %CallWithRef: %CallWithRef.type = struct_value () [concrete] // CHECK:STDOUT: %DefaultOrUnformed.type: type = facet_type <@DefaultOrUnformed> [concrete] @@ -410,10 +412,26 @@ 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.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.ae5) // CHECK:STDOUT: return %Class.F.call // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Class) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc39_20.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc39_20.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc39_20.3(%self.param: ref %struct_type.k.0bf) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc39_20.4(%self.param: ref %Class) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @CallWithRef() -> out %return.param: %i32 { // CHECK:STDOUT: !entry: @@ -436,7 +454,7 @@ 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.Op.bound: = bound_method %c.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %c.var, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%c.var) // CHECK:STDOUT: return %Class.G.call // CHECK:STDOUT: } @@ -474,7 +492,7 @@ 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.Op.bound: = bound_method %.loc58_15.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc58_15.2, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc58_15.2) // CHECK:STDOUT: return %Class.F.call // CHECK:STDOUT: } @@ -488,7 +506,7 @@ 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.Op.bound: = bound_method %.loc62_15.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc62_15.2, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc62_15.2) // CHECK:STDOUT: return %Class.G.call // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/method/static_method.carbon b/toolchain/check/testdata/class/method/static_method.carbon index b6e02fbe54c9..6d82ecb258cb 100644 --- a/toolchain/check/testdata/class/method/static_method.carbon +++ b/toolchain/check/testdata/class/method/static_method.carbon @@ -49,8 +49,8 @@ fn Run() -> i32 { // CHECK:STDOUT: %DefaultOrUnformed.facet: %DefaultOrUnformed.type = facet_value %Class, (%DefaultOrUnformed.impl_witness.6ca) [concrete] // CHECK:STDOUT: %T.as.DefaultOrUnformed.impl.Op.specific_fn: = specific_function %T.as.DefaultOrUnformed.impl.Op.cda, @T.as.DefaultOrUnformed.impl.Op(%Class) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc20_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -127,10 +127,15 @@ 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.Op.bound: = bound_method %c.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %c.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%c.var) // CHECK:STDOUT: return %Class.F.call // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Class) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc20_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc20_3.2(%self.param: ref %Class) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/nested.carbon b/toolchain/check/testdata/class/nested.carbon index e16101bd27e2..e52844118317 100644 --- a/toolchain/check/testdata/class/nested.carbon +++ b/toolchain/check/testdata/class/nested.carbon @@ -92,14 +92,14 @@ fn F(a: Outer*) { // CHECK:STDOUT: %DefaultOrUnformed.facet.6ba: %DefaultOrUnformed.type = facet_value %Inner, (%DefaultOrUnformed.impl_witness.994) [concrete] // CHECK:STDOUT: %T.as.DefaultOrUnformed.impl.Op.specific_fn.14b: = specific_function %T.as.DefaultOrUnformed.impl.Op.da3, @T.as.DefaultOrUnformed.impl.Op(%Inner) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc19 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc18 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.565: type = pattern_type %ptr.78a [concrete] // CHECK:STDOUT: %pattern_type.cd9: type = pattern_type %ptr.56b [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc19_5.4 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.6: type = fn_type @Destroy.Op.loc18_5.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.6: %Destroy.Op.type.bae255.6 = struct_value () [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] -// CHECK:STDOUT: %pattern_type.565: type = pattern_type %ptr.78a [concrete] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.2d4: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.67d) [symbolic] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.74e: %ptr.as.Copy.impl.Op.type.2d4 = struct_value () [symbolic] @@ -240,9 +240,9 @@ fn F(a: Outer*) { // CHECK:STDOUT: assign %i.var, %T.as.DefaultOrUnformed.impl.Op.call.loc19 // CHECK:STDOUT: %Inner.ref: type = name_ref Inner, @Outer.%Inner.decl [concrete = constants.%Inner] // CHECK:STDOUT: %i: ref %Inner = ref_binding i, %i.var -// CHECK:STDOUT: %Destroy.Op.bound.loc19: = bound_method %i.var, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.bound.loc19: = bound_method %i.var, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call.loc19: init %empty_tuple.type = call %Destroy.Op.bound.loc19(%i.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc18: = bound_method %o.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc18: = bound_method %o.var, constants.%Destroy.Op.651ba6.6 // CHECK:STDOUT: %Destroy.Op.call.loc18: init %empty_tuple.type = call %Destroy.Op.bound.loc18(%o.var) // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -279,9 +279,9 @@ fn F(a: Outer*) { // CHECK:STDOUT: assign %i.var, %T.as.DefaultOrUnformed.impl.Op.call.loc30 // CHECK:STDOUT: %Inner.ref: type = name_ref Inner, @Outer.%Inner.decl [concrete = constants.%Inner] // CHECK:STDOUT: %i: ref %Inner = ref_binding i, %i.var -// CHECK:STDOUT: %Destroy.Op.bound.loc30: = bound_method %i.var, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.bound.loc30: = bound_method %i.var, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call.loc30: init %empty_tuple.type = call %Destroy.Op.bound.loc30(%i.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc29: = bound_method %o.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc29: = bound_method %o.var, constants.%Destroy.Op.651ba6.6 // CHECK:STDOUT: %Destroy.Op.call.loc29: init %empty_tuple.type = call %Destroy.Op.bound.loc29(%o.var) // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -318,16 +318,36 @@ fn F(a: Outer*) { // CHECK:STDOUT: assign %i.var, %T.as.DefaultOrUnformed.impl.Op.call.loc37 // CHECK:STDOUT: %Inner.ref: type = name_ref Inner, @Outer.%Inner.decl [concrete = constants.%Inner] // CHECK:STDOUT: %i: ref %Inner = ref_binding i, %i.var -// CHECK:STDOUT: %Destroy.Op.bound.loc37: = bound_method %i.var, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.bound.loc37: = bound_method %i.var, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call.loc37: init %empty_tuple.type = call %Destroy.Op.bound.loc37(%i.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc36: = bound_method %o.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc36: = bound_method %o.var, constants.%Destroy.Op.651ba6.6 // CHECK:STDOUT: %Destroy.Op.call.loc36: init %empty_tuple.type = call %Destroy.Op.bound.loc36(%o.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc19(%self.param: ref %Inner) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc19_5.1(%self.param: ref %ptr.78a) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc18(%self.param: ref %Outer) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc19_5.2(%self.param: ref %ptr.56b) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.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.Op.loc19_5.4(%self.param: ref %Inner) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.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.Op.loc18_5.2(%self.param: ref %Outer) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%a.param: %ptr.56b) { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/class/nested_name.carbon b/toolchain/check/testdata/class/nested_name.carbon index a3dcb76a7399..7a9de85eafab 100644 --- a/toolchain/check/testdata/class/nested_name.carbon +++ b/toolchain/check/testdata/class/nested_name.carbon @@ -37,6 +37,7 @@ fn G(o: Outer) { // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // 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: %Inner.elem: type = unbound_element_type %Inner, %i32 [concrete] // CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %i32} [concrete] // CHECK:STDOUT: %complete_type.54b: = complete_type_witness %struct_type.n [concrete] @@ -70,8 +71,8 @@ fn G(o: Outer) { // CHECK:STDOUT: %DefaultOrUnformed.facet: %DefaultOrUnformed.type = facet_value %Inner, (%DefaultOrUnformed.impl_witness.994) [concrete] // CHECK:STDOUT: %T.as.DefaultOrUnformed.impl.Op.specific_fn: = specific_function %T.as.DefaultOrUnformed.impl.Op.da3, @T.as.DefaultOrUnformed.impl.Op(%Inner) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc26_3.4 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -184,10 +185,25 @@ fn G(o: Outer) { // CHECK:STDOUT: %Inner.ref: type = name_ref Inner, @Outer.%Inner.decl [concrete = constants.%Inner] // CHECK:STDOUT: } // CHECK:STDOUT: %i: ref %Inner = ref_binding i, %i.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %i.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %i.var, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%i.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Inner) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc26_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc26_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc26_3.3(%self.param: ref %struct_type.n) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc26_3.4(%self.param: ref %Inner) { +// CHECK:STDOUT: !entry: +// 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 a268fa9f3b71..02778ee5d724 100644 --- a/toolchain/check/testdata/class/reorder_qualified.carbon +++ b/toolchain/check/testdata/class/reorder_qualified.carbon @@ -63,6 +63,7 @@ class A { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %B.elem: type = unbound_element_type %B, %i32 [concrete] // CHECK:STDOUT: %struct_type.b.0a3: type = struct_type {.b: %i32} [concrete] // CHECK:STDOUT: %complete_type.ba8: = complete_type_witness %struct_type.b.0a3 [concrete] @@ -130,14 +131,14 @@ class A { // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete] // CHECK:STDOUT: %D.val: %D = struct_value (%int_4.940) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc36 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc35 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc34 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc33 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc36_7.4 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.6: type = fn_type @Destroy.Op.loc35_7.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.6: %Destroy.Op.type.bae255.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.8: type = fn_type @Destroy.Op.loc34_7.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.8: %Destroy.Op.type.bae255.8 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.10: type = fn_type @Destroy.Op.loc33_7.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.10: %Destroy.Op.type.bae255.10 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -336,13 +337,13 @@ 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.Op.bound.loc36: = bound_method %d.var, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.bound.loc36: = bound_method %d.var, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call.loc36: init %empty_tuple.type = call %Destroy.Op.bound.loc36(%d.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc35: = bound_method %c.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc35: = bound_method %c.var, constants.%Destroy.Op.651ba6.6 // CHECK:STDOUT: %Destroy.Op.call.loc35: init %empty_tuple.type = call %Destroy.Op.bound.loc35(%c.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc34: = bound_method %b.var, constants.%Destroy.Op.651ba6.3 +// CHECK:STDOUT: %Destroy.Op.bound.loc34: = bound_method %b.var, constants.%Destroy.Op.651ba6.8 // CHECK:STDOUT: %Destroy.Op.call.loc34: init %empty_tuple.type = call %Destroy.Op.bound.loc34(%b.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc33: = bound_method %a.var, constants.%Destroy.Op.651ba6.4 +// CHECK:STDOUT: %Destroy.Op.bound.loc33: = bound_method %a.var, constants.%Destroy.Op.651ba6.10 // CHECK:STDOUT: %Destroy.Op.call.loc33: init %empty_tuple.type = call %Destroy.Op.bound.loc33(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -351,11 +352,50 @@ class A { // CHECK:STDOUT: // CHECK:STDOUT: fn @A.AF(); // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc36(%self.param: ref %D) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc36_7.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc35(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc36_7.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc34(%self.param: ref %B) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc36_7.3(%self.param: ref %struct_type.d.b7b) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc33(%self.param: ref %A) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc36_7.4(%self.param: ref %D) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc35_7.1(%self.param: ref %struct_type.c.b66) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc35_7.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc34_7.1(%self.param: ref %struct_type.b.0a3) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc34_7.2(%self.param: ref %B) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc33_7.1(%self.param: ref %struct_type.a.ba9) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc33_7.2(%self.param: ref %A) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/scope.carbon b/toolchain/check/testdata/class/scope.carbon index 7fe3ce4d1fbc..2ef2477047dc 100644 --- a/toolchain/check/testdata/class/scope.carbon +++ b/toolchain/check/testdata/class/scope.carbon @@ -48,6 +48,7 @@ fn Run() { // CHECK:STDOUT: %Class.G: %Class.G.type = struct_value () [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] @@ -74,8 +75,8 @@ fn Run() { // CHECK:STDOUT: %Run.type: type = fn_type @Run [concrete] // CHECK:STDOUT: %Run: %Run.type = struct_value () [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc31_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -196,12 +197,17 @@ fn Run() { // CHECK:STDOUT: assign %b.var, %Class.F.call // CHECK:STDOUT: %i32.loc31: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %b: ref %i32 = ref_binding b, %b.var -// CHECK:STDOUT: %Destroy.Op.bound.loc31: = bound_method %b.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc31: = bound_method %b.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc31: init %empty_tuple.type = call %Destroy.Op.bound.loc31(%b.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc30: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc30: = bound_method %a.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc30: init %empty_tuple.type = call %Destroy.Op.bound.loc30(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc31_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc31_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// 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 fc5acdda3624..4dca3d311d8a 100644 --- a/toolchain/check/testdata/class/self/fail_ref_self.carbon +++ b/toolchain/check/testdata/class/self/fail_ref_self.carbon @@ -53,8 +53,8 @@ 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: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc35_8.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -141,10 +141,15 @@ 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.Op.bound: = bound_method %.loc35_8.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc35_8.2, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc35_8.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Class) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc35_8.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc35_8.2(%self.param: ref %Class) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/virtual_modifiers.carbon b/toolchain/check/testdata/class/virtual_modifiers.carbon index e03afedcc22c..2dbcc80ed418 100644 --- a/toolchain/check/testdata/class/virtual_modifiers.carbon +++ b/toolchain/check/testdata/class/virtual_modifiers.carbon @@ -648,8 +648,8 @@ class T2(G2:! type) { // 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: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.5: type = fn_type @Destroy.Op.loc12_3.5 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.5: %Destroy.Op.type.bae255.5 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -755,12 +755,32 @@ class T2(G2:! type) { // CHECK:STDOUT: assign %d.var, %.loc12_3 // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [concrete = constants.%Derived] // CHECK:STDOUT: %d: ref %Derived = ref_binding d, %d.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %d.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %d.var, constants.%Destroy.Op.651ba6.5 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%d.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Derived) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc12_3.1(%self.param: ref %ptr.454) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc12_3.2(%self.param: ref %struct_type.vptr) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc12_3.3(%self.param: ref %Base) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc12_3.4(%self.param: ref %struct_type.base.96c) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc12_3.5(%self.param: ref %Derived) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- todo_fail_later_base.carbon // CHECK:STDOUT: @@ -875,8 +895,8 @@ class T2(G2:! type) { // 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: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc7_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -940,14 +960,24 @@ class T2(G2:! type) { // CHECK:STDOUT: %Base.ref: type = name_ref Base, imports.%Modifiers.Base [concrete = constants.%Base] // CHECK:STDOUT: } // CHECK:STDOUT: %v: ref %Base = ref_binding v, %v.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %v.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %v.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%v.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: virtual fn @Base.H [from "modifiers.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Base) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc7_3.1(%self.param: ref %ptr.454) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc7_3.2(%self.param: ref %struct_type.vptr) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc7_3.3(%self.param: ref %Base) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- impl_abstract.carbon // CHECK:STDOUT: @@ -1092,12 +1122,12 @@ class T2(G2:! type) { // CHECK:STDOUT: %C.val: %C = struct_value (%B2.val) [concrete] // CHECK:STDOUT: %C.vtable_ptr: ref %ptr.454 = vtable_ptr @C.vtable [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc21 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc20 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc19 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc21_3.3 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.5: type = fn_type @Destroy.Op.loc21_3.5 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.5: %Destroy.Op.type.bae255.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.7: type = fn_type @Destroy.Op.loc21_3.7 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.7: %Destroy.Op.type.bae255.7 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1279,20 +1309,46 @@ class T2(G2:! type) { // CHECK:STDOUT: assign %c.var, %.loc21_3 // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %c: ref %C = ref_binding c, %c.var -// CHECK:STDOUT: %Destroy.Op.bound.loc21: = bound_method %c.var, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.bound.loc21: = bound_method %c.var, constants.%Destroy.Op.651ba6.7 // CHECK:STDOUT: %Destroy.Op.call.loc21: init %empty_tuple.type = call %Destroy.Op.bound.loc21(%c.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc20: = bound_method %b2.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc20: = bound_method %b2.var, constants.%Destroy.Op.651ba6.5 // CHECK:STDOUT: %Destroy.Op.call.loc20: init %empty_tuple.type = call %Destroy.Op.bound.loc20(%b2.var) // CHECK:STDOUT: %Destroy.Op.bound.loc19: = bound_method %b1.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call.loc19: init %empty_tuple.type = call %Destroy.Op.bound.loc19(%b1.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc21(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc21_3.1(%self.param: ref %ptr.454) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc20(%self.param: ref %B2) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc21_3.2(%self.param: ref %struct_type.vptr) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc19(%self.param: ref %B1) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc21_3.3(%self.param: ref %B1) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc21_3.4(%self.param: ref %struct_type.base.056) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc21_3.5(%self.param: ref %B2) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc21_3.6(%self.param: ref %struct_type.base.812) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc21_3.7(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_modifiers.carbon // CHECK:STDOUT: @@ -1350,6 +1406,7 @@ class T2(G2:! type) { // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // 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: %Base.elem: type = unbound_element_type %Base, %i32 [concrete] // CHECK:STDOUT: %pattern_type.101: type = pattern_type %Base [concrete] // CHECK:STDOUT: %Base.F.type: type = fn_type @Base.F [concrete] @@ -1402,10 +1459,10 @@ class T2(G2:! type) { // CHECK:STDOUT: %bound_method.6d7: = bound_method %int_4.0c1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc14 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc12 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc14_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.5: type = fn_type @Destroy.Op.loc14_3.5 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.5: %Destroy.Op.type.bae255.5 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1561,18 +1618,33 @@ class T2(G2:! type) { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc16: init %i32 = call %bound_method.loc16_9.2(%int_4) [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc16_9: init %i32 = converted %int_4, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc16 [concrete = constants.%int_4.940] // CHECK:STDOUT: assign %.loc16_5, %.loc16_9 -// CHECK:STDOUT: %Destroy.Op.bound.loc14: = bound_method %b2.var, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.bound.loc14: = bound_method %b2.var, constants.%Destroy.Op.651ba6.5 // CHECK:STDOUT: %Destroy.Op.call.loc14: init %empty_tuple.type = call %Destroy.Op.bound.loc14(%b2.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc13: = bound_method %b1.var, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.bound.loc13: = bound_method %b1.var, constants.%Destroy.Op.651ba6.5 // CHECK:STDOUT: %Destroy.Op.call.loc13: init %empty_tuple.type = call %Destroy.Op.bound.loc13(%b1.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc12: = bound_method %i.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc12: = bound_method %i.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call.loc12: init %empty_tuple.type = call %Destroy.Op.bound.loc12(%i.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc14(%self.param: ref %Base) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc14_3.1(%self.param: ref %ptr.454) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc12(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc14_3.2(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc14_3.3(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc14_3.4(%self.param: ref %struct_type.vptr.m1.m2) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc14_3.5(%self.param: ref %Base) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_impl_without_base_declaration.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/deduce/array.carbon b/toolchain/check/testdata/deduce/array.carbon index 9393b9583e07..c5645581c6a2 100644 --- a/toolchain/check/testdata/deduce/array.carbon +++ b/toolchain/check/testdata/deduce/array.carbon @@ -181,8 +181,8 @@ fn G() { // CHECK:STDOUT: %array: %array_type.931 = tuple_value (%C.val, %C.val, %C.val) [concrete] // CHECK:STDOUT: %F.specific_fn.540: = specific_function %F, @F(%C) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: %complete_type.c7a: = complete_type_witness %array_type.931 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -307,12 +307,22 @@ fn G() { // CHECK:STDOUT: %.loc8_11.1: ref %C = splice_block %return.param {} // CHECK:STDOUT: %.loc10: %array_type.931 = acquire_value %a.ref // CHECK:STDOUT: %F.call: init %C to %.loc8_11.1 = call %F.specific_fn(%.loc10) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%a.var) // CHECK:STDOUT: return %F.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %array_type.931) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.3(%self.param: ref %array_type.931) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { // CHECK:STDOUT: %T.loc6_7.1 => constants.%T @@ -393,8 +403,8 @@ fn G() { // CHECK:STDOUT: %array: %array_type.931 = tuple_value (%C.val, %C.val, %C.val) [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: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: %complete_type.c7a: = complete_type_witness %array_type.931 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061: = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete] // CHECK:STDOUT: %bound_method.fa7: = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] @@ -535,12 +545,22 @@ 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.931 = acquire_value %a.ref // CHECK:STDOUT: %F.call: init %i32 = call %F.specific_fn(%.loc10) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%a.var) // CHECK:STDOUT: return %F.call // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %array_type.931) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.3(%self.param: ref %array_type.931) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%N) { // CHECK:STDOUT: %N.loc6_7.1 => constants.%N @@ -595,8 +615,8 @@ fn G() { // CHECK:STDOUT: %array: %array_type.931 = tuple_value (%C.val, %C.val, %C.val) [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: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: %complete_type.c7a: = complete_type_witness %array_type.931 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -711,12 +731,22 @@ 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.931 = acquire_value %a.ref // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn(%.loc10) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %array_type.931) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.3(%self.param: ref %array_type.931) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T, constants.%N) { // CHECK:STDOUT: %T.loc6_7.1 => constants.%T @@ -775,8 +805,8 @@ fn G() { // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc10_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: %complete_type.b8b: = complete_type_witness %array_type.158 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -903,12 +933,22 @@ fn G() { // CHECK:STDOUT: %.loc8_11.1: ref %C = splice_block %return.param {} // CHECK:STDOUT: %.loc21: %array_type.158 = converted %a.ref, [concrete = ] // CHECK:STDOUT: %F.call: init %C to %.loc8_11.1 = call %F.specific_fn() -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%a.var) // CHECK:STDOUT: return %F.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %array_type.931) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc10_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_3.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_3.3(%self.param: ref %array_type.931) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { // CHECK:STDOUT: %T.loc6_7.1 => constants.%T @@ -992,8 +1032,8 @@ fn G() { // CHECK:STDOUT: %pattern_type.f21: type = pattern_type %array_type.931 [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: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc11_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: %complete_type.c7a: = complete_type_witness %array_type.931 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061: = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete] // CHECK:STDOUT: %bound_method.fa7: = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] @@ -1144,12 +1184,22 @@ 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.931 = converted %a.ref, [concrete = ] // CHECK:STDOUT: %F.call: init %i32 = call %F.specific_fn() -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%a.var) // CHECK:STDOUT: return %F.call // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %array_type.b6d) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc11_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc11_3.2(%self.param: ref %D) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc11_3.3(%self.param: ref %array_type.b6d) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%N) { // CHECK:STDOUT: %N.loc7_7.1 => constants.%N @@ -1233,8 +1283,8 @@ fn G() { // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %array: %array_type.931 = tuple_value (%C.val, %C.val, %C.val) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1374,12 +1424,22 @@ fn G() { // CHECK:STDOUT: %a: ref %array_type.931 = ref_binding a, %a.var // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] // CHECK:STDOUT: %a.ref: ref %array_type.931 = name_ref a, %a -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %array_type.931) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.3(%self.param: ref %array_type.931) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%N.5de) { // CHECK:STDOUT: %N.loc6_7.1 => constants.%N.5de diff --git a/toolchain/check/testdata/deduce/generic_type.carbon b/toolchain/check/testdata/deduce/generic_type.carbon index 01a8379ccdae..b52c2209ea1d 100644 --- a/toolchain/check/testdata/deduce/generic_type.carbon +++ b/toolchain/check/testdata/deduce/generic_type.carbon @@ -751,6 +751,7 @@ fn G() -> i32 { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %N.fe9: Core.IntLiteral = symbolic_binding N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] @@ -804,6 +805,9 @@ fn G() -> i32 { // CHECK:STDOUT: %F.specific_fn: = specific_function %F, @F(%int_0.6a9) [concrete] // CHECK:STDOUT: %.0bf: ref %WithNontype.6bb = temporary invalid, %WithNontype.val [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc9_15.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.0bf, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.bound.06d: = bound_method %int_0.6a9, %Int.as.Copy.impl.Op.664 [concrete] // CHECK:STDOUT: %bound_method.5f6: = bound_method %int_0.6a9, %Int.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: } @@ -936,10 +940,16 @@ fn G() -> i32 { // CHECK:STDOUT: %.loc9_15.2: ref %WithNontype.6bb = temporary %.loc9_13.2, %.loc9_15.1 [concrete = constants.%.0bf] // CHECK:STDOUT: %.loc9_15.3: %WithNontype.6bb = 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.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.0bf) // CHECK:STDOUT: return %F.call // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %WithNontype.6bb) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc9_15.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_15.2(%self.param: ref %WithNontype.6bb) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @WithNontype(constants.%N.5de) { // CHECK:STDOUT: %N.loc4_20.1 => constants.%N.5de 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 1b483b850ce7..5f507d3176f9 100644 --- a/toolchain/check/testdata/deduce/value_with_type_through_access.carbon +++ b/toolchain/check/testdata/deduce/value_with_type_through_access.carbon @@ -135,6 +135,12 @@ fn G() { // CHECK:STDOUT: %C.val: %C = struct_value () [concrete] // CHECK:STDOUT: %.5ea: ref %C = temporary invalid, %C.val [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc13_30.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound.ce7: = bound_method %.5ea, %Destroy.Op.651ba6.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc13_8 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound.b2c: = bound_method %.31a, %Destroy.Op.651ba6.3 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -261,12 +267,22 @@ fn G() { // CHECK:STDOUT: %.loc13_30.5: ref %C = temporary %.loc13_30.2, %.loc13_30.4 [concrete = constants.%.5ea] // 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.Op.call.loc13_30: init %empty_tuple.type = call constants.%Destroy.Op.bound.ce7(constants.%.5ea) +// CHECK:STDOUT: %Destroy.Op.call.loc13_8: init %empty_tuple.type = call constants.%Destroy.Op.bound.b2c(constants.%.31a) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc13_30(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc13_30.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc13_8(%self.param: ref %HoldsType.a31) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc13_30.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc13_8(%self.param: ref %HoldsType.a31) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HoldsType(constants.%T) { // CHECK:STDOUT: %T.loc4_18.1 => constants.%T @@ -335,6 +351,12 @@ fn G() { // CHECK:STDOUT: %C.val: %C = struct_value () [concrete] // CHECK:STDOUT: %.5ea: ref %C = temporary invalid, %C.val [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc13_33.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound.ce7: = bound_method %.5ea, %Destroy.Op.651ba6.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc13_8 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound.7ab: = bound_method %.41d, %Destroy.Op.651ba6.3 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -458,12 +480,22 @@ fn G() { // CHECK:STDOUT: %.loc13_33.5: ref %C = temporary %.loc13_33.2, %.loc13_33.4 [concrete = constants.%.5ea] // 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.Op.call.loc13_33: init %empty_tuple.type = call constants.%Destroy.Op.bound.ce7(constants.%.5ea) +// CHECK:STDOUT: %Destroy.Op.call.loc13_8: init %empty_tuple.type = call constants.%Destroy.Op.bound.7ab(constants.%.41d) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc13_33(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc13_33.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc13_8(%self.param: ref %HoldsType.673) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc13_33.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc13_8(%self.param: ref %HoldsType.673) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HoldsType(constants.%T) { // CHECK:STDOUT: %T.loc4_18.1 => constants.%T @@ -542,6 +574,9 @@ fn G() { // CHECK:STDOUT: %.2e2: 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: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc30_13.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.2e2, %Destroy.Op.651ba6.3 [concrete] // CHECK:STDOUT: %HoldsType.317: type = class_type @HoldsType, @HoldsType(%Class.val) [concrete] // CHECK:STDOUT: %HoldsType.val.b6d: %HoldsType.317 = struct_value () [concrete] // CHECK:STDOUT: } @@ -709,10 +744,21 @@ 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.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.2e2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Class) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc30_13.1(%self.param: ref type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc30_13.2(%self.param: ref %struct_type.t) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc30_13.3(%self.param: ref %Class) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HoldsType(constants.%T.d7d) { // CHECK:STDOUT: %T.loc8_18.1 => constants.%T.d7d @@ -762,6 +808,7 @@ fn G() { // CHECK:STDOUT: %pattern_type.dcb: type = pattern_type %array_type [concrete] // CHECK:STDOUT: %T.9b7: %array_type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %HoldsType.type: type = generic_class_type @HoldsType [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %HoldsType.generic: %HoldsType.type = struct_value () [concrete] // CHECK:STDOUT: %HoldsType.ad8: type = class_type @HoldsType, @HoldsType(%T.9b7) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] @@ -810,6 +857,9 @@ fn G() { // CHECK:STDOUT: %HoldsType.d1a: type = class_type @HoldsType, @HoldsType(%array) [concrete] // CHECK:STDOUT: %HoldsType.val: %HoldsType.d1a = struct_value () [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc17_27.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.296, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -955,10 +1005,16 @@ fn G() { // CHECK:STDOUT: %.loc17_6.3: init %HoldsType.d1a to %.loc17_6.2 = class_init () [concrete = constants.%HoldsType.val] // CHECK:STDOUT: %.loc17_8: init %HoldsType.d1a = 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.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.296) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc17_27.1(%self.param: ref type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc17_27.2(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HoldsType(constants.%T.9b7) { // CHECK:STDOUT: %T.loc4_18.1 => constants.%T.9b7 diff --git a/toolchain/check/testdata/eval/aggregates.carbon b/toolchain/check/testdata/eval/aggregates.carbon index 0b8d69699763..0a12eea91ec2 100644 --- a/toolchain/check/testdata/eval/aggregates.carbon +++ b/toolchain/check/testdata/eval/aggregates.carbon @@ -39,7 +39,7 @@ var array_index: array(i32, 1) = (0,) as array(i32, ((5, 7, 1, 9) as array(i32, library "[[@TEST_NAME]]"; // Check that we propagate the `symbolic` tag through evaluations. -fn F(T:! type) { +fn F(T:! Core.Destroy) { //@dump-sem-ir-begin var unused u: (T*, const T); var unused v: {.a: T}; @@ -484,63 +484,64 @@ fn G(N:! i32) { // CHECK:STDOUT: --- symbolic.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %T.67d: type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] -// CHECK:STDOUT: %ptr.e8f: type = ptr_type %T.67d [symbolic] -// CHECK:STDOUT: %const: type = const_type %T.67d [symbolic] -// CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete] -// CHECK:STDOUT: %tuple: %tuple.type.24b = tuple_value (%ptr.e8f, %const) [symbolic] -// CHECK:STDOUT: %tuple.type.3c8: type = tuple_type (%ptr.e8f, %const) [symbolic] -// CHECK:STDOUT: %require_complete.666: = require_complete_type %tuple.type.3c8 [symbolic] -// CHECK:STDOUT: %pattern_type.4ac: type = pattern_type %tuple.type.3c8 [symbolic] -// CHECK:STDOUT: %DefaultOrUnformed.type: type = facet_type <@DefaultOrUnformed> [concrete] -// CHECK:STDOUT: %DefaultOrUnformed.lookup_impl_witness.2ad: = lookup_impl_witness %tuple.type.3c8, @DefaultOrUnformed [symbolic] -// CHECK:STDOUT: %.f7e: require_specific_def_type = require_specific_def @T.as.DefaultOrUnformed.impl(%tuple.type.3c8) [symbolic] -// CHECK:STDOUT: %DefaultOrUnformed.facet.9a0: %DefaultOrUnformed.type = facet_value %tuple.type.3c8, (%DefaultOrUnformed.lookup_impl_witness.2ad) [symbolic] -// CHECK:STDOUT: %DefaultOrUnformed.WithSelf.Op.type.0af: type = fn_type @DefaultOrUnformed.WithSelf.Op, @DefaultOrUnformed.WithSelf(%DefaultOrUnformed.facet.9a0) [symbolic] -// CHECK:STDOUT: %.246: type = fn_type_with_self_type %DefaultOrUnformed.WithSelf.Op.type.0af, %DefaultOrUnformed.facet.9a0 [symbolic] -// CHECK:STDOUT: %impl.elem0.c6f: %.246 = impl_witness_access %DefaultOrUnformed.lookup_impl_witness.2ad, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.58b: = specific_impl_function %impl.elem0.c6f, @DefaultOrUnformed.WithSelf.Op(%DefaultOrUnformed.facet.9a0) [symbolic] -// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %T.67d} [symbolic] -// CHECK:STDOUT: %require_complete.5d6: = require_complete_type %struct_type.a [symbolic] -// CHECK:STDOUT: %pattern_type.7b9: type = pattern_type %struct_type.a [symbolic] -// CHECK:STDOUT: %DefaultOrUnformed.lookup_impl_witness.169: = lookup_impl_witness %struct_type.a, @DefaultOrUnformed [symbolic] -// CHECK:STDOUT: %.d26: require_specific_def_type = require_specific_def @T.as.DefaultOrUnformed.impl(%struct_type.a) [symbolic] -// CHECK:STDOUT: %DefaultOrUnformed.facet.ca5: %DefaultOrUnformed.type = facet_value %struct_type.a, (%DefaultOrUnformed.lookup_impl_witness.169) [symbolic] -// CHECK:STDOUT: %DefaultOrUnformed.WithSelf.Op.type.0c5: type = fn_type @DefaultOrUnformed.WithSelf.Op, @DefaultOrUnformed.WithSelf(%DefaultOrUnformed.facet.ca5) [symbolic] -// CHECK:STDOUT: %.9ac: type = fn_type_with_self_type %DefaultOrUnformed.WithSelf.Op.type.0c5, %DefaultOrUnformed.facet.ca5 [symbolic] -// CHECK:STDOUT: %impl.elem0.e9c: %.9ac = impl_witness_access %DefaultOrUnformed.lookup_impl_witness.169, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.cf6: = specific_impl_function %impl.elem0.e9c, @DefaultOrUnformed.WithSelf.Op(%DefaultOrUnformed.facet.ca5) [symbolic] -// CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete] -// CHECK:STDOUT: %array_type.742: type = array_type %int_5, %T.67d [symbolic] -// CHECK:STDOUT: %require_complete.345: = require_complete_type %array_type.742 [symbolic] -// CHECK:STDOUT: %pattern_type.d52: type = pattern_type %array_type.742 [symbolic] -// CHECK:STDOUT: %DefaultOrUnformed.lookup_impl_witness.945: = lookup_impl_witness %array_type.742, @DefaultOrUnformed [symbolic] -// CHECK:STDOUT: %.617: require_specific_def_type = require_specific_def @T.as.DefaultOrUnformed.impl(%array_type.742) [symbolic] -// CHECK:STDOUT: %DefaultOrUnformed.facet.ad6: %DefaultOrUnformed.type = facet_value %array_type.742, (%DefaultOrUnformed.lookup_impl_witness.945) [symbolic] -// CHECK:STDOUT: %DefaultOrUnformed.WithSelf.Op.type.2f0: type = fn_type @DefaultOrUnformed.WithSelf.Op, @DefaultOrUnformed.WithSelf(%DefaultOrUnformed.facet.ad6) [symbolic] -// CHECK:STDOUT: %.544: type = fn_type_with_self_type %DefaultOrUnformed.WithSelf.Op.type.2f0, %DefaultOrUnformed.facet.ad6 [symbolic] -// CHECK:STDOUT: %impl.elem0.97e: %.544 = impl_witness_access %DefaultOrUnformed.lookup_impl_witness.945, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.261: = specific_impl_function %impl.elem0.97e, @DefaultOrUnformed.WithSelf.Op(%DefaultOrUnformed.facet.ad6) [symbolic] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.b29: = lookup_impl_witness %array_type.742, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.facet.ddc: %Destroy.type = facet_value %array_type.742, (%Destroy.lookup_impl_witness.b29) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.3c6: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.ddc) [symbolic] -// CHECK:STDOUT: %.950: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.3c6, %Destroy.facet.ddc [symbolic] -// CHECK:STDOUT: %impl.elem0.fa5: %.950 = impl_witness_access %Destroy.lookup_impl_witness.b29, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.ede: = specific_impl_function %impl.elem0.fa5, @Destroy.WithSelf.Op(%Destroy.facet.ddc) [symbolic] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.bed: = lookup_impl_witness %struct_type.a, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.facet.d21: %Destroy.type = facet_value %struct_type.a, (%Destroy.lookup_impl_witness.bed) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.873: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.d21) [symbolic] -// CHECK:STDOUT: %.511: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.873, %Destroy.facet.d21 [symbolic] -// CHECK:STDOUT: %impl.elem0.12c: %.511 = impl_witness_access %Destroy.lookup_impl_witness.bed, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.c3a: = specific_impl_function %impl.elem0.12c, @Destroy.WithSelf.Op(%Destroy.facet.d21) [symbolic] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.7eb: = lookup_impl_witness %tuple.type.3c8, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.facet.66d: %Destroy.type = facet_value %tuple.type.3c8, (%Destroy.lookup_impl_witness.7eb) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.f23: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.66d) [symbolic] -// CHECK:STDOUT: %.f20: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.f23, %Destroy.facet.66d [symbolic] -// CHECK:STDOUT: %impl.elem0.f5f: %.f20 = impl_witness_access %Destroy.lookup_impl_witness.7eb, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.87c: = specific_impl_function %impl.elem0.f5f, @Destroy.WithSelf.Op(%Destroy.facet.66d) [symbolic] +// CHECK:STDOUT: %T.765: %Destroy.type = symbolic_binding T, 0 [symbolic] +// CHECK:STDOUT: %T.binding.as_type.140: type = symbolic_binding_type T, 0, %T.765 [symbolic] +// CHECK:STDOUT: %ptr.ef1: type = ptr_type %T.binding.as_type.140 [symbolic] +// CHECK:STDOUT: %const: type = const_type %T.binding.as_type.140 [symbolic] +// CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete] +// CHECK:STDOUT: %tuple: %tuple.type.24b = tuple_value (%ptr.ef1, %const) [symbolic] +// CHECK:STDOUT: %tuple.type.3d1: type = tuple_type (%ptr.ef1, %const) [symbolic] +// CHECK:STDOUT: %require_complete.fd4: = require_complete_type %tuple.type.3d1 [symbolic] +// CHECK:STDOUT: %pattern_type.3d7: type = pattern_type %tuple.type.3d1 [symbolic] +// CHECK:STDOUT: %DefaultOrUnformed.type: type = facet_type <@DefaultOrUnformed> [concrete] +// CHECK:STDOUT: %DefaultOrUnformed.lookup_impl_witness.10f: = lookup_impl_witness %tuple.type.3d1, @DefaultOrUnformed [symbolic] +// CHECK:STDOUT: %.aad: require_specific_def_type = require_specific_def @T.as.DefaultOrUnformed.impl(%tuple.type.3d1) [symbolic] +// CHECK:STDOUT: %DefaultOrUnformed.facet.735: %DefaultOrUnformed.type = facet_value %tuple.type.3d1, (%DefaultOrUnformed.lookup_impl_witness.10f) [symbolic] +// CHECK:STDOUT: %DefaultOrUnformed.WithSelf.Op.type.7cc: type = fn_type @DefaultOrUnformed.WithSelf.Op, @DefaultOrUnformed.WithSelf(%DefaultOrUnformed.facet.735) [symbolic] +// CHECK:STDOUT: %.fc3: type = fn_type_with_self_type %DefaultOrUnformed.WithSelf.Op.type.7cc, %DefaultOrUnformed.facet.735 [symbolic] +// CHECK:STDOUT: %impl.elem0.5de: %.fc3 = impl_witness_access %DefaultOrUnformed.lookup_impl_witness.10f, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.289: = specific_impl_function %impl.elem0.5de, @DefaultOrUnformed.WithSelf.Op(%DefaultOrUnformed.facet.735) [symbolic] +// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %T.binding.as_type.140} [symbolic] +// CHECK:STDOUT: %require_complete.964: = require_complete_type %struct_type.a [symbolic] +// CHECK:STDOUT: %pattern_type.f2e: type = pattern_type %struct_type.a [symbolic] +// CHECK:STDOUT: %DefaultOrUnformed.lookup_impl_witness.ee5: = lookup_impl_witness %struct_type.a, @DefaultOrUnformed [symbolic] +// CHECK:STDOUT: %.a3f: require_specific_def_type = require_specific_def @T.as.DefaultOrUnformed.impl(%struct_type.a) [symbolic] +// CHECK:STDOUT: %DefaultOrUnformed.facet.e47: %DefaultOrUnformed.type = facet_value %struct_type.a, (%DefaultOrUnformed.lookup_impl_witness.ee5) [symbolic] +// CHECK:STDOUT: %DefaultOrUnformed.WithSelf.Op.type.487: type = fn_type @DefaultOrUnformed.WithSelf.Op, @DefaultOrUnformed.WithSelf(%DefaultOrUnformed.facet.e47) [symbolic] +// CHECK:STDOUT: %.d49: type = fn_type_with_self_type %DefaultOrUnformed.WithSelf.Op.type.487, %DefaultOrUnformed.facet.e47 [symbolic] +// CHECK:STDOUT: %impl.elem0.760: %.d49 = impl_witness_access %DefaultOrUnformed.lookup_impl_witness.ee5, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.d5b: = specific_impl_function %impl.elem0.760, @DefaultOrUnformed.WithSelf.Op(%DefaultOrUnformed.facet.e47) [symbolic] +// CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete] +// CHECK:STDOUT: %array_type.750: type = array_type %int_5, %T.binding.as_type.140 [symbolic] +// CHECK:STDOUT: %require_complete.32a: = require_complete_type %array_type.750 [symbolic] +// CHECK:STDOUT: %pattern_type.e81: type = pattern_type %array_type.750 [symbolic] +// CHECK:STDOUT: %DefaultOrUnformed.lookup_impl_witness.b97: = lookup_impl_witness %array_type.750, @DefaultOrUnformed [symbolic] +// CHECK:STDOUT: %.adf: require_specific_def_type = require_specific_def @T.as.DefaultOrUnformed.impl(%array_type.750) [symbolic] +// CHECK:STDOUT: %DefaultOrUnformed.facet.cc0: %DefaultOrUnformed.type = facet_value %array_type.750, (%DefaultOrUnformed.lookup_impl_witness.b97) [symbolic] +// CHECK:STDOUT: %DefaultOrUnformed.WithSelf.Op.type.dff: type = fn_type @DefaultOrUnformed.WithSelf.Op, @DefaultOrUnformed.WithSelf(%DefaultOrUnformed.facet.cc0) [symbolic] +// CHECK:STDOUT: %.86d: type = fn_type_with_self_type %DefaultOrUnformed.WithSelf.Op.type.dff, %DefaultOrUnformed.facet.cc0 [symbolic] +// CHECK:STDOUT: %impl.elem0.0e2: %.86d = impl_witness_access %DefaultOrUnformed.lookup_impl_witness.b97, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.9f7: = specific_impl_function %impl.elem0.0e2, @DefaultOrUnformed.WithSelf.Op(%DefaultOrUnformed.facet.cc0) [symbolic] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.b42: = lookup_impl_witness %array_type.750, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.facet.e98: %Destroy.type = facet_value %array_type.750, (%Destroy.lookup_impl_witness.b42) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.1a4: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.e98) [symbolic] +// CHECK:STDOUT: %.1f4: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.1a4, %Destroy.facet.e98 [symbolic] +// CHECK:STDOUT: %impl.elem0.dcc: %.1f4 = impl_witness_access %Destroy.lookup_impl_witness.b42, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.ef1: = specific_impl_function %impl.elem0.dcc, @Destroy.WithSelf.Op(%Destroy.facet.e98) [symbolic] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.2a6: = lookup_impl_witness %struct_type.a, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.facet.884: %Destroy.type = facet_value %struct_type.a, (%Destroy.lookup_impl_witness.2a6) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.80d: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.884) [symbolic] +// CHECK:STDOUT: %.b19: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.80d, %Destroy.facet.884 [symbolic] +// CHECK:STDOUT: %impl.elem0.0c6: %.b19 = impl_witness_access %Destroy.lookup_impl_witness.2a6, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.d3c: = specific_impl_function %impl.elem0.0c6, @Destroy.WithSelf.Op(%Destroy.facet.884) [symbolic] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.7e1: = lookup_impl_witness %tuple.type.3d1, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.facet.753: %Destroy.type = facet_value %tuple.type.3d1, (%Destroy.lookup_impl_witness.7e1) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.c24: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.753) [symbolic] +// CHECK:STDOUT: %.958: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.c24, %Destroy.facet.753 [symbolic] +// CHECK:STDOUT: %impl.elem0.9bc: %.958 = impl_witness_access %Destroy.lookup_impl_witness.7e1, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.33d: = specific_impl_function %impl.elem0.9bc, @Destroy.WithSelf.Op(%Destroy.facet.753) [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %N.5de: %i32 = symbolic_binding N, 0 [symbolic] @@ -581,138 +582,147 @@ fn G(N:! i32) { // CHECK:STDOUT: %ImplicitAs.impl_witness_table.ea2 = impl_witness_table (%Core.import_ref.0bc), @Int.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(%T.loc4_7.2: type) { +// CHECK:STDOUT: generic fn @F(%T.loc4_7.2: %Destroy.type) { // CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ptr.loc6_19.2: type = ptr_type %T.loc4_7.1 [symbolic = %ptr.loc6_19.2 (constants.%ptr.e8f)] -// CHECK:STDOUT: %const.loc6_22.2: type = const_type %T.loc4_7.1 [symbolic = %const.loc6_22.2 (constants.%const)] +// CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc4_7.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.140)] +// CHECK:STDOUT: %ptr.loc6_19.2: type = ptr_type %T.binding.as_type [symbolic = %ptr.loc6_19.2 (constants.%ptr.ef1)] +// CHECK:STDOUT: %const.loc6_22.2: type = const_type %T.binding.as_type [symbolic = %const.loc6_22.2 (constants.%const)] // CHECK:STDOUT: %tuple: %tuple.type.24b = tuple_value (%ptr.loc6_19.2, %const.loc6_22.2) [symbolic = %tuple (constants.%tuple)] -// CHECK:STDOUT: %tuple.type: type = tuple_type (%ptr.loc6_19.2, %const.loc6_22.2) [symbolic = %tuple.type (constants.%tuple.type.3c8)] -// CHECK:STDOUT: %require_complete.loc6: = require_complete_type %tuple.type [symbolic = %require_complete.loc6 (constants.%require_complete.666)] -// CHECK:STDOUT: %pattern_type.loc6: type = pattern_type %tuple.type [symbolic = %pattern_type.loc6 (constants.%pattern_type.4ac)] -// CHECK:STDOUT: %.loc6_30.3: require_specific_def_type = require_specific_def @T.as.DefaultOrUnformed.impl(%tuple.type) [symbolic = %.loc6_30.3 (constants.%.f7e)] -// CHECK:STDOUT: %DefaultOrUnformed.lookup_impl_witness.loc6: = lookup_impl_witness %tuple.type, @DefaultOrUnformed [symbolic = %DefaultOrUnformed.lookup_impl_witness.loc6 (constants.%DefaultOrUnformed.lookup_impl_witness.2ad)] -// CHECK:STDOUT: %DefaultOrUnformed.facet.loc6_30.2: %DefaultOrUnformed.type = facet_value %tuple.type, (%DefaultOrUnformed.lookup_impl_witness.loc6) [symbolic = %DefaultOrUnformed.facet.loc6_30.2 (constants.%DefaultOrUnformed.facet.9a0)] -// CHECK:STDOUT: %DefaultOrUnformed.WithSelf.Op.type.loc6: type = fn_type @DefaultOrUnformed.WithSelf.Op, @DefaultOrUnformed.WithSelf(%DefaultOrUnformed.facet.loc6_30.2) [symbolic = %DefaultOrUnformed.WithSelf.Op.type.loc6 (constants.%DefaultOrUnformed.WithSelf.Op.type.0af)] -// CHECK:STDOUT: %.loc6_30.4: type = fn_type_with_self_type %DefaultOrUnformed.WithSelf.Op.type.loc6, %DefaultOrUnformed.facet.loc6_30.2 [symbolic = %.loc6_30.4 (constants.%.246)] -// CHECK:STDOUT: %impl.elem0.loc6_30.2: @F.%.loc6_30.4 (%.246) = impl_witness_access %DefaultOrUnformed.lookup_impl_witness.loc6, element0 [symbolic = %impl.elem0.loc6_30.2 (constants.%impl.elem0.c6f)] -// CHECK:STDOUT: %specific_impl_fn.loc6_30.2: = specific_impl_function %impl.elem0.loc6_30.2, @DefaultOrUnformed.WithSelf.Op(%DefaultOrUnformed.facet.loc6_30.2) [symbolic = %specific_impl_fn.loc6_30.2 (constants.%specific_impl_fn.58b)] -// CHECK:STDOUT: %struct_type.a.loc7_23.2: type = struct_type {.a: @F.%T.loc4_7.1 (%T.67d)} [symbolic = %struct_type.a.loc7_23.2 (constants.%struct_type.a)] -// CHECK:STDOUT: %require_complete.loc7: = require_complete_type %struct_type.a.loc7_23.2 [symbolic = %require_complete.loc7 (constants.%require_complete.5d6)] -// CHECK:STDOUT: %pattern_type.loc7: type = pattern_type %struct_type.a.loc7_23.2 [symbolic = %pattern_type.loc7 (constants.%pattern_type.7b9)] -// CHECK:STDOUT: %.loc7_24.3: require_specific_def_type = require_specific_def @T.as.DefaultOrUnformed.impl(%struct_type.a.loc7_23.2) [symbolic = %.loc7_24.3 (constants.%.d26)] -// CHECK:STDOUT: %DefaultOrUnformed.lookup_impl_witness.loc7: = lookup_impl_witness %struct_type.a.loc7_23.2, @DefaultOrUnformed [symbolic = %DefaultOrUnformed.lookup_impl_witness.loc7 (constants.%DefaultOrUnformed.lookup_impl_witness.169)] -// CHECK:STDOUT: %DefaultOrUnformed.facet.loc7_24.2: %DefaultOrUnformed.type = facet_value %struct_type.a.loc7_23.2, (%DefaultOrUnformed.lookup_impl_witness.loc7) [symbolic = %DefaultOrUnformed.facet.loc7_24.2 (constants.%DefaultOrUnformed.facet.ca5)] -// CHECK:STDOUT: %DefaultOrUnformed.WithSelf.Op.type.loc7: type = fn_type @DefaultOrUnformed.WithSelf.Op, @DefaultOrUnformed.WithSelf(%DefaultOrUnformed.facet.loc7_24.2) [symbolic = %DefaultOrUnformed.WithSelf.Op.type.loc7 (constants.%DefaultOrUnformed.WithSelf.Op.type.0c5)] -// CHECK:STDOUT: %.loc7_24.4: type = fn_type_with_self_type %DefaultOrUnformed.WithSelf.Op.type.loc7, %DefaultOrUnformed.facet.loc7_24.2 [symbolic = %.loc7_24.4 (constants.%.9ac)] -// CHECK:STDOUT: %impl.elem0.loc7_24.2: @F.%.loc7_24.4 (%.9ac) = impl_witness_access %DefaultOrUnformed.lookup_impl_witness.loc7, element0 [symbolic = %impl.elem0.loc7_24.2 (constants.%impl.elem0.e9c)] -// CHECK:STDOUT: %specific_impl_fn.loc7_24.2: = specific_impl_function %impl.elem0.loc7_24.2, @DefaultOrUnformed.WithSelf.Op(%DefaultOrUnformed.facet.loc7_24.2) [symbolic = %specific_impl_fn.loc7_24.2 (constants.%specific_impl_fn.cf6)] -// CHECK:STDOUT: %array_type.loc8_27.2: type = array_type constants.%int_5, %T.loc4_7.1 [symbolic = %array_type.loc8_27.2 (constants.%array_type.742)] -// CHECK:STDOUT: %require_complete.loc8: = require_complete_type %array_type.loc8_27.2 [symbolic = %require_complete.loc8 (constants.%require_complete.345)] -// CHECK:STDOUT: %pattern_type.loc8: type = pattern_type %array_type.loc8_27.2 [symbolic = %pattern_type.loc8 (constants.%pattern_type.d52)] -// CHECK:STDOUT: %.loc8_28.3: require_specific_def_type = require_specific_def @T.as.DefaultOrUnformed.impl(%array_type.loc8_27.2) [symbolic = %.loc8_28.3 (constants.%.617)] -// CHECK:STDOUT: %DefaultOrUnformed.lookup_impl_witness.loc8: = lookup_impl_witness %array_type.loc8_27.2, @DefaultOrUnformed [symbolic = %DefaultOrUnformed.lookup_impl_witness.loc8 (constants.%DefaultOrUnformed.lookup_impl_witness.945)] -// CHECK:STDOUT: %DefaultOrUnformed.facet.loc8_28.2: %DefaultOrUnformed.type = facet_value %array_type.loc8_27.2, (%DefaultOrUnformed.lookup_impl_witness.loc8) [symbolic = %DefaultOrUnformed.facet.loc8_28.2 (constants.%DefaultOrUnformed.facet.ad6)] -// CHECK:STDOUT: %DefaultOrUnformed.WithSelf.Op.type.loc8: type = fn_type @DefaultOrUnformed.WithSelf.Op, @DefaultOrUnformed.WithSelf(%DefaultOrUnformed.facet.loc8_28.2) [symbolic = %DefaultOrUnformed.WithSelf.Op.type.loc8 (constants.%DefaultOrUnformed.WithSelf.Op.type.2f0)] -// CHECK:STDOUT: %.loc8_28.4: type = fn_type_with_self_type %DefaultOrUnformed.WithSelf.Op.type.loc8, %DefaultOrUnformed.facet.loc8_28.2 [symbolic = %.loc8_28.4 (constants.%.544)] -// CHECK:STDOUT: %impl.elem0.loc8_28.2: @F.%.loc8_28.4 (%.544) = impl_witness_access %DefaultOrUnformed.lookup_impl_witness.loc8, element0 [symbolic = %impl.elem0.loc8_28.2 (constants.%impl.elem0.97e)] -// 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.261)] -// 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.b29)] -// CHECK:STDOUT: %Destroy.facet.loc8: %Destroy.type = facet_value %array_type.loc8_27.2, (%Destroy.lookup_impl_witness.loc8) [symbolic = %Destroy.facet.loc8 (constants.%Destroy.facet.ddc)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc8: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc8) [symbolic = %Destroy.WithSelf.Op.type.loc8 (constants.%Destroy.WithSelf.Op.type.3c6)] -// CHECK:STDOUT: %.loc8_3.2: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.loc8, %Destroy.facet.loc8 [symbolic = %.loc8_3.2 (constants.%.950)] -// CHECK:STDOUT: %impl.elem0.loc8_3.2: @F.%.loc8_3.2 (%.950) = impl_witness_access %Destroy.lookup_impl_witness.loc8, element0 [symbolic = %impl.elem0.loc8_3.2 (constants.%impl.elem0.fa5)] -// CHECK:STDOUT: %specific_impl_fn.loc8_3.2: = specific_impl_function %impl.elem0.loc8_3.2, @Destroy.WithSelf.Op(%Destroy.facet.loc8) [symbolic = %specific_impl_fn.loc8_3.2 (constants.%specific_impl_fn.ede)] -// 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.bed)] -// CHECK:STDOUT: %Destroy.facet.loc7: %Destroy.type = facet_value %struct_type.a.loc7_23.2, (%Destroy.lookup_impl_witness.loc7) [symbolic = %Destroy.facet.loc7 (constants.%Destroy.facet.d21)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc7: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc7) [symbolic = %Destroy.WithSelf.Op.type.loc7 (constants.%Destroy.WithSelf.Op.type.873)] -// CHECK:STDOUT: %.loc7_3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.loc7, %Destroy.facet.loc7 [symbolic = %.loc7_3 (constants.%.511)] -// CHECK:STDOUT: %impl.elem0.loc7_3.2: @F.%.loc7_3 (%.511) = impl_witness_access %Destroy.lookup_impl_witness.loc7, element0 [symbolic = %impl.elem0.loc7_3.2 (constants.%impl.elem0.12c)] -// CHECK:STDOUT: %specific_impl_fn.loc7_3.2: = specific_impl_function %impl.elem0.loc7_3.2, @Destroy.WithSelf.Op(%Destroy.facet.loc7) [symbolic = %specific_impl_fn.loc7_3.2 (constants.%specific_impl_fn.c3a)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc6: = lookup_impl_witness %tuple.type, @Destroy [symbolic = %Destroy.lookup_impl_witness.loc6 (constants.%Destroy.lookup_impl_witness.7eb)] -// CHECK:STDOUT: %Destroy.facet.loc6: %Destroy.type = facet_value %tuple.type, (%Destroy.lookup_impl_witness.loc6) [symbolic = %Destroy.facet.loc6 (constants.%Destroy.facet.66d)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc6: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc6) [symbolic = %Destroy.WithSelf.Op.type.loc6 (constants.%Destroy.WithSelf.Op.type.f23)] -// CHECK:STDOUT: %.loc6_3.2: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.loc6, %Destroy.facet.loc6 [symbolic = %.loc6_3.2 (constants.%.f20)] -// CHECK:STDOUT: %impl.elem0.loc6_3.2: @F.%.loc6_3.2 (%.f20) = impl_witness_access %Destroy.lookup_impl_witness.loc6, element0 [symbolic = %impl.elem0.loc6_3.2 (constants.%impl.elem0.f5f)] -// CHECK:STDOUT: %specific_impl_fn.loc6_3.2: = specific_impl_function %impl.elem0.loc6_3.2, @Destroy.WithSelf.Op(%Destroy.facet.loc6) [symbolic = %specific_impl_fn.loc6_3.2 (constants.%specific_impl_fn.87c)] +// CHECK:STDOUT: %tuple.type: type = tuple_type (%ptr.loc6_19.2, %const.loc6_22.2) [symbolic = %tuple.type (constants.%tuple.type.3d1)] +// CHECK:STDOUT: %require_complete.loc6: = require_complete_type %tuple.type [symbolic = %require_complete.loc6 (constants.%require_complete.fd4)] +// CHECK:STDOUT: %pattern_type.loc6: type = pattern_type %tuple.type [symbolic = %pattern_type.loc6 (constants.%pattern_type.3d7)] +// CHECK:STDOUT: %.loc6_30.3: require_specific_def_type = require_specific_def @T.as.DefaultOrUnformed.impl(%tuple.type) [symbolic = %.loc6_30.3 (constants.%.aad)] +// CHECK:STDOUT: %DefaultOrUnformed.lookup_impl_witness.loc6: = lookup_impl_witness %tuple.type, @DefaultOrUnformed [symbolic = %DefaultOrUnformed.lookup_impl_witness.loc6 (constants.%DefaultOrUnformed.lookup_impl_witness.10f)] +// CHECK:STDOUT: %DefaultOrUnformed.facet.loc6_30.2: %DefaultOrUnformed.type = facet_value %tuple.type, (%DefaultOrUnformed.lookup_impl_witness.loc6) [symbolic = %DefaultOrUnformed.facet.loc6_30.2 (constants.%DefaultOrUnformed.facet.735)] +// CHECK:STDOUT: %DefaultOrUnformed.WithSelf.Op.type.loc6: type = fn_type @DefaultOrUnformed.WithSelf.Op, @DefaultOrUnformed.WithSelf(%DefaultOrUnformed.facet.loc6_30.2) [symbolic = %DefaultOrUnformed.WithSelf.Op.type.loc6 (constants.%DefaultOrUnformed.WithSelf.Op.type.7cc)] +// CHECK:STDOUT: %.loc6_30.4: type = fn_type_with_self_type %DefaultOrUnformed.WithSelf.Op.type.loc6, %DefaultOrUnformed.facet.loc6_30.2 [symbolic = %.loc6_30.4 (constants.%.fc3)] +// CHECK:STDOUT: %impl.elem0.loc6_30.2: @F.%.loc6_30.4 (%.fc3) = impl_witness_access %DefaultOrUnformed.lookup_impl_witness.loc6, element0 [symbolic = %impl.elem0.loc6_30.2 (constants.%impl.elem0.5de)] +// CHECK:STDOUT: %specific_impl_fn.loc6_30.2: = specific_impl_function %impl.elem0.loc6_30.2, @DefaultOrUnformed.WithSelf.Op(%DefaultOrUnformed.facet.loc6_30.2) [symbolic = %specific_impl_fn.loc6_30.2 (constants.%specific_impl_fn.289)] +// CHECK:STDOUT: %struct_type.a.loc7_23.2: type = struct_type {.a: @F.%T.binding.as_type (%T.binding.as_type.140)} [symbolic = %struct_type.a.loc7_23.2 (constants.%struct_type.a)] +// CHECK:STDOUT: %require_complete.loc7: = require_complete_type %struct_type.a.loc7_23.2 [symbolic = %require_complete.loc7 (constants.%require_complete.964)] +// CHECK:STDOUT: %pattern_type.loc7: type = pattern_type %struct_type.a.loc7_23.2 [symbolic = %pattern_type.loc7 (constants.%pattern_type.f2e)] +// CHECK:STDOUT: %.loc7_24.3: require_specific_def_type = require_specific_def @T.as.DefaultOrUnformed.impl(%struct_type.a.loc7_23.2) [symbolic = %.loc7_24.3 (constants.%.a3f)] +// CHECK:STDOUT: %DefaultOrUnformed.lookup_impl_witness.loc7: = lookup_impl_witness %struct_type.a.loc7_23.2, @DefaultOrUnformed [symbolic = %DefaultOrUnformed.lookup_impl_witness.loc7 (constants.%DefaultOrUnformed.lookup_impl_witness.ee5)] +// CHECK:STDOUT: %DefaultOrUnformed.facet.loc7_24.2: %DefaultOrUnformed.type = facet_value %struct_type.a.loc7_23.2, (%DefaultOrUnformed.lookup_impl_witness.loc7) [symbolic = %DefaultOrUnformed.facet.loc7_24.2 (constants.%DefaultOrUnformed.facet.e47)] +// CHECK:STDOUT: %DefaultOrUnformed.WithSelf.Op.type.loc7: type = fn_type @DefaultOrUnformed.WithSelf.Op, @DefaultOrUnformed.WithSelf(%DefaultOrUnformed.facet.loc7_24.2) [symbolic = %DefaultOrUnformed.WithSelf.Op.type.loc7 (constants.%DefaultOrUnformed.WithSelf.Op.type.487)] +// CHECK:STDOUT: %.loc7_24.4: type = fn_type_with_self_type %DefaultOrUnformed.WithSelf.Op.type.loc7, %DefaultOrUnformed.facet.loc7_24.2 [symbolic = %.loc7_24.4 (constants.%.d49)] +// CHECK:STDOUT: %impl.elem0.loc7_24.2: @F.%.loc7_24.4 (%.d49) = impl_witness_access %DefaultOrUnformed.lookup_impl_witness.loc7, element0 [symbolic = %impl.elem0.loc7_24.2 (constants.%impl.elem0.760)] +// CHECK:STDOUT: %specific_impl_fn.loc7_24.2: = specific_impl_function %impl.elem0.loc7_24.2, @DefaultOrUnformed.WithSelf.Op(%DefaultOrUnformed.facet.loc7_24.2) [symbolic = %specific_impl_fn.loc7_24.2 (constants.%specific_impl_fn.d5b)] +// CHECK:STDOUT: %array_type.loc8_27.2: type = array_type constants.%int_5, %T.binding.as_type [symbolic = %array_type.loc8_27.2 (constants.%array_type.750)] +// CHECK:STDOUT: %require_complete.loc8: = require_complete_type %array_type.loc8_27.2 [symbolic = %require_complete.loc8 (constants.%require_complete.32a)] +// CHECK:STDOUT: %pattern_type.loc8: type = pattern_type %array_type.loc8_27.2 [symbolic = %pattern_type.loc8 (constants.%pattern_type.e81)] +// CHECK:STDOUT: %.loc8_28.3: require_specific_def_type = require_specific_def @T.as.DefaultOrUnformed.impl(%array_type.loc8_27.2) [symbolic = %.loc8_28.3 (constants.%.adf)] +// CHECK:STDOUT: %DefaultOrUnformed.lookup_impl_witness.loc8: = lookup_impl_witness %array_type.loc8_27.2, @DefaultOrUnformed [symbolic = %DefaultOrUnformed.lookup_impl_witness.loc8 (constants.%DefaultOrUnformed.lookup_impl_witness.b97)] +// CHECK:STDOUT: %DefaultOrUnformed.facet.loc8_28.2: %DefaultOrUnformed.type = facet_value %array_type.loc8_27.2, (%DefaultOrUnformed.lookup_impl_witness.loc8) [symbolic = %DefaultOrUnformed.facet.loc8_28.2 (constants.%DefaultOrUnformed.facet.cc0)] +// CHECK:STDOUT: %DefaultOrUnformed.WithSelf.Op.type.loc8: type = fn_type @DefaultOrUnformed.WithSelf.Op, @DefaultOrUnformed.WithSelf(%DefaultOrUnformed.facet.loc8_28.2) [symbolic = %DefaultOrUnformed.WithSelf.Op.type.loc8 (constants.%DefaultOrUnformed.WithSelf.Op.type.dff)] +// CHECK:STDOUT: %.loc8_28.4: type = fn_type_with_self_type %DefaultOrUnformed.WithSelf.Op.type.loc8, %DefaultOrUnformed.facet.loc8_28.2 [symbolic = %.loc8_28.4 (constants.%.86d)] +// CHECK:STDOUT: %impl.elem0.loc8_28.2: @F.%.loc8_28.4 (%.86d) = impl_witness_access %DefaultOrUnformed.lookup_impl_witness.loc8, element0 [symbolic = %impl.elem0.loc8_28.2 (constants.%impl.elem0.0e2)] +// 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.9f7)] +// 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.b42)] +// CHECK:STDOUT: %Destroy.facet.loc8: %Destroy.type = facet_value %array_type.loc8_27.2, (%Destroy.lookup_impl_witness.loc8) [symbolic = %Destroy.facet.loc8 (constants.%Destroy.facet.e98)] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc8: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc8) [symbolic = %Destroy.WithSelf.Op.type.loc8 (constants.%Destroy.WithSelf.Op.type.1a4)] +// CHECK:STDOUT: %.loc8_3.2: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.loc8, %Destroy.facet.loc8 [symbolic = %.loc8_3.2 (constants.%.1f4)] +// CHECK:STDOUT: %impl.elem0.loc8_3.2: @F.%.loc8_3.2 (%.1f4) = impl_witness_access %Destroy.lookup_impl_witness.loc8, element0 [symbolic = %impl.elem0.loc8_3.2 (constants.%impl.elem0.dcc)] +// CHECK:STDOUT: %specific_impl_fn.loc8_3.2: = specific_impl_function %impl.elem0.loc8_3.2, @Destroy.WithSelf.Op(%Destroy.facet.loc8) [symbolic = %specific_impl_fn.loc8_3.2 (constants.%specific_impl_fn.ef1)] +// 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.2a6)] +// CHECK:STDOUT: %Destroy.facet.loc7: %Destroy.type = facet_value %struct_type.a.loc7_23.2, (%Destroy.lookup_impl_witness.loc7) [symbolic = %Destroy.facet.loc7 (constants.%Destroy.facet.884)] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc7: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc7) [symbolic = %Destroy.WithSelf.Op.type.loc7 (constants.%Destroy.WithSelf.Op.type.80d)] +// CHECK:STDOUT: %.loc7_3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.loc7, %Destroy.facet.loc7 [symbolic = %.loc7_3 (constants.%.b19)] +// CHECK:STDOUT: %impl.elem0.loc7_3.2: @F.%.loc7_3 (%.b19) = impl_witness_access %Destroy.lookup_impl_witness.loc7, element0 [symbolic = %impl.elem0.loc7_3.2 (constants.%impl.elem0.0c6)] +// CHECK:STDOUT: %specific_impl_fn.loc7_3.2: = specific_impl_function %impl.elem0.loc7_3.2, @Destroy.WithSelf.Op(%Destroy.facet.loc7) [symbolic = %specific_impl_fn.loc7_3.2 (constants.%specific_impl_fn.d3c)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc6: = lookup_impl_witness %tuple.type, @Destroy [symbolic = %Destroy.lookup_impl_witness.loc6 (constants.%Destroy.lookup_impl_witness.7e1)] +// CHECK:STDOUT: %Destroy.facet.loc6: %Destroy.type = facet_value %tuple.type, (%Destroy.lookup_impl_witness.loc6) [symbolic = %Destroy.facet.loc6 (constants.%Destroy.facet.753)] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc6: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc6) [symbolic = %Destroy.WithSelf.Op.type.loc6 (constants.%Destroy.WithSelf.Op.type.c24)] +// CHECK:STDOUT: %.loc6_3.2: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.loc6, %Destroy.facet.loc6 [symbolic = %.loc6_3.2 (constants.%.958)] +// CHECK:STDOUT: %impl.elem0.loc6_3.2: @F.%.loc6_3.2 (%.958) = impl_witness_access %Destroy.lookup_impl_witness.loc6, element0 [symbolic = %impl.elem0.loc6_3.2 (constants.%impl.elem0.9bc)] +// CHECK:STDOUT: %specific_impl_fn.loc6_3.2: = specific_impl_function %impl.elem0.loc6_3.2, @Destroy.WithSelf.Op(%Destroy.facet.loc6) [symbolic = %specific_impl_fn.loc6_3.2 (constants.%specific_impl_fn.33d)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %u.patt: @F.%pattern_type.loc6 (%pattern_type.4ac) = ref_binding_pattern u [concrete] -// CHECK:STDOUT: %u.var_patt: @F.%pattern_type.loc6 (%pattern_type.4ac) = var_pattern %u.patt [concrete] +// CHECK:STDOUT: %u.patt: @F.%pattern_type.loc6 (%pattern_type.3d7) = ref_binding_pattern u [concrete] +// CHECK:STDOUT: %u.var_patt: @F.%pattern_type.loc6 (%pattern_type.3d7) = var_pattern %u.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %u.var: ref @F.%tuple.type (%tuple.type.3c8) = var %u.var_patt -// CHECK:STDOUT: %DefaultOrUnformed.facet.loc6_30.1: %DefaultOrUnformed.type = facet_value constants.%tuple.type.3c8, (constants.%DefaultOrUnformed.lookup_impl_witness.2ad) [symbolic = %DefaultOrUnformed.facet.loc6_30.2 (constants.%DefaultOrUnformed.facet.9a0)] -// CHECK:STDOUT: %.loc6_30.1: %DefaultOrUnformed.type = converted constants.%tuple.type.3c8, %DefaultOrUnformed.facet.loc6_30.1 [symbolic = %DefaultOrUnformed.facet.loc6_30.2 (constants.%DefaultOrUnformed.facet.9a0)] -// CHECK:STDOUT: %as_type.loc6: type = facet_access_type %.loc6_30.1 [symbolic = %tuple.type (constants.%tuple.type.3c8)] -// CHECK:STDOUT: %.loc6_30.2: type = converted %.loc6_30.1, %as_type.loc6 [symbolic = %tuple.type (constants.%tuple.type.3c8)] -// CHECK:STDOUT: %impl.elem0.loc6_30.1: @F.%.loc6_30.4 (%.246) = impl_witness_access constants.%DefaultOrUnformed.lookup_impl_witness.2ad, element0 [symbolic = %impl.elem0.loc6_30.2 (constants.%impl.elem0.c6f)] -// CHECK:STDOUT: %specific_impl_fn.loc6_30.1: = specific_impl_function %impl.elem0.loc6_30.1, @DefaultOrUnformed.WithSelf.Op(constants.%DefaultOrUnformed.facet.9a0) [symbolic = %specific_impl_fn.loc6_30.2 (constants.%specific_impl_fn.58b)] -// CHECK:STDOUT: %.loc6_3.1: ref @F.%tuple.type (%tuple.type.3c8) = splice_block %u.var {} -// CHECK:STDOUT: %DefaultOrUnformed.WithSelf.Op.call.loc6: init @F.%tuple.type (%tuple.type.3c8) to %.loc6_3.1 = call %specific_impl_fn.loc6_30.1() +// CHECK:STDOUT: %u.var: ref @F.%tuple.type (%tuple.type.3d1) = var %u.var_patt +// CHECK:STDOUT: %DefaultOrUnformed.facet.loc6_30.1: %DefaultOrUnformed.type = facet_value constants.%tuple.type.3d1, (constants.%DefaultOrUnformed.lookup_impl_witness.10f) [symbolic = %DefaultOrUnformed.facet.loc6_30.2 (constants.%DefaultOrUnformed.facet.735)] +// CHECK:STDOUT: %.loc6_30.1: %DefaultOrUnformed.type = converted constants.%tuple.type.3d1, %DefaultOrUnformed.facet.loc6_30.1 [symbolic = %DefaultOrUnformed.facet.loc6_30.2 (constants.%DefaultOrUnformed.facet.735)] +// CHECK:STDOUT: %as_type.loc6: type = facet_access_type %.loc6_30.1 [symbolic = %tuple.type (constants.%tuple.type.3d1)] +// CHECK:STDOUT: %.loc6_30.2: type = converted %.loc6_30.1, %as_type.loc6 [symbolic = %tuple.type (constants.%tuple.type.3d1)] +// CHECK:STDOUT: %impl.elem0.loc6_30.1: @F.%.loc6_30.4 (%.fc3) = impl_witness_access constants.%DefaultOrUnformed.lookup_impl_witness.10f, element0 [symbolic = %impl.elem0.loc6_30.2 (constants.%impl.elem0.5de)] +// CHECK:STDOUT: %specific_impl_fn.loc6_30.1: = specific_impl_function %impl.elem0.loc6_30.1, @DefaultOrUnformed.WithSelf.Op(constants.%DefaultOrUnformed.facet.735) [symbolic = %specific_impl_fn.loc6_30.2 (constants.%specific_impl_fn.289)] +// CHECK:STDOUT: %.loc6_3.1: ref @F.%tuple.type (%tuple.type.3d1) = splice_block %u.var {} +// CHECK:STDOUT: %DefaultOrUnformed.WithSelf.Op.call.loc6: init @F.%tuple.type (%tuple.type.3d1) to %.loc6_3.1 = call %specific_impl_fn.loc6_30.1() // CHECK:STDOUT: assign %u.var, %DefaultOrUnformed.WithSelf.Op.call.loc6 -// CHECK:STDOUT: %.loc6_29.1: type = splice_block %.loc6_29.3 [symbolic = %tuple.type (constants.%tuple.type.3c8)] { -// CHECK:STDOUT: %T.ref.loc6_18: type = name_ref T, %T.loc4_7.2 [symbolic = %T.loc4_7.1 (constants.%T.67d)] -// CHECK:STDOUT: %ptr.loc6_19.1: type = ptr_type %T.ref.loc6_18 [symbolic = %ptr.loc6_19.2 (constants.%ptr.e8f)] -// CHECK:STDOUT: %T.ref.loc6_28: type = name_ref T, %T.loc4_7.2 [symbolic = %T.loc4_7.1 (constants.%T.67d)] -// CHECK:STDOUT: %const.loc6_22.1: type = const_type %T.ref.loc6_28 [symbolic = %const.loc6_22.2 (constants.%const)] +// CHECK:STDOUT: %.loc6_29.1: type = splice_block %.loc6_29.3 [symbolic = %tuple.type (constants.%tuple.type.3d1)] { +// CHECK:STDOUT: %T.ref.loc6_18: %Destroy.type = name_ref T, %T.loc4_7.2 [symbolic = %T.loc4_7.1 (constants.%T.765)] +// CHECK:STDOUT: %T.as_type.loc6_19: type = facet_access_type %T.ref.loc6_18 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.140)] +// CHECK:STDOUT: %.loc6_19: type = converted %T.ref.loc6_18, %T.as_type.loc6_19 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.140)] +// CHECK:STDOUT: %ptr.loc6_19.1: type = ptr_type %.loc6_19 [symbolic = %ptr.loc6_19.2 (constants.%ptr.ef1)] +// CHECK:STDOUT: %T.ref.loc6_28: %Destroy.type = name_ref T, %T.loc4_7.2 [symbolic = %T.loc4_7.1 (constants.%T.765)] +// CHECK:STDOUT: %T.as_type.loc6_22: type = facet_access_type %T.ref.loc6_28 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.140)] +// CHECK:STDOUT: %.loc6_22: type = converted %T.ref.loc6_28, %T.as_type.loc6_22 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.140)] +// CHECK:STDOUT: %const.loc6_22.1: type = const_type %.loc6_22 [symbolic = %const.loc6_22.2 (constants.%const)] // CHECK:STDOUT: %.loc6_29.2: %tuple.type.24b = tuple_literal (%ptr.loc6_19.1, %const.loc6_22.1) [symbolic = %tuple (constants.%tuple)] -// CHECK:STDOUT: %.loc6_29.3: type = converted %.loc6_29.2, constants.%tuple.type.3c8 [symbolic = %tuple.type (constants.%tuple.type.3c8)] +// CHECK:STDOUT: %.loc6_29.3: type = converted %.loc6_29.2, constants.%tuple.type.3d1 [symbolic = %tuple.type (constants.%tuple.type.3d1)] // CHECK:STDOUT: } -// CHECK:STDOUT: %u: ref @F.%tuple.type (%tuple.type.3c8) = ref_binding u, %u.var +// CHECK:STDOUT: %u: ref @F.%tuple.type (%tuple.type.3d1) = ref_binding u, %u.var // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %v.patt: @F.%pattern_type.loc7 (%pattern_type.7b9) = ref_binding_pattern v [concrete] -// CHECK:STDOUT: %v.var_patt: @F.%pattern_type.loc7 (%pattern_type.7b9) = var_pattern %v.patt [concrete] +// CHECK:STDOUT: %v.patt: @F.%pattern_type.loc7 (%pattern_type.f2e) = ref_binding_pattern v [concrete] +// CHECK:STDOUT: %v.var_patt: @F.%pattern_type.loc7 (%pattern_type.f2e) = var_pattern %v.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %v.var: ref @F.%struct_type.a.loc7_23.2 (%struct_type.a) = var %v.var_patt -// CHECK:STDOUT: %DefaultOrUnformed.facet.loc7_24.1: %DefaultOrUnformed.type = facet_value constants.%struct_type.a, (constants.%DefaultOrUnformed.lookup_impl_witness.169) [symbolic = %DefaultOrUnformed.facet.loc7_24.2 (constants.%DefaultOrUnformed.facet.ca5)] -// CHECK:STDOUT: %.loc7_24.1: %DefaultOrUnformed.type = converted constants.%struct_type.a, %DefaultOrUnformed.facet.loc7_24.1 [symbolic = %DefaultOrUnformed.facet.loc7_24.2 (constants.%DefaultOrUnformed.facet.ca5)] +// CHECK:STDOUT: %DefaultOrUnformed.facet.loc7_24.1: %DefaultOrUnformed.type = facet_value constants.%struct_type.a, (constants.%DefaultOrUnformed.lookup_impl_witness.ee5) [symbolic = %DefaultOrUnformed.facet.loc7_24.2 (constants.%DefaultOrUnformed.facet.e47)] +// CHECK:STDOUT: %.loc7_24.1: %DefaultOrUnformed.type = converted constants.%struct_type.a, %DefaultOrUnformed.facet.loc7_24.1 [symbolic = %DefaultOrUnformed.facet.loc7_24.2 (constants.%DefaultOrUnformed.facet.e47)] // CHECK:STDOUT: %as_type.loc7: type = facet_access_type %.loc7_24.1 [symbolic = %struct_type.a.loc7_23.2 (constants.%struct_type.a)] // CHECK:STDOUT: %.loc7_24.2: type = converted %.loc7_24.1, %as_type.loc7 [symbolic = %struct_type.a.loc7_23.2 (constants.%struct_type.a)] -// CHECK:STDOUT: %impl.elem0.loc7_24.1: @F.%.loc7_24.4 (%.9ac) = impl_witness_access constants.%DefaultOrUnformed.lookup_impl_witness.169, element0 [symbolic = %impl.elem0.loc7_24.2 (constants.%impl.elem0.e9c)] -// CHECK:STDOUT: %specific_impl_fn.loc7_24.1: = specific_impl_function %impl.elem0.loc7_24.1, @DefaultOrUnformed.WithSelf.Op(constants.%DefaultOrUnformed.facet.ca5) [symbolic = %specific_impl_fn.loc7_24.2 (constants.%specific_impl_fn.cf6)] +// CHECK:STDOUT: %impl.elem0.loc7_24.1: @F.%.loc7_24.4 (%.d49) = impl_witness_access constants.%DefaultOrUnformed.lookup_impl_witness.ee5, element0 [symbolic = %impl.elem0.loc7_24.2 (constants.%impl.elem0.760)] +// CHECK:STDOUT: %specific_impl_fn.loc7_24.1: = specific_impl_function %impl.elem0.loc7_24.1, @DefaultOrUnformed.WithSelf.Op(constants.%DefaultOrUnformed.facet.e47) [symbolic = %specific_impl_fn.loc7_24.2 (constants.%specific_impl_fn.d5b)] // CHECK:STDOUT: %DefaultOrUnformed.WithSelf.Op.call.loc7: init @F.%struct_type.a.loc7_23.2 (%struct_type.a) = call %specific_impl_fn.loc7_24.1() // CHECK:STDOUT: assign %v.var, %DefaultOrUnformed.WithSelf.Op.call.loc7 // CHECK:STDOUT: %.loc7_23: type = splice_block %struct_type.a.loc7_23.1 [symbolic = %struct_type.a.loc7_23.2 (constants.%struct_type.a)] { -// CHECK:STDOUT: %T.ref.loc7: type = name_ref T, %T.loc4_7.2 [symbolic = %T.loc4_7.1 (constants.%T.67d)] -// CHECK:STDOUT: %struct_type.a.loc7_23.1: type = struct_type {.a: @F.%T.loc4_7.1 (%T.67d)} [symbolic = %struct_type.a.loc7_23.2 (constants.%struct_type.a)] +// CHECK:STDOUT: %T.ref.loc7: %Destroy.type = name_ref T, %T.loc4_7.2 [symbolic = %T.loc4_7.1 (constants.%T.765)] +// CHECK:STDOUT: %T.as_type.loc7: type = facet_access_type %T.ref.loc7 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.140)] +// CHECK:STDOUT: %.loc7_22: type = converted %T.ref.loc7, %T.as_type.loc7 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.140)] +// CHECK:STDOUT: %struct_type.a.loc7_23.1: type = struct_type {.a: @F.%T.binding.as_type (%T.binding.as_type.140)} [symbolic = %struct_type.a.loc7_23.2 (constants.%struct_type.a)] // CHECK:STDOUT: } // CHECK:STDOUT: %v: ref @F.%struct_type.a.loc7_23.2 (%struct_type.a) = ref_binding v, %v.var // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %w.patt: @F.%pattern_type.loc8 (%pattern_type.d52) = ref_binding_pattern w [concrete] -// CHECK:STDOUT: %w.var_patt: @F.%pattern_type.loc8 (%pattern_type.d52) = var_pattern %w.patt [concrete] +// CHECK:STDOUT: %w.patt: @F.%pattern_type.loc8 (%pattern_type.e81) = ref_binding_pattern w [concrete] +// CHECK:STDOUT: %w.var_patt: @F.%pattern_type.loc8 (%pattern_type.e81) = var_pattern %w.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %w.var: ref @F.%array_type.loc8_27.2 (%array_type.742) = var %w.var_patt -// CHECK:STDOUT: %DefaultOrUnformed.facet.loc8_28.1: %DefaultOrUnformed.type = facet_value constants.%array_type.742, (constants.%DefaultOrUnformed.lookup_impl_witness.945) [symbolic = %DefaultOrUnformed.facet.loc8_28.2 (constants.%DefaultOrUnformed.facet.ad6)] -// CHECK:STDOUT: %.loc8_28.1: %DefaultOrUnformed.type = converted constants.%array_type.742, %DefaultOrUnformed.facet.loc8_28.1 [symbolic = %DefaultOrUnformed.facet.loc8_28.2 (constants.%DefaultOrUnformed.facet.ad6)] -// CHECK:STDOUT: %as_type.loc8: type = facet_access_type %.loc8_28.1 [symbolic = %array_type.loc8_27.2 (constants.%array_type.742)] -// CHECK:STDOUT: %.loc8_28.2: type = converted %.loc8_28.1, %as_type.loc8 [symbolic = %array_type.loc8_27.2 (constants.%array_type.742)] -// CHECK:STDOUT: %impl.elem0.loc8_28.1: @F.%.loc8_28.4 (%.544) = impl_witness_access constants.%DefaultOrUnformed.lookup_impl_witness.945, element0 [symbolic = %impl.elem0.loc8_28.2 (constants.%impl.elem0.97e)] -// CHECK:STDOUT: %specific_impl_fn.loc8_28.1: = specific_impl_function %impl.elem0.loc8_28.1, @DefaultOrUnformed.WithSelf.Op(constants.%DefaultOrUnformed.facet.ad6) [symbolic = %specific_impl_fn.loc8_28.2 (constants.%specific_impl_fn.261)] -// CHECK:STDOUT: %.loc8_3.1: ref @F.%array_type.loc8_27.2 (%array_type.742) = splice_block %w.var {} -// CHECK:STDOUT: %DefaultOrUnformed.WithSelf.Op.call.loc8: init @F.%array_type.loc8_27.2 (%array_type.742) to %.loc8_3.1 = call %specific_impl_fn.loc8_28.1() +// CHECK:STDOUT: %w.var: ref @F.%array_type.loc8_27.2 (%array_type.750) = var %w.var_patt +// CHECK:STDOUT: %DefaultOrUnformed.facet.loc8_28.1: %DefaultOrUnformed.type = facet_value constants.%array_type.750, (constants.%DefaultOrUnformed.lookup_impl_witness.b97) [symbolic = %DefaultOrUnformed.facet.loc8_28.2 (constants.%DefaultOrUnformed.facet.cc0)] +// CHECK:STDOUT: %.loc8_28.1: %DefaultOrUnformed.type = converted constants.%array_type.750, %DefaultOrUnformed.facet.loc8_28.1 [symbolic = %DefaultOrUnformed.facet.loc8_28.2 (constants.%DefaultOrUnformed.facet.cc0)] +// CHECK:STDOUT: %as_type.loc8: type = facet_access_type %.loc8_28.1 [symbolic = %array_type.loc8_27.2 (constants.%array_type.750)] +// CHECK:STDOUT: %.loc8_28.2: type = converted %.loc8_28.1, %as_type.loc8 [symbolic = %array_type.loc8_27.2 (constants.%array_type.750)] +// CHECK:STDOUT: %impl.elem0.loc8_28.1: @F.%.loc8_28.4 (%.86d) = impl_witness_access constants.%DefaultOrUnformed.lookup_impl_witness.b97, element0 [symbolic = %impl.elem0.loc8_28.2 (constants.%impl.elem0.0e2)] +// CHECK:STDOUT: %specific_impl_fn.loc8_28.1: = specific_impl_function %impl.elem0.loc8_28.1, @DefaultOrUnformed.WithSelf.Op(constants.%DefaultOrUnformed.facet.cc0) [symbolic = %specific_impl_fn.loc8_28.2 (constants.%specific_impl_fn.9f7)] +// CHECK:STDOUT: %.loc8_3.1: ref @F.%array_type.loc8_27.2 (%array_type.750) = splice_block %w.var {} +// CHECK:STDOUT: %DefaultOrUnformed.WithSelf.Op.call.loc8: init @F.%array_type.loc8_27.2 (%array_type.750) to %.loc8_3.1 = call %specific_impl_fn.loc8_28.1() // CHECK:STDOUT: assign %w.var, %DefaultOrUnformed.WithSelf.Op.call.loc8 -// CHECK:STDOUT: %.loc8_27: type = splice_block %array_type.loc8_27.1 [symbolic = %array_type.loc8_27.2 (constants.%array_type.742)] { -// CHECK:STDOUT: %T.ref.loc8: type = name_ref T, %T.loc4_7.2 [symbolic = %T.loc4_7.1 (constants.%T.67d)] +// CHECK:STDOUT: %.loc8_27: type = splice_block %array_type.loc8_27.1 [symbolic = %array_type.loc8_27.2 (constants.%array_type.750)] { +// CHECK:STDOUT: %T.ref.loc8: %Destroy.type = name_ref T, %T.loc4_7.2 [symbolic = %T.loc4_7.1 (constants.%T.765)] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete = constants.%int_5] -// CHECK:STDOUT: %array_type.loc8_27.1: type = array_type %int_5, %T.ref.loc8 [symbolic = %array_type.loc8_27.2 (constants.%array_type.742)] +// CHECK:STDOUT: %T.as_type.loc8: type = facet_access_type %T.ref.loc8 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.140)] +// CHECK:STDOUT: %.loc8_23: type = converted %T.ref.loc8, %T.as_type.loc8 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.140)] +// CHECK:STDOUT: %array_type.loc8_27.1: type = array_type %int_5, %.loc8_23 [symbolic = %array_type.loc8_27.2 (constants.%array_type.750)] // CHECK:STDOUT: } -// CHECK:STDOUT: %w: ref @F.%array_type.loc8_27.2 (%array_type.742) = ref_binding w, %w.var -// CHECK:STDOUT: %impl.elem0.loc8_3.1: @F.%.loc8_3.2 (%.950) = impl_witness_access constants.%Destroy.lookup_impl_witness.b29, element0 [symbolic = %impl.elem0.loc8_3.2 (constants.%impl.elem0.fa5)] +// CHECK:STDOUT: %w: ref @F.%array_type.loc8_27.2 (%array_type.750) = ref_binding w, %w.var +// CHECK:STDOUT: %impl.elem0.loc8_3.1: @F.%.loc8_3.2 (%.1f4) = impl_witness_access constants.%Destroy.lookup_impl_witness.b42, element0 [symbolic = %impl.elem0.loc8_3.2 (constants.%impl.elem0.dcc)] // CHECK:STDOUT: %bound_method.loc8_3.1: = bound_method %w.var, %impl.elem0.loc8_3.1 -// CHECK:STDOUT: %specific_impl_fn.loc8_3.1: = specific_impl_function %impl.elem0.loc8_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.ddc) [symbolic = %specific_impl_fn.loc8_3.2 (constants.%specific_impl_fn.ede)] +// CHECK:STDOUT: %specific_impl_fn.loc8_3.1: = specific_impl_function %impl.elem0.loc8_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.e98) [symbolic = %specific_impl_fn.loc8_3.2 (constants.%specific_impl_fn.ef1)] // 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 (%.511) = impl_witness_access constants.%Destroy.lookup_impl_witness.bed, element0 [symbolic = %impl.elem0.loc7_3.2 (constants.%impl.elem0.12c)] +// CHECK:STDOUT: %impl.elem0.loc7_3.1: @F.%.loc7_3 (%.b19) = impl_witness_access constants.%Destroy.lookup_impl_witness.2a6, element0 [symbolic = %impl.elem0.loc7_3.2 (constants.%impl.elem0.0c6)] // CHECK:STDOUT: %bound_method.loc7_3.1: = bound_method %v.var, %impl.elem0.loc7_3.1 -// CHECK:STDOUT: %specific_impl_fn.loc7_3.1: = specific_impl_function %impl.elem0.loc7_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.d21) [symbolic = %specific_impl_fn.loc7_3.2 (constants.%specific_impl_fn.c3a)] +// CHECK:STDOUT: %specific_impl_fn.loc7_3.1: = specific_impl_function %impl.elem0.loc7_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.884) [symbolic = %specific_impl_fn.loc7_3.2 (constants.%specific_impl_fn.d3c)] // 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.2 (%.f20) = impl_witness_access constants.%Destroy.lookup_impl_witness.7eb, element0 [symbolic = %impl.elem0.loc6_3.2 (constants.%impl.elem0.f5f)] +// CHECK:STDOUT: %impl.elem0.loc6_3.1: @F.%.loc6_3.2 (%.958) = impl_witness_access constants.%Destroy.lookup_impl_witness.7e1, element0 [symbolic = %impl.elem0.loc6_3.2 (constants.%impl.elem0.9bc)] // CHECK:STDOUT: %bound_method.loc6_3.1: = bound_method %u.var, %impl.elem0.loc6_3.1 -// CHECK:STDOUT: %specific_impl_fn.loc6_3.1: = specific_impl_function %impl.elem0.loc6_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.66d) [symbolic = %specific_impl_fn.loc6_3.2 (constants.%specific_impl_fn.87c)] +// CHECK:STDOUT: %specific_impl_fn.loc6_3.1: = specific_impl_function %impl.elem0.loc6_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.753) [symbolic = %specific_impl_fn.loc6_3.2 (constants.%specific_impl_fn.33d)] // 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: @@ -781,8 +791,8 @@ fn G(N:! i32) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(constants.%T.67d) { -// CHECK:STDOUT: %T.loc4_7.1 => constants.%T.67d +// CHECK:STDOUT: specific @F(constants.%T.765) { +// CHECK:STDOUT: %T.loc4_7.1 => constants.%T.765 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%N.5de) { diff --git a/toolchain/check/testdata/eval/call.carbon b/toolchain/check/testdata/eval/call.carbon index 97a2ebce9b2e..f1b7eaed8600 100644 --- a/toolchain/check/testdata/eval/call.carbon +++ b/toolchain/check/testdata/eval/call.carbon @@ -176,15 +176,20 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // 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: %tuple.type.189: type = tuple_type (%i32, %i32, %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] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %tuple.ee6: %tuple.type.189 = tuple_value (%int_1.5d2, %int_2.ef8, %int_3.822) [concrete] // CHECK:STDOUT: %.43f: ref %tuple.type.189 = temporary invalid, %tuple.ee6 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc8_5.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.43f, %Destroy.Op.651ba6.3 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G() { @@ -193,10 +198,21 @@ fn H() { // CHECK:STDOUT: %.loc8_5.1: ref %tuple.type.189 = temporary_storage // CHECK:STDOUT: %F.call: init %tuple.type.189 to %.loc8_5.1 = call %F.ref() [concrete = constants.%tuple.ee6] // CHECK:STDOUT: %.loc8_5.2: ref %tuple.type.189 = temporary %.loc8_5.1, %F.call [concrete = constants.%.43f] +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.43f) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %tuple.type.189) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_5.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_5.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_5.3(%self.param: ref %tuple.type.189) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- return_in_place_init.carbon // CHECK:STDOUT: @@ -210,12 +226,13 @@ fn H() { // CHECK:STDOUT: %pattern_type.b5a: type = pattern_type %tuple.type.189 [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: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %tuple.ee6: %tuple.type.189 = tuple_value (%int_1.5d2, %int_2.ef8, %int_3.822) [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc8_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G() { @@ -237,17 +254,28 @@ fn H() { // CHECK:STDOUT: %.loc8_31.3: type = converted %.loc8_31.2, constants.%tuple.type.189 [concrete = constants.%tuple.type.189] // CHECK:STDOUT: } // CHECK:STDOUT: %a: ref %tuple.type.189 = ref_binding a, %a.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %tuple.type.189) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.3(%self.param: ref %tuple.type.189) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_return_in_place_tuple.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // 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: %tuple.type.ff9: type = tuple_type (type, type, type) [concrete] // CHECK:STDOUT: %tuple.e64: %tuple.type.ff9 = tuple_value (%i32, %i32, %i32) [concrete] @@ -256,6 +284,7 @@ fn H() { // CHECK:STDOUT: %pattern_type.b5a: type = pattern_type %tuple.type.189 [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: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete] @@ -282,8 +311,12 @@ fn H() { // CHECK:STDOUT: %bound_method.fa7: = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %tuple.ee6: %tuple.type.189 = tuple_value (%int_1.5d2, %int_2.ef8, %int_3.822) [concrete] +// CHECK:STDOUT: %.43f: ref %tuple.type.189 = temporary invalid, %tuple.ee6 [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: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc17_32.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.43f, %Destroy.Op.651ba6.3 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -355,10 +388,21 @@ fn H() { // CHECK:STDOUT: assign %a.var, // CHECK:STDOUT: // CHECK:STDOUT: %a: ref = ref_binding a, [concrete = ] +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.43f) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %tuple.type.189) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc17_32.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc17_32.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc17_32.3(%self.param: ref %tuple.type.189) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- return_in_place_class.carbon // CHECK:STDOUT: @@ -376,6 +420,9 @@ fn H() { // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %.5ea: ref %C = temporary invalid, %C.val [concrete] // CHECK:STDOUT: %G.specific_fn: = specific_function %G, @G(%C.val) [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc13_7.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.5ea, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -408,8 +455,14 @@ 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.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.5ea) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc13_7.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc13_7.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// 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 389ad06bc70a..cb3d0b60123d 100644 --- a/toolchain/check/testdata/facet/call_combined_impl_witness.carbon +++ b/toolchain/check/testdata/facet/call_combined_impl_witness.carbon @@ -129,6 +129,9 @@ fn F() { // CHECK:STDOUT: %G.specific_fn: = specific_function %G, @G(%facet_value) [concrete] // CHECK:STDOUT: %.5ea: ref %C = temporary invalid, %C.val [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc45_8.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.5ea, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: %.171: type = fn_type_with_self_type %A.WithSelf.AA.type.6ff, %A.facet.34f [concrete] // CHECK:STDOUT: %.e04: type = fn_type_with_self_type %B.WithSelf.BB.type.f5e, %B.facet.e93 [concrete] // CHECK:STDOUT: } @@ -389,10 +392,16 @@ fn F() { // CHECK:STDOUT: %.loc45_8.2: ref %C = temporary %.loc45_6.2, %.loc45_8.1 [concrete = constants.%.5ea] // 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.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.5ea) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc45_8.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc45_8.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Empty.WithSelf(constants.%Self.61e) { // CHECK:STDOUT: !definition: 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 fdefe8af926c..5f9d0be94ec2 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 @@ -459,6 +459,9 @@ fn G() { // CHECK:STDOUT: %CallGenericMethod.specific_fn: = specific_function %CallGenericMethod, @CallGenericMethod(%GenericParam, %Generic.facet) [concrete] // CHECK:STDOUT: %.601: ref %GenericParam = temporary invalid, %GenericParam.val [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc18_38.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.601, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -612,10 +615,16 @@ fn G() { // CHECK:STDOUT: %.loc18_38.2: ref %GenericParam = temporary %.loc18_36.2, %.loc18_38.1 [concrete = constants.%.601] // 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.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.601) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %GenericParam) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc18_38.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc18_38.2(%self.param: ref %GenericParam) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Generic(constants.%Scalar) { // CHECK:STDOUT: %Scalar.loc4_25.1 => constants.%Scalar 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 a704db158f0f..d725d44bbf60 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 @@ -51,6 +51,9 @@ fn F() { // CHECK:STDOUT: %WalkAnimal.specific_fn: = specific_function %WalkAnimal, @WalkAnimal(%Animal.facet) [concrete] // CHECK:STDOUT: %.aec: ref %Goat = temporary invalid, %Goat.val [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc23_17.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.aec, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -153,10 +156,16 @@ fn F() { // CHECK:STDOUT: %.loc23_17.2: ref %Goat = temporary %.loc23_15.2, %.loc23_17.1 [concrete = constants.%.aec] // 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.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.aec) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Goat) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc23_17.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc23_17.2(%self.param: ref %Goat) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Animal.WithSelf(constants.%Self.c49) { // CHECK:STDOUT: !definition: 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 7b203b5e627a..98964e112607 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 @@ -161,6 +161,12 @@ fn B() { // CHECK:STDOUT: %.80a: ref %ImplsGeneric = temporary invalid, %ImplsGeneric.val [concrete] // CHECK:STDOUT: %.601: ref %GenericParam = temporary invalid, %GenericParam.val [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc20_44.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound.eb4: = bound_method %.601, %Destroy.Op.651ba6.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc20_24 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound.55e: = bound_method %.80a, %Destroy.Op.651ba6.3 [concrete] // CHECK:STDOUT: %complete_type.57a: = complete_type_witness %Generic.type.498 [concrete] // CHECK:STDOUT: %.fcf: type = fn_type_with_self_type %Generic.WithSelf.F.type.c86, %Generic.facet [concrete] // CHECK:STDOUT: } @@ -350,12 +356,22 @@ fn B() { // CHECK:STDOUT: %.loc20_44.2: ref %GenericParam = temporary %.loc20_42.2, %.loc20_44.1 [concrete = constants.%.601] // 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.Op.call.loc20_44: init %empty_tuple.type = call constants.%Destroy.Op.bound.eb4(constants.%.601) +// CHECK:STDOUT: %Destroy.Op.call.loc20_24: init %empty_tuple.type = call constants.%Destroy.Op.bound.55e(constants.%.80a) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc20_44(%self.param: ref %GenericParam) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc20_44.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc20_24(%self.param: ref %ImplsGeneric) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc20_44.2(%self.param: ref %GenericParam) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc20_24(%self.param: ref %ImplsGeneric) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Generic(constants.%Scalar) { // CHECK:STDOUT: %Scalar.loc4_25.1 => constants.%Scalar @@ -504,6 +520,9 @@ fn B() { // CHECK:STDOUT: %A.specific_fn: = specific_function %A, @A(%I.facet.0e1) [concrete] // CHECK:STDOUT: %.5ea: ref %C = temporary invalid, %C.val [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc12_8.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.5ea, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -654,10 +673,16 @@ fn B() { // CHECK:STDOUT: %.loc12_8.2: ref %C = temporary %.loc12_6.2, %.loc12_8.1 [concrete = constants.%.5ea] // 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.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.5ea) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc12_8.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc12_8.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%V, constants.%W) { // CHECK:STDOUT: %V.loc3_14.1 => constants.%V 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 cd28113c5ed4..972b5a183393 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 @@ -148,6 +148,9 @@ fn F[A:! J, B:! A](x: C(A, B)) { // CHECK:STDOUT: %Goat.val: %Goat = struct_value () [concrete] // CHECK:STDOUT: %.aec: ref %Goat = temporary invalid, %Goat.val [concrete] // CHECK:STDOUT: %.35f: type = fn_type_with_self_type %Eats.WithSelf.Eat.type.b4d, %Eats.facet [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc27_8.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.aec, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -207,10 +210,18 @@ fn F[A:! J, B:! A](x: C(A, B)) { // CHECK:STDOUT: %Eat.ref.loc27: %Eats.assoc_type = name_ref Eat, @Eats.WithSelf.%assoc0 [concrete = constants.%assoc0.083] // CHECK:STDOUT: %impl.elem0.loc27: %.35f = 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.Op.call.loc27: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.aec) +// CHECK:STDOUT: %Destroy.Op.call.loc26: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.aec) +// CHECK:STDOUT: %Destroy.Op.call.loc22: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.aec) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Goat) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc27_8.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc27_8.2(%self.param: ref %Goat) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- facet_access_type_converts_back_to_original_facet_value.carbon // 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 3ecb865b8864..c0627455980c 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 @@ -112,6 +112,12 @@ fn F() { // CHECK:STDOUT: %.aec: ref %Goat = temporary invalid, %Goat.val [concrete] // CHECK:STDOUT: %.cf4: ref %Grass = temporary invalid, %Grass.val [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc35_31.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound.11c: = bound_method %.cf4, %Destroy.Op.651ba6.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc35_19 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound.f91: = bound_method %.aec, %Destroy.Op.651ba6.3 [concrete] // CHECK:STDOUT: %Eats.type.8c2: type = facet_type <@Eats, @Eats(%Grass)> [concrete] // CHECK:STDOUT: %Eats.impl_witness.f54: = impl_witness @T.binding.as_type.as.Eats.impl.%Eats.impl_witness_table, @T.binding.as_type.as.Eats.impl(%Animal.facet, %Edible.facet) [concrete] // CHECK:STDOUT: %Self.ebd: %Eats.type.8c2 = symbolic_binding Self, 1 [symbolic] @@ -428,12 +434,22 @@ fn F() { // CHECK:STDOUT: %.loc35_31.2: ref %Grass = temporary %.loc35_29.2, %.loc35_31.1 [concrete = constants.%.cf4] // 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.Op.call.loc35_31: init %empty_tuple.type = call constants.%Destroy.Op.bound.11c(constants.%.cf4) +// CHECK:STDOUT: %Destroy.Op.call.loc35_19: init %empty_tuple.type = call constants.%Destroy.Op.bound.f91(constants.%.aec) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc35_31(%self.param: ref %Grass) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc35_31.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc35_19(%self.param: ref %Goat) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc35_31.2(%self.param: ref %Grass) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc35_19(%self.param: ref %Goat) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Edible.WithSelf(constants.%Self.461) { // CHECK:STDOUT: !definition: 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 75d76fb183e9..5113b193d694 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 @@ -56,6 +56,9 @@ fn F() { // CHECK:STDOUT: %HandleAnimal.specific_fn: = specific_function %HandleAnimal, @HandleAnimal(%Animal.facet) [concrete] // CHECK:STDOUT: %.aec: ref %Goat = temporary invalid, %Goat.val [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc25_19.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.aec, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: %FeedAnimal.specific_fn.cc5: = specific_function %FeedAnimal, @FeedAnimal(%Animal.facet) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -198,10 +201,16 @@ fn F() { // CHECK:STDOUT: %.loc25_19.2: ref %Goat = temporary %.loc25_17.2, %.loc25_19.1 [concrete = constants.%.aec] // 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.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.aec) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Goat) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc25_19.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc25_19.2(%self.param: ref %Goat) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Animal.WithSelf(constants.%Self.c49) { // CHECK:STDOUT: !definition: 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 a27afa7d212c..120c7cb21cb2 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 @@ -88,8 +88,8 @@ fn G(holds_to: HoldsType((RuntimeConvertTo, )), from:! RuntimeConvertFrom) { // CHECK:STDOUT: %RuntimeConvertFrom.as.ImplicitAs.impl.Convert.bound: = bound_method %from, %RuntimeConvertFrom.as.ImplicitAs.impl.Convert [symbolic] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc40_19.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -285,13 +285,18 @@ fn G(holds_to: HoldsType((RuntimeConvertTo, )), from:! RuntimeConvertFrom) { // CHECK:STDOUT: %.loc40_19.5: %empty_tuple.type = call %F.specific_fn(%holds_to.ref) // CHECK:STDOUT: %tuple.loc40: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc40_19.6: %empty_tuple.type = converted %.loc40_19.5, %tuple.loc40 [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc40_19.3, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc40_19.3, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc40_19.3) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %RuntimeConvertTo) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc40_19.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc40_19.2(%self.param: ref %RuntimeConvertTo) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HoldsType(constants.%T) { // CHECK:STDOUT: %T.loc17_18.1 => constants.%T diff --git a/toolchain/check/testdata/for/actual.carbon b/toolchain/check/testdata/for/actual.carbon index c1b6fbd0c8aa..e1f2fab85ae1 100644 --- a/toolchain/check/testdata/for/actual.carbon +++ b/toolchain/check/testdata/for/actual.carbon @@ -908,8 +908,8 @@ fn Read(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: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc5_3.4 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1017,7 +1017,7 @@ fn Read(y:! Core.IntLiteral()) { // CHECK:STDOUT: %IntRange: type = class_type @IntRange, @IntRange(constants.%int_32) [concrete = constants.%IntRange.a89] // CHECK:STDOUT: } // CHECK:STDOUT: %x: ref %IntRange.a89 = ref_binding x, %x.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %x.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %x.var, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%x.var) // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -1048,7 +1048,22 @@ fn Read(y:! Core.IntLiteral()) { // CHECK:STDOUT: // CHECK:STDOUT: fn @Range [from "lib.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %IntRange.a89) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc5_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc5_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc5_3.3(%self.param: ref %struct_type.start.end.0fe) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc5_3.4(%self.param: ref %IntRange.a89) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Read(constants.%y) { // CHECK:STDOUT: %y.loc4_10.1 => constants.%y diff --git a/toolchain/check/testdata/for/basic.carbon b/toolchain/check/testdata/for/basic.carbon index 635034eeb468..1196e529b560 100644 --- a/toolchain/check/testdata/for/basic.carbon +++ b/toolchain/check/testdata/for/basic.carbon @@ -86,6 +86,7 @@ fn Run() { // CHECK:STDOUT: %Optional.HasValue.4fc: %Optional.HasValue.type.4db = struct_value () [concrete] // CHECK:STDOUT: %Optional.Get.type.68c: type = fn_type @Optional.Get, @Optional(%Copy.facet) [concrete] // CHECK:STDOUT: %Optional.Get.756: %Optional.Get.type.68c = struct_value () [concrete] +// CHECK:STDOUT: %struct_type.has_value.value.da2: type = struct_type {.has_value: bool, .value: %empty_tuple.type} [concrete] // CHECK:STDOUT: %Body.type: type = fn_type @Body [concrete] // CHECK:STDOUT: %Body: %Body.type = struct_value () [concrete] // CHECK:STDOUT: %AfterLoop.type: type = fn_type @AfterLoop [concrete] @@ -102,8 +103,11 @@ fn Run() { // CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.756, @Optional.Get(%Copy.facet) [concrete] // CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc18_35.1 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc18_35.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc18_35.4 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.6: type = fn_type @Destroy.Op.loc18_20.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.6: %Destroy.Op.type.bae255.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.401, %Destroy.Op.651ba6.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: } @@ -181,16 +185,32 @@ fn Run() { // CHECK:STDOUT: %AfterLoop.call: init %empty_tuple.type = call %AfterLoop.ref() // CHECK:STDOUT: %Destroy.Op.bound.loc18_35.1: = bound_method %.loc18_35.10, constants.%Destroy.Op.651ba6.1 // CHECK:STDOUT: %Destroy.Op.call.loc18_35.1: init %empty_tuple.type = call %Destroy.Op.bound.loc18_35.1(%.loc18_35.10) -// CHECK:STDOUT: %Destroy.Op.bound.loc18_35.2: = bound_method %.loc18_35.2, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc18_35.2: = bound_method %.loc18_35.2, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call.loc18_35.2: init %empty_tuple.type = call %Destroy.Op.bound.loc18_35.2(%.loc18_35.2) // CHECK:STDOUT: %Destroy.Op.bound.loc18_35.3: = bound_method %var, constants.%Destroy.Op.651ba6.1 // CHECK:STDOUT: %Destroy.Op.call.loc18_35.3: init %empty_tuple.type = call %Destroy.Op.bound.loc18_35.3(%var) +// CHECK:STDOUT: %Destroy.Op.call.loc18_20: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.401) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.Op.loc18_35.1(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc18_35.2(%self.param: ref %Optional.311) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc18_35.2(%self.param: ref bool) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc18_20(%self.param: ref %TrivialRange) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.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.Op.loc18_35.4(%self.param: ref %Optional.311) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc18_20.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc18_20.2(%self.param: ref %TrivialRange) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/for/pattern.carbon b/toolchain/check/testdata/for/pattern.carbon index d5a16880f830..7c84468401e5 100644 --- a/toolchain/check/testdata/for/pattern.carbon +++ b/toolchain/check/testdata/for/pattern.carbon @@ -165,16 +165,17 @@ fn Run() { // CHECK:STDOUT: %Optional.HasValue.61c: %Optional.HasValue.type.26b = struct_value () [concrete] // CHECK:STDOUT: %Optional.Get.type.7ce: type = fn_type @Optional.Get, @Optional(%Copy.facet) [concrete] // CHECK:STDOUT: %Optional.Get.bce: %Optional.Get.type.7ce = struct_value () [concrete] +// CHECK:STDOUT: %struct_type.has_value.value.2fe: type = struct_type {.has_value: bool, .value: %C} [concrete] // CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.61c, @Optional.HasValue(%Copy.facet) [concrete] // CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.bce, @Optional.Get(%Copy.facet) [concrete] // CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc10_36.1 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc10_36.2 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc10_36.3 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc10_35 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.5: type = fn_type @Destroy.Op.loc10_36.5 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.5: %Destroy.Op.type.bae255.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.6: type = fn_type @Destroy.Op.loc10_35 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.6: %Destroy.Op.type.bae255.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: } @@ -260,24 +261,40 @@ fn Run() { // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %Destroy.Op.bound.loc10_36.1: = bound_method %.loc10_36.10, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.bound.loc10_36.1: = bound_method %.loc10_36.10, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc10_36.1: init %empty_tuple.type = call %Destroy.Op.bound.loc10_36.1(%.loc10_36.10) -// CHECK:STDOUT: %Destroy.Op.bound.loc10_36.2: = bound_method %.loc10_36.2, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc10_36.2: = bound_method %.loc10_36.2, constants.%Destroy.Op.651ba6.5 // CHECK:STDOUT: %Destroy.Op.call.loc10_36.2: init %empty_tuple.type = call %Destroy.Op.bound.loc10_36.2(%.loc10_36.2) -// CHECK:STDOUT: %Destroy.Op.bound.loc10_36.3: = bound_method %var, constants.%Destroy.Op.651ba6.3 +// CHECK:STDOUT: %Destroy.Op.bound.loc10_36.3: = bound_method %var, constants.%Destroy.Op.651ba6.1 // CHECK:STDOUT: %Destroy.Op.call.loc10_36.3: init %empty_tuple.type = call %Destroy.Op.bound.loc10_36.3(%var) -// CHECK:STDOUT: %Destroy.Op.bound.loc10_35: = bound_method %.loc10_35.2, constants.%Destroy.Op.651ba6.4 +// CHECK:STDOUT: %Destroy.Op.bound.loc10_35: = bound_method %.loc10_35.2, constants.%Destroy.Op.651ba6.6 // CHECK:STDOUT: %Destroy.Op.call.loc10_35: init %empty_tuple.type = call %Destroy.Op.bound.loc10_35(%.loc10_35.2) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc10_36.1(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc10_36.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc10_36.2(%self.param: ref %Optional.e59) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc10_36.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc10_36.3(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc10_36.3(%self.param: ref bool) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc10_35(%self.param: ref %EmptyRange.77b) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc10_36.4(%self.param: ref %struct_type.has_value.value.2fe) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_36.5(%self.param: ref %Optional.e59) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_35(%self.param: ref %EmptyRange.77b) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- var.carbon // CHECK:STDOUT: @@ -328,16 +345,17 @@ fn Run() { // CHECK:STDOUT: %Optional.HasValue.61c: %Optional.HasValue.type.26b = struct_value () [concrete] // CHECK:STDOUT: %Optional.Get.type.7ce: type = fn_type @Optional.Get, @Optional(%Copy.facet) [concrete] // CHECK:STDOUT: %Optional.Get.bce: %Optional.Get.type.7ce = struct_value () [concrete] +// CHECK:STDOUT: %struct_type.has_value.value.2fe: type = struct_type {.has_value: bool, .value: %C} [concrete] // CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.61c, @Optional.HasValue(%Copy.facet) [concrete] // CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.bce, @Optional.Get(%Copy.facet) [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc10_8 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc10_8.1 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc10_40.1 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc10_8.2 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc10_40.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc10_39 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.5: type = fn_type @Destroy.Op.loc10_40.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.5: %Destroy.Op.type.bae255.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.6: type = fn_type @Destroy.Op.loc10_39 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.6: %Destroy.Op.type.bae255.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: } @@ -425,24 +443,40 @@ fn Run() { // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %Destroy.Op.bound.loc10_8: = bound_method %c.var, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.bound.loc10_8: = bound_method %c.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc10_8: init %empty_tuple.type = call %Destroy.Op.bound.loc10_8(%c.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc10_40.1: = bound_method %.loc10_40.2, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc10_40.1: = bound_method %.loc10_40.2, constants.%Destroy.Op.651ba6.5 // CHECK:STDOUT: %Destroy.Op.call.loc10_40.1: init %empty_tuple.type = call %Destroy.Op.bound.loc10_40.1(%.loc10_40.2) -// CHECK:STDOUT: %Destroy.Op.bound.loc10_40.2: = bound_method %var, constants.%Destroy.Op.651ba6.3 +// CHECK:STDOUT: %Destroy.Op.bound.loc10_40.2: = bound_method %var, constants.%Destroy.Op.651ba6.1 // CHECK:STDOUT: %Destroy.Op.call.loc10_40.2: init %empty_tuple.type = call %Destroy.Op.bound.loc10_40.2(%var) -// CHECK:STDOUT: %Destroy.Op.bound.loc10_39: = bound_method %.loc10_39.2, constants.%Destroy.Op.651ba6.4 +// CHECK:STDOUT: %Destroy.Op.bound.loc10_39: = bound_method %.loc10_39.2, constants.%Destroy.Op.651ba6.6 // CHECK:STDOUT: %Destroy.Op.call.loc10_39: init %empty_tuple.type = call %Destroy.Op.bound.loc10_39(%.loc10_39.2) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc10_8(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc10_8.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc10_40.1(%self.param: ref %Optional.e59) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc10_8.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc10_40.2(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc10_40.1(%self.param: ref bool) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc10_39(%self.param: ref %EmptyRange.77b) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc10_40.2(%self.param: ref %struct_type.has_value.value.2fe) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_40.3(%self.param: ref %Optional.e59) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_39(%self.param: ref %EmptyRange.77b) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- tuple.carbon // CHECK:STDOUT: @@ -500,16 +534,17 @@ fn Run() { // CHECK:STDOUT: %Optional.HasValue.960: %Optional.HasValue.type.101 = struct_value () [concrete] // CHECK:STDOUT: %Optional.Get.type.758: type = fn_type @Optional.Get, @Optional(%Copy.facet.3ce) [concrete] // CHECK:STDOUT: %Optional.Get.2ff: %Optional.Get.type.758 = struct_value () [concrete] +// 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.960, @Optional.HasValue(%Copy.facet.3ce) [concrete] // CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.2ff, @Optional.Get(%Copy.facet.3ce) [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc10_61.1 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc10_61.2 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc10_61.3 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc10_60 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc10_61.4 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.5: type = fn_type @Destroy.Op.loc10_61.5 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.5: %Destroy.Op.type.bae255.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.6: type = fn_type @Destroy.Op.loc10_60 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.6: %Destroy.Op.type.bae255.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: } @@ -606,24 +641,40 @@ fn Run() { // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %Destroy.Op.bound.loc10_61.1: = bound_method %.loc10_61.10, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.bound.loc10_61.1: = bound_method %.loc10_61.10, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc10_61.1: init %empty_tuple.type = call %Destroy.Op.bound.loc10_61.1(%.loc10_61.10) -// CHECK:STDOUT: %Destroy.Op.bound.loc10_61.2: = bound_method %.loc10_61.2, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc10_61.2: = bound_method %.loc10_61.2, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call.loc10_61.2: init %empty_tuple.type = call %Destroy.Op.bound.loc10_61.2(%.loc10_61.2) -// CHECK:STDOUT: %Destroy.Op.bound.loc10_61.3: = bound_method %var, constants.%Destroy.Op.651ba6.3 +// CHECK:STDOUT: %Destroy.Op.bound.loc10_61.3: = bound_method %var, constants.%Destroy.Op.651ba6.5 // CHECK:STDOUT: %Destroy.Op.call.loc10_61.3: init %empty_tuple.type = call %Destroy.Op.bound.loc10_61.3(%var) -// CHECK:STDOUT: %Destroy.Op.bound.loc10_60: = bound_method %.loc10_60.2, constants.%Destroy.Op.651ba6.4 +// CHECK:STDOUT: %Destroy.Op.bound.loc10_60: = bound_method %.loc10_60.2, constants.%Destroy.Op.651ba6.6 // CHECK:STDOUT: %Destroy.Op.call.loc10_60: init %empty_tuple.type = call %Destroy.Op.bound.loc10_60(%.loc10_60.2) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc10_61.1(%self.param: ref %tuple.type.784) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc10_61.1(%self.param: ref bool) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc10_61.2(%self.param: ref %Optional.678) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc10_61.2(%self.param: ref %tuple.type.784) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc10_61.3(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.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.Op.loc10_60(%self.param: ref %EmptyRange.717) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc10_61.4(%self.param: ref %Optional.678) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_61.5(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_60(%self.param: ref %EmptyRange.717) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- tuple_class.carbon // CHECK:STDOUT: @@ -682,16 +733,17 @@ fn Run() { // CHECK:STDOUT: %Optional.HasValue.de9: %Optional.HasValue.type.6de = struct_value () [concrete] // CHECK:STDOUT: %Optional.Get.type.925: type = fn_type @Optional.Get, @Optional(%Copy.facet.ad0) [concrete] // CHECK:STDOUT: %Optional.Get.a9e: %Optional.Get.type.925 = struct_value () [concrete] +// CHECK:STDOUT: %struct_type.has_value.value.a96: type = struct_type {.has_value: bool, .value: %tuple.type.d23} [concrete] // CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.de9, @Optional.HasValue(%Copy.facet.ad0) [concrete] // CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.a9e, @Optional.Get(%Copy.facet.ad0) [concrete] // CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc10_49.1 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc10_49.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc10_49.3 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc10_48 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.6: type = fn_type @Destroy.Op.loc10_49.6 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.6: %Destroy.Op.type.bae255.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.7: type = fn_type @Destroy.Op.loc10_48 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.7: %Destroy.Op.type.bae255.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: } @@ -789,22 +841,43 @@ fn Run() { // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %Destroy.Op.bound.loc10_49.1: = bound_method %.loc10_49.10, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.bound.loc10_49.1: = bound_method %.loc10_49.10, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call.loc10_49.1: init %empty_tuple.type = call %Destroy.Op.bound.loc10_49.1(%.loc10_49.10) -// CHECK:STDOUT: %Destroy.Op.bound.loc10_49.2: = bound_method %.loc10_49.2, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc10_49.2: = bound_method %.loc10_49.2, constants.%Destroy.Op.651ba6.6 // CHECK:STDOUT: %Destroy.Op.call.loc10_49.2: init %empty_tuple.type = call %Destroy.Op.bound.loc10_49.2(%.loc10_49.2) -// CHECK:STDOUT: %Destroy.Op.bound.loc10_49.3: = bound_method %var, constants.%Destroy.Op.651ba6.3 +// CHECK:STDOUT: %Destroy.Op.bound.loc10_49.3: = bound_method %var, constants.%Destroy.Op.651ba6.1 // CHECK:STDOUT: %Destroy.Op.call.loc10_49.3: init %empty_tuple.type = call %Destroy.Op.bound.loc10_49.3(%var) -// CHECK:STDOUT: %Destroy.Op.bound.loc10_48: = bound_method %.loc10_48.2, constants.%Destroy.Op.651ba6.4 +// CHECK:STDOUT: %Destroy.Op.bound.loc10_48: = bound_method %.loc10_48.2, constants.%Destroy.Op.651ba6.7 // CHECK:STDOUT: %Destroy.Op.call.loc10_48: init %empty_tuple.type = call %Destroy.Op.bound.loc10_48(%.loc10_48.2) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc10_49.1(%self.param: ref %tuple.type.d23) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc10_49.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc10_49.2(%self.param: ref %Optional.2f4) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc10_49.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc10_49.3(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc10_49.3(%self.param: ref %tuple.type.d23) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc10_48(%self.param: ref %EmptyRange.849) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc10_49.4(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_49.5(%self.param: ref %struct_type.has_value.value.a96) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_49.6(%self.param: ref %Optional.2f4) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_48(%self.param: ref %EmptyRange.849) { +// CHECK:STDOUT: !entry: +// 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 f75d80b8af6f..0222f5657a5f 100644 --- a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon +++ b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon @@ -60,10 +60,11 @@ fn Run() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc25_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -127,10 +128,15 @@ fn Run() { // CHECK:STDOUT: assign %x.var, // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %x: ref %i32 = ref_binding x, %x.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %x.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %x.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%x.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc25_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc25_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// 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 d88457fc9fe7..038eed4afdbc 100644 --- a/toolchain/check/testdata/function/call/form.carbon +++ b/toolchain/check/testdata/function/call/form.carbon @@ -278,6 +278,7 @@ fn F(Form:! Core.Form()) ->? Form; // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %ImplicitAs.type.e8c: 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.4e6: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic] @@ -293,6 +294,9 @@ fn F(Form:! Core.Form()) ->? Form; // CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %.eea: ref %i32 = temporary invalid, %int_0.6a9 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc4_7.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.eea, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -329,10 +333,16 @@ fn F(Form:! Core.Form()) ->? Form; // CHECK:STDOUT: %.loc4_7.2: init %i32 = converted %int_0, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc4_7.3: ref %i32 = temporary %.loc4_7.1, %.loc4_7.2 [concrete = constants.%.eea] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.ref(%.loc4_7.3) +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.eea) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc4_7.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc4_7.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- val_form_param.carbon // CHECK:STDOUT: @@ -467,8 +477,9 @@ fn F(Form:! Core.Form()) ->? Form; // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc9_7.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -497,12 +508,17 @@ fn F(Form:! Core.Form()) ->? Form; // CHECK:STDOUT: assign %_.var, %F.call // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %_: ref %i32 = ref_binding _, %_.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %_.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %_.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%_.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc9_7.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_7.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- val_return_form.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/call/i32.carbon b/toolchain/check/testdata/function/call/i32.carbon index a27cd6a7cddd..244243cea5f3 100644 --- a/toolchain/check/testdata/function/call/i32.carbon +++ b/toolchain/check/testdata/function/call/i32.carbon @@ -33,6 +33,7 @@ fn Main() { // CHECK:STDOUT: %.ff5: Core.Form = init_form %i32 [concrete] // CHECK:STDOUT: %Echo.type: type = fn_type @Echo [concrete] // CHECK:STDOUT: %Echo: %Echo.type = struct_value () [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.824: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] // CHECK:STDOUT: %Int.as.Copy.impl.Op.9b9: %Int.as.Copy.impl.Op.type.824 = struct_value () [symbolic] @@ -63,8 +64,8 @@ fn Main() { // CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc20_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -141,10 +142,15 @@ fn Main() { // CHECK:STDOUT: assign %b.var, %Echo.call // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %b: ref %i32 = ref_binding b, %b.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %b.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %b.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%b.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc20_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc20_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// 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 55b1a1120336..5f2356bcc170 100644 --- a/toolchain/check/testdata/function/call/more_param_ir.carbon +++ b/toolchain/check/testdata/function/call/more_param_ir.carbon @@ -31,6 +31,7 @@ fn Main() { // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [concrete] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %Main.type: type = fn_type @Main [concrete] // CHECK:STDOUT: %Main: %Main.type = struct_value () [concrete] // CHECK:STDOUT: %tuple.type.85c: type = tuple_type (type) [concrete] @@ -63,8 +64,8 @@ fn Main() { // CHECK:STDOUT: %bound_method.bc2: = bound_method %int_6.462, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_6.e56: %i32 = int_value 6 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc18_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -148,10 +149,20 @@ fn Main() { // CHECK:STDOUT: %.loc20_12.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc20 [concrete = constants.%int_6.e56] // CHECK:STDOUT: %.loc20_12.2: %i32 = converted %int_6, %.loc20_12.1 [concrete = constants.%int_6.e56] // CHECK:STDOUT: %Foo.call: init %empty_tuple.type = call %Foo.ref(%.loc20_8, %.loc20_12.2) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %x.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %x.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%x.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %tuple.type.a1c) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc18_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc18_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc18_3.3(%self.param: ref %tuple.type.a1c) { +// CHECK:STDOUT: !entry: +// 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 a43c6591df04..94cda2ac3290 100644 --- a/toolchain/check/testdata/function/call/ref.carbon +++ b/toolchain/check/testdata/function/call/ref.carbon @@ -112,6 +112,7 @@ 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: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %ImplicitAs.type.e8c: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete] // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic] @@ -127,8 +128,8 @@ fn G() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5, @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.6a9: %i32 = int_value 0 [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -171,12 +172,17 @@ fn G() { // 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(%.loc10) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %y.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %y.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%y.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- class.carbon // CHECK:STDOUT: @@ -196,8 +202,8 @@ fn G() { // CHECK:STDOUT: %T.as.DefaultOrUnformed.impl.Op.ae1: %T.as.DefaultOrUnformed.impl.Op.type.6c6 = struct_value () [symbolic] // CHECK:STDOUT: %DefaultOrUnformed.impl_witness.6fd: = impl_witness imports.%DefaultOrUnformed.impl_witness_table.349, @T.as.DefaultOrUnformed.impl(%C) [concrete] // CHECK:STDOUT: %DefaultOrUnformed.facet: %DefaultOrUnformed.type = facet_value %C, (%DefaultOrUnformed.impl_witness.6fd) [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc10_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -250,10 +256,15 @@ fn G() { // 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.Op.bound: = bound_method %c.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %c.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%c.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc10_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_3.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// 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 67fe5a2255a4..806a896b9dad 100644 --- a/toolchain/check/testdata/function/declaration/fail_import_incomplete_return.carbon +++ b/toolchain/check/testdata/function/declaration/fail_import_incomplete_return.carbon @@ -217,8 +217,8 @@ fn CallFAndGIncomplete() { // CHECK:STDOUT: %ReturnDUsed.type: type = fn_type @ReturnDUsed [concrete] // CHECK:STDOUT: %ReturnDUsed: %ReturnDUsed.type = struct_value () [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc34_15.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -279,9 +279,9 @@ fn CallFAndGIncomplete() { // 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.Op.bound.loc34: = bound_method %.loc34_15.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc34: = bound_method %.loc34_15.2, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc34: init %empty_tuple.type = call %Destroy.Op.bound.loc34(%.loc34_15.2) -// CHECK:STDOUT: %Destroy.Op.bound.loc33: = bound_method %.loc33_17.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc33: = bound_method %.loc33_17.2, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc33: init %empty_tuple.type = call %Destroy.Op.bound.loc33(%.loc33_17.2) // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -294,5 +294,10 @@ fn CallFAndGIncomplete() { // CHECK:STDOUT: // CHECK:STDOUT: fn @ReturnDUsed [from "fail_incomplete_return.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %D) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc34_15.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc34_15.2(%self.param: ref %D) { +// CHECK:STDOUT: !entry: +// 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 a91ee6335b45..c2a90f4902c5 100644 --- a/toolchain/check/testdata/function/generic/deduce.carbon +++ b/toolchain/check/testdata/function/generic/deduce.carbon @@ -546,6 +546,7 @@ fn F() { // CHECK:STDOUT: %.cb6: Core.Form = init_form %ptr.e8f [symbolic] // CHECK:STDOUT: %pattern_type.4f4: type = pattern_type %ptr.e8f [symbolic] // CHECK:STDOUT: %ExplicitAndAlsoDeduced.type: type = fn_type @ExplicitAndAlsoDeduced [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %ExplicitAndAlsoDeduced: %ExplicitAndAlsoDeduced.type = struct_value () [concrete] // CHECK:STDOUT: %require_complete.944: = require_complete_type %T [symbolic] // CHECK:STDOUT: %require_complete.ef1: = require_complete_type %ptr.e8f [symbolic] @@ -561,6 +562,9 @@ fn F() { // CHECK:STDOUT: %A.val: %A = struct_value () [concrete] // CHECK:STDOUT: %.33f: ref %A = temporary invalid, %A.val [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc11_37.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.33f, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: %complete_type.8a0: = complete_type_witness %ptr.643 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -658,10 +662,16 @@ fn F() { // CHECK:STDOUT: %.loc11_37.5: ref %A = temporary %.loc11_37.2, %.loc11_37.4 [concrete = constants.%.33f] // CHECK:STDOUT: %.loc11_37.6: %A = acquire_value %.loc11_37.5 [concrete = constants.%A.val] // CHECK:STDOUT: %ExplicitAndAlsoDeduced.call: init %ptr.643 = call %ExplicitAndAlsoDeduced.specific_fn(%.loc11_37.6) +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.33f) // CHECK:STDOUT: return %ExplicitAndAlsoDeduced.call // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %A) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc11_37.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc11_37.2(%self.param: ref %A) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ExplicitAndAlsoDeduced(constants.%T) { // CHECK:STDOUT: %T.loc6_28.1 => constants.%T diff --git a/toolchain/check/testdata/function/generic/resolve_used.carbon b/toolchain/check/testdata/function/generic/resolve_used.carbon index 8cc5c43cdf5d..ac68c0811afa 100644 --- a/toolchain/check/testdata/function/generic/resolve_used.carbon +++ b/toolchain/check/testdata/function/generic/resolve_used.carbon @@ -67,11 +67,11 @@ fn CallNegative() { // CHECK:STDOUT: %impl.elem0.12f: %.ca4 = impl_witness_access %DefaultOrUnformed.lookup_impl_witness, element0 [symbolic] // CHECK:STDOUT: %specific_impl_fn.f0d: = specific_impl_function %impl.elem0.12f, @DefaultOrUnformed.WithSelf.Op(%DefaultOrUnformed.facet.c82) [symbolic] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Int, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.facet.1c0: %Destroy.type = facet_value %Int, (%Destroy.lookup_impl_witness) [symbolic] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.93c: = lookup_impl_witness %Int, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.facet.1c0: %Destroy.type = facet_value %Int, (%Destroy.lookup_impl_witness.93c) [symbolic] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.297: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.1c0) [symbolic] // CHECK:STDOUT: %.e63: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.297, %Destroy.facet.1c0 [symbolic] -// CHECK:STDOUT: %impl.elem0.602: %.e63 = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic] +// CHECK:STDOUT: %impl.elem0.602: %.e63 = impl_witness_access %Destroy.lookup_impl_witness.93c, element0 [symbolic] // CHECK:STDOUT: %specific_impl_fn.d65: = specific_impl_function %impl.elem0.602, @Destroy.WithSelf.Op(%Destroy.facet.1c0) [symbolic] // CHECK:STDOUT: %CallNegative.type: type = fn_type @CallNegative [concrete] // CHECK:STDOUT: %CallNegative: %CallNegative.type = struct_value () [concrete] @@ -149,7 +149,7 @@ fn CallNegative() { // CHECK:STDOUT: %.loc9_28.4: type = fn_type_with_self_type %DefaultOrUnformed.WithSelf.Op.type, %DefaultOrUnformed.facet.loc9_28.2 [symbolic = %.loc9_28.4 (constants.%.ca4)] // CHECK:STDOUT: %impl.elem0.loc9_28.2: @ErrorIfNIsZero.%.loc9_28.4 (%.ca4) = impl_witness_access %DefaultOrUnformed.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_28.2 (constants.%impl.elem0.12f)] // 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.f0d)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Int.loc9_27.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Int.loc9_27.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.93c)] // CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %Int.loc9_27.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.1c0)] // CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.297)] // CHECK:STDOUT: %.loc9_3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet [symbolic = %.loc9_3 (constants.%.e63)] @@ -178,7 +178,7 @@ fn CallNegative() { // CHECK:STDOUT: %Int.loc9_27.1: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc9_27.2 (constants.%Int)] // CHECK:STDOUT: } // CHECK:STDOUT: %v: ref @ErrorIfNIsZero.%Int.loc9_27.2 (%Int) = ref_binding v, %v.var -// CHECK:STDOUT: %impl.elem0.loc9_3.1: @ErrorIfNIsZero.%.loc9_3 (%.e63) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_3.2 (constants.%impl.elem0.602)] +// CHECK:STDOUT: %impl.elem0.loc9_3.1: @ErrorIfNIsZero.%.loc9_3 (%.e63) = impl_witness_access constants.%Destroy.lookup_impl_witness.93c, element0 [symbolic = %impl.elem0.loc9_3.2 (constants.%impl.elem0.602)] // CHECK:STDOUT: %bound_method.loc9_3.1: = bound_method %v.var, %impl.elem0.loc9_3.1 // CHECK:STDOUT: %specific_impl_fn.loc9_3.1: = specific_impl_function %impl.elem0.loc9_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.1c0) [symbolic = %specific_impl_fn.loc9_3.2 (constants.%specific_impl_fn.d65)] // CHECK:STDOUT: %bound_method.loc9_3.2: = bound_method %v.var, %specific_impl_fn.loc9_3.1 @@ -196,7 +196,10 @@ fn CallNegative() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i0) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i0) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ErrorIfNIsZero(constants.%N) { // CHECK:STDOUT: %N.loc4_20.1 => constants.%N diff --git a/toolchain/check/testdata/function/generic/return_slot.carbon b/toolchain/check/testdata/function/generic/return_slot.carbon index dfeb4751fd10..e7ca877256af 100644 --- a/toolchain/check/testdata/function/generic/return_slot.carbon +++ b/toolchain/check/testdata/function/generic/return_slot.carbon @@ -77,12 +77,12 @@ fn G() { // CHECK:STDOUT: %.a69: Core.Form = init_form %C [concrete] // CHECK:STDOUT: %Wrap.Make.specific_fn.cb9: = specific_function %Wrap.Make.62a, @Wrap.Make(%C) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc24 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc23 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc24_3.2 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc22 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.5: type = fn_type @Destroy.Op.loc24_3.5 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.5: %Destroy.Op.type.bae255.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.6: type = fn_type @Destroy.Op.loc23 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.6: %Destroy.Op.type.bae255.6 = struct_value () [concrete] // CHECK:STDOUT: %complete_type.782: = complete_type_witness %empty_tuple.type [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -232,21 +232,39 @@ fn G() { // CHECK:STDOUT: assign %c.var, %Wrap.Make.call.loc24 // CHECK:STDOUT: %C.ref.loc24_17: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %c: ref %C = ref_binding c, %c.var -// CHECK:STDOUT: %Destroy.Op.bound.loc24: = bound_method %c.var, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.bound.loc24: = bound_method %c.var, constants.%Destroy.Op.651ba6.5 // CHECK:STDOUT: %Destroy.Op.call.loc24: init %empty_tuple.type = call %Destroy.Op.bound.loc24(%c.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc23: = bound_method %b.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc23: = bound_method %b.var, constants.%Destroy.Op.651ba6.6 // CHECK:STDOUT: %Destroy.Op.call.loc23: init %empty_tuple.type = call %Destroy.Op.bound.loc23(%b.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc22: = bound_method %a.var, constants.%Destroy.Op.651ba6.3 +// CHECK:STDOUT: %Destroy.Op.bound.loc22: = bound_method %a.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc22: init %empty_tuple.type = call %Destroy.Op.bound.loc22(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc24(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc24_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc24_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc24_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc24_3.4(%self.param: ref %struct_type.arr.5f2) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc24_3.5(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.Op.loc23(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc22(%self.param: ref %i32) = "no_op"; -// CHECK:STDOUT: // CHECK:STDOUT: specific @Wrap(constants.%T) { // CHECK:STDOUT: %T.loc15_13.1 => constants.%T // CHECK:STDOUT: diff --git a/toolchain/check/testdata/generic/local.carbon b/toolchain/check/testdata/generic/local.carbon index 67520cbbe2bc..d47a5c85ff58 100644 --- a/toolchain/check/testdata/generic/local.carbon +++ b/toolchain/check/testdata/generic/local.carbon @@ -96,8 +96,8 @@ class C(C:! type) { // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %C.val: %C.d45 = struct_value (%int_1.5d2) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc8_3.4 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -182,12 +182,27 @@ class C(C:! type) { // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%i32) [concrete = constants.%C.d45] // CHECK:STDOUT: } // CHECK:STDOUT: %v: ref %C.d45 = ref_binding v, %v.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %v.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %v.var, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%v.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %C.d45) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.3(%self.param: ref %struct_type.x.ed6) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.4(%self.param: ref %C.d45) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%T) { // CHECK:STDOUT: %T.loc5_12.1 => constants.%T diff --git a/toolchain/check/testdata/generic/template/unimplemented.carbon b/toolchain/check/testdata/generic/template/unimplemented.carbon index 0374b39d2d44..c8777b68589c 100644 --- a/toolchain/check/testdata/generic/template/unimplemented.carbon +++ b/toolchain/check/testdata/generic/template/unimplemented.carbon @@ -269,9 +269,10 @@ fn F[template T:! Core.Destroy](x: T) { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc22_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %T.765, @Destroy [template] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.cb2e47.2: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%T.765) [template] // CHECK:STDOUT: %.d5f: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.cb2e47.2, %T.765 [template] @@ -363,7 +364,7 @@ fn F[template T:! Core.Destroy](x: T) { // CHECK:STDOUT: assign %w.var, // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %w: ref %i32 = ref_binding w, %w.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %w.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %w.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%w.var) // CHECK:STDOUT: %impl.elem0.loc14_3.1: @F.%.loc14_3.5 (%.d5f) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [template = %impl.elem0.loc14_3.2 (constants.%impl.elem0.a6b)] // CHECK:STDOUT: %bound_method.loc14_3.1: = bound_method %v.var, %impl.elem0.loc14_3.1 @@ -374,7 +375,12 @@ fn F[template T:! Core.Destroy](x: T) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc22_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc22_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T.765) { // CHECK:STDOUT: %T.loc4_16.1 => constants.%T.765 diff --git a/toolchain/check/testdata/if_expr/basic.carbon b/toolchain/check/testdata/if_expr/basic.carbon index b0297c773ef5..cdc40133de86 100644 --- a/toolchain/check/testdata/if_expr/basic.carbon +++ b/toolchain/check/testdata/if_expr/basic.carbon @@ -33,6 +33,7 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: %.ff5: Core.Form = init_form %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] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %array_type: type = array_type %int_1, %i32 [concrete] // CHECK:STDOUT: %pattern_type.a98: type = pattern_type %array_type [concrete] @@ -67,8 +68,8 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: %.8e2: type = fn_type_with_self_type %Copy.WithSelf.Op.type.081, %Copy.facet [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.664, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc16_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -175,10 +176,20 @@ 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.Op.bound: = bound_method %x.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %x.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%x.var) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc16_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc16_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc16_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// 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 6c804e5c47ae..d80a4cf897be 100644 --- a/toolchain/check/testdata/if_expr/constant_condition.carbon +++ b/toolchain/check/testdata/if_expr/constant_condition.carbon @@ -48,6 +48,7 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %A.type: type = fn_type @A [concrete] // CHECK:STDOUT: %A: %A.type = struct_value () [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] @@ -105,8 +106,8 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc28 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc27 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc27_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: %PartiallyConstant.type: type = fn_type @PartiallyConstant [concrete] // CHECK:STDOUT: %PartiallyConstant: %PartiallyConstant.type = struct_value () [concrete] // CHECK:STDOUT: } @@ -367,14 +368,19 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc29_10.2(%.loc29_10.2) // CHECK:STDOUT: %Destroy.Op.bound.loc28: = bound_method %w.var, constants.%Destroy.Op.651ba6.1 // CHECK:STDOUT: %Destroy.Op.call.loc28: init %empty_tuple.type = call %Destroy.Op.bound.loc28(%w.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc27: = bound_method %v.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc27: = bound_method %v.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call.loc27: init %empty_tuple.type = call %Destroy.Op.bound.loc27(%v.var) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.Op.loc28(%self.param: ref %ptr.235) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc27(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc27_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc27_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @PartiallyConstant(%t.param: type) -> out %return.param: %i32 { // CHECK:STDOUT: !entry: @@ -456,7 +462,7 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc35_10.2(%.loc35_10.2) // CHECK:STDOUT: %Destroy.Op.bound.loc34: = bound_method %w.var, constants.%Destroy.Op.651ba6.1 // CHECK:STDOUT: %Destroy.Op.call.loc34: init %empty_tuple.type = call %Destroy.Op.bound.loc34(%w.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc33: = bound_method %v.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc33: = bound_method %v.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call.loc33: init %empty_tuple.type = call %Destroy.Op.bound.loc33(%v.var) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/if_expr/struct.carbon b/toolchain/check/testdata/if_expr/struct.carbon index 780d810fb267..a4318751773d 100644 --- a/toolchain/check/testdata/if_expr/struct.carbon +++ b/toolchain/check/testdata/if_expr/struct.carbon @@ -36,6 +36,7 @@ fn F(cond: bool) { // CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [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: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %struct_type.a.b.cfd: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [concrete] @@ -61,8 +62,8 @@ fn F(cond: bool) { // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %struct.ed5: %struct_type.a.b.501 = struct_value (%int_1.5d2, %int_2.ef8) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc18_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -175,10 +176,20 @@ fn F(cond: bool) { // CHECK:STDOUT: !if.expr.result: // CHECK:STDOUT: %.loc19_5: %struct_type.a.b.501 = block_arg !if.expr.result // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.ref(%.loc19_5) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %struct_type.a.b.501) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc18_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc18_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc18_3.3(%self.param: ref %struct_type.a.b.501) { +// CHECK:STDOUT: !entry: +// 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 b6c4a37bb8b9..1ffe3714dff1 100644 --- a/toolchain/check/testdata/impl/extend_impl_generic.carbon +++ b/toolchain/check/testdata/impl/extend_impl_generic.carbon @@ -75,6 +75,7 @@ class X(U:! type) { // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // 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: %Param.elem: type = unbound_element_type %Param, %i32 [concrete] // CHECK:STDOUT: %struct_type.x.ed6: type = struct_type {.x: %i32} [concrete] // CHECK:STDOUT: %complete_type.1ec: = complete_type_witness %struct_type.x.ed6 [concrete] @@ -134,10 +135,10 @@ class X(U:! type) { // CHECK:STDOUT: %.8e2: type = fn_type_with_self_type %Copy.WithSelf.Op.type.081, %Copy.facet [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.664, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc22_27 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc22_3 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc22_27.2 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc22_27.4 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -337,18 +338,31 @@ class X(U:! type) { // CHECK:STDOUT: assign %b.var, %Int.as.Copy.impl.Op.call // CHECK:STDOUT: %i32.loc22: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %b: ref %i32 = ref_binding b, %b.var -// CHECK:STDOUT: %Destroy.Op.bound.loc22_27: = bound_method %.loc22_27.2, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.bound.loc22_27: = bound_method %.loc22_27.2, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call.loc22_27: init %empty_tuple.type = call %Destroy.Op.bound.loc22_27(%.loc22_27.2) // CHECK:STDOUT: %Destroy.Op.bound.loc22_3: = bound_method %b.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc22_3: init %empty_tuple.type = call %Destroy.Op.bound.loc22_3(%b.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc21: = bound_method %.loc21_27.2, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.bound.loc21: = bound_method %.loc21_27.2, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call.loc21: init %empty_tuple.type = call %Destroy.Op.bound.loc21(%.loc21_27.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc22_27(%self.param: ref %Param) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc22_27.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc22_3(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc22_27.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc22_27.3(%self.param: ref %struct_type.x.ed6) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc22_27.4(%self.param: ref %Param) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF(constants.%T.67d) { // CHECK:STDOUT: %T.loc4_17.1 => constants.%T.67d diff --git a/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon b/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon index 10f7018cd150..280900d15b2f 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon @@ -209,6 +209,9 @@ fn F() { // CHECK:STDOUT: %Z.WithSelf.Zero.55b: %Z.WithSelf.Zero.type.15e = struct_value () [concrete] // CHECK:STDOUT: %.c1b: type = fn_type_with_self_type %Z.WithSelf.Zero.type.bb1, %Z.facet [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc25_7.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.fcf, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -323,10 +326,16 @@ fn F() { // CHECK:STDOUT: %Zero.ref: %Z.assoc_type = name_ref Zero, @Z.WithSelf.%assoc0 [concrete = constants.%assoc0.cc0] // CHECK:STDOUT: %impl.elem0: %.c1b = 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.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.fcf) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Point) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc25_7.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc25_7.2(%self.param: ref %Point) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Z.WithSelf(constants.%Self.c59) { // CHECK:STDOUT: !definition: diff --git a/toolchain/check/testdata/impl/fail_impl_as_scope.carbon b/toolchain/check/testdata/impl/fail_impl_as_scope.carbon index 1fd09b92d783..73f69db64b89 100644 --- a/toolchain/check/testdata/impl/fail_impl_as_scope.carbon +++ b/toolchain/check/testdata/impl/fail_impl_as_scope.carbon @@ -272,6 +272,9 @@ class X { // CHECK:STDOUT: %Point.as.Z.impl.Method.bound: = bound_method %Point.val, %Point.as.Z.impl.Method [concrete] // CHECK:STDOUT: %.fcf: ref %Point = temporary invalid, %Point.val [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc29_7.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.fcf, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -459,10 +462,16 @@ class X { // CHECK:STDOUT: %.loc29_7.2: ref %Point = temporary %.loc29_5.2, %.loc29_7.1 [concrete = constants.%.fcf] // 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.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.fcf) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Point) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc29_7.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc29_7.2(%self.param: ref %Point) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Z.WithSelf(constants.%Self.c59) { // CHECK:STDOUT: !definition: diff --git a/toolchain/check/testdata/impl/impl_as.carbon b/toolchain/check/testdata/impl/impl_as.carbon index f4b644d073eb..1e46c70f3b40 100644 --- a/toolchain/check/testdata/impl/impl_as.carbon +++ b/toolchain/check/testdata/impl/impl_as.carbon @@ -48,8 +48,8 @@ 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: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc23_7.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -130,12 +130,17 @@ class C { // CHECK:STDOUT: assign %c.var, %.loc23_7 // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %c: ref %C = ref_binding c, %c.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %c.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %c.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%c.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc23_7.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc23_7.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Simple.WithSelf(constants.%Self.af2) { // CHECK:STDOUT: !definition: diff --git a/toolchain/check/testdata/impl/impl_thunk.carbon b/toolchain/check/testdata/impl/impl_thunk.carbon index 17b743f8876f..878bf1b798b7 100644 --- a/toolchain/check/testdata/impl/impl_thunk.carbon +++ b/toolchain/check/testdata/impl/impl_thunk.carbon @@ -342,8 +342,8 @@ impl () as I({}) { // CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.type.19e4b8.2: type = fn_type @empty_tuple.type.as.I.impl.F.loc10_48.2 [concrete] // CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.8be29b.2: %empty_tuple.type.as.I.impl.F.type.19e4b8.2 = struct_value () [concrete] // CHECK:STDOUT: %struct: %struct_type.c.d.15a = struct_value (%empty_tuple, %empty_struct) [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc10_48.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @empty_tuple.type.as.I.impl: %.loc8_7.2 as %I.ref { @@ -403,12 +403,19 @@ impl () as I({}) { // CHECK:STDOUT: %.loc10_48.10: init %empty_struct_type = converted %.loc10_48.7, %.loc10_48.9 [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc10_48.11: init %struct_type.c.d.15a to %return.param = struct_init (%.loc10_48.6, %.loc10_48.10) [concrete = constants.%struct] // CHECK:STDOUT: %.loc10_48.12: init %struct_type.c.d.15a = converted %empty_tuple.type.as.I.impl.F.call, %.loc10_48.11 [concrete = constants.%struct] -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc10_48.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc10_48.2, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc10_48.2) // CHECK:STDOUT: return %.loc10_48.12 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %struct_type.d.c.b36) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc10_48.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_48.2(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_48.3(%self.param: ref %struct_type.d.c.b36) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- inheritance_conversion.carbon // CHECK:STDOUT: @@ -753,16 +760,18 @@ impl () as I({}) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %B: type = class_type @B [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %struct_type.base.5af: type = struct_type {.base: %A} [concrete] // CHECK:STDOUT: %.7df: Core.Form = init_form %B [concrete] // CHECK:STDOUT: %pattern_type.1f4: type = pattern_type %B [concrete] // CHECK:STDOUT: %A.as.X.impl.F.type.170a02.1: type = fn_type @A.as.X.impl.F.loc23_14.1 [concrete] // CHECK:STDOUT: %A.as.X.impl.F.e6cf46.1: %A.as.X.impl.F.type.170a02.1 = struct_value () [concrete] // CHECK:STDOUT: %A.as.X.impl.F.type.170a02.2: type = fn_type @A.as.X.impl.F.loc23_14.2 [concrete] // CHECK:STDOUT: %A.as.X.impl.F.e6cf46.2: %A.as.X.impl.F.type.170a02.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc23_14.4 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @A.as.X.impl: %A.ref as %X.ref { @@ -800,12 +809,27 @@ 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.Op.bound: = bound_method %.loc23_14.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc23_14.2, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc23_14.2) // CHECK:STDOUT: return to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %B) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc23_14.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc23_14.2(%self.param: ref %A) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc23_14.3(%self.param: ref %struct_type.base.5af) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc23_14.4(%self.param: ref %B) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- generic_function.carbon // CHECK:STDOUT: @@ -1157,8 +1181,8 @@ impl () as I({}) { // CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.type.e82c13.2: type = fn_type @empty_tuple.type.as.I.impl.F.loc10_29.2 [concrete] // CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.5f0cef.2: %empty_tuple.type.as.I.impl.F.type.e82c13.2 = struct_value () [concrete] // CHECK:STDOUT: %struct: %struct_type.a.b.f95 = struct_value (%empty_struct, %empty_struct) [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc10_29.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @empty_tuple.type.as.I.impl: %.loc8_7.2 as %I.type { @@ -1206,10 +1230,15 @@ impl () as I({}) { // CHECK:STDOUT: %.loc10_29.10: init %empty_struct_type = converted %.loc10_29.7, %.loc10_29.9 [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc10_29.11: init %struct_type.a.b.f95 to %return.param = struct_init (%.loc10_29.6, %.loc10_29.10) [concrete = constants.%struct] // CHECK:STDOUT: %.loc10_29.12: init %struct_type.a.b.f95 = converted %empty_tuple.type.as.I.impl.F.call, %.loc10_29.11 [concrete = constants.%struct] -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc10_29.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc10_29.2, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc10_29.2) // CHECK:STDOUT: return %.loc10_29.12 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %struct_type.b.a.1b0) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc10_29.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_29.2(%self.param: ref %struct_type.b.a.1b0) { +// CHECK:STDOUT: !entry: +// 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 2b8fa7265955..26582e06f075 100644 --- a/toolchain/check/testdata/impl/import_thunk.carbon +++ b/toolchain/check/testdata/impl/import_thunk.carbon @@ -146,12 +146,12 @@ fn G() { // CHECK:STDOUT: %Destroy.assoc_type: type = assoc_entity_type @Destroy [concrete] // CHECK:STDOUT: %assoc0: %Destroy.assoc_type = assoc_entity element0, imports.%Core.import_ref.8bb [concrete] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %C.c8540f.2, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %C.c8540f.2, (%Destroy.lookup_impl_witness) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.155: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet) [symbolic] -// CHECK:STDOUT: %.371: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.155, %Destroy.facet [symbolic] +// CHECK:STDOUT: %Destroy.facet.832: %Destroy.type = facet_value %C.c8540f.2, (%Destroy.lookup_impl_witness) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.155: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.832) [symbolic] +// CHECK:STDOUT: %.371: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.155, %Destroy.facet.832 [symbolic] // CHECK:STDOUT: %impl.elem0: %.371 = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic] // CHECK:STDOUT: %bound_method.995: = bound_method %.5fa, %impl.elem0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @Destroy.WithSelf.Op(%Destroy.facet) [symbolic] +// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @Destroy.WithSelf.Op(%Destroy.facet.832) [symbolic] // CHECK:STDOUT: %bound_method.fc8: = bound_method %.5fa, %specific_impl_fn [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -299,7 +299,7 @@ fn G() { // CHECK:STDOUT: %C.val: @C.as.I.impl.F.loc8_24.2.%C (%C.c8540f.2) = struct_value () [symbolic = %C.val (constants.%C.val)] // CHECK:STDOUT: %.6: ref @C.as.I.impl.F.loc8_24.2.%C (%C.c8540f.2) = temporary invalid, %C.val [symbolic = %.6 (constants.%.5fa)] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %C, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %C, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet)] +// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %C, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.832)] // CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.155)] // CHECK:STDOUT: %.7: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet [symbolic = %.7 (constants.%.371)] // CHECK:STDOUT: %impl.elem0.2: @C.as.I.impl.F.loc8_24.2.%.7 (%.371) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.2 (constants.%impl.elem0)] @@ -321,13 +321,15 @@ fn G() { // CHECK:STDOUT: %Op.ref: %Destroy.assoc_type = name_ref Op, imports.%Core.import_ref.06b [concrete = constants.%assoc0] // CHECK:STDOUT: %impl.elem0.1: @C.as.I.impl.F.loc8_24.2.%.7 (%.371) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.2 (constants.%impl.elem0)] // CHECK:STDOUT: %bound_method.1: = bound_method %.4, %impl.elem0.1 [symbolic = %bound_method.3 (constants.%bound_method.995)] -// CHECK:STDOUT: %specific_impl_fn.1: = specific_impl_function %impl.elem0.1, @Destroy.WithSelf.Op(constants.%Destroy.facet) [symbolic = %specific_impl_fn.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %specific_impl_fn.1: = specific_impl_function %impl.elem0.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.832) [symbolic = %specific_impl_fn.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: %bound_method.2: = bound_method %.4, %specific_impl_fn.1 [symbolic = %bound_method.4 (constants.%bound_method.fc8)] // CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.2(%.4) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%X) { // CHECK:STDOUT: %X.loc5_10.1 => constants.%X // CHECK:STDOUT: } @@ -434,13 +436,13 @@ fn G() { // CHECK:STDOUT: %C.as.I.impl.F.specific_fn.a77113.2: = specific_function %C.as.I.impl.F.fcfec4.1, @C.as.I.impl.F.2(%empty_tuple) [concrete] // CHECK:STDOUT: %C.val.135: %C.387 = struct_value () [concrete] // CHECK:STDOUT: %.e94e: ref %C.387 = temporary invalid, %C.val.135 [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.50a: = custom_witness (%Destroy.Op), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.4d6: %Destroy.type = facet_value %C.387, (%custom_witness.50a) [concrete] +// CHECK:STDOUT: %Destroy.Op.type.989f67.2: type = fn_type @Destroy.Op.loc7_16.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.3d2d93.2: %Destroy.Op.type.989f67.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.50a5c4.2: = custom_witness (%Destroy.Op.3d2d93.2), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.4d6: %Destroy.type = facet_value %C.387, (%custom_witness.50a5c4.2) [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.cb8: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.4d6) [concrete] // CHECK:STDOUT: %.58c: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.cb8, %Destroy.facet.4d6 [concrete] -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.e94e, %Destroy.Op [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.e94e, %Destroy.Op.3d2d93.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -549,6 +551,7 @@ fn G() { // CHECK:STDOUT: %.loc7_16.6: ref %C.387 = temporary %.loc7_16.3, %.loc7_16.5 [concrete = constants.%.e94e] // CHECK:STDOUT: %.loc7_16.7: %C.387 = acquire_value %.loc7_16.6 [concrete = constants.%C.val.135] // 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.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.e94e) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -589,7 +592,12 @@ fn G() { // CHECK:STDOUT: fn; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %C.387) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc7_16.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc7_16.2(%self.param: ref %C.387) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%X) { // CHECK:STDOUT: %X => constants.%X @@ -668,13 +676,13 @@ fn G() { // CHECK:STDOUT: %require_complete => constants.%complete_type // CHECK:STDOUT: %C.val => constants.%C.val.135 // CHECK:STDOUT: %.1 => constants.%.e94e -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.50a +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.50a5c4.2 // CHECK:STDOUT: %Destroy.facet => constants.%Destroy.facet.4d6 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.cb8 // CHECK:STDOUT: %.2 => constants.%.58c -// CHECK:STDOUT: %impl.elem0 => constants.%Destroy.Op +// CHECK:STDOUT: %impl.elem0 => constants.%Destroy.Op.3d2d93.2 // CHECK:STDOUT: %bound_method.1 => constants.%Destroy.Op.bound -// CHECK:STDOUT: %specific_impl_fn => constants.%Destroy.Op +// CHECK:STDOUT: %specific_impl_fn => constants.%Destroy.Op.3d2d93.2 // CHECK:STDOUT: %bound_method.2 => constants.%Destroy.Op.bound // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/lookup/canonical_query_self.carbon b/toolchain/check/testdata/impl/lookup/canonical_query_self.carbon index b2dec688844f..e4b942779097 100644 --- a/toolchain/check/testdata/impl/lookup/canonical_query_self.carbon +++ b/toolchain/check/testdata/impl/lookup/canonical_query_self.carbon @@ -130,6 +130,9 @@ fn G() { // CHECK:STDOUT: %facet_value: %facet_type = facet_value %C, (%I.impl_witness, %J.impl_witness) [concrete] // CHECK:STDOUT: %F.specific_fn: = specific_function %F, @F(%facet_value) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc46_11.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.b19, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -417,6 +420,8 @@ fn G() { // CHECK:STDOUT: %.loc46_11.2: ref %C = temporary %.loc46_9.2, %.loc46_11.1 [concrete = constants.%.b19] // 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.Op.call.loc46: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.b19) +// CHECK:STDOUT: %Destroy.Op.call.loc40: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.b19) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -430,7 +435,12 @@ fn G() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc46_11.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc46_11.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf(constants.%Self.ab9) { // CHECK:STDOUT: !definition: diff --git a/toolchain/check/testdata/impl/lookup/find_in_final.carbon b/toolchain/check/testdata/impl/lookup/find_in_final.carbon index 91a8e30f4516..bc43890f4815 100644 --- a/toolchain/check/testdata/impl/lookup/find_in_final.carbon +++ b/toolchain/check/testdata/impl/lookup/find_in_final.carbon @@ -90,7 +90,7 @@ fn F(T:! I & J) -> () { // --- non_final_impl_makes_compatible_facet_values.carbon library "[[@TEST_NAME]]"; -interface I { let X:! type; } +interface I { let X:! Core.Destroy; } interface J {} impl forall [T:! J] T as I where .X = () {} diff --git a/toolchain/check/testdata/impl/lookup/import.carbon b/toolchain/check/testdata/impl/lookup/import.carbon index cfd78e95333f..e82d8dd64c1d 100644 --- a/toolchain/check/testdata/impl/lookup/import.carbon +++ b/toolchain/check/testdata/impl/lookup/import.carbon @@ -1677,8 +1677,8 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %assoc0.633: %Y.assoc_type = assoc_entity element0, imports.%PackageHasParam.import_ref.0e4 [concrete] // CHECK:STDOUT: %.6b1: type = fn_type_with_self_type %Y.WithSelf.K.type.d5a, %Y.facet [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc13_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1837,12 +1837,17 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %bound_method: = bound_method %obj.ref, %impl.elem0 // CHECK:STDOUT: %.loc14: %AnyParam.33d = acquire_value %obj.ref // CHECK:STDOUT: %AnyParam.as.Y.impl.K.call: init %empty_tuple.type = call %bound_method(%.loc14) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %obj.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %obj.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%obj.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %AnyParam.33d) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc13_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc13_3.2(%self.param: ref %AnyParam.33d) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @GenericInterface(constants.%U) { // CHECK:STDOUT: %U.loc6_29.1 => constants.%U @@ -1930,8 +1935,8 @@ 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: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -2056,7 +2061,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %bound_method: = bound_method %obj.ref, %impl.elem0 // CHECK:STDOUT: %.loc10: %AnyParam.861 = acquire_value %obj.ref // CHECK:STDOUT: %AnyParam.as.Y.impl.K.call: init %empty_tuple.type = call %bound_method(%.loc10) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %obj.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %obj.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%obj.var) // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -2074,7 +2079,12 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: fn @AnyParam.as.Y.impl.K [from "has_generic_interface.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %AnyParam.861) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.2(%self.param: ref %AnyParam.861) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @AnyParam(constants.%T, constants.%X) { // CHECK:STDOUT: %T => constants.%T @@ -2158,8 +2168,8 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %assoc0.633: %Y.assoc_type = assoc_entity element0, imports.%PackageHasParam.import_ref.0e4 [concrete] // CHECK:STDOUT: %.c0a: type = fn_type_with_self_type %Y.WithSelf.K.type.cd5, %Y.facet [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc13_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -2313,12 +2323,17 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %bound_method: = bound_method %obj.ref, %impl.elem0 // CHECK:STDOUT: %.loc14: %AnyParam.8e0 = acquire_value %obj.ref // CHECK:STDOUT: %AnyParam.as.Y.impl.K.call: init %empty_tuple.type = call %bound_method(%.loc14) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %obj.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %obj.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%obj.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %AnyParam.8e0) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc13_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc13_3.2(%self.param: ref %AnyParam.8e0) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @GenericClass(constants.%U) { // CHECK:STDOUT: %U.loc6_21.1 => constants.%U @@ -2402,8 +2417,8 @@ 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: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -2526,7 +2541,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %bound_method: = bound_method %obj.ref, %impl.elem0 // CHECK:STDOUT: %.loc9: %AnyParam.d71 = acquire_value %obj.ref // CHECK:STDOUT: %AnyParam.as.Y.impl.K.call: init %empty_tuple.type = call %bound_method(%.loc9) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %obj.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %obj.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%obj.var) // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -2544,7 +2559,12 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: fn @AnyParam.as.Y.impl.K [from "has_generic_class.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %AnyParam.d71) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.2(%self.param: ref %AnyParam.d71) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @AnyParam(constants.%T, constants.%X) { // CHECK:STDOUT: %T => constants.%T diff --git a/toolchain/check/testdata/impl/lookup/transitive.carbon b/toolchain/check/testdata/impl/lookup/transitive.carbon index 76e641b25a77..b63ae3cd2b91 100644 --- a/toolchain/check/testdata/impl/lookup/transitive.carbon +++ b/toolchain/check/testdata/impl/lookup/transitive.carbon @@ -317,8 +317,8 @@ 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: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc9_7.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -389,7 +389,7 @@ fn Call() { // 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.Op.bound: = bound_method %.loc9_7.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc9_7.2, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc9_7.2) // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -406,7 +406,12 @@ fn Call() { // CHECK:STDOUT: // CHECK:STDOUT: fn @C.as.I.impl.F [from "c.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc9_7.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_7.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf(constants.%Self.651) { // CHECK:STDOUT: !definition: diff --git a/toolchain/check/testdata/impl/use_assoc_entity.carbon b/toolchain/check/testdata/impl/use_assoc_entity.carbon index 9ad1c8ca9bc0..1e00e13889fb 100644 --- a/toolchain/check/testdata/impl/use_assoc_entity.carbon +++ b/toolchain/check/testdata/impl/use_assoc_entity.carbon @@ -3558,8 +3558,8 @@ fn F() { // CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.907e52.2: %empty_tuple.type.as.K.impl.F.type.1710d5.2 = struct_value () [concrete] // CHECK:STDOUT: %struct: %struct_type.x = struct_value (%empty_tuple) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc26_52.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3726,12 +3726,17 @@ fn F() { // CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.call: init %struct_type.x = call %empty_tuple.type.as.K.impl.F.bound(%self.param, ) // CHECK:STDOUT: %.loc26_52.1: ref %struct_type.x = temporary_storage // CHECK:STDOUT: %.loc26_52.2: ref %struct_type.x = temporary %.loc26_52.1, %empty_tuple.type.as.K.impl.F.call -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc26_52.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc26_52.2, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc26_52.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %struct_type.x) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc26_52.1(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc26_52.2(%self.param: ref %struct_type.x) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @K.WithSelf(constants.%Self.44d) { // CHECK:STDOUT: !definition: @@ -4560,6 +4565,7 @@ fn F() { // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete] // CHECK:STDOUT: %C.5a3: type = class_type @C, @C(%T) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] @@ -4585,6 +4591,9 @@ fn F() { // CHECK:STDOUT: %C.val: %C.302 = struct_value () [concrete] // CHECK:STDOUT: %.cdd: ref %C.302 = temporary invalid, %C.val [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc12_30.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.cdd, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -4724,10 +4733,16 @@ fn F() { // CHECK:STDOUT: %.loc12_30.2: ref %C.302 = temporary %.loc12_28.2, %.loc12_30.1 [concrete = constants.%.cdd] // CHECK:STDOUT: %.loc12_30.3: %C.302 = acquire_value %.loc12_30.2 [concrete = constants.%C.val] // CHECK:STDOUT: %a: %C.302 = value_binding a, %.loc12_30.3 +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.cdd) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %C.302) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc12_30.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc12_30.2(%self.param: ref %C.302) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Z.WithSelf(constants.%Self.c59) { // CHECK:STDOUT: !definition: diff --git a/toolchain/check/testdata/index/expr_category.carbon b/toolchain/check/testdata/index/expr_category.carbon index edf6e0500103..43785d4ac540 100644 --- a/toolchain/check/testdata/index/expr_category.carbon +++ b/toolchain/check/testdata/index/expr_category.carbon @@ -48,6 +48,7 @@ fn ValueBinding(b: array(i32, 3)) { // 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: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %tuple.type.37f: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [concrete] @@ -99,8 +100,8 @@ fn ValueBinding(b: array(i32, 3)) { // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc21 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc18 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc18_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] // CHECK:STDOUT: %ValueBinding.type: type = fn_type @ValueBinding [concrete] // CHECK:STDOUT: %ValueBinding: %ValueBinding.type = struct_value () [concrete] // CHECK:STDOUT: } @@ -265,14 +266,24 @@ fn ValueBinding(b: array(i32, 3)) { // CHECK:STDOUT: assign %.loc22_6, %.loc22_8 // CHECK:STDOUT: %Destroy.Op.bound.loc21: = bound_method %pa.var, constants.%Destroy.Op.651ba6.1 // CHECK:STDOUT: %Destroy.Op.call.loc21: init %empty_tuple.type = call %Destroy.Op.bound.loc21(%pa.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc18: = bound_method %a.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc18: = bound_method %a.var, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call.loc18: init %empty_tuple.type = call %Destroy.Op.bound.loc18(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.Op.loc21(%self.param: ref %ptr.235) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc18(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc18_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc18_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc18_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @ValueBinding(%b.param: %array_type) { // CHECK:STDOUT: !entry: @@ -357,9 +368,9 @@ fn ValueBinding(b: array(i32, 3)) { // CHECK:STDOUT: %.loc32_7.2: %i32 = converted %int_0.loc32, %.loc32_7.1 [concrete = constants.%int_0.6a9] // 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.Op.bound.loc32: = bound_method %.loc32_5.2, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc32: = bound_method %.loc32_5.2, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call.loc32: init %empty_tuple.type = call %Destroy.Op.bound.loc32(%.loc32_5.2) -// CHECK:STDOUT: %Destroy.Op.bound.loc26: = bound_method %a.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc26: = bound_method %a.var, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call.loc26: init %empty_tuple.type = call %Destroy.Op.bound.loc26(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/index/fail_expr_category.carbon b/toolchain/check/testdata/index/fail_expr_category.carbon index 22c8181be059..7a369b95abb7 100644 --- a/toolchain/check/testdata/index/fail_expr_category.carbon +++ b/toolchain/check/testdata/index/fail_expr_category.carbon @@ -57,6 +57,7 @@ fn G(b: array(i32, 3)) { // 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: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [concrete] // CHECK:STDOUT: %pattern_type.fe8: type = pattern_type %ptr.235 [concrete] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete] @@ -92,10 +93,10 @@ fn G(b: array(i32, 3)) { // CHECK:STDOUT: %bound_method.6d7: = bound_method %int_4.0c1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc41 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc36 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc41_5.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc36 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -255,18 +256,28 @@ 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.940] // CHECK:STDOUT: %.loc41_10: init %i32 = converted %int_4.loc41, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc41_10 [concrete = constants.%int_4.940] // CHECK:STDOUT: assign %.loc41_8.2, %.loc41_10 -// CHECK:STDOUT: %Destroy.Op.bound.loc41: = bound_method %.loc41_5.2, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.bound.loc41: = bound_method %.loc41_5.2, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call.loc41: init %empty_tuple.type = call %Destroy.Op.bound.loc41(%.loc41_5.2) -// CHECK:STDOUT: %Destroy.Op.bound.loc36_28: = bound_method %.loc36_28.2, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.bound.loc36_28: = bound_method %.loc36_28.2, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call.loc36_28: init %empty_tuple.type = call %Destroy.Op.bound.loc36_28(%.loc36_28.2) -// CHECK:STDOUT: %Destroy.Op.bound.loc36_3: = bound_method %pf.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc36_3: = bound_method %pf.var, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call.loc36_3: init %empty_tuple.type = call %Destroy.Op.bound.loc36_3(%pf.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc23: = bound_method %pb.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc23: = bound_method %pb.var, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call.loc23: init %empty_tuple.type = call %Destroy.Op.bound.loc23(%pb.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc41(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc41_5.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc41_5.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc41_5.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.Op.loc36(%self.param: ref %ptr.235) = "no_op"; // 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 56688ae935c5..087a209bb57a 100644 --- a/toolchain/check/testdata/index/fail_name_not_found.carbon +++ b/toolchain/check/testdata/index/fail_name_not_found.carbon @@ -30,11 +30,12 @@ fn Main() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc20_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -70,10 +71,15 @@ fn Main() { // CHECK:STDOUT: assign %b.var, // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %b: ref %i32 = ref_binding b, %b.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %b.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %b.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%b.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc20_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc20_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// 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 258dd6026e69..f6cc09b0e303 100644 --- a/toolchain/check/testdata/interface/default_fn.carbon +++ b/toolchain/check/testdata/interface/default_fn.carbon @@ -54,8 +54,8 @@ class C { // CHECK:STDOUT: %C.val: %C = struct_value () [concrete] // CHECK:STDOUT: %.fae: type = fn_type_with_self_type %I.WithSelf.F.type.1f2, %I.facet [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc20_7.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -167,7 +167,7 @@ class C { // CHECK:STDOUT: %bound_method: = bound_method %c.ref, %impl.elem0 // CHECK:STDOUT: %.loc21: %C = acquire_value %c.ref // CHECK:STDOUT: %C.as.I.impl.F.call: init %empty_tuple.type = call %bound_method(%.loc21) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %c.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %c.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%c.var) // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -178,7 +178,12 @@ class C { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc20_7.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc20_7.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf(constants.%Self.849) { // CHECK:STDOUT: !definition: diff --git a/toolchain/check/testdata/interface/generic_method.carbon b/toolchain/check/testdata/interface/generic_method.carbon index 3aa2d598d95b..eae0179e8e49 100644 --- a/toolchain/check/testdata/interface/generic_method.carbon +++ b/toolchain/check/testdata/interface/generic_method.carbon @@ -38,7 +38,7 @@ fn Call() { (Y as A(X)).F(Z, &u); } -fn CallGeneric(T:! A(X)) { +fn CallGeneric(T:! A(X) & Core.Destroy) { var u: Z; T.F(Z, &u); } @@ -74,7 +74,7 @@ fn Call() { (((Y1, Y2) as type) as A(X)).F(Z, {}); } -fn CallGeneric(T:! A(X)) { +fn CallGeneric(T:! A(X) & Core.Destroy) { T.F(Z, {}); } @@ -130,11 +130,11 @@ fn CallIndirect() { // CHECK:STDOUT: %pattern_type.06d: type = pattern_type %tuple.type.244 [symbolic] // CHECK:STDOUT: %Y.as.A.impl.F.type: type = fn_type @Y.as.A.impl.F [concrete] // CHECK:STDOUT: %Y.as.A.impl.F: %Y.as.A.impl.F.type = struct_value () [concrete] -// CHECK:STDOUT: %A.facet: %A.type.ab6 = facet_value %Y, (%A.impl_witness) [concrete] -// CHECK:STDOUT: %A.WithSelf.F.type.12f: type = fn_type @A.WithSelf.F, @A.WithSelf(%X, %A.facet) [concrete] +// CHECK:STDOUT: %A.facet.04e: %A.type.ab6 = facet_value %Y, (%A.impl_witness) [concrete] +// CHECK:STDOUT: %A.WithSelf.F.type.12f: type = fn_type @A.WithSelf.F, @A.WithSelf(%X, %A.facet.04e) [concrete] // CHECK:STDOUT: %A.WithSelf.F.48c: %A.WithSelf.F.type.12f = struct_value () [concrete] // CHECK:STDOUT: %tuple.type.f96: type = tuple_type (type, %A.type.ab6, type) [concrete] -// CHECK:STDOUT: %tuple.5c5: %tuple.type.f96 = tuple_value (%X, %A.facet, %ptr.e8f8f9.1) [symbolic] +// CHECK:STDOUT: %tuple.5c5: %tuple.type.f96 = tuple_value (%X, %A.facet.04e, %ptr.e8f8f9.1) [symbolic] // CHECK:STDOUT: %require_complete.ef162c.1: = require_complete_type %ptr.e8f8f9.1 [symbolic] // CHECK:STDOUT: %require_complete.034: = require_complete_type %tuple.type.244 [symbolic] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] @@ -162,7 +162,7 @@ fn CallIndirect() { // CHECK:STDOUT: %T.as.DefaultOrUnformed.impl.Op.4f1: %T.as.DefaultOrUnformed.impl.Op.type.b84 = struct_value () [concrete] // CHECK:STDOUT: %DefaultOrUnformed.facet: %DefaultOrUnformed.type = facet_value %Z, (%DefaultOrUnformed.impl_witness.263) [concrete] // CHECK:STDOUT: %T.as.DefaultOrUnformed.impl.Op.specific_fn: = specific_function %T.as.DefaultOrUnformed.impl.Op.4f1, @T.as.DefaultOrUnformed.impl.Op(%Z) [concrete] -// CHECK:STDOUT: %.de2: type = fn_type_with_self_type %A.WithSelf.F.type.12f, %A.facet [concrete] +// CHECK:STDOUT: %.de2: type = fn_type_with_self_type %A.WithSelf.F.type.12f, %A.facet.04e [concrete] // CHECK:STDOUT: %ptr.2a0: type = ptr_type %Z [concrete] // CHECK:STDOUT: %pattern_type.771: type = pattern_type %ptr.2a0 [concrete] // CHECK:STDOUT: %tuple.84f: %tuple.type.ff9 = tuple_value (%X, %Y, %ptr.2a0) [concrete] @@ -171,39 +171,57 @@ fn CallIndirect() { // CHECK:STDOUT: %pattern_type.79c: type = pattern_type %tuple.type.847 [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: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc23 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.8d7fae.1: = custom_witness (%Destroy.Op.651ba6.1), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.bba: %Destroy.type = facet_value %tuple.type.847, (%custom_witness.8d7fae.1) [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc23_22.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.8d7fae.3: = custom_witness (%Destroy.Op.651ba6.3), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.5: type = fn_type @Destroy.Op.loc23_22.5 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.5: %Destroy.Op.type.bae255.5 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.8d7fae.5: = custom_witness (%Destroy.Op.651ba6.5), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.bba: %Destroy.type = facet_value %tuple.type.847, (%custom_witness.8d7fae.5) [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.770: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.bba) [concrete] // CHECK:STDOUT: %.f4b: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.770, %Destroy.facet.bba [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc22 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] -// CHECK:STDOUT: %pattern_type.143: type = pattern_type %A.type.ab6 [concrete] -// CHECK:STDOUT: %T.2bc: %A.type.ab6 = symbolic_binding T, 0 [symbolic] +// CHECK:STDOUT: %Destroy.Op.type.bae255.6: type = fn_type @Destroy.Op.loc22 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.6: %Destroy.Op.type.bae255.6 = struct_value () [concrete] +// CHECK:STDOUT: %BitAndWith.type.f2e: type = generic_interface_type @BitAndWith [concrete] +// CHECK:STDOUT: %BitAndWith.generic: %BitAndWith.type.f2e = struct_value () [concrete] +// CHECK:STDOUT: %BitAndWith.type.b10: type = facet_type <@BitAndWith, @BitAndWith(type)> [concrete] +// CHECK:STDOUT: %BitAndWith.impl_witness: = impl_witness imports.%BitAndWith.impl_witness_table [concrete] +// CHECK:STDOUT: %BitAndWith.facet: %BitAndWith.type.b10 = facet_value type, (%BitAndWith.impl_witness) [concrete] +// CHECK:STDOUT: %BitAndWith.WithSelf.Op.type.4bd: type = fn_type @BitAndWith.WithSelf.Op, @BitAndWith.WithSelf(type, %BitAndWith.facet) [concrete] +// CHECK:STDOUT: %.d15: type = fn_type_with_self_type %BitAndWith.WithSelf.Op.type.4bd, %BitAndWith.facet [concrete] +// CHECK:STDOUT: %type.as.BitAndWith.impl.Op.type: type = fn_type @type.as.BitAndWith.impl.Op [concrete] +// CHECK:STDOUT: %type.as.BitAndWith.impl.Op: %type.as.BitAndWith.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %type.as.BitAndWith.impl.Op.bound: = bound_method %A.type.ab6, %type.as.BitAndWith.impl.Op [concrete] +// CHECK:STDOUT: %facet_type: type = facet_type <@A, @A(%X) & @Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.2a4: type = pattern_type %facet_type [concrete] +// CHECK:STDOUT: %T.5da: %facet_type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %CallGeneric.type: type = fn_type @CallGeneric [concrete] // CHECK:STDOUT: %CallGeneric: %CallGeneric.type = struct_value () [concrete] -// CHECK:STDOUT: %A.WithSelf.F.type.f08: type = fn_type @A.WithSelf.F, @A.WithSelf(%X, %T.2bc) [symbolic] -// CHECK:STDOUT: %A.WithSelf.F.7ad: %A.WithSelf.F.type.f08 = struct_value () [symbolic] -// CHECK:STDOUT: %T.binding.as_type.3d0: type = symbolic_binding_type T, 0, %T.2bc [symbolic] -// CHECK:STDOUT: %A.lookup_impl_witness: = lookup_impl_witness %T.2bc, @A, @A(%X) [symbolic] -// CHECK:STDOUT: %.189: type = fn_type_with_self_type %A.WithSelf.F.type.f08, %T.2bc [symbolic] -// CHECK:STDOUT: %impl.elem0.86f8: %.189 = impl_witness_access %A.lookup_impl_witness, element0 [symbolic] -// CHECK:STDOUT: %tuple.d24: %tuple.type.f96 = tuple_value (%X, %T.2bc, %ptr.2a0) [symbolic] -// CHECK:STDOUT: %tuple.type.a50: type = tuple_type (%X, %T.binding.as_type.3d0, %ptr.2a0) [symbolic] -// CHECK:STDOUT: %.69c: Core.Form = init_form %tuple.type.a50 [symbolic] -// CHECK:STDOUT: %pattern_type.160: type = pattern_type %tuple.type.a50 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.44b: = specific_impl_function %impl.elem0.86f8, @A.WithSelf.F(%X, %T.2bc, %Z) [symbolic] -// CHECK:STDOUT: %require_complete.8fa: = require_complete_type %tuple.type.a50 [symbolic] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %tuple.type.a50, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.facet.df5: %Destroy.type = facet_value %tuple.type.a50, (%Destroy.lookup_impl_witness) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.707: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.df5) [symbolic] -// CHECK:STDOUT: %.11e: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.707, %Destroy.facet.df5 [symbolic] -// CHECK:STDOUT: %impl.elem0.853: %.11e = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.8a5: = specific_impl_function %impl.elem0.853, @Destroy.WithSelf.Op(%Destroy.facet.df5) [symbolic] +// CHECK:STDOUT: %A.WithSelf.F.type.6cc: type = fn_type @A.WithSelf.F, @A.WithSelf(%X, %T.5da) [symbolic] +// CHECK:STDOUT: %A.WithSelf.F.dc9: %A.WithSelf.F.type.6cc = struct_value () [symbolic] +// CHECK:STDOUT: %T.binding.as_type.833: type = symbolic_binding_type T, 0, %T.5da [symbolic] +// CHECK:STDOUT: %A.lookup_impl_witness: = lookup_impl_witness %T.5da, @A, @A(%X) [symbolic] +// CHECK:STDOUT: %A.facet.b04: %A.type.ab6 = facet_value %T.binding.as_type.833, (%A.lookup_impl_witness) [symbolic] +// CHECK:STDOUT: %A.WithSelf.F.type.416: type = fn_type @A.WithSelf.F, @A.WithSelf(%X, %A.facet.b04) [symbolic] +// CHECK:STDOUT: %A.WithSelf.F.d39: %A.WithSelf.F.type.416 = struct_value () [symbolic] +// CHECK:STDOUT: %.8ed: type = fn_type_with_self_type %A.WithSelf.F.type.416, %A.facet.b04 [symbolic] +// CHECK:STDOUT: %impl.elem0.138: %.8ed = impl_witness_access %A.lookup_impl_witness, element0 [symbolic] +// CHECK:STDOUT: %tuple.2df: %tuple.type.f96 = tuple_value (%X, %A.facet.b04, %ptr.2a0) [symbolic] +// CHECK:STDOUT: %tuple.type.726: type = tuple_type (%X, %T.binding.as_type.833, %ptr.2a0) [symbolic] +// CHECK:STDOUT: %.ef7: Core.Form = init_form %tuple.type.726 [symbolic] +// CHECK:STDOUT: %pattern_type.41c: type = pattern_type %tuple.type.726 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.1d5: = specific_impl_function %impl.elem0.138, @A.WithSelf.F(%X, %A.facet.b04, %Z) [symbolic] +// CHECK:STDOUT: %require_complete.b02: = require_complete_type %tuple.type.726 [symbolic] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.6c0: = lookup_impl_witness %tuple.type.726, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.facet.f94: %Destroy.type = facet_value %tuple.type.726, (%Destroy.lookup_impl_witness.6c0) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.3e6: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.f94) [symbolic] +// CHECK:STDOUT: %.29b: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.3e6, %Destroy.facet.f94 [symbolic] +// CHECK:STDOUT: %impl.elem0.571: %.29b = impl_witness_access %Destroy.lookup_impl_witness.6c0, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.a73: = specific_impl_function %impl.elem0.571, @Destroy.WithSelf.Op(%Destroy.facet.f94) [symbolic] // CHECK:STDOUT: %CallIndirect.type: type = fn_type @CallIndirect [concrete] // CHECK:STDOUT: %CallIndirect: %CallIndirect.type = struct_value () [concrete] -// CHECK:STDOUT: %CallGeneric.specific_fn: = specific_function %CallGeneric, @CallGeneric(%A.facet) [concrete] +// CHECK:STDOUT: %facet_value: %facet_type = facet_value %Y, (%A.impl_witness, %custom_witness.8d7fae.3) [concrete] +// CHECK:STDOUT: %CallGeneric.specific_fn: = specific_function %CallGeneric, @CallGeneric(%facet_value) [concrete] // CHECK:STDOUT: %complete_type.543: = complete_type_witness %ptr.2a0 [concrete] // CHECK:STDOUT: %complete_type.28e: = complete_type_witness %tuple.type.847 [concrete] // CHECK:STDOUT: %tuple.type.0dd: type = tuple_type (%empty_struct_type, %empty_struct_type, %ptr.2a0) [concrete] @@ -215,7 +233,7 @@ fn CallIndirect() { // CHECK:STDOUT: %Copy.WithSelf.Op.type.a8b: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.26e) [concrete] // CHECK:STDOUT: %.2ef: type = fn_type_with_self_type %Copy.WithSelf.Op.type.a8b, %Copy.facet.26e [concrete] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.7d1, @ptr.as.Copy.impl.Op(%Z) [concrete] -// CHECK:STDOUT: %tuple.6cd: %tuple.type.f96 = tuple_value (%X, %A.facet, %ptr.2a0) [concrete] +// CHECK:STDOUT: %tuple.6cd: %tuple.type.f96 = tuple_value (%X, %A.facet.04e, %ptr.2a0) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -223,6 +241,7 @@ fn CallIndirect() { // CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: .DefaultOrUnformed = %Core.DefaultOrUnformed // CHECK:STDOUT: .Destroy = %Core.Destroy +// CHECK:STDOUT: .BitAndWith = %Core.BitAndWith // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -233,6 +252,9 @@ fn CallIndirect() { // CHECK:STDOUT: %Core.import_ref.01d: @T.as.DefaultOrUnformed.impl.%T.as.DefaultOrUnformed.impl.Op.type (%T.as.DefaultOrUnformed.impl.Op.type.6c6) = import_ref Core//prelude/parts/default, loc{{\d+_\d+}}, loaded [symbolic = @T.as.DefaultOrUnformed.impl.%T.as.DefaultOrUnformed.impl.Op (constants.%T.as.DefaultOrUnformed.impl.Op.ae1)] // CHECK:STDOUT: %DefaultOrUnformed.impl_witness_table.349 = impl_witness_table (%Core.import_ref.01d), @T.as.DefaultOrUnformed.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] +// CHECK:STDOUT: %Core.BitAndWith: %BitAndWith.type.f2e = import_ref Core//prelude/parts/as, BitAndWith, loaded [concrete = constants.%BitAndWith.generic] +// CHECK:STDOUT: %Core.import_ref.8d3: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude/parts/as, loc{{\d+_\d+}}, loaded [concrete = constants.%type.as.BitAndWith.impl.Op] +// CHECK:STDOUT: %BitAndWith.impl_witness_table = impl_witness_table (%Core.import_ref.8d3), @type.as.BitAndWith.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -267,15 +289,22 @@ fn CallIndirect() { // CHECK:STDOUT: } // CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [concrete = constants.%Call] {} {} // CHECK:STDOUT: %CallGeneric.decl: %CallGeneric.type = fn_decl @CallGeneric [concrete = constants.%CallGeneric] { -// CHECK:STDOUT: %T.patt: %pattern_type.143 = symbolic_binding_pattern T, 0 [concrete] +// CHECK:STDOUT: %T.patt: %pattern_type.2a4 = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc26: type = splice_block %A.type [concrete = constants.%A.type.ab6] { +// CHECK:STDOUT: %.loc26_25.1: type = splice_block %.loc26_25.3 [concrete = constants.%facet_type] { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %A.ref: %A.type.464 = name_ref A, file.%A.decl [concrete = constants.%A.generic] // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %A.type: type = facet_type <@A, @A(constants.%X)> [concrete = constants.%A.type.ab6] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %Destroy.ref: type = name_ref Destroy, imports.%Core.Destroy [concrete = constants.%Destroy.type] +// CHECK:STDOUT: %impl.elem0.loc26: %.d15 = impl_witness_access constants.%BitAndWith.impl_witness, element0 [concrete = constants.%type.as.BitAndWith.impl.Op] +// CHECK:STDOUT: %bound_method.loc26: = bound_method %A.type, %impl.elem0.loc26 [concrete = constants.%type.as.BitAndWith.impl.Op.bound] +// CHECK:STDOUT: %type.as.BitAndWith.impl.Op.call: init type = call %bound_method.loc26(%A.type, %Destroy.ref) [concrete = constants.%facet_type] +// CHECK:STDOUT: %.loc26_25.2: type = value_of_initializer %type.as.BitAndWith.impl.Op.call [concrete = constants.%facet_type] +// CHECK:STDOUT: %.loc26_25.3: type = converted %type.as.BitAndWith.impl.Op.call, %.loc26_25.2 [concrete = constants.%facet_type] // CHECK:STDOUT: } -// CHECK:STDOUT: %T.loc26_17.2: %A.type.ab6 = symbolic_binding T, 0 [symbolic = %T.loc26_17.1 (constants.%T.2bc)] +// CHECK:STDOUT: %T.loc26_17.2: %facet_type = symbolic_binding T, 0 [symbolic = %T.loc26_17.1 (constants.%T.5da)] // CHECK:STDOUT: } // CHECK:STDOUT: %CallIndirect.decl: %CallIndirect.type = fn_decl @CallIndirect [concrete = constants.%CallIndirect] {} {} // CHECK:STDOUT: } @@ -483,11 +512,11 @@ fn CallIndirect() { // CHECK:STDOUT: %A.ref: %A.type.464 = name_ref A, file.%A.decl [concrete = constants.%A.generic] // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %A.type: type = facet_type <@A, @A(constants.%X)> [concrete = constants.%A.type.ab6] -// CHECK:STDOUT: %A.facet: %A.type.ab6 = facet_value %Y.ref, (constants.%A.impl_witness) [concrete = constants.%A.facet] -// CHECK:STDOUT: %.loc23_6: %A.type.ab6 = converted %Y.ref, %A.facet [concrete = constants.%A.facet] +// CHECK:STDOUT: %A.facet: %A.type.ab6 = facet_value %Y.ref, (constants.%A.impl_witness) [concrete = constants.%A.facet.04e] +// CHECK:STDOUT: %.loc23_6: %A.type.ab6 = converted %Y.ref, %A.facet [concrete = constants.%A.facet.04e] // CHECK:STDOUT: %as_type.loc23: type = facet_access_type %.loc23_6 [concrete = constants.%Y] // CHECK:STDOUT: %.loc23_14.1: type = converted %.loc23_6, %as_type.loc23 [concrete = constants.%Y] -// CHECK:STDOUT: %.loc23_14.2: %A.assoc_type.f05 = specific_constant @A.WithSelf.%assoc0.loc6_41.1, @A.WithSelf(constants.%X, constants.%A.facet) [concrete = constants.%assoc0.368] +// CHECK:STDOUT: %.loc23_14.2: %A.assoc_type.f05 = specific_constant @A.WithSelf.%assoc0.loc6_41.1, @A.WithSelf(constants.%X, constants.%A.facet.04e) [concrete = constants.%assoc0.368] // CHECK:STDOUT: %F.ref: %A.assoc_type.f05 = name_ref F, %.loc23_14.2 [concrete = constants.%assoc0.368] // CHECK:STDOUT: %impl.elem0: %.de2 = impl_witness_access constants.%A.impl_witness, element0 [concrete = constants.%Y.as.A.impl.F] // CHECK:STDOUT: %Z.ref.loc23: type = name_ref Z, file.%Z.decl [concrete = constants.%Z] @@ -497,35 +526,56 @@ fn CallIndirect() { // CHECK:STDOUT: %.loc23_22.1: ref %tuple.type.847 = temporary_storage // CHECK:STDOUT: %Y.as.A.impl.F.call: init %tuple.type.847 to %.loc23_22.1 = call %specific_fn(%addr) // CHECK:STDOUT: %.loc23_22.2: ref %tuple.type.847 = temporary %.loc23_22.1, %Y.as.A.impl.F.call -// CHECK:STDOUT: %Destroy.Op.bound.loc23: = bound_method %.loc23_22.2, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.bound.loc23: = bound_method %.loc23_22.2, constants.%Destroy.Op.651ba6.5 // CHECK:STDOUT: %Destroy.Op.call.loc23: init %empty_tuple.type = call %Destroy.Op.bound.loc23(%.loc23_22.2) -// CHECK:STDOUT: %Destroy.Op.bound.loc22: = bound_method %u.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc22: = bound_method %u.var, constants.%Destroy.Op.651ba6.6 // CHECK:STDOUT: %Destroy.Op.call.loc22: init %empty_tuple.type = call %Destroy.Op.bound.loc22(%u.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc23(%self.param: ref %tuple.type.847) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc23_22.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc22(%self.param: ref %Z) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc23_22.2(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @CallGeneric(%T.loc26_17.2: %A.type.ab6) { -// CHECK:STDOUT: %T.loc26_17.1: %A.type.ab6 = symbolic_binding T, 0 [symbolic = %T.loc26_17.1 (constants.%T.2bc)] +// CHECK:STDOUT: fn @Destroy.Op.loc23_22.3(%self.param: ref %Y) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc23_22.4(%self.param: ref %ptr.2a0) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc23_22.5(%self.param: ref %tuple.type.847) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc22(%self.param: ref %Z) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @CallGeneric(%T.loc26_17.2: %facet_type) { +// CHECK:STDOUT: %T.loc26_17.1: %facet_type = symbolic_binding T, 0 [symbolic = %T.loc26_17.1 (constants.%T.5da)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc26_17.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.3d0)] -// CHECK:STDOUT: %A.WithSelf.F.type: type = fn_type @A.WithSelf.F, @A.WithSelf(constants.%X, %T.loc26_17.1) [symbolic = %A.WithSelf.F.type (constants.%A.WithSelf.F.type.f08)] -// CHECK:STDOUT: %.loc28_4.3: type = fn_type_with_self_type %A.WithSelf.F.type, %T.loc26_17.1 [symbolic = %.loc28_4.3 (constants.%.189)] +// CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc26_17.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.833)] // CHECK:STDOUT: %A.lookup_impl_witness: = lookup_impl_witness %T.loc26_17.1, @A, @A(constants.%X) [symbolic = %A.lookup_impl_witness (constants.%A.lookup_impl_witness)] -// CHECK:STDOUT: %impl.elem0.loc28_4.2: @CallGeneric.%.loc28_4.3 (%.189) = impl_witness_access %A.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_4.2 (constants.%impl.elem0.86f8)] -// CHECK:STDOUT: %specific_impl_fn.loc28_4.2: = specific_impl_function %impl.elem0.loc28_4.2, @A.WithSelf.F(constants.%X, %T.loc26_17.1, constants.%Z) [symbolic = %specific_impl_fn.loc28_4.2 (constants.%specific_impl_fn.44b)] -// CHECK:STDOUT: %tuple.type: type = tuple_type (constants.%X, %T.binding.as_type, constants.%ptr.2a0) [symbolic = %tuple.type (constants.%tuple.type.a50)] -// CHECK:STDOUT: %require_complete: = require_complete_type %tuple.type [symbolic = %require_complete (constants.%require_complete.8fa)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %tuple.type, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %tuple.type, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.df5)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.707)] -// CHECK:STDOUT: %.loc28_12.3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet [symbolic = %.loc28_12.3 (constants.%.11e)] -// CHECK:STDOUT: %impl.elem0.loc28_12.2: @CallGeneric.%.loc28_12.3 (%.11e) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_12.2 (constants.%impl.elem0.853)] -// CHECK:STDOUT: %specific_impl_fn.loc28_12.2: = specific_impl_function %impl.elem0.loc28_12.2, @Destroy.WithSelf.Op(%Destroy.facet) [symbolic = %specific_impl_fn.loc28_12.2 (constants.%specific_impl_fn.8a5)] +// CHECK:STDOUT: %A.facet: %A.type.ab6 = facet_value %T.binding.as_type, (%A.lookup_impl_witness) [symbolic = %A.facet (constants.%A.facet.b04)] +// CHECK:STDOUT: %A.WithSelf.F.type: type = fn_type @A.WithSelf.F, @A.WithSelf(constants.%X, %A.facet) [symbolic = %A.WithSelf.F.type (constants.%A.WithSelf.F.type.416)] +// CHECK:STDOUT: %.loc28_4.3: type = fn_type_with_self_type %A.WithSelf.F.type, %A.facet [symbolic = %.loc28_4.3 (constants.%.8ed)] +// CHECK:STDOUT: %impl.elem0.loc28_4.2: @CallGeneric.%.loc28_4.3 (%.8ed) = impl_witness_access %A.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_4.2 (constants.%impl.elem0.138)] +// CHECK:STDOUT: %specific_impl_fn.loc28_4.2: = specific_impl_function %impl.elem0.loc28_4.2, @A.WithSelf.F(constants.%X, %A.facet, constants.%Z) [symbolic = %specific_impl_fn.loc28_4.2 (constants.%specific_impl_fn.1d5)] +// CHECK:STDOUT: %tuple.type: type = tuple_type (constants.%X, %T.binding.as_type, constants.%ptr.2a0) [symbolic = %tuple.type (constants.%tuple.type.726)] +// CHECK:STDOUT: %require_complete: = require_complete_type %tuple.type [symbolic = %require_complete (constants.%require_complete.b02)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %tuple.type, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.6c0)] +// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %tuple.type, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.f94)] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.3e6)] +// CHECK:STDOUT: %.loc28_12.3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet [symbolic = %.loc28_12.3 (constants.%.29b)] +// CHECK:STDOUT: %impl.elem0.loc28_12.2: @CallGeneric.%.loc28_12.3 (%.29b) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_12.2 (constants.%impl.elem0.571)] +// CHECK:STDOUT: %specific_impl_fn.loc28_12.2: = specific_impl_function %impl.elem0.loc28_12.2, @Destroy.WithSelf.Op(%Destroy.facet) [symbolic = %specific_impl_fn.loc28_12.2 (constants.%specific_impl_fn.a73)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: @@ -544,25 +594,25 @@ fn CallIndirect() { // CHECK:STDOUT: assign %u.var, %T.as.DefaultOrUnformed.impl.Op.call // CHECK:STDOUT: %Z.ref.loc27: type = name_ref Z, file.%Z.decl [concrete = constants.%Z] // CHECK:STDOUT: %u: ref %Z = ref_binding u, %u.var -// CHECK:STDOUT: %T.ref: %A.type.ab6 = name_ref T, %T.loc26_17.2 [symbolic = %T.loc26_17.1 (constants.%T.2bc)] -// CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type.3d0)] -// CHECK:STDOUT: %.loc28_4.1: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type.3d0)] -// CHECK:STDOUT: %.loc28_4.2: %A.assoc_type.f05 = specific_constant @A.WithSelf.%assoc0.loc6_41.1, @A.WithSelf(constants.%X, constants.%T.2bc) [concrete = constants.%assoc0.368] +// CHECK:STDOUT: %T.ref: %facet_type = name_ref T, %T.loc26_17.2 [symbolic = %T.loc26_17.1 (constants.%T.5da)] +// CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type.833)] +// CHECK:STDOUT: %.loc28_4.1: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type.833)] +// CHECK:STDOUT: %.loc28_4.2: %A.assoc_type.f05 = specific_constant @A.WithSelf.%assoc0.loc6_41.1, @A.WithSelf(constants.%X, constants.%T.5da) [concrete = constants.%assoc0.368] // CHECK:STDOUT: %F.ref: %A.assoc_type.f05 = name_ref F, %.loc28_4.2 [concrete = constants.%assoc0.368] -// CHECK:STDOUT: %impl.elem0.loc28_4.1: @CallGeneric.%.loc28_4.3 (%.189) = impl_witness_access constants.%A.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_4.2 (constants.%impl.elem0.86f8)] +// CHECK:STDOUT: %impl.elem0.loc28_4.1: @CallGeneric.%.loc28_4.3 (%.8ed) = impl_witness_access constants.%A.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_4.2 (constants.%impl.elem0.138)] // CHECK:STDOUT: %Z.ref.loc28: type = name_ref Z, file.%Z.decl [concrete = constants.%Z] // CHECK:STDOUT: %u.ref: ref %Z = name_ref u, %u // CHECK:STDOUT: %addr: %ptr.2a0 = addr_of %u.ref -// CHECK:STDOUT: %specific_impl_fn.loc28_4.1: = specific_impl_function %impl.elem0.loc28_4.1, @A.WithSelf.F(constants.%X, constants.%T.2bc, constants.%Z) [symbolic = %specific_impl_fn.loc28_4.2 (constants.%specific_impl_fn.44b)] -// CHECK:STDOUT: %.loc28_12.1: ref @CallGeneric.%tuple.type (%tuple.type.a50) = temporary_storage -// CHECK:STDOUT: %A.WithSelf.F.call: init @CallGeneric.%tuple.type (%tuple.type.a50) to %.loc28_12.1 = call %specific_impl_fn.loc28_4.1(%addr) -// CHECK:STDOUT: %.loc28_12.2: ref @CallGeneric.%tuple.type (%tuple.type.a50) = temporary %.loc28_12.1, %A.WithSelf.F.call -// CHECK:STDOUT: %impl.elem0.loc28_12.1: @CallGeneric.%.loc28_12.3 (%.11e) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_12.2 (constants.%impl.elem0.853)] +// CHECK:STDOUT: %specific_impl_fn.loc28_4.1: = specific_impl_function %impl.elem0.loc28_4.1, @A.WithSelf.F(constants.%X, constants.%A.facet.b04, constants.%Z) [symbolic = %specific_impl_fn.loc28_4.2 (constants.%specific_impl_fn.1d5)] +// CHECK:STDOUT: %.loc28_12.1: ref @CallGeneric.%tuple.type (%tuple.type.726) = temporary_storage +// CHECK:STDOUT: %A.WithSelf.F.call: init @CallGeneric.%tuple.type (%tuple.type.726) to %.loc28_12.1 = call %specific_impl_fn.loc28_4.1(%addr) +// CHECK:STDOUT: %.loc28_12.2: ref @CallGeneric.%tuple.type (%tuple.type.726) = temporary %.loc28_12.1, %A.WithSelf.F.call +// CHECK:STDOUT: %impl.elem0.loc28_12.1: @CallGeneric.%.loc28_12.3 (%.29b) = impl_witness_access constants.%Destroy.lookup_impl_witness.6c0, element0 [symbolic = %impl.elem0.loc28_12.2 (constants.%impl.elem0.571)] // CHECK:STDOUT: %bound_method.loc28_12.1: = bound_method %.loc28_12.2, %impl.elem0.loc28_12.1 -// CHECK:STDOUT: %specific_impl_fn.loc28_12.1: = specific_impl_function %impl.elem0.loc28_12.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.df5) [symbolic = %specific_impl_fn.loc28_12.2 (constants.%specific_impl_fn.8a5)] +// CHECK:STDOUT: %specific_impl_fn.loc28_12.1: = specific_impl_function %impl.elem0.loc28_12.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.f94) [symbolic = %specific_impl_fn.loc28_12.2 (constants.%specific_impl_fn.a73)] // CHECK:STDOUT: %bound_method.loc28_12.2: = bound_method %.loc28_12.2, %specific_impl_fn.loc28_12.1 // CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc28_12.2(%.loc28_12.2) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %u.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %u.var, constants.%Destroy.Op.651ba6.6 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%u.var) // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -572,9 +622,9 @@ 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: %A.facet: %A.type.ab6 = facet_value %Y.ref, (constants.%A.impl_witness) [concrete = constants.%A.facet] -// CHECK:STDOUT: %.loc32: %A.type.ab6 = converted %Y.ref, %A.facet [concrete = constants.%A.facet] -// CHECK:STDOUT: %CallGeneric.specific_fn: = specific_function %CallGeneric.ref, @CallGeneric(constants.%A.facet) [concrete = constants.%CallGeneric.specific_fn] +// CHECK:STDOUT: %facet_value: %facet_type = facet_value %Y.ref, (constants.%A.impl_witness, constants.%custom_witness.8d7fae.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() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -629,24 +679,24 @@ fn CallIndirect() { // CHECK:STDOUT: %pattern_type.loc16_37 => constants.%pattern_type.06d // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @A.WithSelf(constants.%X, constants.%A.facet) { +// CHECK:STDOUT: specific @A.WithSelf(constants.%X, constants.%A.facet.04e) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T => constants.%X // CHECK:STDOUT: %A.type => constants.%A.type.ab6 -// CHECK:STDOUT: %Self => constants.%A.facet +// CHECK:STDOUT: %Self => constants.%A.facet.04e // CHECK:STDOUT: %A.WithSelf.F.type => constants.%A.WithSelf.F.type.12f // CHECK:STDOUT: %A.WithSelf.F => constants.%A.WithSelf.F.48c // CHECK:STDOUT: %A.assoc_type => constants.%A.assoc_type.f05 // CHECK:STDOUT: %assoc0.loc6_41.2 => constants.%assoc0.368 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @A.WithSelf.F(constants.%X, constants.%A.facet, constants.%U.67d) { +// CHECK:STDOUT: specific @A.WithSelf.F(constants.%X, constants.%A.facet.04e, constants.%U.67d) { // CHECK:STDOUT: %U.loc6_9.1 => constants.%U.67d // CHECK:STDOUT: %ptr.loc6_22.1 => constants.%ptr.e8f8f9.1 // CHECK:STDOUT: %pattern_type.loc6_19 => constants.%pattern_type.4f4b84.1 // CHECK:STDOUT: %T => constants.%X // CHECK:STDOUT: %A.type => constants.%A.type.ab6 -// CHECK:STDOUT: %Self => constants.%A.facet +// CHECK:STDOUT: %Self => constants.%A.facet.04e // CHECK:STDOUT: %tuple.type.loc6_40.1 => constants.%tuple.type.f96 // CHECK:STDOUT: %tuple => constants.%tuple.5c5 // CHECK:STDOUT: %Self.binding.as_type => constants.%Y @@ -677,63 +727,75 @@ fn CallIndirect() { // CHECK:STDOUT: %specific_impl_fn.loc17_21.2 => constants.%ptr.as.Copy.impl.Op.specific_fn // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @CallGeneric(constants.%T.2bc) { -// CHECK:STDOUT: %T.loc26_17.1 => constants.%T.2bc +// CHECK:STDOUT: specific @CallGeneric(constants.%T.5da) { +// CHECK:STDOUT: %T.loc26_17.1 => constants.%T.5da // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @A.WithSelf(constants.%X, constants.%T.2bc) { +// CHECK:STDOUT: specific @A.WithSelf(constants.%X, constants.%T.5da) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T => constants.%X // CHECK:STDOUT: %A.type => constants.%A.type.ab6 -// CHECK:STDOUT: %Self => constants.%T.2bc -// CHECK:STDOUT: %A.WithSelf.F.type => constants.%A.WithSelf.F.type.f08 -// CHECK:STDOUT: %A.WithSelf.F => constants.%A.WithSelf.F.7ad +// CHECK:STDOUT: %Self => constants.%T.5da +// CHECK:STDOUT: %A.WithSelf.F.type => constants.%A.WithSelf.F.type.6cc +// CHECK:STDOUT: %A.WithSelf.F => constants.%A.WithSelf.F.dc9 // CHECK:STDOUT: %A.assoc_type => constants.%A.assoc_type.f05 // CHECK:STDOUT: %assoc0.loc6_41.2 => constants.%assoc0.368 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @A.WithSelf.F(constants.%X, constants.%T.2bc, constants.%Z) { +// CHECK:STDOUT: specific @A.WithSelf(constants.%X, constants.%A.facet.b04) { +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %T => constants.%X +// CHECK:STDOUT: %A.type => constants.%A.type.ab6 +// CHECK:STDOUT: %Self => constants.%A.facet.b04 +// CHECK:STDOUT: %A.WithSelf.F.type => constants.%A.WithSelf.F.type.416 +// CHECK:STDOUT: %A.WithSelf.F => constants.%A.WithSelf.F.d39 +// CHECK:STDOUT: %A.assoc_type => constants.%A.assoc_type.f05 +// CHECK:STDOUT: %assoc0.loc6_41.2 => constants.%assoc0.368 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @A.WithSelf.F(constants.%X, constants.%A.facet.b04, constants.%Z) { // CHECK:STDOUT: %U.loc6_9.1 => constants.%Z // CHECK:STDOUT: %ptr.loc6_22.1 => constants.%ptr.2a0 // CHECK:STDOUT: %pattern_type.loc6_19 => constants.%pattern_type.771 // CHECK:STDOUT: %T => constants.%X // CHECK:STDOUT: %A.type => constants.%A.type.ab6 -// CHECK:STDOUT: %Self => constants.%T.2bc +// CHECK:STDOUT: %Self => constants.%A.facet.b04 // CHECK:STDOUT: %tuple.type.loc6_40.1 => constants.%tuple.type.f96 -// CHECK:STDOUT: %tuple => constants.%tuple.d24 -// CHECK:STDOUT: %Self.binding.as_type => constants.%T.binding.as_type.3d0 -// CHECK:STDOUT: %tuple.type.loc6_40.2 => constants.%tuple.type.a50 -// CHECK:STDOUT: %.loc6_40.1 => constants.%.69c -// CHECK:STDOUT: %pattern_type.loc6_40 => constants.%pattern_type.160 +// CHECK:STDOUT: %tuple => constants.%tuple.2df +// CHECK:STDOUT: %Self.binding.as_type => constants.%T.binding.as_type.833 +// CHECK:STDOUT: %tuple.type.loc6_40.2 => constants.%tuple.type.726 +// CHECK:STDOUT: %.loc6_40.1 => constants.%.ef7 +// CHECK:STDOUT: %pattern_type.loc6_40 => constants.%pattern_type.41c // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @CallGeneric(constants.%A.facet) { -// CHECK:STDOUT: %T.loc26_17.1 => constants.%A.facet +// CHECK:STDOUT: specific @CallGeneric(constants.%facet_value) { +// CHECK:STDOUT: %T.loc26_17.1 => constants.%facet_value // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T.binding.as_type => constants.%Y +// CHECK:STDOUT: %A.lookup_impl_witness => constants.%A.impl_witness +// CHECK:STDOUT: %A.facet => constants.%A.facet.04e // CHECK:STDOUT: %A.WithSelf.F.type => constants.%A.WithSelf.F.type.12f // CHECK:STDOUT: %.loc28_4.3 => constants.%.de2 -// CHECK:STDOUT: %A.lookup_impl_witness => constants.%A.impl_witness // CHECK:STDOUT: %impl.elem0.loc28_4.2 => constants.%Y.as.A.impl.F // CHECK:STDOUT: %specific_impl_fn.loc28_4.2 => constants.%Y.as.A.impl.F.specific_fn // CHECK:STDOUT: %tuple.type => constants.%tuple.type.847 // CHECK:STDOUT: %require_complete => constants.%complete_type.28e -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.8d7fae.1 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.8d7fae.5 // CHECK:STDOUT: %Destroy.facet => constants.%Destroy.facet.bba // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.770 // CHECK:STDOUT: %.loc28_12.3 => constants.%.f4b -// CHECK:STDOUT: %impl.elem0.loc28_12.2 => constants.%Destroy.Op.651ba6.1 -// CHECK:STDOUT: %specific_impl_fn.loc28_12.2 => constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %impl.elem0.loc28_12.2 => constants.%Destroy.Op.651ba6.5 +// CHECK:STDOUT: %specific_impl_fn.loc28_12.2 => constants.%Destroy.Op.651ba6.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @A.WithSelf.F(constants.%X, constants.%A.facet, constants.%Z) { +// CHECK:STDOUT: specific @A.WithSelf.F(constants.%X, constants.%A.facet.04e, constants.%Z) { // CHECK:STDOUT: %U.loc6_9.1 => constants.%Z // CHECK:STDOUT: %ptr.loc6_22.1 => constants.%ptr.2a0 // CHECK:STDOUT: %pattern_type.loc6_19 => constants.%pattern_type.771 // CHECK:STDOUT: %T => constants.%X // CHECK:STDOUT: %A.type => constants.%A.type.ab6 -// CHECK:STDOUT: %Self => constants.%A.facet +// CHECK:STDOUT: %Self => constants.%A.facet.04e // CHECK:STDOUT: %tuple.type.loc6_40.1 => constants.%tuple.type.f96 // CHECK:STDOUT: %tuple => constants.%tuple.6cd // CHECK:STDOUT: %Self.binding.as_type => constants.%Y @@ -831,38 +893,59 @@ fn CallIndirect() { // CHECK:STDOUT: %Z.val: %Z = struct_value () [concrete] // CHECK:STDOUT: %.318: ref %Z = temporary invalid, %Z.val [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc24_39 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.8d7fae.1: = custom_witness (%Destroy.Op.651ba6.1), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.9fd: %Destroy.type = facet_value %tuple.type.65a, (%custom_witness.8d7fae.1) [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.5: type = fn_type @Destroy.Op.loc24_39.5 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.5: %Destroy.Op.type.bae255.5 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.8d7fae.5: = custom_witness (%Destroy.Op.651ba6.5), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.6: type = fn_type @Destroy.Op.loc24_39.6 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.6: %Destroy.Op.type.bae255.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.7: type = fn_type @Destroy.Op.loc24_39.7 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.7: %Destroy.Op.type.bae255.7 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.8d7fae.7: = custom_witness (%Destroy.Op.651ba6.7), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.9fd: %Destroy.type = facet_value %tuple.type.65a, (%custom_witness.8d7fae.7) [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.d36: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.9fd) [concrete] // CHECK:STDOUT: %.498: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.d36, %Destroy.facet.9fd [concrete] -// CHECK:STDOUT: %pattern_type.143: type = pattern_type %A.type.ab6 [concrete] -// CHECK:STDOUT: %T.2bc: %A.type.ab6 = symbolic_binding T, 0 [symbolic] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.318, %Destroy.Op.651ba6.6 [concrete] +// CHECK:STDOUT: %BitAndWith.type.f2e: type = generic_interface_type @BitAndWith [concrete] +// CHECK:STDOUT: %BitAndWith.generic: %BitAndWith.type.f2e = struct_value () [concrete] +// CHECK:STDOUT: %BitAndWith.type.b10: type = facet_type <@BitAndWith, @BitAndWith(type)> [concrete] +// CHECK:STDOUT: %BitAndWith.impl_witness: = impl_witness imports.%BitAndWith.impl_witness_table [concrete] +// CHECK:STDOUT: %BitAndWith.facet: %BitAndWith.type.b10 = facet_value type, (%BitAndWith.impl_witness) [concrete] +// CHECK:STDOUT: %BitAndWith.WithSelf.Op.type.4bd: type = fn_type @BitAndWith.WithSelf.Op, @BitAndWith.WithSelf(type, %BitAndWith.facet) [concrete] +// CHECK:STDOUT: %.d15: type = fn_type_with_self_type %BitAndWith.WithSelf.Op.type.4bd, %BitAndWith.facet [concrete] +// CHECK:STDOUT: %type.as.BitAndWith.impl.Op.type: type = fn_type @type.as.BitAndWith.impl.Op [concrete] +// CHECK:STDOUT: %type.as.BitAndWith.impl.Op: %type.as.BitAndWith.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %type.as.BitAndWith.impl.Op.bound: = bound_method %A.type.ab6, %type.as.BitAndWith.impl.Op [concrete] +// CHECK:STDOUT: %facet_type: type = facet_type <@A, @A(%X) & @Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.2a4: type = pattern_type %facet_type [concrete] +// CHECK:STDOUT: %T.5da: %facet_type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %CallGeneric.type: type = fn_type @CallGeneric [concrete] // CHECK:STDOUT: %CallGeneric: %CallGeneric.type = struct_value () [concrete] -// CHECK:STDOUT: %A.WithSelf.F.type.f08: type = fn_type @A.WithSelf.F, @A.WithSelf(%X, %T.2bc) [symbolic] -// CHECK:STDOUT: %A.WithSelf.F.7ad: %A.WithSelf.F.type.f08 = struct_value () [symbolic] -// CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.2bc [symbolic] -// CHECK:STDOUT: %A.lookup_impl_witness: = lookup_impl_witness %T.2bc, @A, @A(%X) [symbolic] -// CHECK:STDOUT: %.189: type = fn_type_with_self_type %A.WithSelf.F.type.f08, %T.2bc [symbolic] -// CHECK:STDOUT: %impl.elem0.86f: %.189 = impl_witness_access %A.lookup_impl_witness, element0 [symbolic] +// CHECK:STDOUT: %A.WithSelf.F.type.6cc: type = fn_type @A.WithSelf.F, @A.WithSelf(%X, %T.5da) [symbolic] +// CHECK:STDOUT: %A.WithSelf.F.dc9: %A.WithSelf.F.type.6cc = struct_value () [symbolic] +// CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.5da [symbolic] +// CHECK:STDOUT: %A.lookup_impl_witness: = lookup_impl_witness %T.5da, @A, @A(%X) [symbolic] +// CHECK:STDOUT: %A.facet.b04: %A.type.ab6 = facet_value %T.binding.as_type, (%A.lookup_impl_witness) [symbolic] +// CHECK:STDOUT: %A.WithSelf.F.type.416: type = fn_type @A.WithSelf.F, @A.WithSelf(%X, %A.facet.b04) [symbolic] +// CHECK:STDOUT: %A.WithSelf.F.d39: %A.WithSelf.F.type.416 = struct_value () [symbolic] +// CHECK:STDOUT: %.8ed: type = fn_type_with_self_type %A.WithSelf.F.type.416, %A.facet.b04 [symbolic] +// CHECK:STDOUT: %impl.elem0.138: %.8ed = impl_witness_access %A.lookup_impl_witness, element0 [symbolic] // CHECK:STDOUT: %tuple.type.f96: type = tuple_type (type, %A.type.ab6, type) [concrete] -// CHECK:STDOUT: %tuple.631: %tuple.type.f96 = tuple_value (%X, %T.2bc, %Z) [symbolic] -// CHECK:STDOUT: %tuple.type.856: type = tuple_type (%X, %T.binding.as_type, %Z) [symbolic] -// CHECK:STDOUT: %.5b0: Core.Form = init_form %tuple.type.856 [symbolic] -// CHECK:STDOUT: %pattern_type.4b2: type = pattern_type %tuple.type.856 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.44b: = specific_impl_function %impl.elem0.86f, @A.WithSelf.F(%X, %T.2bc, %Z) [symbolic] -// CHECK:STDOUT: %require_complete.7d4: = require_complete_type %tuple.type.856 [symbolic] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %tuple.type.856, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.facet.a1c: %Destroy.type = facet_value %tuple.type.856, (%Destroy.lookup_impl_witness) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.725: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.a1c) [symbolic] -// CHECK:STDOUT: %.949: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.725, %Destroy.facet.a1c [symbolic] -// CHECK:STDOUT: %impl.elem0.487: %.949 = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.56d: = specific_impl_function %impl.elem0.487, @Destroy.WithSelf.Op(%Destroy.facet.a1c) [symbolic] +// CHECK:STDOUT: %tuple.5a0: %tuple.type.f96 = tuple_value (%X, %A.facet.b04, %Z) [symbolic] +// CHECK:STDOUT: %tuple.type.f23: type = tuple_type (%X, %T.binding.as_type, %Z) [symbolic] +// CHECK:STDOUT: %.c4a: Core.Form = init_form %tuple.type.f23 [symbolic] +// CHECK:STDOUT: %pattern_type.434: type = pattern_type %tuple.type.f23 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.1d5: = specific_impl_function %impl.elem0.138, @A.WithSelf.F(%X, %A.facet.b04, %Z) [symbolic] +// CHECK:STDOUT: %require_complete.247: = require_complete_type %tuple.type.f23 [symbolic] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.74b: = lookup_impl_witness %tuple.type.f23, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.facet.8b5: %Destroy.type = facet_value %tuple.type.f23, (%Destroy.lookup_impl_witness.74b) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.209: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.8b5) [symbolic] +// CHECK:STDOUT: %.509: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.209, %Destroy.facet.8b5 [symbolic] +// CHECK:STDOUT: %impl.elem0.243: %.509 = impl_witness_access %Destroy.lookup_impl_witness.74b, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.d18: = specific_impl_function %impl.elem0.243, @Destroy.WithSelf.Op(%Destroy.facet.8b5) [symbolic] // CHECK:STDOUT: %CallIndirect.type: type = fn_type @CallIndirect [concrete] // CHECK:STDOUT: %CallIndirect: %CallIndirect.type = struct_value () [concrete] -// CHECK:STDOUT: %CallGeneric.specific_fn: = specific_function %CallGeneric, @CallGeneric(%A.facet.906) [concrete] +// CHECK:STDOUT: %facet_value: %facet_type = facet_value %tuple.type.ab2, (%A.impl_witness.b3a, %custom_witness.8d7fae.5) [concrete] +// CHECK:STDOUT: %CallGeneric.specific_fn: = specific_function %CallGeneric, @CallGeneric(%facet_value) [concrete] // CHECK:STDOUT: %complete_type.cf2: = complete_type_witness %tuple.type.65a [concrete] // CHECK:STDOUT: %tuple.5e4: %tuple.type.f96 = tuple_value (%X, %A.facet.906, %Z) [concrete] // CHECK:STDOUT: } @@ -870,10 +953,14 @@ fn CallIndirect() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Destroy = %Core.Destroy +// CHECK:STDOUT: .BitAndWith = %Core.BitAndWith // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] +// CHECK:STDOUT: %Core.BitAndWith: %BitAndWith.type.f2e = import_ref Core//prelude/parts/as, BitAndWith, loaded [concrete = constants.%BitAndWith.generic] +// CHECK:STDOUT: %Core.import_ref.8d3: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude/parts/as, loc{{\d+_\d+}}, loaded [concrete = constants.%type.as.BitAndWith.impl.Op] +// CHECK:STDOUT: %BitAndWith.impl_witness_table = impl_witness_table (%Core.import_ref.8d3), @type.as.BitAndWith.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -932,15 +1019,22 @@ fn CallIndirect() { // CHECK:STDOUT: } // CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [concrete = constants.%Call] {} {} // CHECK:STDOUT: %CallGeneric.decl: %CallGeneric.type = fn_decl @CallGeneric [concrete = constants.%CallGeneric] { -// CHECK:STDOUT: %T.patt: %pattern_type.143 = symbolic_binding_pattern T, 0 [concrete] +// CHECK:STDOUT: %T.patt: %pattern_type.2a4 = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc27: type = splice_block %A.type [concrete = constants.%A.type.ab6] { +// CHECK:STDOUT: %.loc27_25.1: type = splice_block %.loc27_25.3 [concrete = constants.%facet_type] { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %A.ref: %A.type.464 = name_ref A, file.%A.decl [concrete = constants.%A.generic] // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %A.type: type = facet_type <@A, @A(constants.%X)> [concrete = constants.%A.type.ab6] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %Destroy.ref: type = name_ref Destroy, imports.%Core.Destroy [concrete = constants.%Destroy.type] +// CHECK:STDOUT: %impl.elem0.loc27: %.d15 = impl_witness_access constants.%BitAndWith.impl_witness, element0 [concrete = constants.%type.as.BitAndWith.impl.Op] +// CHECK:STDOUT: %bound_method.loc27: = bound_method %A.type, %impl.elem0.loc27 [concrete = constants.%type.as.BitAndWith.impl.Op.bound] +// CHECK:STDOUT: %type.as.BitAndWith.impl.Op.call: init type = call %bound_method.loc27(%A.type, %Destroy.ref) [concrete = constants.%facet_type] +// CHECK:STDOUT: %.loc27_25.2: type = value_of_initializer %type.as.BitAndWith.impl.Op.call [concrete = constants.%facet_type] +// CHECK:STDOUT: %.loc27_25.3: type = converted %type.as.BitAndWith.impl.Op.call, %.loc27_25.2 [concrete = constants.%facet_type] // CHECK:STDOUT: } -// CHECK:STDOUT: %T.loc27_17.2: %A.type.ab6 = symbolic_binding T, 0 [symbolic = %T.loc27_17.1 (constants.%T.2bc)] +// CHECK:STDOUT: %T.loc27_17.2: %facet_type = symbolic_binding T, 0 [symbolic = %T.loc27_17.1 (constants.%T.5da)] // CHECK:STDOUT: } // CHECK:STDOUT: %CallIndirect.decl: %CallIndirect.type = fn_decl @CallIndirect [concrete = constants.%CallIndirect] {} {} // CHECK:STDOUT: } @@ -1160,58 +1254,89 @@ 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.65a to %.loc24_39.1 = call %specific_fn(%.loc24_38.6) // CHECK:STDOUT: %.loc24_39.2: ref %tuple.type.65a = temporary %.loc24_39.1, %tuple.type.as.A.impl.F.call -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc24_39.2, constants.%Destroy.Op.651ba6.1 -// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc24_39.2) +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc24_39.2, constants.%Destroy.Op.651ba6.7 +// CHECK:STDOUT: %Destroy.Op.call.loc24_39: init %empty_tuple.type = call %Destroy.Op.bound(%.loc24_39.2) +// CHECK:STDOUT: %Destroy.Op.call.loc24_38: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.318) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc24_39(%self.param: ref %tuple.type.65a) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc24_39.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc24_38(%self.param: ref %Z) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc24_39.2(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @CallGeneric(%T.loc27_17.2: %A.type.ab6) { -// CHECK:STDOUT: %T.loc27_17.1: %A.type.ab6 = symbolic_binding T, 0 [symbolic = %T.loc27_17.1 (constants.%T.2bc)] +// CHECK:STDOUT: fn @Destroy.Op.loc24_39.3(%self.param: ref %Y1) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc24_39.4(%self.param: ref %Y2) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc24_39.5(%self.param: ref %tuple.type.ab2) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc24_39.6(%self.param: ref %Z) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc24_39.7(%self.param: ref %tuple.type.65a) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @CallGeneric(%T.loc27_17.2: %facet_type) { +// CHECK:STDOUT: %T.loc27_17.1: %facet_type = symbolic_binding T, 0 [symbolic = %T.loc27_17.1 (constants.%T.5da)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc27_17.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %A.WithSelf.F.type: type = fn_type @A.WithSelf.F, @A.WithSelf(constants.%X, %T.loc27_17.1) [symbolic = %A.WithSelf.F.type (constants.%A.WithSelf.F.type.f08)] -// CHECK:STDOUT: %.loc28_4.3: type = fn_type_with_self_type %A.WithSelf.F.type, %T.loc27_17.1 [symbolic = %.loc28_4.3 (constants.%.189)] // CHECK:STDOUT: %A.lookup_impl_witness: = lookup_impl_witness %T.loc27_17.1, @A, @A(constants.%X) [symbolic = %A.lookup_impl_witness (constants.%A.lookup_impl_witness)] -// CHECK:STDOUT: %impl.elem0.loc28_4.2: @CallGeneric.%.loc28_4.3 (%.189) = impl_witness_access %A.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_4.2 (constants.%impl.elem0.86f)] -// CHECK:STDOUT: %specific_impl_fn.loc28_4.2: = specific_impl_function %impl.elem0.loc28_4.2, @A.WithSelf.F(constants.%X, %T.loc27_17.1, constants.%Z) [symbolic = %specific_impl_fn.loc28_4.2 (constants.%specific_impl_fn.44b)] -// CHECK:STDOUT: %tuple.type: type = tuple_type (constants.%X, %T.binding.as_type, constants.%Z) [symbolic = %tuple.type (constants.%tuple.type.856)] -// CHECK:STDOUT: %require_complete: = require_complete_type %tuple.type [symbolic = %require_complete (constants.%require_complete.7d4)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %tuple.type, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %tuple.type, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.a1c)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.725)] -// CHECK:STDOUT: %.loc28_12.3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet [symbolic = %.loc28_12.3 (constants.%.949)] -// CHECK:STDOUT: %impl.elem0.loc28_12.2: @CallGeneric.%.loc28_12.3 (%.949) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_12.2 (constants.%impl.elem0.487)] -// CHECK:STDOUT: %specific_impl_fn.loc28_12.2: = specific_impl_function %impl.elem0.loc28_12.2, @Destroy.WithSelf.Op(%Destroy.facet) [symbolic = %specific_impl_fn.loc28_12.2 (constants.%specific_impl_fn.56d)] +// CHECK:STDOUT: %A.facet: %A.type.ab6 = facet_value %T.binding.as_type, (%A.lookup_impl_witness) [symbolic = %A.facet (constants.%A.facet.b04)] +// CHECK:STDOUT: %A.WithSelf.F.type: type = fn_type @A.WithSelf.F, @A.WithSelf(constants.%X, %A.facet) [symbolic = %A.WithSelf.F.type (constants.%A.WithSelf.F.type.416)] +// CHECK:STDOUT: %.loc28_4.3: type = fn_type_with_self_type %A.WithSelf.F.type, %A.facet [symbolic = %.loc28_4.3 (constants.%.8ed)] +// CHECK:STDOUT: %impl.elem0.loc28_4.2: @CallGeneric.%.loc28_4.3 (%.8ed) = impl_witness_access %A.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_4.2 (constants.%impl.elem0.138)] +// CHECK:STDOUT: %specific_impl_fn.loc28_4.2: = specific_impl_function %impl.elem0.loc28_4.2, @A.WithSelf.F(constants.%X, %A.facet, constants.%Z) [symbolic = %specific_impl_fn.loc28_4.2 (constants.%specific_impl_fn.1d5)] +// CHECK:STDOUT: %tuple.type: type = tuple_type (constants.%X, %T.binding.as_type, constants.%Z) [symbolic = %tuple.type (constants.%tuple.type.f23)] +// CHECK:STDOUT: %require_complete: = require_complete_type %tuple.type [symbolic = %require_complete (constants.%require_complete.247)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %tuple.type, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.74b)] +// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %tuple.type, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.8b5)] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.209)] +// CHECK:STDOUT: %.loc28_12.3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet [symbolic = %.loc28_12.3 (constants.%.509)] +// CHECK:STDOUT: %impl.elem0.loc28_12.2: @CallGeneric.%.loc28_12.3 (%.509) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_12.2 (constants.%impl.elem0.243)] +// CHECK:STDOUT: %specific_impl_fn.loc28_12.2: = specific_impl_function %impl.elem0.loc28_12.2, @Destroy.WithSelf.Op(%Destroy.facet) [symbolic = %specific_impl_fn.loc28_12.2 (constants.%specific_impl_fn.d18)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %T.ref: %A.type.ab6 = name_ref T, %T.loc27_17.2 [symbolic = %T.loc27_17.1 (constants.%T.2bc)] +// CHECK:STDOUT: %T.ref: %facet_type = name_ref T, %T.loc27_17.2 [symbolic = %T.loc27_17.1 (constants.%T.5da)] // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] // CHECK:STDOUT: %.loc28_4.1: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %.loc28_4.2: %A.assoc_type.f05 = specific_constant @A.WithSelf.%assoc0.loc6_39.1, @A.WithSelf(constants.%X, constants.%T.2bc) [concrete = constants.%assoc0.368] +// CHECK:STDOUT: %.loc28_4.2: %A.assoc_type.f05 = specific_constant @A.WithSelf.%assoc0.loc6_39.1, @A.WithSelf(constants.%X, constants.%T.5da) [concrete = constants.%assoc0.368] // CHECK:STDOUT: %F.ref: %A.assoc_type.f05 = name_ref F, %.loc28_4.2 [concrete = constants.%assoc0.368] -// CHECK:STDOUT: %impl.elem0.loc28_4.1: @CallGeneric.%.loc28_4.3 (%.189) = impl_witness_access constants.%A.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_4.2 (constants.%impl.elem0.86f)] +// CHECK:STDOUT: %impl.elem0.loc28_4.1: @CallGeneric.%.loc28_4.3 (%.8ed) = impl_witness_access constants.%A.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_4.2 (constants.%impl.elem0.138)] // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z] // CHECK:STDOUT: %.loc28_11.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %specific_impl_fn.loc28_4.1: = specific_impl_function %impl.elem0.loc28_4.1, @A.WithSelf.F(constants.%X, constants.%T.2bc, constants.%Z) [symbolic = %specific_impl_fn.loc28_4.2 (constants.%specific_impl_fn.44b)] -// CHECK:STDOUT: %.loc28_12.1: ref @CallGeneric.%tuple.type (%tuple.type.856) = temporary_storage +// CHECK:STDOUT: %specific_impl_fn.loc28_4.1: = specific_impl_function %impl.elem0.loc28_4.1, @A.WithSelf.F(constants.%X, constants.%A.facet.b04, constants.%Z) [symbolic = %specific_impl_fn.loc28_4.2 (constants.%specific_impl_fn.1d5)] +// CHECK:STDOUT: %.loc28_12.1: ref @CallGeneric.%tuple.type (%tuple.type.f23) = temporary_storage // CHECK:STDOUT: %.loc28_11.2: ref %Z = temporary_storage // CHECK:STDOUT: %.loc28_11.3: init %Z to %.loc28_11.2 = class_init () [concrete = constants.%Z.val] // CHECK:STDOUT: %.loc28_11.4: init %Z = converted %.loc28_11.1, %.loc28_11.3 [concrete = constants.%Z.val] // CHECK:STDOUT: %.loc28_11.5: ref %Z = temporary %.loc28_11.2, %.loc28_11.4 [concrete = constants.%.318] // 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.856) 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.856) = temporary %.loc28_12.1, %A.WithSelf.F.call -// CHECK:STDOUT: %impl.elem0.loc28_12.1: @CallGeneric.%.loc28_12.3 (%.949) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_12.2 (constants.%impl.elem0.487)] +// CHECK:STDOUT: %A.WithSelf.F.call: init @CallGeneric.%tuple.type (%tuple.type.f23) 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.f23) = temporary %.loc28_12.1, %A.WithSelf.F.call +// CHECK:STDOUT: %impl.elem0.loc28_12.1: @CallGeneric.%.loc28_12.3 (%.509) = impl_witness_access constants.%Destroy.lookup_impl_witness.74b, element0 [symbolic = %impl.elem0.loc28_12.2 (constants.%impl.elem0.243)] // CHECK:STDOUT: %bound_method.loc28_12.1: = bound_method %.loc28_12.2, %impl.elem0.loc28_12.1 -// CHECK:STDOUT: %specific_impl_fn.loc28_12.1: = specific_impl_function %impl.elem0.loc28_12.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.a1c) [symbolic = %specific_impl_fn.loc28_12.2 (constants.%specific_impl_fn.56d)] +// CHECK:STDOUT: %specific_impl_fn.loc28_12.1: = specific_impl_function %impl.elem0.loc28_12.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.8b5) [symbolic = %specific_impl_fn.loc28_12.2 (constants.%specific_impl_fn.d18)] // CHECK:STDOUT: %bound_method.loc28_12.2: = bound_method %.loc28_12.2, %specific_impl_fn.loc28_12.1 // CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc28_12.2(%.loc28_12.2) +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.318) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -1224,9 +1349,9 @@ fn CallIndirect() { // CHECK:STDOUT: %.loc33_22: %tuple.type.24b = tuple_literal (%Y1.ref, %Y2.ref) [concrete = constants.%tuple.dd5] // CHECK:STDOUT: %.loc33_27: type = type_literal type [concrete = type] // CHECK:STDOUT: %.loc33_24: type = converted %.loc33_22, constants.%tuple.type.ab2 [concrete = constants.%tuple.type.ab2] -// CHECK:STDOUT: %A.facet: %A.type.ab6 = facet_value %.loc33_24, (constants.%A.impl_witness.b3a) [concrete = constants.%A.facet.906] -// CHECK:STDOUT: %.loc33_31: %A.type.ab6 = converted %.loc33_24, %A.facet [concrete = constants.%A.facet.906] -// CHECK:STDOUT: %CallGeneric.specific_fn: = specific_function %CallGeneric.ref, @CallGeneric(constants.%A.facet.906) [concrete = constants.%CallGeneric.specific_fn] +// CHECK:STDOUT: %facet_value: %facet_type = facet_value %.loc33_24, (constants.%A.impl_witness.b3a, constants.%custom_witness.8d7fae.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() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -1397,53 +1522,65 @@ fn CallIndirect() { // CHECK:STDOUT: %tuple.type.as.A.impl.F.specific_fn.loc18_12.2 => constants.%tuple.type.as.A.impl.F.specific_fn.af6 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @CallGeneric(constants.%T.2bc) { -// CHECK:STDOUT: %T.loc27_17.1 => constants.%T.2bc +// CHECK:STDOUT: specific @CallGeneric(constants.%T.5da) { +// CHECK:STDOUT: %T.loc27_17.1 => constants.%T.5da // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @A.WithSelf(constants.%X, constants.%T.2bc) { +// CHECK:STDOUT: specific @A.WithSelf(constants.%X, constants.%T.5da) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T => constants.%X // CHECK:STDOUT: %A.type => constants.%A.type.ab6 -// CHECK:STDOUT: %Self => constants.%T.2bc -// CHECK:STDOUT: %A.WithSelf.F.type => constants.%A.WithSelf.F.type.f08 -// CHECK:STDOUT: %A.WithSelf.F => constants.%A.WithSelf.F.7ad +// CHECK:STDOUT: %Self => constants.%T.5da +// CHECK:STDOUT: %A.WithSelf.F.type => constants.%A.WithSelf.F.type.6cc +// CHECK:STDOUT: %A.WithSelf.F => constants.%A.WithSelf.F.dc9 // CHECK:STDOUT: %A.assoc_type => constants.%A.assoc_type.f05 // CHECK:STDOUT: %assoc0.loc6_39.2 => constants.%assoc0.368 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @A.WithSelf.F(constants.%X, constants.%T.2bc, constants.%Z) { +// CHECK:STDOUT: specific @A.WithSelf(constants.%X, constants.%A.facet.b04) { +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %T => constants.%X +// CHECK:STDOUT: %A.type => constants.%A.type.ab6 +// CHECK:STDOUT: %Self => constants.%A.facet.b04 +// CHECK:STDOUT: %A.WithSelf.F.type => constants.%A.WithSelf.F.type.416 +// CHECK:STDOUT: %A.WithSelf.F => constants.%A.WithSelf.F.d39 +// CHECK:STDOUT: %A.assoc_type => constants.%A.assoc_type.f05 +// CHECK:STDOUT: %assoc0.loc6_39.2 => constants.%assoc0.368 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @A.WithSelf.F(constants.%X, constants.%A.facet.b04, constants.%Z) { // CHECK:STDOUT: %U.loc6_9.1 => constants.%Z // CHECK:STDOUT: %pattern_type.loc6_19 => constants.%pattern_type.bdb // CHECK:STDOUT: %T => constants.%X // CHECK:STDOUT: %A.type => constants.%A.type.ab6 -// CHECK:STDOUT: %Self => constants.%T.2bc +// CHECK:STDOUT: %Self => constants.%A.facet.b04 // CHECK:STDOUT: %tuple.type.loc6_38.1 => constants.%tuple.type.f96 -// CHECK:STDOUT: %tuple => constants.%tuple.631 +// CHECK:STDOUT: %tuple => constants.%tuple.5a0 // CHECK:STDOUT: %Self.binding.as_type => constants.%T.binding.as_type -// CHECK:STDOUT: %tuple.type.loc6_38.2 => constants.%tuple.type.856 -// CHECK:STDOUT: %.loc6_38.1 => constants.%.5b0 -// CHECK:STDOUT: %pattern_type.loc6_38 => constants.%pattern_type.4b2 +// CHECK:STDOUT: %tuple.type.loc6_38.2 => constants.%tuple.type.f23 +// CHECK:STDOUT: %.loc6_38.1 => constants.%.c4a +// CHECK:STDOUT: %pattern_type.loc6_38 => constants.%pattern_type.434 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @CallGeneric(constants.%A.facet.906) { -// CHECK:STDOUT: %T.loc27_17.1 => constants.%A.facet.906 +// CHECK:STDOUT: specific @CallGeneric(constants.%facet_value) { +// CHECK:STDOUT: %T.loc27_17.1 => constants.%facet_value // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T.binding.as_type => constants.%tuple.type.ab2 +// CHECK:STDOUT: %A.lookup_impl_witness => constants.%A.impl_witness.b3a +// CHECK:STDOUT: %A.facet => constants.%A.facet.906 // CHECK:STDOUT: %A.WithSelf.F.type => constants.%A.WithSelf.F.type.757 // CHECK:STDOUT: %.loc28_4.3 => constants.%.fa2 -// CHECK:STDOUT: %A.lookup_impl_witness => constants.%A.impl_witness.b3a // CHECK:STDOUT: %impl.elem0.loc28_4.2 => constants.%tuple.type.as.A.impl.F.cc8 // CHECK:STDOUT: %specific_impl_fn.loc28_4.2 => constants.%tuple.type.as.A.impl.F.specific_fn.af6 // CHECK:STDOUT: %tuple.type => constants.%tuple.type.65a // CHECK:STDOUT: %require_complete => constants.%complete_type.cf2 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.8d7fae.1 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.8d7fae.7 // CHECK:STDOUT: %Destroy.facet => constants.%Destroy.facet.9fd // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.d36 // CHECK:STDOUT: %.loc28_12.3 => constants.%.498 -// CHECK:STDOUT: %impl.elem0.loc28_12.2 => constants.%Destroy.Op.651ba6.1 -// CHECK:STDOUT: %specific_impl_fn.loc28_12.2 => constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %impl.elem0.loc28_12.2 => constants.%Destroy.Op.651ba6.7 +// CHECK:STDOUT: %specific_impl_fn.loc28_12.2 => constants.%Destroy.Op.651ba6.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @A.WithSelf.F(constants.%X, constants.%A.facet.906, constants.%Z) { diff --git a/toolchain/check/testdata/interop/cpp/builtins.llp64.carbon b/toolchain/check/testdata/interop/cpp/builtins.llp64.carbon index d013cdef5aa6..75ad51d0e022 100644 --- a/toolchain/check/testdata/interop/cpp/builtins.llp64.carbon +++ b/toolchain/check/testdata/interop/cpp/builtins.llp64.carbon @@ -734,6 +734,7 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Int.as.ImplicitAs.impl.Convert.535, @Int.as.ImplicitAs.impl.Convert(%int_64) [concrete] // CHECK:STDOUT: %bound_method.d1e: = bound_method %int_1.41a, %Int.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %array_type: type = array_type %int_1.5b8, %f32.97e [concrete] +// CHECK:STDOUT: %f32.9b3: type = float_type %int_32, f32 [concrete] // CHECK:STDOUT: %pattern_type.b36: type = pattern_type %array_type [concrete] // CHECK:STDOUT: %float.6da: Core.FloatLiteral = float_literal_value 10e-1 [concrete] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.FloatLiteral) [concrete] @@ -753,8 +754,8 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %bound_method.57d: = bound_method %float.6da, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %float.e3b: %f32.97e = float_value 1 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%float.e3b) [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc11_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -838,12 +839,22 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %array_type: type = array_type %.loc11_30.4, %f32 [concrete = constants.%array_type] // CHECK:STDOUT: } // CHECK:STDOUT: %a: ref %array_type = ref_binding a, %a.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc11_3.1(%self.param: ref %f32.9b3) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc11_3.2(%self.param: ref %f32.97e) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc11_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- unsigned_long_long.carbon // CHECK:STDOUT: @@ -896,6 +907,7 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %UInt.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %UInt.as.ImplicitAs.impl.Convert.309, @UInt.as.ImplicitAs.impl.Convert.1(%int_64) [concrete] // CHECK:STDOUT: %bound_method.f18: = bound_method %int_1.f23, %UInt.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %array_type: type = array_type %int_1.5b8, %f32.97e [concrete] +// CHECK:STDOUT: %f32.9b3: type = float_type %int_32, f32 [concrete] // CHECK:STDOUT: %pattern_type.b36: type = pattern_type %array_type [concrete] // CHECK:STDOUT: %float.6da: Core.FloatLiteral = float_literal_value 10e-1 [concrete] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.FloatLiteral) [concrete] @@ -915,8 +927,8 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %bound_method.57d: = bound_method %float.6da, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %float.e3b: %f32.97e = float_value 1 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%float.e3b) [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc11_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1000,12 +1012,22 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %array_type: type = array_type %.loc11_30.4, %f32 [concrete = constants.%array_type] // CHECK:STDOUT: } // CHECK:STDOUT: %a: ref %array_type = ref_binding a, %a.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc11_3.1(%self.param: ref %f32.9b3) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc11_3.2(%self.param: ref %f32.97e) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc11_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- long.carbon // CHECK:STDOUT: @@ -1075,6 +1097,7 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %Cpp.long.as.ImplicitAs.impl.Convert.d49: %Cpp.long.as.ImplicitAs.impl.Convert.type.9ed = struct_value () [concrete] // CHECK:STDOUT: %Cpp.long.as.ImplicitAs.impl.Convert.bound: = bound_method %int_1.5a4, %Cpp.long.as.ImplicitAs.impl.Convert.d49 [concrete] // CHECK:STDOUT: %array_type: type = array_type %int_1.5b8, %f32.97e [concrete] +// CHECK:STDOUT: %f32.9b3: type = float_type %int_32, f32 [concrete] // CHECK:STDOUT: %pattern_type.b36: type = pattern_type %array_type [concrete] // CHECK:STDOUT: %float.6da: Core.FloatLiteral = float_literal_value 10e-1 [concrete] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.FloatLiteral) [concrete] @@ -1095,8 +1118,8 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %float.e3b: %f32.97e = float_value 1 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%float.e3b) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc26_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [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: %LongResult.cpp_destructor.type: type = fn_type @LongResult.cpp_destructor [concrete] @@ -1292,7 +1315,7 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %array_type: type = array_type %.loc26_30.4, %f32 [concrete = constants.%array_type] // CHECK:STDOUT: } // CHECK:STDOUT: %a: ref %array_type = ref_binding a, %a.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.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) @@ -1303,13 +1326,25 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc26_3.1(%self.param: ref %f32.9b3) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc26_3.2(%self.param: ref %f32.97e) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc26_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- copy_long.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Cpp.long: type = class_type @Long32 [concrete] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %pattern_type.68c: type = pattern_type %Cpp.long [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %ImplicitAs.type.819: type = facet_type <@ImplicitAs, @ImplicitAs(%Cpp.long)> [concrete] @@ -1328,8 +1363,8 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.539: type = fn_type_with_self_type %Copy.WithSelf.Op.type.11b, %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: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1377,14 +1412,19 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %long.ref.loc9: type = name_ref long, constants.%Cpp.long [concrete = constants.%Cpp.long] // CHECK:STDOUT: } // CHECK:STDOUT: %b: ref %Cpp.long = ref_binding b, %b.var -// CHECK:STDOUT: %Destroy.Op.bound.loc9: = bound_method %b.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc9: = bound_method %b.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc9: init %empty_tuple.type = call %Destroy.Op.bound.loc9(%b.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc8: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc8: = bound_method %a.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc8: init %empty_tuple.type = call %Destroy.Op.bound.loc8(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Cpp.long) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.2(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- comparisons_homogeneous_long.carbon // CHECK:STDOUT: @@ -2646,6 +2686,8 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Cpp.long: type = class_type @Long32 [concrete] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %pattern_type.68c: type = pattern_type %Cpp.long [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %ImplicitAs.type.819: type = facet_type <@ImplicitAs, @ImplicitAs(%Cpp.long)> [concrete] @@ -2816,8 +2858,8 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.19a: type = fn_type_with_self_type %RightShiftAssignWith.WithSelf.Op.type.6ca, %RightShiftAssignWith.facet [concrete] // CHECK:STDOUT: %Cpp.long.as.RightShiftAssignWith.impl.Op.specific_fn.1ec453.1: = specific_function %Cpp.long.as.RightShiftAssignWith.impl.Op.860e6c.2, @Cpp.long.as.RightShiftAssignWith.impl.Op.1(%ImplicitAs.facet.3fe) [concrete] // CHECK:STDOUT: %Cpp.long.as.RightShiftAssignWith.impl.Op.specific_fn.1ec453.2: = specific_function %Cpp.long.as.RightShiftAssignWith.impl.Op.860e6c.1, @Cpp.long.as.RightShiftAssignWith.impl.Op.2(%ImplicitAs.facet.3fe) [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = 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: } @@ -3049,14 +3091,19 @@ 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.3fe) [concrete = constants.%Cpp.long.as.RightShiftAssignWith.impl.Op.specific_fn.1ec453.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.Op.bound.loc9: = bound_method %b.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc9: = bound_method %b.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc9: init %empty_tuple.type = call %Destroy.Op.bound.loc9(%b.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc8: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc8: = bound_method %a.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc8: init %empty_tuple.type = call %Destroy.Op.bound.loc8(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Cpp.long) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.2(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- compound_assignment_hereogeneous_long_and_i32.carbon // CHECK:STDOUT: @@ -3064,6 +3111,7 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // 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: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %Cpp.long: type = class_type @Long32 [concrete] // CHECK:STDOUT: %pattern_type.68c: type = pattern_type %Cpp.long [concrete] @@ -3233,8 +3281,8 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.eaa: type = fn_type_with_self_type %RightShiftAssignWith.WithSelf.Op.type.e38, %RightShiftAssignWith.facet [concrete] // CHECK:STDOUT: %Cpp.long.as.RightShiftAssignWith.impl.Op.specific_fn.11c3db.1: = specific_function %Cpp.long.as.RightShiftAssignWith.impl.Op.56db42.2, @Cpp.long.as.RightShiftAssignWith.impl.Op.1(%ImplicitAs.facet.174) [concrete] // CHECK:STDOUT: %Cpp.long.as.RightShiftAssignWith.impl.Op.specific_fn.11c3db.2: = specific_function %Cpp.long.as.RightShiftAssignWith.impl.Op.56db42.1, @Cpp.long.as.RightShiftAssignWith.impl.Op.2(%ImplicitAs.facet.174) [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3537,18 +3585,25 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.loc20_9.1: %Cpp.long = value_of_initializer %i32.as.ImplicitAs.impl.Convert.call.loc20_9 // 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.4(%a.ref.loc20, %.loc20_9.2) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Cpp.long) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.2(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- compound_assignment_heterogeneous_long_and_int_literal.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Cpp.long: type = class_type @Long32 [concrete] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %pattern_type.68c: type = pattern_type %Cpp.long [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %ImplicitAs.type.819: type = facet_type <@ImplicitAs, @ImplicitAs(%Cpp.long)> [concrete] @@ -3576,8 +3631,8 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.2e2: type = fn_type_with_self_type %AddAssignWith.WithSelf.Op.type.e1c, %AddAssignWith.facet [concrete] // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.specific_fn.3a3075.1: = specific_function %Cpp.long.as.AddAssignWith.impl.Op.5fb128.2, @Cpp.long.as.AddAssignWith.impl.Op.1(%ImplicitAs.facet) [concrete] // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.specific_fn.3a3075.2: = specific_function %Cpp.long.as.AddAssignWith.impl.Op.5fb128.1, @Cpp.long.as.AddAssignWith.impl.Op.2(%ImplicitAs.facet) [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3634,12 +3689,17 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.loc9_8.1: %Cpp.long = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_8 [concrete = constants.%int_1.5a4] // CHECK:STDOUT: %.loc9_8.2: %Cpp.long = converted %int_1.loc9, %.loc9_8.1 [concrete = constants.%int_1.5a4] // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.call: init %empty_tuple.type = call %bound_method.loc9_5.4(%a.ref, %.loc9_8.2) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Cpp.long) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.2(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- compound_assignment_heterogeneous_long_and_runtime_i32.carbon // CHECK:STDOUT: @@ -3648,6 +3708,7 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %Cpp.long: type = class_type @Long32 [concrete] // 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.68c: type = pattern_type %Cpp.long [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %ImplicitAs.type.819: type = facet_type <@ImplicitAs, @ImplicitAs(%Cpp.long)> [concrete] @@ -3696,8 +3757,8 @@ fn CopyUnsignedLong() { // 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: %Cpp.long.as.AddAssignWith.impl.Op.specific_fn.2a1dd4.2: = specific_function %Cpp.long.as.AddAssignWith.impl.Op.d19046.1, @Cpp.long.as.AddAssignWith.impl.Op.2(%ImplicitAs.facet.174) [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3771,18 +3832,25 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.loc10_8.1: %Cpp.long = value_of_initializer %i32.as.ImplicitAs.impl.Convert.call.loc10_8 // 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.4(%a.ref, %.loc10_8.2) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Cpp.long) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.2(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- increment_decrement_long.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Cpp.long: type = class_type @Long32 [concrete] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %pattern_type.68c: type = pattern_type %Cpp.long [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %ImplicitAs.type.819: type = facet_type <@ImplicitAs, @ImplicitAs(%Cpp.long)> [concrete] @@ -3808,8 +3876,8 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.253: type = fn_type_with_self_type %Dec.WithSelf.Op.type.b87, %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: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3851,12 +3919,17 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %impl.elem0.loc10: %.253 = 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.Op.bound: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Cpp.long) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.2(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- unsigned_long.carbon // CHECK:STDOUT: @@ -3930,6 +4003,7 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %Cpp.unsigned_long.as.ImplicitAs.impl.Convert: %Cpp.unsigned_long.as.ImplicitAs.impl.Convert.type = struct_value () [concrete] // CHECK:STDOUT: %Cpp.unsigned_long.as.ImplicitAs.impl.Convert.bound: = bound_method %int_1.0ab, %Cpp.unsigned_long.as.ImplicitAs.impl.Convert [concrete] // CHECK:STDOUT: %array_type: type = array_type %int_1.5b8, %f32.97e [concrete] +// CHECK:STDOUT: %f32.9b3: type = float_type %int_32, f32 [concrete] // CHECK:STDOUT: %pattern_type.b36: type = pattern_type %array_type [concrete] // CHECK:STDOUT: %float.6da: Core.FloatLiteral = float_literal_value 10e-1 [concrete] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.FloatLiteral) [concrete] @@ -3950,8 +4024,8 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %float.e3b: %f32.97e = float_value 1 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%float.e3b) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc24_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [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: %ULongResult.cpp_destructor.type: type = fn_type @ULongResult.cpp_destructor [concrete] @@ -4140,7 +4214,7 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %array_type: type = array_type %.loc24_30.4, %f32 [concrete = constants.%array_type] // CHECK:STDOUT: } // CHECK:STDOUT: %a: ref %array_type = ref_binding a, %a.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.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) @@ -4151,13 +4225,25 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc24_3.1(%self.param: ref %f32.9b3) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc24_3.2(%self.param: ref %f32.97e) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc24_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- copy_unsigned_long.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Cpp.unsigned_long: type = class_type @ULong32 [concrete] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] +// CHECK:STDOUT: %u32.builtin: type = int_type unsigned, %int_32 [concrete] // CHECK:STDOUT: %pattern_type.5b7: type = pattern_type %Cpp.unsigned_long [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %ImplicitAs.type.3c3: type = facet_type <@ImplicitAs, @ImplicitAs(%Cpp.unsigned_long)> [concrete] @@ -4176,8 +4262,8 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.f45: type = fn_type_with_self_type %Copy.WithSelf.Op.type.973, %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: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -4225,12 +4311,17 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %unsigned_long.ref.loc9: type = name_ref unsigned_long, constants.%Cpp.unsigned_long [concrete = constants.%Cpp.unsigned_long] // CHECK:STDOUT: } // CHECK:STDOUT: %b: ref %Cpp.unsigned_long = ref_binding b, %b.var -// CHECK:STDOUT: %Destroy.Op.bound.loc9: = bound_method %b.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc9: = bound_method %b.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc9: init %empty_tuple.type = call %Destroy.Op.bound.loc9(%b.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc8: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc8: = bound_method %a.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc8: init %empty_tuple.type = call %Destroy.Op.bound.loc8(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Cpp.unsigned_long) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.1(%self.param: ref %u32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.2(%self.param: ref %Cpp.unsigned_long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/builtins.lp64.carbon b/toolchain/check/testdata/interop/cpp/builtins.lp64.carbon index 478d4c8ed46a..b1791e5eb885 100644 --- a/toolchain/check/testdata/interop/cpp/builtins.lp64.carbon +++ b/toolchain/check/testdata/interop/cpp/builtins.lp64.carbon @@ -682,6 +682,7 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Int.as.ImplicitAs.impl.Convert.535, @Int.as.ImplicitAs.impl.Convert(%int_64) [concrete] // CHECK:STDOUT: %bound_method.d1e: = bound_method %int_1.41a, %Int.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %array_type: type = array_type %int_1.5b8, %f32.97e [concrete] +// CHECK:STDOUT: %f32.9b3: type = float_type %int_32, f32 [concrete] // CHECK:STDOUT: %pattern_type.b36: type = pattern_type %array_type [concrete] // CHECK:STDOUT: %float.6da: Core.FloatLiteral = float_literal_value 10e-1 [concrete] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.FloatLiteral) [concrete] @@ -701,8 +702,8 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %bound_method.57d: = bound_method %float.6da, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %float.e3b: %f32.97e = float_value 1 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%float.e3b) [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc11_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -786,12 +787,22 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %array_type: type = array_type %.loc11_30.4, %f32 [concrete = constants.%array_type] // CHECK:STDOUT: } // CHECK:STDOUT: %a: ref %array_type = ref_binding a, %a.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc11_3.1(%self.param: ref %f32.9b3) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc11_3.2(%self.param: ref %f32.97e) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc11_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- unsigned_long.carbon // CHECK:STDOUT: @@ -844,6 +855,7 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %UInt.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %UInt.as.ImplicitAs.impl.Convert.309, @UInt.as.ImplicitAs.impl.Convert.1(%int_64) [concrete] // CHECK:STDOUT: %bound_method.f18: = bound_method %int_1.f23, %UInt.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %array_type: type = array_type %int_1.5b8, %f32.97e [concrete] +// CHECK:STDOUT: %f32.9b3: type = float_type %int_32, f32 [concrete] // CHECK:STDOUT: %pattern_type.b36: type = pattern_type %array_type [concrete] // CHECK:STDOUT: %float.6da: Core.FloatLiteral = float_literal_value 10e-1 [concrete] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.FloatLiteral) [concrete] @@ -863,8 +875,8 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %bound_method.57d: = bound_method %float.6da, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %float.e3b: %f32.97e = float_value 1 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%float.e3b) [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc11_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -948,12 +960,22 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %array_type: type = array_type %.loc11_30.4, %f32 [concrete = constants.%array_type] // CHECK:STDOUT: } // CHECK:STDOUT: %a: ref %array_type = ref_binding a, %a.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc11_3.1(%self.param: ref %f32.9b3) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc11_3.2(%self.param: ref %f32.97e) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc11_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- long_long.carbon // CHECK:STDOUT: @@ -1014,6 +1036,7 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %Cpp.long_long.as.ImplicitAs.impl.Convert: %Cpp.long_long.as.ImplicitAs.impl.Convert.type = struct_value () [concrete] // CHECK:STDOUT: %Cpp.long_long.as.ImplicitAs.impl.Convert.bound: = bound_method %int_1.092, %Cpp.long_long.as.ImplicitAs.impl.Convert [concrete] // CHECK:STDOUT: %array_type: type = array_type %int_1.5b8, %f32.97e [concrete] +// CHECK:STDOUT: %f32.9b3: type = float_type %int_32, f32 [concrete] // CHECK:STDOUT: %pattern_type.b36: type = pattern_type %array_type [concrete] // CHECK:STDOUT: %float.6da: Core.FloatLiteral = float_literal_value 10e-1 [concrete] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.FloatLiteral) [concrete] @@ -1034,8 +1057,8 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %float.e3b: %f32.97e = float_value 1 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%float.e3b) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc24_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [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: %LongLongResult.cpp_destructor.type: type = fn_type @LongLongResult.cpp_destructor [concrete] @@ -1218,7 +1241,7 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %array_type: type = array_type %.loc24_30.4, %f32 [concrete = constants.%array_type] // CHECK:STDOUT: } // CHECK:STDOUT: %a: ref %array_type = ref_binding a, %a.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.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) @@ -1229,13 +1252,25 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc24_3.1(%self.param: ref %f32.9b3) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc24_3.2(%self.param: ref %f32.97e) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc24_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- copy_long_long.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Cpp.long_long: type = class_type @LongLong64 [concrete] +// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete] +// CHECK:STDOUT: %i64.builtin: type = int_type signed, %int_64 [concrete] // CHECK:STDOUT: %pattern_type.76e: type = pattern_type %Cpp.long_long [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %ImplicitAs.type.a03: type = facet_type <@ImplicitAs, @ImplicitAs(%Cpp.long_long)> [concrete] @@ -1254,8 +1289,8 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.3c6: type = fn_type_with_self_type %Copy.WithSelf.Op.type.fdc, %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: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1303,14 +1338,19 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %long_long.ref.loc9: type = name_ref long_long, constants.%Cpp.long_long [concrete = constants.%Cpp.long_long] // CHECK:STDOUT: } // CHECK:STDOUT: %b: ref %Cpp.long_long = ref_binding b, %b.var -// CHECK:STDOUT: %Destroy.Op.bound.loc9: = bound_method %b.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc9: = bound_method %b.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc9: init %empty_tuple.type = call %Destroy.Op.bound.loc9(%b.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc8: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc8: = bound_method %a.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc8: init %empty_tuple.type = call %Destroy.Op.bound.loc8(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Cpp.long_long) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.1(%self.param: ref %i64.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.2(%self.param: ref %Cpp.long_long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- comparisons_homogeneous_long_long.carbon // CHECK:STDOUT: @@ -2364,6 +2404,8 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Cpp.long_long: type = class_type @LongLong64 [concrete] +// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete] +// CHECK:STDOUT: %i64.builtin: type = int_type signed, %int_64 [concrete] // CHECK:STDOUT: %pattern_type.76e: type = pattern_type %Cpp.long_long [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %ImplicitAs.type.a03: type = facet_type <@ImplicitAs, @ImplicitAs(%Cpp.long_long)> [concrete] @@ -2534,8 +2576,8 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.8eb: type = fn_type_with_self_type %RightShiftAssignWith.WithSelf.Op.type.eb3, %RightShiftAssignWith.facet [concrete] // CHECK:STDOUT: %Cpp.long_long.as.RightShiftAssignWith.impl.Op.specific_fn.df86ad.1: = specific_function %Cpp.long_long.as.RightShiftAssignWith.impl.Op.4e9b16.2, @Cpp.long_long.as.RightShiftAssignWith.impl.Op.1(%ImplicitAs.facet.c8d) [concrete] // CHECK:STDOUT: %Cpp.long_long.as.RightShiftAssignWith.impl.Op.specific_fn.df86ad.2: = specific_function %Cpp.long_long.as.RightShiftAssignWith.impl.Op.4e9b16.1, @Cpp.long_long.as.RightShiftAssignWith.impl.Op.2(%ImplicitAs.facet.c8d) [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = 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: } @@ -2767,14 +2809,19 @@ 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.c8d) [concrete = constants.%Cpp.long_long.as.RightShiftAssignWith.impl.Op.specific_fn.df86ad.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.Op.bound.loc9: = bound_method %b.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc9: = bound_method %b.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc9: init %empty_tuple.type = call %Destroy.Op.bound.loc9(%b.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc8: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc8: = bound_method %a.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc8: init %empty_tuple.type = call %Destroy.Op.bound.loc8(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Cpp.long_long) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.1(%self.param: ref %i64.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.2(%self.param: ref %Cpp.long_long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- compound_assignment_hereogeneous_long_long_and_i64.carbon // CHECK:STDOUT: @@ -2782,6 +2829,7 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // 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: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %Cpp.long_long: type = class_type @LongLong64 [concrete] // CHECK:STDOUT: %pattern_type.76e: type = pattern_type %Cpp.long_long [concrete] @@ -2951,8 +2999,8 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.298: type = fn_type_with_self_type %RightShiftAssignWith.WithSelf.Op.type.eb9, %RightShiftAssignWith.facet [concrete] // CHECK:STDOUT: %Cpp.long_long.as.RightShiftAssignWith.impl.Op.specific_fn.1c2239.1: = specific_function %Cpp.long_long.as.RightShiftAssignWith.impl.Op.efc522.2, @Cpp.long_long.as.RightShiftAssignWith.impl.Op.1(%ImplicitAs.facet.c59) [concrete] // CHECK:STDOUT: %Cpp.long_long.as.RightShiftAssignWith.impl.Op.specific_fn.1c2239.2: = specific_function %Cpp.long_long.as.RightShiftAssignWith.impl.Op.efc522.1, @Cpp.long_long.as.RightShiftAssignWith.impl.Op.2(%ImplicitAs.facet.c59) [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3255,18 +3303,25 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.loc20_9.1: %Cpp.long_long = value_of_initializer %i64.as.ImplicitAs.impl.Convert.call.loc20_9 // 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.4(%a.ref.loc20, %.loc20_9.2) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Cpp.long_long) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.1(%self.param: ref %i64.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.2(%self.param: ref %Cpp.long_long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- compound_assignment_heterogeneous_long_long_and_int_literal.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Cpp.long_long: type = class_type @LongLong64 [concrete] +// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete] +// CHECK:STDOUT: %i64.builtin: type = int_type signed, %int_64 [concrete] // CHECK:STDOUT: %pattern_type.76e: type = pattern_type %Cpp.long_long [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %ImplicitAs.type.a03: type = facet_type <@ImplicitAs, @ImplicitAs(%Cpp.long_long)> [concrete] @@ -3294,8 +3349,8 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.883: type = fn_type_with_self_type %AddAssignWith.WithSelf.Op.type.58a, %AddAssignWith.facet [concrete] // CHECK:STDOUT: %Cpp.long_long.as.AddAssignWith.impl.Op.specific_fn.918060.1: = specific_function %Cpp.long_long.as.AddAssignWith.impl.Op.d69079.2, @Cpp.long_long.as.AddAssignWith.impl.Op.1(%ImplicitAs.facet) [concrete] // CHECK:STDOUT: %Cpp.long_long.as.AddAssignWith.impl.Op.specific_fn.918060.2: = specific_function %Cpp.long_long.as.AddAssignWith.impl.Op.d69079.1, @Cpp.long_long.as.AddAssignWith.impl.Op.2(%ImplicitAs.facet) [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3352,12 +3407,17 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.loc9_8.1: %Cpp.long_long = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_8 [concrete = constants.%int_1.092] // CHECK:STDOUT: %.loc9_8.2: %Cpp.long_long = converted %int_1.loc9, %.loc9_8.1 [concrete = constants.%int_1.092] // CHECK:STDOUT: %Cpp.long_long.as.AddAssignWith.impl.Op.call: init %empty_tuple.type = call %bound_method.loc9_5.4(%a.ref, %.loc9_8.2) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Cpp.long_long) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.1(%self.param: ref %i64.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.2(%self.param: ref %Cpp.long_long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- compound_assignment_heterogeneous_long_long_and_runtime_i64.carbon // CHECK:STDOUT: @@ -3366,6 +3426,7 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %Cpp.long_long: type = class_type @LongLong64 [concrete] // 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.76e: type = pattern_type %Cpp.long_long [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %ImplicitAs.type.a03: type = facet_type <@ImplicitAs, @ImplicitAs(%Cpp.long_long)> [concrete] @@ -3414,8 +3475,8 @@ fn CopyUnsignedLongLong() { // 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: %Cpp.long_long.as.AddAssignWith.impl.Op.specific_fn.50a783.2: = specific_function %Cpp.long_long.as.AddAssignWith.impl.Op.fa1912.1, @Cpp.long_long.as.AddAssignWith.impl.Op.2(%ImplicitAs.facet.c59) [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3489,18 +3550,25 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.loc10_8.1: %Cpp.long_long = value_of_initializer %i64.as.ImplicitAs.impl.Convert.call.loc10_8 // 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.4(%a.ref, %.loc10_8.2) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Cpp.long_long) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.1(%self.param: ref %i64.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.2(%self.param: ref %Cpp.long_long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- increment_decrement_long_long.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Cpp.long_long: type = class_type @LongLong64 [concrete] +// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete] +// CHECK:STDOUT: %i64.builtin: type = int_type signed, %int_64 [concrete] // CHECK:STDOUT: %pattern_type.76e: type = pattern_type %Cpp.long_long [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %ImplicitAs.type.a03: type = facet_type <@ImplicitAs, @ImplicitAs(%Cpp.long_long)> [concrete] @@ -3526,8 +3594,8 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.c6e: type = fn_type_with_self_type %Dec.WithSelf.Op.type.241, %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: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3569,12 +3637,17 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %impl.elem0.loc10: %.c6e = 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.Op.bound: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Cpp.long_long) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.1(%self.param: ref %i64.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.2(%self.param: ref %Cpp.long_long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- unsigned_long_long.carbon // CHECK:STDOUT: @@ -3649,6 +3722,7 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %Cpp.unsigned_long_long.as.ImplicitAs.impl.Convert: %Cpp.unsigned_long_long.as.ImplicitAs.impl.Convert.type = struct_value () [concrete] // CHECK:STDOUT: %Cpp.unsigned_long_long.as.ImplicitAs.impl.Convert.bound: = bound_method %int_1.79a, %Cpp.unsigned_long_long.as.ImplicitAs.impl.Convert [concrete] // CHECK:STDOUT: %array_type: type = array_type %int_1.5b8, %f32.97e [concrete] +// CHECK:STDOUT: %f32.9b3: type = float_type %int_32, f32 [concrete] // CHECK:STDOUT: %pattern_type.b36: type = pattern_type %array_type [concrete] // CHECK:STDOUT: %float.6da: Core.FloatLiteral = float_literal_value 10e-1 [concrete] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.FloatLiteral) [concrete] @@ -3669,8 +3743,8 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %float.e3b: %f32.97e = float_value 1 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%float.e3b) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc24_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [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: %ULongLongResult.cpp_destructor.type: type = fn_type @ULongLongResult.cpp_destructor [concrete] @@ -3859,7 +3933,7 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %array_type: type = array_type %.loc24_30.4, %f32 [concrete = constants.%array_type] // CHECK:STDOUT: } // CHECK:STDOUT: %a: ref %array_type = ref_binding a, %a.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.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) @@ -3870,13 +3944,25 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc24_3.1(%self.param: ref %f32.9b3) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc24_3.2(%self.param: ref %f32.97e) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc24_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- copy_unsigned_long_long.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Cpp.unsigned_long_long: type = class_type @ULongLong64 [concrete] +// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete] +// CHECK:STDOUT: %u64.builtin: type = int_type unsigned, %int_64 [concrete] // CHECK:STDOUT: %pattern_type.ebd: type = pattern_type %Cpp.unsigned_long_long [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %ImplicitAs.type.407: type = facet_type <@ImplicitAs, @ImplicitAs(%Cpp.unsigned_long_long)> [concrete] @@ -3895,8 +3981,8 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.d24: type = fn_type_with_self_type %Copy.WithSelf.Op.type.04c, %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: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3944,12 +4030,17 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %unsigned_long_long.ref.loc9: type = name_ref unsigned_long_long, constants.%Cpp.unsigned_long_long [concrete = constants.%Cpp.unsigned_long_long] // CHECK:STDOUT: } // CHECK:STDOUT: %b: ref %Cpp.unsigned_long_long = ref_binding b, %b.var -// CHECK:STDOUT: %Destroy.Op.bound.loc9: = bound_method %b.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc9: = bound_method %b.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc9: init %empty_tuple.type = call %Destroy.Op.bound.loc9(%b.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc8: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc8: = bound_method %a.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc8: init %empty_tuple.type = call %Destroy.Op.bound.loc8(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Cpp.unsigned_long_long) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.1(%self.param: ref %u64.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.2(%self.param: ref %Cpp.unsigned_long_long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/class/method.carbon b/toolchain/check/testdata/interop/cpp/class/method.carbon index 29981c4384c0..e02b91d9eba9 100644 --- a/toolchain/check/testdata/interop/cpp/class/method.carbon +++ b/toolchain/check/testdata/interop/cpp/class/method.carbon @@ -355,6 +355,7 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) { // CHECK:STDOUT: %ptr.2a2: type = ptr_type %NoRefQualifier [concrete] // 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.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %NoRefQualifier.F.cpp_overload_set.type: type = cpp_overload_set_type @NoRefQualifier.F.cpp_overload_set [concrete] // CHECK:STDOUT: %NoRefQualifier.F.cpp_overload_set.value: %NoRefQualifier.F.cpp_overload_set.type = cpp_overload_set_value @NoRefQualifier.F.cpp_overload_set [concrete] @@ -366,8 +367,8 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) { // CHECK:STDOUT: %NoRefQualifier.F.d50a5a.2: %NoRefQualifier.F.type.b65611.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc9 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: %WithRefQualifier: type = class_type @WithRefQualifier [concrete] // CHECK:STDOUT: %pattern_type.4ed: type = pattern_type %WithRefQualifier [concrete] // CHECK:STDOUT: %ptr.c86: type = ptr_type %WithRefQualifier [concrete] @@ -446,14 +447,19 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) { // CHECK:STDOUT: %b: ref %ptr.235 = ref_binding b, %b.var // CHECK:STDOUT: %Destroy.Op.bound.loc9: = bound_method %b.var, constants.%Destroy.Op.651ba6.1 // CHECK:STDOUT: %Destroy.Op.call.loc9: init %empty_tuple.type = call %Destroy.Op.bound.loc9(%b.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc8: = bound_method %a.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc8: = bound_method %a.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call.loc8: init %empty_tuple.type = call %Destroy.Op.bound.loc8(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.Op.loc9(%self.param: ref %ptr.235) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc8(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @CallFWithRefQualifier(%v.param: %WithRefQualifier, %p.param: %ptr.c86) { // CHECK:STDOUT: !entry: @@ -487,7 +493,7 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) { // CHECK:STDOUT: %b: ref %ptr.235 = ref_binding b, %b.var // CHECK:STDOUT: %Destroy.Op.bound.loc16: = bound_method %b.var, constants.%Destroy.Op.651ba6.1 // CHECK:STDOUT: %Destroy.Op.call.loc16: init %empty_tuple.type = call %Destroy.Op.bound.loc16(%b.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc15: = bound_method %a.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc15: = bound_method %a.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call.loc15: init %empty_tuple.type = call %Destroy.Op.bound.loc15(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interop/cpp/function/arithmetic_types_bridged.carbon b/toolchain/check/testdata/interop/cpp/function/arithmetic_types_bridged.carbon index deb660f21592..f379435473a4 100644 --- a/toolchain/check/testdata/interop/cpp/function/arithmetic_types_bridged.carbon +++ b/toolchain/check/testdata/interop/cpp/function/arithmetic_types_bridged.carbon @@ -685,6 +685,7 @@ fn F() { // CHECK:STDOUT: %ptr.5c1: 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] +// CHECK:STDOUT: %i8.builtin: type = int_type signed, %int_8 [concrete] // CHECK:STDOUT: %ImplicitAs.type.ee6: type = facet_type <@ImplicitAs, @ImplicitAs(%i8)> [concrete] // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic] @@ -713,6 +714,9 @@ fn F() { // CHECK:STDOUT: %bound_method.81a: = bound_method %int_-1.416, %Int.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %.702: ref %i8 = temporary invalid, %int_-1.416 [concrete] // CHECK:STDOUT: %addr: %ptr.5c1 = addr_of %.702 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8_11.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.702, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -761,10 +765,16 @@ fn F() { // CHECK:STDOUT: %.loc8_11.6: ref %i8 = temporary %.loc8_11.5, %Int.as.Copy.impl.Op.call [concrete = constants.%.702] // CHECK:STDOUT: %addr: %ptr.5c1 = 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.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.702) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i8) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_11.1(%self.param: ref %i8.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_11.2(%self.param: ref %i8) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_unsigned_char_param.carbon // CHECK:STDOUT: @@ -779,6 +789,7 @@ fn F() { // CHECK:STDOUT: %ptr.3e8: 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] +// CHECK:STDOUT: %u8.builtin: type = int_type unsigned, %int_8 [concrete] // CHECK:STDOUT: %ImplicitAs.type.8ae: type = facet_type <@ImplicitAs, @ImplicitAs(%u8)> [concrete] // CHECK:STDOUT: %To.fe9: Core.IntLiteral = symbolic_binding To, 0 [symbolic] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.6a6: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To.fe9) [symbolic] @@ -807,6 +818,9 @@ fn F() { // CHECK:STDOUT: %bound_method.98f: = bound_method %int_1.e80, %UInt.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %.84f: ref %u8 = temporary invalid, %int_1.e80 [concrete] // CHECK:STDOUT: %addr: %ptr.3e8 = addr_of %.84f [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8_11.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.84f, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -847,10 +861,16 @@ fn F() { // CHECK:STDOUT: %.loc8_11.4: ref %u8 = temporary %.loc8_11.3, %UInt.as.Copy.impl.Op.call [concrete = constants.%.84f] // CHECK:STDOUT: %addr: %ptr.3e8 = 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.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.84f) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %u8) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_11.1(%self.param: ref %u8.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_11.2(%self.param: ref %u8) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_char_param.carbon // CHECK:STDOUT: @@ -860,6 +880,8 @@ fn F() { // CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete] // CHECK:STDOUT: %.d16: Core.CharLiteral = char_value U+0058 [concrete] // CHECK:STDOUT: %char: type = class_type @Char [concrete] +// CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [concrete] +// CHECK:STDOUT: %u8.builtin: type = int_type unsigned, %int_8 [concrete] // CHECK:STDOUT: %ptr.fb0: 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] @@ -882,6 +904,9 @@ fn F() { // CHECK:STDOUT: %char.as.Copy.impl.Op.bound: = bound_method %int_88, %char.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %.3df: ref %char = temporary invalid, %int_88 [concrete] // CHECK:STDOUT: %addr: %ptr.fb0 = addr_of %.3df [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8_11.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.3df, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -918,10 +943,16 @@ fn F() { // CHECK:STDOUT: %.loc8_11.5: ref %char = temporary %.loc8_11.4, %char.as.Copy.impl.Op.call [concrete = constants.%.3df] // CHECK:STDOUT: %addr: %ptr.fb0 = 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.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.3df) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %char) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_11.1(%self.param: ref %u8.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_11.2(%self.param: ref %char) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_import_wchar_t_param.carbon // CHECK:STDOUT: @@ -1063,6 +1094,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: %i16.builtin: type = int_type signed, %int_16 [concrete] // CHECK:STDOUT: %As.type.359: type = facet_type <@As, @As(%i16)> [concrete] // CHECK:STDOUT: %To.fe9: Core.IntLiteral = symbolic_binding To, 0 [symbolic] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.09e: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%To.fe9) [symbolic] @@ -1094,6 +1126,9 @@ fn F() { // CHECK:STDOUT: %bound_method.a48: = bound_method %int_1.f90, %Int.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %.dde: ref %i16 = temporary invalid, %int_1.f90 [concrete] // CHECK:STDOUT: %addr: %ptr.251 = addr_of %.dde [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8_13.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.dde, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1135,10 +1170,16 @@ fn F() { // CHECK:STDOUT: %.loc8_13.4: ref %i16 = temporary %.loc8_13.3, %Int.as.Copy.impl.Op.call [concrete = constants.%.dde] // CHECK:STDOUT: %addr: %ptr.251 = 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.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.dde) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i16) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_13.1(%self.param: ref %i16.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_13.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_short_param_max.carbon // CHECK:STDOUT: @@ -1153,6 +1194,7 @@ fn F() { // CHECK:STDOUT: %ptr.251: 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] +// CHECK:STDOUT: %i16.builtin: type = int_type signed, %int_16 [concrete] // CHECK:STDOUT: %ImplicitAs.type.9fb: type = facet_type <@ImplicitAs, @ImplicitAs(%i16)> [concrete] // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic] @@ -1181,6 +1223,9 @@ fn F() { // CHECK:STDOUT: %bound_method.964: = bound_method %int_32767.faa, %Int.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %.436: ref %i16 = temporary invalid, %int_32767.faa [concrete] // CHECK:STDOUT: %addr: %ptr.251 = addr_of %.436 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8_11.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.436, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1221,10 +1266,16 @@ fn F() { // CHECK:STDOUT: %.loc8_11.4: ref %i16 = temporary %.loc8_11.3, %Int.as.Copy.impl.Op.call [concrete = constants.%.436] // CHECK:STDOUT: %addr: %ptr.251 = 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.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.436) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i16) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_11.1(%self.param: ref %i16.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_11.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_short_param_min.carbon // CHECK:STDOUT: @@ -1248,6 +1299,7 @@ fn F() { // CHECK:STDOUT: %ptr.251: 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] +// CHECK:STDOUT: %i16.builtin: type = int_type signed, %int_16 [concrete] // CHECK:STDOUT: %ImplicitAs.type.9fb: type = facet_type <@ImplicitAs, @ImplicitAs(%i16)> [concrete] // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic] @@ -1276,6 +1328,9 @@ fn F() { // CHECK:STDOUT: %bound_method.971: = bound_method %int_-32768.7e5, %Int.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %.81f: ref %i16 = temporary invalid, %int_-32768.7e5 [concrete] // CHECK:STDOUT: %addr: %ptr.251 = addr_of %.81f [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8_11.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.81f, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1324,10 +1379,16 @@ fn F() { // CHECK:STDOUT: %.loc8_11.6: ref %i16 = temporary %.loc8_11.5, %Int.as.Copy.impl.Op.call [concrete = constants.%.81f] // CHECK:STDOUT: %addr: %ptr.251 = 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.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.81f) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i16) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_11.1(%self.param: ref %i16.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_11.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_short_int_param.carbon // CHECK:STDOUT: @@ -1339,6 +1400,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: %i16.builtin: type = int_type signed, %int_16 [concrete] // CHECK:STDOUT: %As.type.359: type = facet_type <@As, @As(%i16)> [concrete] // CHECK:STDOUT: %To.fe9: Core.IntLiteral = symbolic_binding To, 0 [symbolic] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.09e: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%To.fe9) [symbolic] @@ -1370,6 +1432,9 @@ fn F() { // CHECK:STDOUT: %bound_method.a48: = bound_method %int_1.f90, %Int.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %.dde: ref %i16 = temporary invalid, %int_1.f90 [concrete] // CHECK:STDOUT: %addr: %ptr.251 = addr_of %.dde [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8_13.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.dde, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1411,10 +1476,16 @@ fn F() { // CHECK:STDOUT: %.loc8_13.4: ref %i16 = temporary %.loc8_13.3, %Int.as.Copy.impl.Op.call [concrete = constants.%.dde] // CHECK:STDOUT: %addr: %ptr.251 = 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.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.dde) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i16) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_13.1(%self.param: ref %i16.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_13.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_signed_short_param.carbon // CHECK:STDOUT: @@ -1426,6 +1497,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: %i16.builtin: type = int_type signed, %int_16 [concrete] // CHECK:STDOUT: %As.type.359: type = facet_type <@As, @As(%i16)> [concrete] // CHECK:STDOUT: %To.fe9: Core.IntLiteral = symbolic_binding To, 0 [symbolic] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.09e: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%To.fe9) [symbolic] @@ -1457,6 +1529,9 @@ fn F() { // CHECK:STDOUT: %bound_method.a48: = bound_method %int_1.f90, %Int.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %.dde: ref %i16 = temporary invalid, %int_1.f90 [concrete] // CHECK:STDOUT: %addr: %ptr.251 = addr_of %.dde [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8_13.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.dde, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1498,10 +1573,16 @@ fn F() { // CHECK:STDOUT: %.loc8_13.4: ref %i16 = temporary %.loc8_13.3, %Int.as.Copy.impl.Op.call [concrete = constants.%.dde] // CHECK:STDOUT: %addr: %ptr.251 = 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.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.dde) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i16) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_13.1(%self.param: ref %i16.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_13.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_signed_short_int_param.carbon // CHECK:STDOUT: @@ -1513,6 +1594,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: %i16.builtin: type = int_type signed, %int_16 [concrete] // CHECK:STDOUT: %As.type.359: type = facet_type <@As, @As(%i16)> [concrete] // CHECK:STDOUT: %To.fe9: Core.IntLiteral = symbolic_binding To, 0 [symbolic] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.09e: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%To.fe9) [symbolic] @@ -1544,6 +1626,9 @@ fn F() { // CHECK:STDOUT: %bound_method.a48: = bound_method %int_1.f90, %Int.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %.dde: ref %i16 = temporary invalid, %int_1.f90 [concrete] // CHECK:STDOUT: %addr: %ptr.251 = addr_of %.dde [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8_13.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.dde, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1585,10 +1670,16 @@ fn F() { // CHECK:STDOUT: %.loc8_13.4: ref %i16 = temporary %.loc8_13.3, %Int.as.Copy.impl.Op.call [concrete = constants.%.dde] // CHECK:STDOUT: %addr: %ptr.251 = 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.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.dde) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i16) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_13.1(%self.param: ref %i16.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_13.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_int16_t_param.carbon // CHECK:STDOUT: @@ -1600,6 +1691,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: %i16.builtin: type = int_type signed, %int_16 [concrete] // CHECK:STDOUT: %As.type.359: type = facet_type <@As, @As(%i16)> [concrete] // CHECK:STDOUT: %To.fe9: Core.IntLiteral = symbolic_binding To, 0 [symbolic] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.09e: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%To.fe9) [symbolic] @@ -1631,6 +1723,9 @@ fn F() { // CHECK:STDOUT: %bound_method.a48: = bound_method %int_1.f90, %Int.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %.dde: ref %i16 = temporary invalid, %int_1.f90 [concrete] // CHECK:STDOUT: %addr: %ptr.251 = addr_of %.dde [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8_13.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.dde, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1672,10 +1767,16 @@ fn F() { // CHECK:STDOUT: %.loc8_13.4: ref %i16 = temporary %.loc8_13.3, %Int.as.Copy.impl.Op.call [concrete = constants.%.dde] // CHECK:STDOUT: %addr: %ptr.251 = 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.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.dde) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i16) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_13.1(%self.param: ref %i16.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_13.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_float16_param.carbon // CHECK:STDOUT: @@ -1687,6 +1788,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: %f16.a6a: type = class_type @Float, @Float(%int_16) [concrete] +// CHECK:STDOUT: %f16.3ab: type = float_type %int_16, f16 [concrete] // CHECK:STDOUT: %As.type.b64: type = facet_type <@As, @As(%f16.a6a)> [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.As.impl.Convert.type.882: type = fn_type @Core.FloatLiteral.as.As.impl.Convert, @Core.FloatLiteral.as.As.impl(%N) [symbolic] // CHECK:STDOUT: %Core.FloatLiteral.as.As.impl.Convert.27d: %Core.FloatLiteral.as.As.impl.Convert.type.882 = struct_value () [symbolic] @@ -1717,6 +1819,9 @@ fn F() { // CHECK:STDOUT: %bound_method.670: = bound_method %float.032, %Float.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %.9d1: ref %f16.a6a = temporary invalid, %float.032 [concrete] // CHECK:STDOUT: %addr: %ptr.823 = addr_of %.9d1 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8_15.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.9d1, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1758,10 +1863,16 @@ fn F() { // CHECK:STDOUT: %.loc8_15.4: ref %f16.a6a = temporary %.loc8_15.3, %Float.as.Copy.impl.Op.call [concrete = constants.%.9d1] // CHECK:STDOUT: %addr: %ptr.823 = 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.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.9d1) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %f16.a6a) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_15.1(%self.param: ref %f16.3ab) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_15.2(%self.param: ref %f16.a6a) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_float_param.carbon // CHECK:STDOUT: @@ -1773,6 +1884,7 @@ fn F() { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] // CHECK:STDOUT: %f32.97e: type = class_type @Float, @Float(%int_32) [concrete] +// CHECK:STDOUT: %f32.9b3: type = float_type %int_32, f32 [concrete] // CHECK:STDOUT: %As.type.9fc: type = facet_type <@As, @As(%f32.97e)> [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.As.impl.Convert.type.882: type = fn_type @Core.FloatLiteral.as.As.impl.Convert, @Core.FloatLiteral.as.As.impl(%N) [symbolic] // CHECK:STDOUT: %Core.FloatLiteral.as.As.impl.Convert.27d: %Core.FloatLiteral.as.As.impl.Convert.type.882 = struct_value () [symbolic] @@ -1803,6 +1915,9 @@ fn F() { // CHECK:STDOUT: %bound_method.d87: = bound_method %float.4cb, %Float.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %.404: ref %f32.97e = temporary invalid, %float.4cb [concrete] // CHECK:STDOUT: %addr: %ptr.0bc = addr_of %.404 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8_15.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.404, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1844,10 +1959,16 @@ fn F() { // CHECK:STDOUT: %.loc8_15.4: ref %f32.97e = temporary %.loc8_15.3, %Float.as.Copy.impl.Op.call [concrete = constants.%.404] // CHECK:STDOUT: %addr: %ptr.0bc = 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.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.404) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %f32.97e) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_15.1(%self.param: ref %f32.9b3) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_15.2(%self.param: ref %f32.97e) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_double_param.carbon // CHECK:STDOUT: @@ -1859,6 +1980,7 @@ fn F() { // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete] // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] // CHECK:STDOUT: %f64.d77: type = class_type @Float, @Float(%int_64) [concrete] +// CHECK:STDOUT: %f64.794: type = float_type %int_64, f64 [concrete] // CHECK:STDOUT: %As.type.a57: type = facet_type <@As, @As(%f64.d77)> [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.As.impl.Convert.type.882: type = fn_type @Core.FloatLiteral.as.As.impl.Convert, @Core.FloatLiteral.as.As.impl(%N) [symbolic] // CHECK:STDOUT: %Core.FloatLiteral.as.As.impl.Convert.27d: %Core.FloatLiteral.as.As.impl.Convert.type.882 = struct_value () [symbolic] @@ -1889,6 +2011,9 @@ fn F() { // CHECK:STDOUT: %bound_method.36b: = bound_method %float.0fc, %Float.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %.39a: ref %f64.d77 = temporary invalid, %float.0fc [concrete] // CHECK:STDOUT: %addr: %ptr.bcc = addr_of %.39a [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8_15.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.39a, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1930,10 +2055,16 @@ fn F() { // CHECK:STDOUT: %.loc8_15.4: ref %f64.d77 = temporary %.loc8_15.3, %Float.as.Copy.impl.Op.call [concrete = constants.%.39a] // CHECK:STDOUT: %addr: %ptr.bcc = 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.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.39a) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %f64.d77) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_15.1(%self.param: ref %f64.794) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_15.2(%self.param: ref %f64.d77) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_float128_param.carbon // CHECK:STDOUT: @@ -1945,6 +2076,7 @@ fn F() { // CHECK:STDOUT: %int_128: Core.IntLiteral = int_value 128 [concrete] // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] // CHECK:STDOUT: %f128.b8c: type = class_type @Float, @Float(%int_128) [concrete] +// CHECK:STDOUT: %f128.853: type = float_type %int_128, f128 [concrete] // CHECK:STDOUT: %As.type.6c6: type = facet_type <@As, @As(%f128.b8c)> [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.As.impl.Convert.type.882: type = fn_type @Core.FloatLiteral.as.As.impl.Convert, @Core.FloatLiteral.as.As.impl(%N) [symbolic] // CHECK:STDOUT: %Core.FloatLiteral.as.As.impl.Convert.27d: %Core.FloatLiteral.as.As.impl.Convert.type.882 = struct_value () [symbolic] @@ -1975,6 +2107,9 @@ fn F() { // CHECK:STDOUT: %bound_method.6ed: = bound_method %float.709, %Float.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %.1c5: ref %f128.b8c = temporary invalid, %float.709 [concrete] // CHECK:STDOUT: %addr: %ptr.402 = addr_of %.1c5 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8_15.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.1c5, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -2016,10 +2151,16 @@ fn F() { // CHECK:STDOUT: %.loc8_15.4: ref %f128.b8c = temporary %.loc8_15.3, %Float.as.Copy.impl.Op.call [concrete = constants.%.1c5] // CHECK:STDOUT: %addr: %ptr.402 = 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.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.1c5) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %f128.b8c) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_15.1(%self.param: ref %f128.853) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_15.2(%self.param: ref %f128.b8c) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_bool_return.carbon // CHECK:STDOUT: @@ -2076,14 +2217,15 @@ fn F() { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [concrete] +// CHECK:STDOUT: %i16.builtin: type = int_type signed, %int_16 [concrete] // CHECK:STDOUT: %pattern_type.2f8: type = pattern_type %i16 [concrete] // CHECK:STDOUT: %foo_short.cpp_overload_set.type: type = cpp_overload_set_type @foo_short.cpp_overload_set [concrete] // CHECK:STDOUT: %foo_short.cpp_overload_set.value: %foo_short.cpp_overload_set.type = cpp_overload_set_value @foo_short.cpp_overload_set [concrete] // 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: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8_37.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -2114,12 +2256,17 @@ fn F() { // CHECK:STDOUT: %.loc8_37.3: ref %i16 = temporary %.loc8_37.1, %.loc8_37.2 // CHECK:STDOUT: %.loc8_37.4: %i16 = acquire_value %.loc8_37.3 // CHECK:STDOUT: %x: %i16 = value_binding x, %.loc8_37.4 -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc8_37.3, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc8_37.3, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc8_37.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i16) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_37.1(%self.param: ref %i16.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_37.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_import_bit_int_24_param.carbon // CHECK:STDOUT: @@ -2151,14 +2298,15 @@ fn F() { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete] // CHECK:STDOUT: %f64.d77: type = class_type @Float, @Float(%int_64) [concrete] +// CHECK:STDOUT: %f64.794: type = float_type %int_64, f64 [concrete] // CHECK:STDOUT: %pattern_type.0ae: type = pattern_type %f64.d77 [concrete] // CHECK:STDOUT: %foo_double.cpp_overload_set.type: type = cpp_overload_set_type @foo_double.cpp_overload_set [concrete] // CHECK:STDOUT: %foo_double.cpp_overload_set.value: %foo_double.cpp_overload_set.type = cpp_overload_set_value @foo_double.cpp_overload_set [concrete] // CHECK:STDOUT: %ptr: type = ptr_type %f64.d77 [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: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8_38.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -2189,10 +2337,15 @@ fn F() { // CHECK:STDOUT: %.loc8_38.3: ref %f64.d77 = temporary %.loc8_38.1, %.loc8_38.2 // CHECK:STDOUT: %.loc8_38.4: %f64.d77 = acquire_value %.loc8_38.3 // CHECK:STDOUT: %x: %f64.d77 = value_binding x, %.loc8_38.4 -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc8_38.3, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc8_38.3, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc8_38.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %f64.d77) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_38.1(%self.param: ref %f64.794) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_38.2(%self.param: ref %f64.d77) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/decayed_param.carbon b/toolchain/check/testdata/interop/cpp/function/decayed_param.carbon index f11441a9d259..05aeb31c5f17 100644 --- a/toolchain/check/testdata/interop/cpp/function/decayed_param.carbon +++ b/toolchain/check/testdata/interop/cpp/function/decayed_param.carbon @@ -83,6 +83,7 @@ fn F() { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [concrete] // CHECK:STDOUT: %array_type.643: type = array_type %int_42, %i32 [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %pattern_type.b6e: type = pattern_type %array_type.643 [concrete] // CHECK:STDOUT: %DefaultOrUnformed.type: type = facet_type <@DefaultOrUnformed> [concrete] // CHECK:STDOUT: %UnformedInit.type: type = facet_type <@UnformedInit> [concrete] @@ -125,6 +126,11 @@ fn F() { // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.Some.38a: %ptr.as.OptionalStorage.impl.Some.type.c7a = struct_value () [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.None.type.03c: type = fn_type @ptr.as.OptionalStorage.impl.None, @ptr.as.OptionalStorage.impl(%T.67d) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.None.f37: %ptr.as.OptionalStorage.impl.None.type.03c = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.1 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.8d7fae.1: = custom_witness (%Destroy.Op.651ba6.1), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.252: %Destroy.type = facet_value %ptr.235, (%custom_witness.8d7fae.1) [concrete] +// CHECK:STDOUT: %MaybeUnformed.859: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.252) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.e42: = impl_witness imports.%OptionalStorage.impl_witness_table.851, @ptr.as.OptionalStorage.impl(%i32) [concrete] // CHECK:STDOUT: %OptionalStorage.facet.6bd: %OptionalStorage.type = facet_value %ptr.235, (%OptionalStorage.impl_witness.e42) [concrete] // CHECK:STDOUT: %Optional.75d: type = class_type @Optional, @Optional(%OptionalStorage.facet.6bd) [concrete] @@ -160,10 +166,10 @@ fn F() { // CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.bound: = bound_method %uninit, %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.a00 [concrete] // CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.a00, @Cpp.nullptr_t.as.ImplicitAs.impl.Convert(%i32) [concrete] // CHECK:STDOUT: %bound_method.3ee: = bound_method %uninit, %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.specific_fn [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc13 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc10 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc13_21.2 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.7: type = fn_type @Destroy.Op.loc10_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.7: %Destroy.Op.type.bae255.7 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -264,18 +270,36 @@ fn F() { // CHECK:STDOUT: %.loc13_21.3: ref %Optional.75d = temporary %.loc13_21.2, %.loc13_21.1 // CHECK:STDOUT: %.loc13_21.4: %Optional.75d = acquire_value %.loc13_21.3 // CHECK:STDOUT: %TakesArray.call.loc13: init %empty_tuple.type = call imports.%TakesArray.decl(%.loc13_21.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc13: = bound_method %.loc13_21.3, constants.%Destroy.Op.651ba6.3 +// CHECK:STDOUT: %Destroy.Op.bound.loc13: = bound_method %.loc13_21.3, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call.loc13: init %empty_tuple.type = call %Destroy.Op.bound.loc13(%.loc13_21.3) -// CHECK:STDOUT: %Destroy.Op.bound.loc11: = bound_method %.loc11_18.3, constants.%Destroy.Op.651ba6.3 +// CHECK:STDOUT: %Destroy.Op.bound.loc11: = bound_method %.loc11_18.3, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call.loc11: init %empty_tuple.type = call %Destroy.Op.bound.loc11(%.loc11_18.3) -// CHECK:STDOUT: %Destroy.Op.bound.loc10: = bound_method %n.var, constants.%Destroy.Op.651ba6.4 +// CHECK:STDOUT: %Destroy.Op.bound.loc10: = bound_method %n.var, constants.%Destroy.Op.651ba6.7 // CHECK:STDOUT: %Destroy.Op.call.loc10: init %empty_tuple.type = call %Destroy.Op.bound.loc10(%n.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc13(%self.param: ref %Optional.75d) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc13_21.1(%self.param: ref %MaybeUnformed.859) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc10(%self.param: ref %array_type.643) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc13_21.2(%self.param: ref %Optional.75d) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_3.3(%self.param: ref %array_type.643) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_call_params_2.carbon // CHECK:STDOUT: @@ -291,6 +315,7 @@ fn F() { // CHECK:STDOUT: %Function.cpp_overload_set.value: %Function.cpp_overload_set.type = cpp_overload_set_value @Function.cpp_overload_set [concrete] // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [concrete] // CHECK:STDOUT: %array_type.643: type = array_type %int_42, %i32 [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %pattern_type.b6e: type = pattern_type %array_type.643 [concrete] // CHECK:STDOUT: %DefaultOrUnformed.type: type = facet_type <@DefaultOrUnformed> [concrete] // CHECK:STDOUT: %UnformedInit.type: type = facet_type <@UnformedInit> [concrete] @@ -321,8 +346,8 @@ fn F() { // CHECK:STDOUT: %ptr.235: 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: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc22 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc22_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -388,10 +413,20 @@ 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.Op.bound: = bound_method %n.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %n.var, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%n.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc22(%self.param: ref %array_type.643) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc22_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc22_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc22_3.3(%self.param: ref %array_type.643) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/full_semir.carbon b/toolchain/check/testdata/interop/cpp/function/full_semir.carbon index 6e2071ee8200..54eab6c9935e 100644 --- a/toolchain/check/testdata/interop/cpp/function/full_semir.carbon +++ b/toolchain/check/testdata/interop/cpp/function/full_semir.carbon @@ -79,6 +79,7 @@ fn F() { // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [concrete] +// CHECK:STDOUT: %i16.builtin: type = int_type signed, %int_16 [concrete] // CHECK:STDOUT: %As.type.90f: type = generic_interface_type @As [concrete] // CHECK:STDOUT: %As.generic: %As.type.90f = struct_value () [concrete] // CHECK:STDOUT: %As.type.359: type = facet_type <@As, @As(%i16)> [concrete] @@ -114,6 +115,9 @@ fn F() { // CHECK:STDOUT: %.dde: ref %i16 = temporary invalid, %int_1.f90 [concrete] // CHECK:STDOUT: %addr: %ptr.251 = addr_of %.dde [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc7_13.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.dde, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -187,6 +191,7 @@ fn F() { // CHECK:STDOUT: %.loc7_13.4: ref %i16 = temporary %.loc7_13.3, %Int.as.Copy.impl.Op.call [concrete = constants.%.dde] // CHECK:STDOUT: %addr: %ptr.251 = 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.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.dde) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -194,7 +199,12 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: fn @foo__carbon_thunk(%a.param: %ptr.251); // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i16) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc7_13.1(%self.param: ref %i16.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc7_13.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_int_param.carbon // CHECK:STDOUT: @@ -301,6 +311,7 @@ fn F() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [concrete] +// CHECK:STDOUT: %i16.builtin: type = int_type signed, %int_16 [concrete] // CHECK:STDOUT: %pattern_type.2f8: type = pattern_type %i16 [concrete] // CHECK:STDOUT: %foo_short.cpp_overload_set.type: type = cpp_overload_set_type @foo_short.cpp_overload_set [concrete] // CHECK:STDOUT: %foo_short.cpp_overload_set.value: %foo_short.cpp_overload_set.type = cpp_overload_set_value @foo_short.cpp_overload_set [concrete] @@ -309,8 +320,8 @@ 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: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc7_37.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -369,7 +380,7 @@ fn F() { // CHECK:STDOUT: %.loc7_37.3: ref %i16 = temporary %.loc7_37.1, %.loc7_37.2 // CHECK:STDOUT: %.loc7_37.4: %i16 = acquire_value %.loc7_37.3 // CHECK:STDOUT: %x: %i16 = value_binding x, %.loc7_37.4 -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc7_37.3, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc7_37.3, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc7_37.3) // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -378,5 +389,10 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: fn @foo_short__carbon_thunk(%return.param: %ptr); // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i16) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc7_37.1(%self.param: ref %i16.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc7_37.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/inline.carbon b/toolchain/check/testdata/interop/cpp/function/inline.carbon index 75262fc4576e..d0275243b2aa 100644 --- a/toolchain/check/testdata/interop/cpp/function/inline.carbon +++ b/toolchain/check/testdata/interop/cpp/function/inline.carbon @@ -178,6 +178,7 @@ fn MyF() { // CHECK:STDOUT: %ptr.251: type = ptr_type %i16 [concrete] // CHECK:STDOUT: %ThunkOnArg__carbon_thunk.type: type = fn_type @ThunkOnArg__carbon_thunk [concrete] // CHECK:STDOUT: %ThunkOnArg__carbon_thunk: %ThunkOnArg__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %i16.builtin: type = int_type signed, %int_16 [concrete] // CHECK:STDOUT: %ImplicitAs.type.9fb: type = facet_type <@ImplicitAs, @ImplicitAs(%i16)> [concrete] // CHECK:STDOUT: %ImplicitAs.impl_witness.882: = impl_witness imports.%ImplicitAs.impl_witness_table.74f, @Core.IntLiteral.as.ImplicitAs.impl(%int_16) [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.c54: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_16) [concrete] @@ -211,8 +212,9 @@ 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: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc16_41.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.dde, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -349,12 +351,19 @@ fn MyF() { // CHECK:STDOUT: %.loc16_41.3: ref %i16 = temporary %.loc16_41.1, %.loc16_41.2 // CHECK:STDOUT: %.loc16_41.4: %i16 = acquire_value %.loc16_41.3 // CHECK:STDOUT: %r4: %i16 = value_binding r4, %.loc16_41.4 -// CHECK:STDOUT: %Destroy.Op.bound.loc16: = bound_method %.loc16_41.3, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call.loc16: init %empty_tuple.type = call %Destroy.Op.bound.loc16(%.loc16_41.3) -// CHECK:STDOUT: %Destroy.Op.bound.loc15: = bound_method %.loc15_43.3, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc16: = bound_method %.loc16_41.3, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.call.loc16_41: init %empty_tuple.type = call %Destroy.Op.bound.loc16(%.loc16_41.3) +// CHECK:STDOUT: %Destroy.Op.call.loc16_40: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.dde) +// CHECK:STDOUT: %Destroy.Op.bound.loc15: = bound_method %.loc15_43.3, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc15: init %empty_tuple.type = call %Destroy.Op.bound.loc15(%.loc15_43.3) +// CHECK:STDOUT: %Destroy.Op.call.loc14: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.dde) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i16) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc16_41.1(%self.param: ref %i16.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc16_41.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/overloads.carbon b/toolchain/check/testdata/interop/cpp/function/overloads.carbon index 8abef67a6d26..d750faa0c622 100644 --- a/toolchain/check/testdata/interop/cpp/function/overloads.carbon +++ b/toolchain/check/testdata/interop/cpp/function/overloads.carbon @@ -804,6 +804,7 @@ fn F() { // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [concrete] +// CHECK:STDOUT: %i16.builtin: type = int_type signed, %int_16 [concrete] // CHECK:STDOUT: %As.type.90f: type = generic_interface_type @As [concrete] // CHECK:STDOUT: %As.generic: %As.type.90f = struct_value () [concrete] // CHECK:STDOUT: %As.type.359: type = facet_type <@As, @As(%i16)> [concrete] @@ -839,6 +840,9 @@ fn F() { // CHECK:STDOUT: %.dde: ref %i16 = temporary invalid, %int_1.f90 [concrete] // CHECK:STDOUT: %addr: %ptr.251 = addr_of %.dde [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc7_13.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.dde, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -912,6 +916,7 @@ fn F() { // CHECK:STDOUT: %.loc7_13.4: ref %i16 = temporary %.loc7_13.3, %Int.as.Copy.impl.Op.call [concrete = constants.%.dde] // CHECK:STDOUT: %addr: %ptr.251 = addr_of %.loc7_13.4 [concrete = constants.%addr] // CHECK:STDOUT: %bar__carbon_thunk.call: init %empty_tuple.type = call imports.%bar__carbon_thunk.decl(%addr) +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.dde) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -919,7 +924,12 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: fn @bar__carbon_thunk(%a.param: %ptr.251); // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i16) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc7_13.1(%self.param: ref %i16.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc7_13.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_overloaded_functions.carbon // CHECK:STDOUT: @@ -1052,6 +1062,7 @@ fn F() { // CHECK:STDOUT: %foo.23ea43.1: %foo.type.a5abd1.1 = struct_value () [concrete] // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [concrete] +// CHECK:STDOUT: %i16.builtin: type = int_type signed, %int_16 [concrete] // CHECK:STDOUT: %As.type.359: type = facet_type <@As, @As(%i16)> [concrete] // CHECK:STDOUT: %As.impl_witness.b61: = impl_witness imports.%As.impl_witness_table.9fc, @Core.IntLiteral.as.As.impl(%int_16) [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.c60: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%int_16) [concrete] @@ -1082,6 +1093,9 @@ fn F() { // CHECK:STDOUT: %.dde: ref %i16 = temporary invalid, %int_1.f90 [concrete] // CHECK:STDOUT: %addr: %ptr.251 = addr_of %.dde [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8_13.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.dde, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1179,6 +1193,7 @@ fn F() { // CHECK:STDOUT: %.loc8_13.4: ref %i16 = temporary %.loc8_13.3, %Int.as.Copy.impl.Op.call [concrete = constants.%.dde] // CHECK:STDOUT: %addr: %ptr.251 = 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.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.dde) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1188,7 +1203,12 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: fn @foo__carbon_thunk(%a.param: %ptr.251); // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i16) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_13.1(%self.param: ref %i16.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_13.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_multiple_overloaded_sets.carbon // CHECK:STDOUT: @@ -1374,6 +1394,7 @@ fn F() { // CHECK:STDOUT: %int_9223372036854775807.9c2: %i64 = int_value 9223372036854775807 [concrete] // CHECK:STDOUT: %int_128: Core.IntLiteral = int_value 128 [concrete] // CHECK:STDOUT: %i128: type = class_type @Int, @Int(%int_128) [concrete] +// CHECK:STDOUT: %i128.builtin: type = int_type signed, %int_128 [concrete] // CHECK:STDOUT: %pattern_type.57d: type = pattern_type %i128 [concrete] // CHECK:STDOUT: %int_9223372036854775808.293: Core.IntLiteral = int_value 9223372036854775808 [concrete] // CHECK:STDOUT: %ptr.974: type = ptr_type %i128 [concrete] @@ -1430,8 +1451,12 @@ fn F() { // CHECK:STDOUT: %.7df: ref %i128 = temporary invalid, %int_170141183460469231731687303715884105727.ff5 [concrete] // CHECK:STDOUT: %addr.6a2: %ptr.974 = addr_of %.7df [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc31_71.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound.667: = bound_method %.7df, %Destroy.Op.651ba6.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.bound.217: = bound_method %.4db, %Destroy.Op.651ba6.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.bound.663: = bound_method %.2ee, %Destroy.Op.651ba6.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.bound.a6a: = bound_method %.5bc, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1738,14 +1763,18 @@ fn F() { // CHECK:STDOUT: %.loc31_71.3: ref %i128 = temporary %.loc31_71.1, %.loc31_71.2 // CHECK:STDOUT: %.loc31_71.4: %i128 = acquire_value %.loc31_71.3 // CHECK:STDOUT: %g: %i128 = value_binding g, %.loc31_71.4 -// CHECK:STDOUT: %Destroy.Op.bound.loc31: = bound_method %.loc31_71.3, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call.loc31: init %empty_tuple.type = call %Destroy.Op.bound.loc31(%.loc31_71.3) -// CHECK:STDOUT: %Destroy.Op.bound.loc28: = bound_method %.loc28_52.3, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call.loc28: init %empty_tuple.type = call %Destroy.Op.bound.loc28(%.loc28_52.3) -// CHECK:STDOUT: %Destroy.Op.bound.loc25: = bound_method %.loc25_52.3, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call.loc25: init %empty_tuple.type = call %Destroy.Op.bound.loc25(%.loc25_52.3) -// CHECK:STDOUT: %Destroy.Op.bound.loc22: = bound_method %.loc22_51.3, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call.loc22: init %empty_tuple.type = call %Destroy.Op.bound.loc22(%.loc22_51.3) +// CHECK:STDOUT: %Destroy.Op.bound.loc31: = bound_method %.loc31_71.3, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.call.loc31_71: init %empty_tuple.type = call %Destroy.Op.bound.loc31(%.loc31_71.3) +// CHECK:STDOUT: %Destroy.Op.call.loc31_32: init %empty_tuple.type = call constants.%Destroy.Op.bound.667(constants.%.7df) +// CHECK:STDOUT: %Destroy.Op.bound.loc28: = bound_method %.loc28_52.3, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.call.loc28_52: init %empty_tuple.type = call %Destroy.Op.bound.loc28(%.loc28_52.3) +// CHECK:STDOUT: %Destroy.Op.call.loc28_32: init %empty_tuple.type = call constants.%Destroy.Op.bound.217(constants.%.4db) +// CHECK:STDOUT: %Destroy.Op.bound.loc25: = bound_method %.loc25_52.3, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.call.loc25_52: init %empty_tuple.type = call %Destroy.Op.bound.loc25(%.loc25_52.3) +// CHECK:STDOUT: %Destroy.Op.call.loc25_32: init %empty_tuple.type = call constants.%Destroy.Op.bound.663(constants.%.2ee) +// CHECK:STDOUT: %Destroy.Op.bound.loc22: = bound_method %.loc22_51.3, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.call.loc22_51: init %empty_tuple.type = call %Destroy.Op.bound.loc22(%.loc22_51.3) +// CHECK:STDOUT: %Destroy.Op.call.loc22_32: init %empty_tuple.type = call constants.%Destroy.Op.bound.a6a(constants.%.5bc) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1757,7 +1786,12 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: fn @foo__carbon_thunk(%a.param: %ptr.974, %return.param: %ptr.974); // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i128) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc31_71.1(%self.param: ref %i128.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc31_71.2(%self.param: ref %i128) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_import_large_int_literal.carbon // CHECK:STDOUT: @@ -2053,6 +2087,7 @@ fn F() { // CHECK:STDOUT: %Float.generic: %Float.type = struct_value () [concrete] // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] // CHECK:STDOUT: %f64.d77: type = class_type @Float, @Float(%int_64) [concrete] +// CHECK:STDOUT: %f64.794: type = float_type %int_64, f64 [concrete] // CHECK:STDOUT: %pattern_type.0ae: type = pattern_type %f64.d77 [concrete] // 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] @@ -2092,8 +2127,9 @@ fn F() { // CHECK:STDOUT: %.4f3: ref %f64.d77 = temporary invalid, %float.d20 [concrete] // CHECK:STDOUT: %addr: %ptr.bcc = addr_of %.4f3 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc7_34.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.4f3, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -2185,8 +2221,9 @@ fn F() { // CHECK:STDOUT: %.loc7_34.3: ref %f64.d77 = temporary %.loc7_34.1, %.loc7_34.2 // CHECK:STDOUT: %.loc7_34.4: %f64.d77 = acquire_value %.loc7_34.3 // CHECK:STDOUT: %d: %f64.d77 = value_binding d, %.loc7_34.4 -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc7_34.3, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc7_34.3) +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc7_34.3, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.call.loc7_34: init %empty_tuple.type = call %Destroy.Op.bound(%.loc7_34.3) +// CHECK:STDOUT: %Destroy.Op.call.loc7_31: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.4f3) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2194,7 +2231,12 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: fn @foo__carbon_thunk(%a.param: %ptr.bcc, %return.param: %ptr.bcc); // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %f64.d77) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc7_34.1(%self.param: ref %f64.794) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc7_34.2(%self.param: ref %f64.d77) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_import_large_floating_point_literal.carbon // CHECK:STDOUT: @@ -2214,6 +2256,7 @@ fn F() { // CHECK:STDOUT: %pattern_type.0ce: type = pattern_type %ptr.bcc [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: %f64.794: type = float_type %int_64, f64 [concrete] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] // CHECK:STDOUT: %ImplicitAs.type.4a8: type = facet_type <@ImplicitAs, @ImplicitAs(%f64.d77)> [concrete] @@ -2240,8 +2283,8 @@ fn F() { // CHECK:STDOUT: %.59b: type = fn_type_with_self_type %Copy.WithSelf.Op.type.fb6, %Copy.facet [concrete] // CHECK:STDOUT: %Float.as.Copy.impl.Op.specific_fn: = specific_function %Float.as.Copy.impl.Op.f05, @Float.as.Copy.impl.Op(%int_64) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc15_19.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -2327,7 +2370,7 @@ fn F() { // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc15_19.1, %addr.loc15_19.2) // CHECK:STDOUT: %.loc15_19.2: init %f64.d77 to %.loc15_19.1 = mark_in_place_init %foo__carbon_thunk.call // CHECK:STDOUT: %.loc15_19.3: ref %f64.d77 = temporary %.loc15_19.1, %.loc15_19.2 -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc15_19.3, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc15_19.3, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc15_19.3) // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -2336,7 +2379,12 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: fn @foo__carbon_thunk(%a.param: %ptr.bcc, %return.param: %ptr.bcc); // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %f64.d77) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc15_19.1(%self.param: ref %f64.794) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc15_19.2(%self.param: ref %f64.d77) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- struct_init.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/pointer.carbon b/toolchain/check/testdata/interop/cpp/function/pointer.carbon index f7f70c84c4c4..3145008d759e 100644 --- a/toolchain/check/testdata/interop/cpp/function/pointer.carbon +++ b/toolchain/check/testdata/interop/cpp/function/pointer.carbon @@ -500,8 +500,8 @@ fn F() { // CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc10_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -543,12 +543,17 @@ fn F() { // CHECK:STDOUT: %.loc11_11.2: ref %ptr = converted %p.ref, %.loc11_11.1 // CHECK:STDOUT: %.loc11_11.3: %ptr = acquire_value %.loc11_11.2 // CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc11_11.3) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %p.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %p.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%p.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %const) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc10_3.1(%self.param: ref %ptr) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_3.2(%self.param: ref %const) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_double_non_nullable_pointer_param.carbon // CHECK:STDOUT: @@ -709,7 +714,10 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %const) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %const) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_non_nullable_pointer_to_const_param_using_non_const.carbon // CHECK:STDOUT: @@ -787,8 +795,8 @@ fn F() { // CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc10_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -830,12 +838,17 @@ fn F() { // CHECK:STDOUT: %.loc11_11.2: ref %ptr = converted %p.ref, %.loc11_11.1 // CHECK:STDOUT: %.loc11_11.3: %ptr = acquire_value %.loc11_11.2 // CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc11_11.3) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %p.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %p.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%p.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %const) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc10_3.1(%self.param: ref %ptr) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_3.2(%self.param: ref %const) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_const_non_nullable_pointer_param_using_non_const.carbon // CHECK:STDOUT: @@ -919,6 +932,11 @@ fn F() { // CHECK:STDOUT: %MaybeUnformed.2e9: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.617) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.Some.type.c7a: type = fn_type @ptr.as.OptionalStorage.impl.Some, @ptr.as.OptionalStorage.impl(%T.67d) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.Some.38a: %ptr.as.OptionalStorage.impl.Some.type.c7a = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.1 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.8d7fae.1: = custom_witness (%Destroy.Op.651ba6.1), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.021: %Destroy.type = facet_value %ptr.5c7, (%custom_witness.8d7fae.1) [concrete] +// CHECK:STDOUT: %MaybeUnformed.74a: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.021) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.ba1: = impl_witness imports.%OptionalStorage.impl_witness_table.bee, @ptr.as.OptionalStorage.impl(%S) [concrete] // CHECK:STDOUT: %OptionalStorage.facet.872: %OptionalStorage.type = facet_value %ptr.5c7, (%OptionalStorage.impl_witness.ba1) [concrete] // CHECK:STDOUT: %Optional.065: type = class_type @Optional, @Optional(%OptionalStorage.facet.872) [concrete] @@ -947,10 +965,10 @@ fn F() { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.05e: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%Optional.065, %ImplicitAs.facet.1bd) [concrete] // CHECK:STDOUT: %.b4e: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.05e, %ImplicitAs.facet.1bd [concrete] // CHECK:STDOUT: %const.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %const.as.ImplicitAs.impl.Convert.af2, @const.as.ImplicitAs.impl.Convert(%Optional.065, %ImplicitAs.facet.77f) [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc11 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc10 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc11_11.2 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc10 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1017,16 +1035,27 @@ fn F() { // CHECK:STDOUT: %.loc11_11.4: ref %Optional.065 = temporary %.loc11_11.3, %.loc11_11.2 // CHECK:STDOUT: %.loc11_11.5: %Optional.065 = acquire_value %.loc11_11.4 // CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc11_11.5) -// CHECK:STDOUT: %Destroy.Op.bound.loc11: = bound_method %.loc11_11.4, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc11: = bound_method %.loc11_11.4, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call.loc11: init %empty_tuple.type = call %Destroy.Op.bound.loc11(%.loc11_11.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc10: = bound_method %p.var, constants.%Destroy.Op.651ba6.3 +// CHECK:STDOUT: %Destroy.Op.bound.loc10: = bound_method %p.var, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call.loc10: init %empty_tuple.type = call %Destroy.Op.bound.loc10(%p.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc11(%self.param: ref %Optional.065) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc11_11.1(%self.param: ref %MaybeUnformed.74a) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc10(%self.param: ref %const.b9a) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc11_11.2(%self.param: ref %Optional.065) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10(%self.param: ref %const.b9a) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_const_nullable_pointer_param_using_non_const.carbon // CHECK:STDOUT: @@ -1051,6 +1080,9 @@ fn F() { // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.Some.38a: %ptr.as.OptionalStorage.impl.Some.type.c7a = struct_value () [symbolic] // CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.1 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.8d7fae.1: = custom_witness (%Destroy.Op.651ba6.1), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.021: %Destroy.type = facet_value %ptr.5c7, (%custom_witness.8d7fae.1) [concrete] +// CHECK:STDOUT: %MaybeUnformed.74a: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.021) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.ba1: = impl_witness imports.%OptionalStorage.impl_witness_table.bee, @ptr.as.OptionalStorage.impl(%S) [concrete] // CHECK:STDOUT: %OptionalStorage.facet.872: %OptionalStorage.type = facet_value %ptr.5c7, (%OptionalStorage.impl_witness.ba1) [concrete] // CHECK:STDOUT: %Optional.065: type = class_type @Optional, @Optional(%OptionalStorage.facet.872) [concrete] @@ -1073,8 +1105,8 @@ fn F() { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.0a72: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%Optional.065, %ImplicitAs.facet.77f) [concrete] // CHECK:STDOUT: %.9b3: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.0a72, %ImplicitAs.facet.77f [concrete] // CHECK:STDOUT: %U.binding.as_type.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %U.binding.as_type.as.ImplicitAs.impl.Convert.bd4, @U.binding.as_type.as.ImplicitAs.impl.Convert.2(%OptionalStorage.facet.872, %OptionalAs.facet) [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc11 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc11_11.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1138,14 +1170,22 @@ fn F() { // CHECK:STDOUT: %.loc11_11.4: ref %Optional.065 = temporary %.loc11_11.3, %.loc11_11.2 // CHECK:STDOUT: %.loc11_11.5: %Optional.065 = acquire_value %.loc11_11.4 // CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc11_11.5) -// CHECK:STDOUT: %Destroy.Op.bound.loc11: = bound_method %.loc11_11.4, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc11: = bound_method %.loc11_11.4, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call.loc11: init %empty_tuple.type = call %Destroy.Op.bound.loc11(%.loc11_11.4) // CHECK:STDOUT: %Destroy.Op.bound.loc10: = bound_method %p.var, constants.%Destroy.Op.651ba6.1 // CHECK:STDOUT: %Destroy.Op.call.loc10: init %empty_tuple.type = call %Destroy.Op.bound.loc10(%p.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc11(%self.param: ref %Optional.065) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc11_11.1(%self.param: ref %MaybeUnformed.74a) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc11_11.2(%self.param: ref %Optional.065) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_non_nullable_pointer_return.carbon // CHECK:STDOUT: @@ -1303,6 +1343,11 @@ fn F() { // CHECK:STDOUT: %MaybeUnformed.2e9: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.617) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.Some.type.c7a: type = fn_type @ptr.as.OptionalStorage.impl.Some, @ptr.as.OptionalStorage.impl(%T.67d) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.Some.38a: %ptr.as.OptionalStorage.impl.Some.type.c7a = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.1 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.8d7fae.1: = custom_witness (%Destroy.Op.651ba6.1), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.021: %Destroy.type = facet_value %ptr.5c7, (%custom_witness.8d7fae.1) [concrete] +// CHECK:STDOUT: %MaybeUnformed.74a: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.021) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.ba1: = impl_witness imports.%OptionalStorage.impl_witness_table.bee, @ptr.as.OptionalStorage.impl(%S) [concrete] // CHECK:STDOUT: %OptionalStorage.facet.872: %OptionalStorage.type = facet_value %ptr.5c7, (%OptionalStorage.impl_witness.ba1) [concrete] // CHECK:STDOUT: %Optional.065: type = class_type @Optional, @Optional(%OptionalStorage.facet.872) [concrete] @@ -1325,8 +1370,8 @@ fn F() { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.0a72: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%Optional.065, %ImplicitAs.facet.77f) [concrete] // CHECK:STDOUT: %.9b3: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.0a72, %ImplicitAs.facet.77f [concrete] // CHECK:STDOUT: %U.binding.as_type.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %U.binding.as_type.as.ImplicitAs.impl.Convert.bd4, @U.binding.as_type.as.ImplicitAs.impl.Convert.2(%OptionalStorage.facet.872, %OptionalAs.facet) [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc9 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc9_11.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [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: } @@ -1392,14 +1437,22 @@ fn F() { // CHECK:STDOUT: %.loc9_11.3: ref %Optional.065 = temporary %.loc9_11.2, %.loc9_11.1 // CHECK:STDOUT: %.loc9_11.4: %Optional.065 = acquire_value %.loc9_11.3 // CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc9_11.4) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc9_11.3, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc9_11.3, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc9_11.3) // 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: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc9(%self.param: ref %Optional.065) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc9_11.1(%self.param: ref %MaybeUnformed.74a) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_11.2(%self.param: ref %Optional.065) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- null_pointer_arg_to_pointer_param.carbon // CHECK:STDOUT: @@ -1423,6 +1476,11 @@ fn F() { // CHECK:STDOUT: %MaybeUnformed.2e9: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.617) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.None.type.03c: type = fn_type @ptr.as.OptionalStorage.impl.None, @ptr.as.OptionalStorage.impl(%T.67d) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.None.f37: %ptr.as.OptionalStorage.impl.None.type.03c = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.1 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.8d7fae.1: = custom_witness (%Destroy.Op.651ba6.1), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.021: %Destroy.type = facet_value %ptr.5c7, (%custom_witness.8d7fae.1) [concrete] +// CHECK:STDOUT: %MaybeUnformed.74a: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.021) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.a7b: = impl_witness imports.%OptionalStorage.impl_witness_table.75b, @ptr.as.OptionalStorage.impl(%S) [concrete] // CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value %ptr.5c7, (%OptionalStorage.impl_witness.a7b) [concrete] // CHECK:STDOUT: %Optional.7f5: type = class_type @Optional, @Optional(%OptionalStorage.facet) [concrete] @@ -1431,8 +1489,8 @@ fn F() { // CHECK:STDOUT: %Optional.None.specific_fn: = specific_function %Optional.None.c13, @Optional.None(%OptionalStorage.facet) [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc8_38.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1491,12 +1549,20 @@ fn F() { // CHECK:STDOUT: %.loc8_38.2: ref %Optional.7f5 = temporary %.loc8_38.1, %Optional.None.call // CHECK:STDOUT: %.loc8_38.3: %Optional.7f5 = acquire_value %.loc8_38.2 // CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc8_38.3) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc8_38.2, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc8_38.2, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc8_38.2) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc8(%self.param: ref %Optional.7f5) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_38.1(%self.param: ref %MaybeUnformed.74a) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_38.2(%self.param: ref %Optional.7f5) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- nonnull_pointer_arg_to_pointer_param.carbon // CHECK:STDOUT: @@ -1524,6 +1590,11 @@ fn F() { // CHECK:STDOUT: %MaybeUnformed.2e9: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.617) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.Some.type.c7a: type = fn_type @ptr.as.OptionalStorage.impl.Some, @ptr.as.OptionalStorage.impl(%T.67d) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.Some.38a: %ptr.as.OptionalStorage.impl.Some.type.c7a = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.1 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.8d7fae.1: = custom_witness (%Destroy.Op.651ba6.1), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.021: %Destroy.type = facet_value %ptr.5c7, (%custom_witness.8d7fae.1) [concrete] +// CHECK:STDOUT: %MaybeUnformed.74a: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.021) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.ba1: = impl_witness imports.%OptionalStorage.impl_witness_table.bee, @ptr.as.OptionalStorage.impl(%S) [concrete] // CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value %ptr.5c7, (%OptionalStorage.impl_witness.ba1) [concrete] // CHECK:STDOUT: %Optional.065: type = class_type @Optional, @Optional(%OptionalStorage.facet) [concrete] @@ -1532,8 +1603,8 @@ fn F() { // CHECK:STDOUT: %Optional.Some.specific_fn: = specific_function %Optional.Some.16d, @Optional.Some(%OptionalStorage.facet) [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc9 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc9_40.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [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: } @@ -1612,14 +1683,22 @@ fn F() { // CHECK:STDOUT: %.loc9_40.3: ref %Optional.065 = temporary %.loc9_40.2, %Optional.Some.call // CHECK:STDOUT: %.loc9_40.4: %Optional.065 = acquire_value %.loc9_40.3 // CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc9_40.4) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc9_40.3, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc9_40.3, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc9_40.3) // 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: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc9(%self.param: ref %Optional.065) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc9_40.1(%self.param: ref %MaybeUnformed.74a) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_40.2(%self.param: ref %Optional.065) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- forward_nullable_pointer.carbon // CHECK:STDOUT: @@ -1638,6 +1717,11 @@ fn F() { // CHECK:STDOUT: %Destroy.lookup_impl_witness.e1f: = lookup_impl_witness %ptr.e8f, @Destroy [symbolic] // CHECK:STDOUT: %Destroy.facet.617: %Destroy.type = facet_value %ptr.e8f, (%Destroy.lookup_impl_witness.e1f) [symbolic] // CHECK:STDOUT: %MaybeUnformed.2e9: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.617) [symbolic] +// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.1 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.8d7fae.1: = custom_witness (%Destroy.Op.651ba6.1), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.021: %Destroy.type = facet_value %ptr.5c7, (%custom_witness.8d7fae.1) [concrete] +// CHECK:STDOUT: %MaybeUnformed.74a: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.021) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.723: = impl_witness imports.%OptionalStorage.impl_witness_table.d23, @ptr.as.OptionalStorage.impl(%S) [concrete] // CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value %ptr.5c7, (%OptionalStorage.impl_witness.723) [concrete] // CHECK:STDOUT: %Optional.ece: type = class_type @Optional, @Optional(%OptionalStorage.facet) [concrete] @@ -1645,8 +1729,8 @@ fn F() { // CHECK:STDOUT: %get: %get.type = struct_value () [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc8_19.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1695,12 +1779,20 @@ fn F() { // CHECK:STDOUT: %.loc8_19.2: ref %Optional.ece = temporary %.loc8_19.1, %get.call // CHECK:STDOUT: %.loc8_19.3: %Optional.ece = acquire_value %.loc8_19.2 // CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc8_19.3) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc8_19.2, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc8_19.2, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc8_19.2) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc8(%self.param: ref %Optional.ece) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_19.1(%self.param: ref %MaybeUnformed.74a) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_19.2(%self.param: ref %Optional.ece) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_deduced_any_param_as_pointer.carbon // CHECK:STDOUT: @@ -1797,6 +1889,11 @@ fn F() { // CHECK:STDOUT: %MaybeUnformed.2e9: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.617) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.Some.type.c7a: type = fn_type @ptr.as.OptionalStorage.impl.Some, @ptr.as.OptionalStorage.impl(%T.67d) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.Some.38a: %ptr.as.OptionalStorage.impl.Some.type.c7a = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.1 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.8d7fae.1: = custom_witness (%Destroy.Op.651ba6.1), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.021: %Destroy.type = facet_value %ptr.5c7, (%custom_witness.8d7fae.1) [concrete] +// CHECK:STDOUT: %MaybeUnformed.74a: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.021) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.ba1: = impl_witness imports.%OptionalStorage.impl_witness_table.bee, @ptr.as.OptionalStorage.impl(%S) [concrete] // CHECK:STDOUT: %OptionalStorage.facet.872: %OptionalStorage.type = facet_value %ptr.5c7, (%OptionalStorage.impl_witness.ba1) [concrete] // CHECK:STDOUT: %Optional.065: type = class_type @Optional, @Optional(%OptionalStorage.facet.872) [concrete] @@ -1827,8 +1924,8 @@ fn F() { // 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: %.6ef: ref %S = temporary invalid, %S.val [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc13 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc13_65.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [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: } @@ -1947,14 +2044,22 @@ fn F() { // CHECK:STDOUT: %.loc13_65.2: ref %Optional.065 = temporary %.loc13_65.1, %Indirect__carbon_thunk.call // CHECK:STDOUT: %.loc13_65.3: %Optional.065 = acquire_value %.loc13_65.2 // CHECK:STDOUT: %a: %Optional.065 = value_binding a, %.loc13_65.3 -// CHECK:STDOUT: %Destroy.Op.bound.loc13: = bound_method %.loc13_65.2, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc13: = bound_method %.loc13_65.2, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call.loc13: init %empty_tuple.type = call %Destroy.Op.bound.loc13(%.loc13_65.2) -// CHECK:STDOUT: %Destroy.Op.bound.loc11: = bound_method %.loc11_14.3, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc11: = bound_method %.loc11_14.3, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call.loc11: init %empty_tuple.type = call %Destroy.Op.bound.loc11(%.loc11_14.3) // 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: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc13(%self.param: ref %Optional.065) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc13_65.1(%self.param: ref %MaybeUnformed.74a) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc13_65.2(%self.param: ref %Optional.065) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/return.carbon b/toolchain/check/testdata/interop/cpp/function/return.carbon index 831e50aa324d..a3d4d11505de 100644 --- a/toolchain/check/testdata/interop/cpp/function/return.carbon +++ b/toolchain/check/testdata/interop/cpp/function/return.carbon @@ -121,12 +121,13 @@ fn Var() { // CHECK:STDOUT: %ptr: type = ptr_type %i16 [concrete] // 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: %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] // CHECK:STDOUT: %foo2: %foo2.type = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc11_22.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -168,26 +169,33 @@ fn Var() { // CHECK:STDOUT: %.loc12_22.1: %i32 = value_of_initializer %foo2.call // CHECK:STDOUT: %.loc12_22.2: %i32 = converted %foo2.call, %.loc12_22.1 // CHECK:STDOUT: %IngestI32.call: init %empty_tuple.type = call %IngestI32.ref(%.loc12_22.2) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc11_22.3, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc11_22.3, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc11_22.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i16) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc11_22.1(%self.param: ref %i16.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc11_22.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- var_from_thunk_param.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Cpp.nullptr_t: type = class_type @NullptrT [concrete] +// CHECK:STDOUT: %Cpp.void: type = class_type @VoidBase [concrete] +// CHECK:STDOUT: %ptr.874: type = ptr_type %Cpp.void [concrete] // CHECK:STDOUT: %pattern_type.f05: type = pattern_type %Cpp.nullptr_t [concrete] // CHECK:STDOUT: %ReturnNullPtr.cpp_overload_set.type: type = cpp_overload_set_type @ReturnNullPtr.cpp_overload_set [concrete] // CHECK:STDOUT: %ReturnNullPtr.cpp_overload_set.value: %ReturnNullPtr.cpp_overload_set.type = cpp_overload_set_value @ReturnNullPtr.cpp_overload_set [concrete] // CHECK:STDOUT: %ptr.142: 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: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc11 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc11_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -223,12 +231,17 @@ fn Var() { // CHECK:STDOUT: %nullptr_t.ref: type = name_ref nullptr_t, constants.%Cpp.nullptr_t [concrete = constants.%Cpp.nullptr_t] // CHECK:STDOUT: } // CHECK:STDOUT: %c: ref %Cpp.nullptr_t = ref_binding c, %c.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %c.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %c.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%c.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc11(%self.param: ref %Cpp.nullptr_t) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc11_3.1(%self.param: ref %ptr.874) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc11_3.2(%self.param: ref %Cpp.nullptr_t) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- return_from_thunk_param.carbon // CHECK:STDOUT: @@ -322,14 +335,15 @@ fn Var() { // 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] +// CHECK:STDOUT: %u32.builtin: type = int_type unsigned, %int_32 [concrete] // CHECK:STDOUT: %pattern_type.4a9: type = pattern_type %u32 [concrete] // CHECK:STDOUT: %ReturnU32.cpp_overload_set.type: type = cpp_overload_set_type @ReturnU32.cpp_overload_set [concrete] // CHECK:STDOUT: %ReturnU32.cpp_overload_set.value: %ReturnU32.cpp_overload_set.type = cpp_overload_set_value @ReturnU32.cpp_overload_set [concrete] // 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: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -384,12 +398,17 @@ fn Var() { // CHECK:STDOUT: assign %my_u32.var, %ReturnU32.call // CHECK:STDOUT: %u32: type = type_literal constants.%u32 [concrete = constants.%u32] // CHECK:STDOUT: %my_u32: ref %u32 = ref_binding my_u32, %my_u32.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %my_u32.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %my_u32.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.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.Op(%self.param: ref %u32) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.1(%self.param: ref %u32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.2(%self.param: ref %u32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/void_pointer.carbon b/toolchain/check/testdata/interop/cpp/function/void_pointer.carbon index dfb333ce6d8a..69a1ea9f0a85 100644 --- a/toolchain/check/testdata/interop/cpp/function/void_pointer.carbon +++ b/toolchain/check/testdata/interop/cpp/function/void_pointer.carbon @@ -210,6 +210,11 @@ fn F() { // CHECK:STDOUT: %MaybeUnformed.2e9: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.617) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.Some.type.c7a: type = fn_type @ptr.as.OptionalStorage.impl.Some, @ptr.as.OptionalStorage.impl(%T.67d) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.Some.38a: %ptr.as.OptionalStorage.impl.Some.type.c7a = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.1 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.8d7fae.1: = custom_witness (%Destroy.Op.651ba6.1), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.d24: %Destroy.type = facet_value %ptr.874, (%custom_witness.8d7fae.1) [concrete] +// CHECK:STDOUT: %MaybeUnformed.28c: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.d24) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.502: = impl_witness imports.%OptionalStorage.impl_witness_table.bee, @ptr.as.OptionalStorage.impl(%Cpp.void) [concrete] // CHECK:STDOUT: %OptionalStorage.facet.92c: %OptionalStorage.type = facet_value %ptr.874, (%OptionalStorage.impl_witness.502) [concrete] // CHECK:STDOUT: %Optional.804: type = class_type @Optional, @Optional(%OptionalStorage.facet.92c) [concrete] @@ -232,8 +237,8 @@ fn F() { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.baa: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%Optional.804, %ImplicitAs.facet.d14) [concrete] // CHECK:STDOUT: %.73c: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.baa, %ImplicitAs.facet.d14 [concrete] // CHECK:STDOUT: %U.binding.as_type.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %U.binding.as_type.as.ImplicitAs.impl.Convert.d74, @U.binding.as_type.as.ImplicitAs.impl.Convert.2(%OptionalStorage.facet.92c, %OptionalAs.facet) [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc10 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc10_11.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -281,12 +286,20 @@ fn F() { // CHECK:STDOUT: %.loc10_11.3: ref %Optional.804 = temporary %.loc10_11.2, %.loc10_11.1 // CHECK:STDOUT: %.loc10_11.4: %Optional.804 = acquire_value %.loc10_11.3 // CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc10_11.4) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc10_11.3, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc10_11.3, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc10_11.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc10(%self.param: ref %Optional.804) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc10_11.1(%self.param: ref %MaybeUnformed.28c) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_11.2(%self.param: ref %Optional.804) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- null_param.carbon // CHECK:STDOUT: @@ -310,6 +323,11 @@ fn F() { // CHECK:STDOUT: %MaybeUnformed.2e9: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.617) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.None.type.03c: type = fn_type @ptr.as.OptionalStorage.impl.None, @ptr.as.OptionalStorage.impl(%T.67d) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.None.f37: %ptr.as.OptionalStorage.impl.None.type.03c = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.1 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.8d7fae.1: = custom_witness (%Destroy.Op.651ba6.1), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.d24: %Destroy.type = facet_value %ptr.874, (%custom_witness.8d7fae.1) [concrete] +// CHECK:STDOUT: %MaybeUnformed.28c: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.d24) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.9aa: = impl_witness imports.%OptionalStorage.impl_witness_table.75b, @ptr.as.OptionalStorage.impl(%Cpp.void) [concrete] // CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value %ptr.874, (%OptionalStorage.impl_witness.9aa) [concrete] // CHECK:STDOUT: %Optional.ad7: type = class_type @Optional, @Optional(%OptionalStorage.facet) [concrete] @@ -318,8 +336,8 @@ fn F() { // CHECK:STDOUT: %Optional.None.specific_fn: = specific_function %Optional.None.a61, @Optional.None(%OptionalStorage.facet) [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc10 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc10_41.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -385,12 +403,20 @@ fn F() { // CHECK:STDOUT: %.loc10_41.2: ref %Optional.ad7 = temporary %.loc10_41.1, %Optional.None.call // CHECK:STDOUT: %.loc10_41.3: %Optional.ad7 = acquire_value %.loc10_41.2 // CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc10_41.3) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc10_41.2, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc10_41.2, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc10_41.2) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc10(%self.param: ref %Optional.ad7) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc10_41.1(%self.param: ref %MaybeUnformed.28c) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_41.2(%self.param: ref %Optional.ad7) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- nullable_return_value.carbon // CHECK:STDOUT: @@ -407,6 +433,11 @@ fn F() { // CHECK:STDOUT: %Destroy.lookup_impl_witness.e1f: = lookup_impl_witness %ptr.e8f, @Destroy [symbolic] // CHECK:STDOUT: %Destroy.facet.617: %Destroy.type = facet_value %ptr.e8f, (%Destroy.lookup_impl_witness.e1f) [symbolic] // CHECK:STDOUT: %MaybeUnformed.2e9: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.617) [symbolic] +// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.1 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.8d7fae.1: = custom_witness (%Destroy.Op.651ba6.1), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.d24: %Destroy.type = facet_value %ptr.874, (%custom_witness.8d7fae.1) [concrete] +// CHECK:STDOUT: %MaybeUnformed.28c: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.d24) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.32c: = impl_witness imports.%OptionalStorage.impl_witness_table.d23, @ptr.as.OptionalStorage.impl(%Cpp.void) [concrete] // CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value %ptr.874, (%OptionalStorage.impl_witness.32c) [concrete] // CHECK:STDOUT: %Optional.bb8: type = class_type @Optional, @Optional(%OptionalStorage.facet) [concrete] @@ -415,8 +446,8 @@ fn F() { // CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc10 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc10_57.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -480,12 +511,20 @@ fn F() { // CHECK:STDOUT: %.loc10_57.2: ref %Optional.bb8 = temporary %.loc10_57.1, %foo.call // CHECK:STDOUT: %.loc10_57.3: %Optional.bb8 = acquire_value %.loc10_57.2 // CHECK:STDOUT: %output: %Optional.bb8 = value_binding output, %.loc10_57.3 -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc10_57.2, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc10_57.2, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc10_57.2) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc10(%self.param: ref %Optional.bb8) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc10_57.1(%self.param: ref %MaybeUnformed.28c) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_57.2(%self.param: ref %Optional.bb8) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- non_nullable_pointer.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/impls/destroy.carbon b/toolchain/check/testdata/interop/cpp/impls/destroy.carbon index a5154a032b61..1122733fec14 100644 --- a/toolchain/check/testdata/interop/cpp/impls/destroy.carbon +++ b/toolchain/check/testdata/interop/cpp/impls/destroy.carbon @@ -65,7 +65,7 @@ fn TrivialDestroy() { var unused a: Cpp.TrivialDestructor = {}; } -// --- destroy_protected_base_destructor.carbon +// --- fail_todo_destroy_protected_base_destructor.carbon library "[[@TEST_NAME]]"; @@ -77,11 +77,19 @@ class Derived { fn DestroyClassWithProtectedBaseDestructor() { //@dump-sem-ir-begin + // CHECK:STDERR: fail_todo_destroy_protected_base_destructor.carbon:[[@LINE+8]]:3: error: cannot access protected member `` of type `Cpp.ProtectedDestructor` [ClassInvalidMemberAccess] + // CHECK:STDERR: var unused a: Derived = {.base = {}}; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_todo_destroy_protected_base_destructor.carbon:[[@LINE-11]]:10: in file included here [InCppInclude] + // CHECK:STDERR: ./types.h:33:3: note: declared here [ClassMemberDeclaration] + // CHECK:STDERR: ~ProtectedDestructor(); + // CHECK:STDERR: ^ + // CHECK:STDERR: var unused a: Derived = {.base = {}}; //@dump-sem-ir-end } -// --- todo_fail_destroy_private_base_destructor.carbon +// --- fail_destroy_private_base_destructor.carbon library "[[@TEST_NAME]]"; @@ -94,6 +102,14 @@ class Derived { fn DestroyClassWithPrivateBaseDestructor() { //@dump-sem-ir-begin // TODO: We should not allow this, as the destructor of the base class is private. + // CHECK:STDERR: fail_destroy_private_base_destructor.carbon:[[@LINE+8]]:3: error: cannot access private member `` of type `Cpp.PrivateDestructor` [ClassInvalidMemberAccess] + // CHECK:STDERR: var unused a: Derived = {.base = {}}; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_destroy_private_base_destructor.carbon:[[@LINE-12]]:10: in file included here [InCppInclude] + // CHECK:STDERR: ./types.h:28:3: note: declared here [ClassMemberDeclaration] + // CHECK:STDERR: ~PrivateDestructor(); + // CHECK:STDERR: ^ + // CHECK:STDERR: var unused a: Derived = {.base = {}}; //@dump-sem-ir-end } @@ -329,13 +345,14 @@ fn EqualWitnesses(p: Wrap(Cpp.PublicDestructor)*) -> Wrap(Cpp.PublicDestructor)* // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: --- destroy_protected_base_destructor.carbon +// CHECK:STDOUT: --- fail_todo_destroy_protected_base_destructor.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Derived: type = class_type @Derived [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %ProtectedDestructor: type = class_type @ProtectedDestructor [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %struct_type.base.e31: type = struct_type {.base: %ProtectedDestructor} [concrete] // CHECK:STDOUT: %pattern_type.9f6: type = pattern_type %Derived [concrete] // CHECK:STDOUT: %empty_struct.a40: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: %struct_type.base.f5e: type = struct_type {.base: %empty_struct_type} [concrete] @@ -344,8 +361,8 @@ fn EqualWitnesses(p: Wrap(Cpp.PublicDestructor)*) -> Wrap(Cpp.PublicDestructor)* // CHECK:STDOUT: %empty_struct.377: %.ce2 = struct_value () [concrete] // CHECK:STDOUT: %ProtectedDestructor.val: %ProtectedDestructor = struct_value () [concrete] // CHECK:STDOUT: %Derived.val: %Derived = struct_value (%ProtectedDestructor.val) [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc20_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @DestroyClassWithProtectedBaseDestructor() { @@ -355,31 +372,40 @@ fn EqualWitnesses(p: Wrap(Cpp.PublicDestructor)*) -> Wrap(Cpp.PublicDestructor)* // CHECK:STDOUT: %a.var_patt: %pattern_type.9f6 = var_pattern %a.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %a.var: ref %Derived = var %a.var_patt -// CHECK:STDOUT: %.loc12_37.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct.a40] -// CHECK:STDOUT: %.loc12_38.1: %struct_type.base.f5e = struct_literal (%.loc12_37.1) [concrete = constants.%struct] -// CHECK:STDOUT: %.loc12_38.2: ref %.ce2 = class_element_access %a.var, element0 -// CHECK:STDOUT: %.loc12_37.2: init %.ce2 to %.loc12_38.2 = class_init () [concrete = constants.%empty_struct.377] -// CHECK:STDOUT: %.loc12_38.3: init %.ce2 = converted %.loc12_37.1, %.loc12_37.2 [concrete = constants.%empty_struct.377] -// CHECK:STDOUT: %.loc12_38.4: init %ProtectedDestructor = as_compatible %.loc12_38.3 [concrete = constants.%ProtectedDestructor.val] -// CHECK:STDOUT: %.loc12_38.5: init %Derived to %a.var = class_init (%.loc12_38.4) [concrete = constants.%Derived.val] -// CHECK:STDOUT: %.loc12_3: init %Derived = converted %.loc12_38.1, %.loc12_38.5 [concrete = constants.%Derived.val] -// CHECK:STDOUT: assign %a.var, %.loc12_3 +// CHECK:STDOUT: %.loc20_37.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct.a40] +// CHECK:STDOUT: %.loc20_38.1: %struct_type.base.f5e = struct_literal (%.loc20_37.1) [concrete = constants.%struct] +// CHECK:STDOUT: %.loc20_38.2: ref %.ce2 = class_element_access %a.var, element0 +// CHECK:STDOUT: %.loc20_37.2: init %.ce2 to %.loc20_38.2 = class_init () [concrete = constants.%empty_struct.377] +// CHECK:STDOUT: %.loc20_38.3: init %.ce2 = converted %.loc20_37.1, %.loc20_37.2 [concrete = constants.%empty_struct.377] +// CHECK:STDOUT: %.loc20_38.4: init %ProtectedDestructor = as_compatible %.loc20_38.3 [concrete = constants.%ProtectedDestructor.val] +// CHECK:STDOUT: %.loc20_38.5: init %Derived to %a.var = class_init (%.loc20_38.4) [concrete = constants.%Derived.val] +// CHECK:STDOUT: %.loc20_3: init %Derived = converted %.loc20_38.1, %.loc20_38.5 [concrete = constants.%Derived.val] +// CHECK:STDOUT: assign %a.var, %.loc20_3 // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [concrete = constants.%Derived] // CHECK:STDOUT: %a: ref %Derived = ref_binding a, %a.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Derived) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc20_3.1(%self.param: ref %struct_type.base.e31) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: --- todo_fail_destroy_private_base_destructor.carbon +// CHECK:STDOUT: fn @Destroy.Op.loc20_3.2(%self.param: ref %Derived) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- fail_destroy_private_base_destructor.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Derived: type = class_type @Derived [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %PrivateDestructor: type = class_type @PrivateDestructor [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %struct_type.base.616: type = struct_type {.base: %PrivateDestructor} [concrete] // CHECK:STDOUT: %pattern_type.9f6: type = pattern_type %Derived [concrete] // CHECK:STDOUT: %empty_struct.a40: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: %struct_type.base.f5e: type = struct_type {.base: %empty_struct_type} [concrete] @@ -388,8 +414,8 @@ fn EqualWitnesses(p: Wrap(Cpp.PublicDestructor)*) -> Wrap(Cpp.PublicDestructor)* // CHECK:STDOUT: %empty_struct.361: %.b20 = struct_value () [concrete] // CHECK:STDOUT: %PrivateDestructor.val: %PrivateDestructor = struct_value () [concrete] // CHECK:STDOUT: %Derived.val: %Derived = struct_value (%PrivateDestructor.val) [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc21_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @DestroyClassWithPrivateBaseDestructor() { @@ -399,21 +425,29 @@ fn EqualWitnesses(p: Wrap(Cpp.PublicDestructor)*) -> Wrap(Cpp.PublicDestructor)* // CHECK:STDOUT: %a.var_patt: %pattern_type.9f6 = var_pattern %a.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %a.var: ref %Derived = var %a.var_patt -// CHECK:STDOUT: %.loc13_37.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct.a40] -// CHECK:STDOUT: %.loc13_38.1: %struct_type.base.f5e = struct_literal (%.loc13_37.1) [concrete = constants.%struct] -// CHECK:STDOUT: %.loc13_38.2: ref %.b20 = class_element_access %a.var, element0 -// CHECK:STDOUT: %.loc13_37.2: init %.b20 to %.loc13_38.2 = class_init () [concrete = constants.%empty_struct.361] -// CHECK:STDOUT: %.loc13_38.3: init %.b20 = converted %.loc13_37.1, %.loc13_37.2 [concrete = constants.%empty_struct.361] -// CHECK:STDOUT: %.loc13_38.4: init %PrivateDestructor = as_compatible %.loc13_38.3 [concrete = constants.%PrivateDestructor.val] -// CHECK:STDOUT: %.loc13_38.5: init %Derived to %a.var = class_init (%.loc13_38.4) [concrete = constants.%Derived.val] -// CHECK:STDOUT: %.loc13_3: init %Derived = converted %.loc13_38.1, %.loc13_38.5 [concrete = constants.%Derived.val] -// CHECK:STDOUT: assign %a.var, %.loc13_3 +// CHECK:STDOUT: %.loc21_37.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct.a40] +// CHECK:STDOUT: %.loc21_38.1: %struct_type.base.f5e = struct_literal (%.loc21_37.1) [concrete = constants.%struct] +// CHECK:STDOUT: %.loc21_38.2: ref %.b20 = class_element_access %a.var, element0 +// CHECK:STDOUT: %.loc21_37.2: init %.b20 to %.loc21_38.2 = class_init () [concrete = constants.%empty_struct.361] +// CHECK:STDOUT: %.loc21_38.3: init %.b20 = converted %.loc21_37.1, %.loc21_37.2 [concrete = constants.%empty_struct.361] +// CHECK:STDOUT: %.loc21_38.4: init %PrivateDestructor = as_compatible %.loc21_38.3 [concrete = constants.%PrivateDestructor.val] +// CHECK:STDOUT: %.loc21_38.5: init %Derived to %a.var = class_init (%.loc21_38.4) [concrete = constants.%Derived.val] +// CHECK:STDOUT: %.loc21_3: init %Derived = converted %.loc21_38.1, %.loc21_38.5 [concrete = constants.%Derived.val] +// CHECK:STDOUT: assign %a.var, %.loc21_3 // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [concrete = constants.%Derived] // CHECK:STDOUT: %a: ref %Derived = ref_binding a, %a.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Derived) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc21_3.1(%self.param: ref %struct_type.base.616) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc21_3.2(%self.param: ref %Derived) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/macros.carbon b/toolchain/check/testdata/interop/cpp/macros.carbon index 90b54a559adc..f907cb93a235 100644 --- a/toolchain/check/testdata/interop/cpp/macros.carbon +++ b/toolchain/check/testdata/interop/cpp/macros.carbon @@ -1083,6 +1083,7 @@ fn F() { // CHECK:STDOUT: %bound_method.04c: = bound_method %int_1.5d2, %Int.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %array_type: type = array_type %int_1.5b8, %f32.97e [concrete] +// CHECK:STDOUT: %f32.9b3: type = float_type %int_32, f32 [concrete] // CHECK:STDOUT: %pattern_type.b36: type = pattern_type %array_type [concrete] // CHECK:STDOUT: %float.6da: Core.FloatLiteral = float_literal_value 10e-1 [concrete] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.FloatLiteral) [concrete] @@ -1103,8 +1104,8 @@ fn F() { // CHECK:STDOUT: %bound_method.57d: = bound_method %float.6da, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %float.e3b: %f32.97e = float_value 1 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%float.e3b) [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc10_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1172,12 +1173,22 @@ fn F() { // CHECK:STDOUT: %f32.loc12: type = type_literal constants.%f32.97e [concrete = constants.%f32.97e] // CHECK:STDOUT: %.loc12: %f32.97e = acquire_value %n.ref.loc12 // CHECK:STDOUT: %b: %f32.97e = value_binding b, %.loc12 -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc10_3.1(%self.param: ref %f32.9b3) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_3.2(%self.param: ref %f32.97e) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_unary_operator.carbon // CHECK:STDOUT: @@ -1746,6 +1757,11 @@ fn F() { // CHECK:STDOUT: %MaybeUnformed.2e9: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.617) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.None.type.03c: type = fn_type @ptr.as.OptionalStorage.impl.None, @ptr.as.OptionalStorage.impl(%T.67d) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.None.f37: %ptr.as.OptionalStorage.impl.None.type.03c = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.8d7fae.2: = custom_witness (%Destroy.Op.651ba6.2), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.252: %Destroy.type = facet_value %ptr.235, (%custom_witness.8d7fae.2) [concrete] +// CHECK:STDOUT: %MaybeUnformed.859: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.252) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.c23: = impl_witness imports.%OptionalStorage.impl_witness_table.75b, @ptr.as.OptionalStorage.impl(%i32) [concrete] // CHECK:STDOUT: %OptionalStorage.facet.a2f: %OptionalStorage.type = facet_value %ptr.235, (%OptionalStorage.impl_witness.c23) [concrete] // CHECK:STDOUT: %Optional.1d0: type = class_type @Optional, @Optional(%OptionalStorage.facet.a2f) [concrete] @@ -1763,8 +1779,8 @@ fn F() { // CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.bound: = bound_method %uninit, %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.0f5 [concrete] // CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.0f5, @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: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc11 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc11_14.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1813,12 +1829,20 @@ fn F() { // CHECK:STDOUT: %.loc11_14.3: ref %Optional.1d0 = temporary %.loc11_14.2, %.loc11_14.1 // CHECK:STDOUT: %.loc11_14.4: %Optional.1d0 = acquire_value %.loc11_14.3 // CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc11_14.4) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc11_14.3, constants.%Destroy.Op.651ba6.3 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc11_14.3, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc11_14.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc11(%self.param: ref %Optional.1d0) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc11_14.1(%self.param: ref %MaybeUnformed.859) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc11_14.2(%self.param: ref %Optional.1d0) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- enums.carbon // 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 78328affc2f6..31de168d7d82 100644 --- a/toolchain/check/testdata/interop/cpp/stdlib/initializer_list.carbon +++ b/toolchain/check/testdata/interop/cpp/stdlib/initializer_list.carbon @@ -61,6 +61,7 @@ fn F() { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %initializer_list: type = class_type @initializer_list [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %pattern_type.22f: type = pattern_type %initializer_list [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] @@ -113,6 +114,9 @@ fn F() { // CHECK:STDOUT: %InitListConstructor.cpp_destructor: %InitListConstructor.cpp_destructor.type = struct_value () [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.Op.type.bae255.4: type = fn_type @Destroy.Op.loc12_44.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.fd3, %Destroy.Op.651ba6.4 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -350,10 +354,13 @@ fn F() { // CHECK:STDOUT: %InitListConstructor.cpp_destructor.call: init %empty_tuple.type = call %InitListConstructor.cpp_destructor.bound(%.loc12_44.24) // CHECK:STDOUT: %initializer_list.cpp_destructor.bound.loc12: = bound_method %.loc12_44.19, 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.19) +// CHECK:STDOUT: %Destroy.Op.call.loc12: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.fd3) // CHECK:STDOUT: %initializer_list.cpp_destructor.bound.loc10: = bound_method %.loc10_23.18, 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.18) +// CHECK:STDOUT: %Destroy.Op.call.loc10: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.fd3) // CHECK:STDOUT: %initializer_list.cpp_destructor.bound.loc8: = bound_method %.loc8_50.18, 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.18) +// CHECK:STDOUT: %Destroy.Op.call.loc8: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.fd3) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -363,5 +370,15 @@ fn F() { // 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.Op.loc12(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc12_44.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc12_44.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc12_44.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/typedef.carbon b/toolchain/check/testdata/interop/cpp/typedef.carbon index 3dbf6525e790..63d8d6b8ef31 100644 --- a/toolchain/check/testdata/interop/cpp/typedef.carbon +++ b/toolchain/check/testdata/interop/cpp/typedef.carbon @@ -55,6 +55,7 @@ fn H(var c: Cpp.C, var d: Cpp.D) { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // 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.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %int_42.20e: Core.IntLiteral = int_value 42 [concrete] // CHECK:STDOUT: %ImplicitAs.type.e8c: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete] @@ -86,8 +87,8 @@ 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.011, @ptr.as.Copy.impl.Op(%i32) [concrete] // CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc10 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -145,14 +146,19 @@ fn H(var c: Cpp.C, var d: Cpp.D) { // CHECK:STDOUT: %p: ref %ptr.235 = ref_binding p, %p.var // CHECK:STDOUT: %Destroy.Op.bound.loc10: = bound_method %p.var, constants.%Destroy.Op.651ba6.1 // CHECK:STDOUT: %Destroy.Op.call.loc10: init %empty_tuple.type = call %Destroy.Op.bound.loc10(%p.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc8: = bound_method %n.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc8: = bound_method %n.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call.loc8: init %empty_tuple.type = call %Destroy.Op.bound.loc8(%n.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.Op.loc10(%self.param: ref %ptr.235) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc8(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- use_class_typedef.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/namespace/merging_with_indirections.carbon b/toolchain/check/testdata/namespace/merging_with_indirections.carbon index 257b71d50479..dcc5d5a92c93 100644 --- a/toolchain/check/testdata/namespace/merging_with_indirections.carbon +++ b/toolchain/check/testdata/namespace/merging_with_indirections.carbon @@ -180,8 +180,8 @@ fn Run() { // CHECK:STDOUT: %DefaultOrUnformed.facet: %DefaultOrUnformed.type = facet_value %A, (%DefaultOrUnformed.impl_witness.c9e) [concrete] // CHECK:STDOUT: %T.as.DefaultOrUnformed.impl.Op.specific_fn: = specific_function %T.as.DefaultOrUnformed.impl.Op.993, @T.as.DefaultOrUnformed.impl.Op(%A) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc10_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -263,14 +263,19 @@ 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.Op.bound.loc10: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc10: = bound_method %a.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc10: init %empty_tuple.type = call %Destroy.Op.bound.loc10(%a.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc7: = bound_method %.loc7_11.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc7: = bound_method %.loc7_11.2, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc7: init %empty_tuple.type = call %Destroy.Op.bound.loc7(%.loc7_11.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F [from "b.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %A) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc10_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_3.2(%self.param: ref %A) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/namespace/shadow.carbon b/toolchain/check/testdata/namespace/shadow.carbon index b321c21ecac6..eb1520bed051 100644 --- a/toolchain/check/testdata/namespace/shadow.carbon +++ b/toolchain/check/testdata/namespace/shadow.carbon @@ -48,6 +48,7 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %B.type: type = fn_type @B [concrete] // CHECK:STDOUT: %B: %B.type = struct_value () [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %true: bool = bool_literal true [concrete] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] @@ -77,8 +78,8 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: %.8e2: type = fn_type_with_self_type %Copy.WithSelf.Op.type.081, %Copy.facet [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.664, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc26_5.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -162,7 +163,7 @@ 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.Op.bound.loc26_5.1: = bound_method %A.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc26_5.1: = bound_method %A.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc26_5.1: init %empty_tuple.type = call %Destroy.Op.bound.loc26_5.1(%A.var) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: @@ -174,10 +175,15 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: %bound_method.loc31_11.2: = bound_method %int_0.loc31, %specific_fn.loc31 [concrete = constants.%bound_method] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc31: init %i32 = call %bound_method.loc31_11.2(%int_0.loc31) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc31: init %i32 = converted %int_0.loc31, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc31 [concrete = constants.%int_0.6a9] -// CHECK:STDOUT: %Destroy.Op.bound.loc26_5.2: = bound_method %A.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc26_5.2: = bound_method %A.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc26_5.2: init %empty_tuple.type = call %Destroy.Op.bound.loc26_5.2(%A.var) // CHECK:STDOUT: return %.loc31 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc26_5.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc26_5.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// 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 319258265b99..23d67c85c4fd 100644 --- a/toolchain/check/testdata/operators/builtin/assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/assignment.carbon @@ -40,6 +40,7 @@ fn Main() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %int_12.6a3: Core.IntLiteral = int_value 12 [concrete] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] @@ -116,12 +117,12 @@ fn Main() { // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc27 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc23 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc19 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc23_3.2 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc16 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc23_3.3 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.5: type = fn_type @Destroy.Op.loc19 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.5: %Destroy.Op.type.bae255.5 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -342,20 +343,31 @@ fn Main() { // CHECK:STDOUT: assign %.loc30_3, %.loc30_29 // CHECK:STDOUT: %Destroy.Op.bound.loc27: = bound_method %p.var, constants.%Destroy.Op.651ba6.1 // CHECK:STDOUT: %Destroy.Op.call.loc27: init %empty_tuple.type = call %Destroy.Op.bound.loc27(%p.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc23: = bound_method %c.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc23: = bound_method %c.var, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call.loc23: init %empty_tuple.type = call %Destroy.Op.bound.loc23(%c.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc19: = bound_method %b.var, constants.%Destroy.Op.651ba6.3 +// CHECK:STDOUT: %Destroy.Op.bound.loc19: = bound_method %b.var, constants.%Destroy.Op.651ba6.5 // CHECK:STDOUT: %Destroy.Op.call.loc19: init %empty_tuple.type = call %Destroy.Op.bound.loc19(%b.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc16: = bound_method %a.var, constants.%Destroy.Op.651ba6.4 +// CHECK:STDOUT: %Destroy.Op.bound.loc16: = bound_method %a.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call.loc16: init %empty_tuple.type = call %Destroy.Op.bound.loc16(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.Op.loc27(%self.param: ref %ptr.235) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc23(%self.param: ref %struct_type.a.b.501) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc23_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc19(%self.param: ref %tuple.type.d07) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc23_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc16(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc23_3.3(%self.param: ref %struct_type.a.b.501) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc19(%self.param: ref %tuple.type.d07) { +// CHECK:STDOUT: !entry: +// 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 6fb2e31ffacb..61c00dc6e61d 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 @@ -86,6 +86,7 @@ fn Main() { // CHECK:STDOUT: %Core.IntLiteral.as.Copy.impl.Op.type: type = fn_type @Core.IntLiteral.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.Copy.impl.Op: %Core.IntLiteral.as.Copy.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.Copy.impl.Op.bound.74e: = bound_method %int_2.ecc, %Core.IntLiteral.as.Copy.impl.Op [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] // CHECK:STDOUT: %ImplicitAs.type.e8c: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete] @@ -146,8 +147,8 @@ fn Main() { // CHECK:STDOUT: %bound_method.409: = bound_method %int_10.64f, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_10.265: %i32 = int_value 10 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc56_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -379,12 +380,17 @@ 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.265] // CHECK:STDOUT: %.loc61_27: init %i32 = converted %int_10, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc61 [concrete = constants.%int_10.265] // CHECK:STDOUT: assign %.loc61_4, %.loc61_27 -// CHECK:STDOUT: %Destroy.Op.bound.loc56: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc56: = bound_method %a.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc56: init %empty_tuple.type = call %Destroy.Op.bound.loc56(%a.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc33: = bound_method %n.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc33: = bound_method %n.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc33: init %empty_tuple.type = call %Destroy.Op.bound.loc33(%n.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc56_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc56_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// 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 dbfa65adafae..12a1e1ea7c34 100644 --- a/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon @@ -41,6 +41,7 @@ fn Main() { // CHECK:STDOUT: %pattern_type.7ce: 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] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] @@ -75,8 +76,8 @@ fn Main() { // CHECK:STDOUT: %.8e2: type = fn_type_with_self_type %Copy.WithSelf.Op.type.081, %Copy.facet [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.664, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc18_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -161,10 +162,15 @@ 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.Op.bound: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc18_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc18_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// 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 d57d3505317f..da4240745111 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon @@ -34,6 +34,7 @@ fn Main() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] @@ -54,8 +55,8 @@ fn Main() { // CHECK:STDOUT: %int_3.822: %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: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc16_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -103,10 +104,15 @@ 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.Op.bound: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc16_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc16_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon b/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon index d05722094a2c..782aede16aef 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon @@ -70,8 +70,8 @@ fn TestRef(b: C) { // CHECK:STDOUT: %AddAssignWith.generic: %AddAssignWith.type.fc6 = struct_value () [concrete] // CHECK:STDOUT: %Inc.type: type = facet_type <@Inc> [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc36_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -181,10 +181,15 @@ 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.Op.bound: = bound_method %a.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc36_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc36_3.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// 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 33e27b779c9d..e922faa7280f 100644 --- a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon +++ b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon @@ -99,8 +99,8 @@ fn Test() { // CHECK:STDOUT: %Source.specific_fn.217: = specific_function %Source, @Source(%i32) [concrete] // CHECK:STDOUT: %.eba: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.d7d, %ImplicitAs.facet.be6 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc35_20.4 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -323,14 +323,29 @@ 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.Op.bound.loc35: = bound_method %.loc35_20.5, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc35: = bound_method %.loc35_20.5, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call.loc35: init %empty_tuple.type = call %Destroy.Op.bound.loc35(%.loc35_20.5) -// CHECK:STDOUT: %Destroy.Op.bound.loc34: = bound_method %.loc34_20.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc34: = bound_method %.loc34_20.2, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call.loc34: init %empty_tuple.type = call %Destroy.Op.bound.loc34(%.loc34_20.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %X) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc35_20.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc35_20.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc35_20.3(%self.param: ref %struct_type.n) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc35_20.4(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Source(constants.%T.67d) { // CHECK:STDOUT: %T.loc31_12.1 => constants.%T.67d diff --git a/toolchain/check/testdata/operators/overloaded/index.carbon b/toolchain/check/testdata/operators/overloaded/index.carbon index 01eb4a74e7b8..f6259ad0707a 100644 --- a/toolchain/check/testdata/operators/overloaded/index.carbon +++ b/toolchain/check/testdata/operators/overloaded/index.carbon @@ -349,6 +349,9 @@ fn F() { // CHECK:STDOUT: %C.val: %C = struct_value () [concrete] // CHECK:STDOUT: %.5ea: ref %C = temporary invalid, %C.val [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc15_15.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.5ea, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -488,10 +491,16 @@ fn F() { // CHECK:STDOUT: %c: %C = value_binding c, %.loc15_15.6 // CHECK:STDOUT: %c.ref: %C = name_ref c, %c // CHECK:STDOUT: %.loc23: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.5ea) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc15_15.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc15_15.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @IndexWith(constants.%SubscriptType, constants.%ElementType) { // CHECK:STDOUT: %SubscriptType => constants.%SubscriptType diff --git a/toolchain/check/testdata/package_expr/fail_not_found.carbon b/toolchain/check/testdata/package_expr/fail_not_found.carbon index 55b148cd7123..75c79b955596 100644 --- a/toolchain/check/testdata/package_expr/fail_not_found.carbon +++ b/toolchain/check/testdata/package_expr/fail_not_found.carbon @@ -30,10 +30,11 @@ fn Main() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc20_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -69,10 +70,15 @@ fn Main() { // CHECK:STDOUT: assign %y.var, // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %y: ref %i32 = ref_binding y, %y.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %y.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %y.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%y.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc20_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc20_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// 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 b367e3ac9648..cdd4baf35192 100644 --- a/toolchain/check/testdata/package_expr/syntax.carbon +++ b/toolchain/check/testdata/package_expr/syntax.carbon @@ -154,6 +154,7 @@ fn Main() { // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // 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.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] @@ -189,8 +190,8 @@ fn Main() { // CHECK:STDOUT: %.8e2: type = fn_type_with_self_type %Copy.WithSelf.Op.type.081, %Copy.facet [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.664, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -262,14 +263,19 @@ fn Main() { // CHECK:STDOUT: assign %y.var, %Int.as.Copy.impl.Op.call // CHECK:STDOUT: %i32.loc9: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %y: ref %i32 = ref_binding y, %y.var -// CHECK:STDOUT: %Destroy.Op.bound.loc9: = bound_method %y.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc9: = bound_method %y.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc9: init %empty_tuple.type = call %Destroy.Op.bound.loc9(%y.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc7: = bound_method %x.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc7: = bound_method %x.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc7: init %empty_tuple.type = call %Destroy.Op.bound.loc7(%x.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/pointer/address_of_deref.carbon b/toolchain/check/testdata/pointer/address_of_deref.carbon index 1edced71572e..6fb39851bbc1 100644 --- a/toolchain/check/testdata/pointer/address_of_deref.carbon +++ b/toolchain/check/testdata/pointer/address_of_deref.carbon @@ -30,6 +30,7 @@ fn F() -> i32 { // CHECK:STDOUT: %pattern_type.7ce: 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] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] @@ -59,8 +60,8 @@ fn F() -> i32 { // CHECK:STDOUT: %.8e2: type = fn_type_with_self_type %Copy.WithSelf.Op.type.081, %Copy.facet [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.664, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc16_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -127,10 +128,15 @@ 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.Op.bound: = bound_method %n.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %n.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%n.var) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc16_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc16_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// 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 abf928c9dab4..e77c4b6b598c 100644 --- a/toolchain/check/testdata/pointer/address_of_lvalue.carbon +++ b/toolchain/check/testdata/pointer/address_of_lvalue.carbon @@ -35,6 +35,7 @@ fn F() { // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %struct_type.a.b.501: type = struct_type {.a: %i32, .b: %i32} [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %ptr.3ee: type = ptr_type %struct_type.a.b.501 [concrete] // CHECK:STDOUT: %pattern_type.851: type = pattern_type %struct_type.a.b.501 [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] @@ -93,12 +94,12 @@ fn F() { // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc24 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc22 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc18 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc16 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc22_3.3 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.5: type = fn_type @Destroy.Op.loc18 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.5: %Destroy.Op.type.bae255.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.6: type = fn_type @Destroy.Op.loc16 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.6: %Destroy.Op.type.bae255.6 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -300,24 +301,37 @@ fn F() { // CHECK:STDOUT: %Destroy.Op.call.loc24: init %empty_tuple.type = call %Destroy.Op.bound.loc24(%t1.var) // CHECK:STDOUT: %Destroy.Op.bound.loc23: = bound_method %t0.var, constants.%Destroy.Op.651ba6.1 // CHECK:STDOUT: %Destroy.Op.call.loc23: init %empty_tuple.type = call %Destroy.Op.bound.loc23(%t0.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc22: = bound_method %t.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc22: = bound_method %t.var, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call.loc22: init %empty_tuple.type = call %Destroy.Op.bound.loc22(%t.var) // CHECK:STDOUT: %Destroy.Op.bound.loc20: = bound_method %r.var, constants.%Destroy.Op.651ba6.1 // CHECK:STDOUT: %Destroy.Op.call.loc20: init %empty_tuple.type = call %Destroy.Op.bound.loc20(%r.var) // CHECK:STDOUT: %Destroy.Op.bound.loc19: = bound_method %q.var, constants.%Destroy.Op.651ba6.1 // CHECK:STDOUT: %Destroy.Op.call.loc19: init %empty_tuple.type = call %Destroy.Op.bound.loc19(%q.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc18: = bound_method %p.var, constants.%Destroy.Op.651ba6.3 +// CHECK:STDOUT: %Destroy.Op.bound.loc18: = bound_method %p.var, constants.%Destroy.Op.651ba6.5 // CHECK:STDOUT: %Destroy.Op.call.loc18: init %empty_tuple.type = call %Destroy.Op.bound.loc18(%p.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc16: = bound_method %s.var, constants.%Destroy.Op.651ba6.4 +// CHECK:STDOUT: %Destroy.Op.bound.loc16: = bound_method %s.var, constants.%Destroy.Op.651ba6.6 // CHECK:STDOUT: %Destroy.Op.call.loc16: init %empty_tuple.type = call %Destroy.Op.bound.loc16(%s.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.Op.loc24(%self.param: ref %ptr.235) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc22(%self.param: ref %tuple.type.d07) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc22_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc22_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc22_3.3(%self.param: ref %tuple.type.d07) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.Op.loc18(%self.param: ref %ptr.3ee) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc16(%self.param: ref %struct_type.a.b.501) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc16(%self.param: ref %struct_type.a.b.501) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/pointer/basic.carbon b/toolchain/check/testdata/pointer/basic.carbon index b085453a5600..47dd75aba85f 100644 --- a/toolchain/check/testdata/pointer/basic.carbon +++ b/toolchain/check/testdata/pointer/basic.carbon @@ -32,6 +32,7 @@ fn F() -> i32 { // CHECK:STDOUT: %pattern_type.7ce: 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] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] @@ -74,8 +75,8 @@ fn F() -> i32 { // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc17 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc16 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc16_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -162,12 +163,17 @@ fn F() -> i32 { // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc19_10.2(%.loc19_10.2) // CHECK:STDOUT: %Destroy.Op.bound.loc17: = bound_method %p.var, constants.%Destroy.Op.651ba6.1 // CHECK:STDOUT: %Destroy.Op.call.loc17: init %empty_tuple.type = call %Destroy.Op.bound.loc17(%p.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc16: = bound_method %n.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc16: = bound_method %n.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call.loc16: init %empty_tuple.type = call %Destroy.Op.bound.loc16(%n.var) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.Op.loc17(%self.param: ref %ptr.235) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc16(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc16_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc16_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// 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 450744738b13..69ca0abc8ec0 100644 --- a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon +++ b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon @@ -49,6 +49,7 @@ fn G() -> C { // CHECK:STDOUT: %pattern_type.7ce: 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] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] @@ -68,8 +69,8 @@ fn G() -> C { // CHECK:STDOUT: %int_0.6a9: %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: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc16_12.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.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.501: type = struct_type {.a: %i32, .b: %i32} [concrete] @@ -166,12 +167,17 @@ fn G() -> C { // CHECK:STDOUT: %i32.loc16: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %v: ref %i32 = ref_binding v, %v.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %v.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %v.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%v.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc16_12.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc16_12.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G() -> out %return.param: %C { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon index 2654991e7113..e3aecd0062c7 100644 --- a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon @@ -56,6 +56,7 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %SameScope.type: type = fn_type @SameScope [concrete] // CHECK:STDOUT: %SameScope: %SameScope.type = struct_value () [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %true: bool = bool_literal true [concrete] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] @@ -79,8 +80,8 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: %bound_method.38b: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc25_14.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: %DifferentScopes.type: type = fn_type @DifferentScopes [concrete] // CHECK:STDOUT: %DifferentScopes: %DifferentScopes.type = struct_value () [concrete] // CHECK:STDOUT: } @@ -173,14 +174,19 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: %bound_method.loc27_11.2: = bound_method %int_0.loc27, %specific_fn.loc27 [concrete = constants.%bound_method.d2e] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc27: init %i32 = call %bound_method.loc27_11.2(%int_0.loc27) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc27: init %i32 = converted %int_0.loc27, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc27 [concrete = constants.%int_0.6a9] -// CHECK:STDOUT: %Destroy.Op.bound.loc25: = bound_method %w.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc25: = bound_method %w.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc25: init %empty_tuple.type = call %Destroy.Op.bound.loc25(%w.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc17: = bound_method %v.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc17: = bound_method %v.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc17: init %empty_tuple.type = call %Destroy.Op.bound.loc17(%v.var) // CHECK:STDOUT: return %.loc27 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc25_14.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc25_14.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @DifferentScopes() -> out %return.param: %i32 { // CHECK:STDOUT: !entry: @@ -235,9 +241,9 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: %bound_method.loc44_11.2: = bound_method %int_0.loc44, %specific_fn.loc44 [concrete = constants.%bound_method.d2e] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc44: init %i32 = call %bound_method.loc44_11.2(%int_0.loc44) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc44: init %i32 = converted %int_0.loc44, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc44 [concrete = constants.%int_0.6a9] -// CHECK:STDOUT: %Destroy.Op.bound.loc41: = bound_method %w.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc41: = bound_method %w.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc41: init %empty_tuple.type = call %Destroy.Op.bound.loc41(%w.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc32: = bound_method %v.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc32: = bound_method %v.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc32: init %empty_tuple.type = call %Destroy.Op.bound.loc32(%v.var) // CHECK:STDOUT: return %.loc44 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/return/fail_returned_var_type.carbon b/toolchain/check/testdata/return/fail_returned_var_type.carbon index 976431d3aa5f..7c99ba21801b 100644 --- a/toolchain/check/testdata/return/fail_returned_var_type.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_type.carbon @@ -40,6 +40,7 @@ fn Mismatch() -> i32 { // CHECK:STDOUT: %Float.type: type = generic_class_type @Float [concrete] // CHECK:STDOUT: %Float.generic: %Float.type = struct_value () [concrete] // CHECK:STDOUT: %f64.d77: type = class_type @Float, @Float(%int_64) [concrete] +// CHECK:STDOUT: %f64.794: type = float_type %int_64, f64 [concrete] // CHECK:STDOUT: %pattern_type.0ae: type = pattern_type %f64.d77 [concrete] // CHECK:STDOUT: %float.1f7: Core.FloatLiteral = float_literal_value 0e-1 [concrete] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] @@ -59,8 +60,8 @@ fn Mismatch() -> i32 { // CHECK:STDOUT: %bound_method: = bound_method %float.1f7, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %float.0a8: %f64.d77 = float_value 0 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc23_12.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -115,10 +116,15 @@ fn Mismatch() -> i32 { // CHECK:STDOUT: %f64: type = type_literal constants.%f64.d77 [concrete = constants.%f64.d77] // CHECK:STDOUT: %v: ref %f64.d77 = ref_binding v, %v.var // CHECK:STDOUT: %.loc23_17: %f64.d77 = acquire_value %v -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %v.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %v.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%v.var) // CHECK:STDOUT: return %.loc23_17 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %f64.d77) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc23_12.1(%self.param: ref %f64.794) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc23_12.2(%self.param: ref %f64.d77) { +// CHECK:STDOUT: !entry: +// 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 f9a922f6cdf8..560af4409424 100644 --- a/toolchain/check/testdata/return/import_convert_function.carbon +++ b/toolchain/check/testdata/return/import_convert_function.carbon @@ -707,6 +707,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] @@ -767,6 +768,9 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.bound.cfc: = bound_method %C.val.452, %C.as.ImplicitAs.impl.Convert.78d [concrete] // CHECK:STDOUT: %.b4e: ref %C.b00 = temporary invalid, %C.val.452 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc7_26.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound.f1d: = bound_method %.b4e, %Destroy.Op.651ba6.2 [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete] // CHECK:STDOUT: %bound_method.38b: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] @@ -779,6 +783,9 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.b44: %C.as.ImplicitAs.impl.Convert.type.900 = struct_value () [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.bound.530: = bound_method %C.val.678, %C.as.ImplicitAs.impl.Convert.b44 [concrete] // CHECK:STDOUT: %.6f4: ref %C.674 = temporary invalid, %C.val.678 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc8 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound.48f: = bound_method %.6f4, %Destroy.Op.651ba6.3 [concrete] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5: = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete] // CHECK:STDOUT: %bound_method.646: = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] @@ -791,6 +798,9 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.dd6: %C.as.ImplicitAs.impl.Convert.type.ae1 = struct_value () [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.bound.fc6: = bound_method %C.val.fb5, %C.as.ImplicitAs.impl.Convert.dd6 [concrete] // CHECK:STDOUT: %.18a: ref %C.681 = temporary invalid, %C.val.fb5 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc9 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound.db5: = bound_method %.18a, %Destroy.Op.651ba6.4 [concrete] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061: = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete] // CHECK:STDOUT: %bound_method.fa7: = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] @@ -803,6 +813,9 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.d1c: %C.as.ImplicitAs.impl.Convert.type.cbe = struct_value () [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.bound.ffe: = bound_method %C.val.fe7, %C.as.ImplicitAs.impl.Convert.d1c [concrete] // CHECK:STDOUT: %.440: ref %C.7ac = temporary invalid, %C.val.fe7 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.5: type = fn_type @Destroy.Op.loc10 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.5: %Destroy.Op.type.bae255.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound.818: = bound_method %.440, %Destroy.Op.651ba6.5 [concrete] // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.f0c: = bound_method %int_4.0c1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete] // CHECK:STDOUT: %bound_method.6d7: = bound_method %int_4.0c1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] @@ -815,6 +828,9 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.db5: %C.as.ImplicitAs.impl.Convert.type.876 = struct_value () [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.bound.7cc: = bound_method %C.val.1dd, %C.as.ImplicitAs.impl.Convert.db5 [concrete] // CHECK:STDOUT: %.c3b: ref %C.89d = temporary invalid, %C.val.1dd [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.6: type = fn_type @Destroy.Op.loc11 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.6: %Destroy.Op.type.bae255.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound.ffc: = bound_method %.c3b, %Destroy.Op.651ba6.6 [concrete] // CHECK:STDOUT: %int_5.64b: Core.IntLiteral = int_value 5 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.005: = bound_method %int_5.64b, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete] // CHECK:STDOUT: %bound_method.e9d: = bound_method %int_5.64b, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] @@ -827,6 +843,9 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.a63: %C.as.ImplicitAs.impl.Convert.type.043 = struct_value () [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.bound.4ca: = bound_method %C.val.a4a, %C.as.ImplicitAs.impl.Convert.a63 [concrete] // CHECK:STDOUT: %.d3c: ref %C.f0a = temporary invalid, %C.val.a4a [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.7: type = fn_type @Destroy.Op.loc12 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.7: %Destroy.Op.type.bae255.7 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound.311: = bound_method %.d3c, %Destroy.Op.651ba6.7 [concrete] // CHECK:STDOUT: %int_6.462: Core.IntLiteral = int_value 6 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.502: = bound_method %int_6.462, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete] // CHECK:STDOUT: %bound_method.bc2: = bound_method %int_6.462, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] @@ -839,6 +858,9 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.e2f: %C.as.ImplicitAs.impl.Convert.type.7be = struct_value () [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.bound.f82: = bound_method %C.val.a4b, %C.as.ImplicitAs.impl.Convert.e2f [concrete] // CHECK:STDOUT: %.d2b: ref %C.c60 = temporary invalid, %C.val.a4b [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.8: type = fn_type @Destroy.Op.loc13 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.8: %Destroy.Op.type.bae255.8 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound.a51: = bound_method %.d2b, %Destroy.Op.651ba6.8 [concrete] // CHECK:STDOUT: %int_7.29f: Core.IntLiteral = int_value 7 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.1e0: = bound_method %int_7.29f, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete] // CHECK:STDOUT: %bound_method.bf2: = bound_method %int_7.29f, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] @@ -851,6 +873,9 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.5ea: %C.as.ImplicitAs.impl.Convert.type.c30 = struct_value () [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.bound.622: = bound_method %C.val.f9f, %C.as.ImplicitAs.impl.Convert.5ea [concrete] // CHECK:STDOUT: %.5dc: ref %C.304 = temporary invalid, %C.val.f9f [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.9: type = fn_type @Destroy.Op.loc14 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.9: %Destroy.Op.type.bae255.9 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound.c64: = bound_method %.5dc, %Destroy.Op.651ba6.9 [concrete] // CHECK:STDOUT: %Make.type: type = fn_type @Make [concrete] // CHECK:STDOUT: %Make: %Make.type = struct_value () [concrete] // CHECK:STDOUT: } @@ -1041,6 +1066,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %.loc7_26.3: %C.b00 = acquire_value %.loc7_26.2 [concrete = constants.%C.val.452] // 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.Op.call.loc7_26.1: init %empty_tuple.type = call constants.%Destroy.Op.bound.f1d(constants.%.b4e) // CHECK:STDOUT: return %.loc7_35 to %return.param // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc7: @@ -1070,6 +1096,8 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %.loc8_26.3: %C.674 = acquire_value %.loc8_26.2 [concrete = constants.%C.val.678] // 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.Op.call.loc8_26.1: init %empty_tuple.type = call constants.%Destroy.Op.bound.48f(constants.%.6f4) +// CHECK:STDOUT: %Destroy.Op.call.loc7_26.2: init %empty_tuple.type = call constants.%Destroy.Op.bound.f1d(constants.%.b4e) // CHECK:STDOUT: return %.loc8_35 to %return.param // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc8: @@ -1099,6 +1127,9 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %.loc9_26.3: %C.681 = acquire_value %.loc9_26.2 [concrete = constants.%C.val.fb5] // 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.Op.call.loc9_26.1: init %empty_tuple.type = call constants.%Destroy.Op.bound.db5(constants.%.18a) +// CHECK:STDOUT: %Destroy.Op.call.loc8_26.2: init %empty_tuple.type = call constants.%Destroy.Op.bound.48f(constants.%.6f4) +// CHECK:STDOUT: %Destroy.Op.call.loc7_26.3: init %empty_tuple.type = call constants.%Destroy.Op.bound.f1d(constants.%.b4e) // CHECK:STDOUT: return %.loc9_35 to %return.param // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc9: @@ -1128,6 +1159,10 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %.loc10_26.3: %C.7ac = acquire_value %.loc10_26.2 [concrete = constants.%C.val.fe7] // 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.Op.call.loc10_26.1: init %empty_tuple.type = call constants.%Destroy.Op.bound.818(constants.%.440) +// CHECK:STDOUT: %Destroy.Op.call.loc9_26.2: init %empty_tuple.type = call constants.%Destroy.Op.bound.db5(constants.%.18a) +// CHECK:STDOUT: %Destroy.Op.call.loc8_26.3: init %empty_tuple.type = call constants.%Destroy.Op.bound.48f(constants.%.6f4) +// CHECK:STDOUT: %Destroy.Op.call.loc7_26.4: init %empty_tuple.type = call constants.%Destroy.Op.bound.f1d(constants.%.b4e) // CHECK:STDOUT: return %.loc10_35 to %return.param // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc10: @@ -1157,6 +1192,11 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %.loc11_26.3: %C.89d = acquire_value %.loc11_26.2 [concrete = constants.%C.val.1dd] // 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.Op.call.loc11_26.1: init %empty_tuple.type = call constants.%Destroy.Op.bound.ffc(constants.%.c3b) +// CHECK:STDOUT: %Destroy.Op.call.loc10_26.2: init %empty_tuple.type = call constants.%Destroy.Op.bound.818(constants.%.440) +// CHECK:STDOUT: %Destroy.Op.call.loc9_26.3: init %empty_tuple.type = call constants.%Destroy.Op.bound.db5(constants.%.18a) +// CHECK:STDOUT: %Destroy.Op.call.loc8_26.4: init %empty_tuple.type = call constants.%Destroy.Op.bound.48f(constants.%.6f4) +// CHECK:STDOUT: %Destroy.Op.call.loc7_26.5: init %empty_tuple.type = call constants.%Destroy.Op.bound.f1d(constants.%.b4e) // CHECK:STDOUT: return %.loc11_35 to %return.param // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc11: @@ -1186,6 +1226,12 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %.loc12_26.3: %C.f0a = acquire_value %.loc12_26.2 [concrete = constants.%C.val.a4a] // 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.Op.call.loc12_26.1: init %empty_tuple.type = call constants.%Destroy.Op.bound.311(constants.%.d3c) +// CHECK:STDOUT: %Destroy.Op.call.loc11_26.2: init %empty_tuple.type = call constants.%Destroy.Op.bound.ffc(constants.%.c3b) +// CHECK:STDOUT: %Destroy.Op.call.loc10_26.3: init %empty_tuple.type = call constants.%Destroy.Op.bound.818(constants.%.440) +// CHECK:STDOUT: %Destroy.Op.call.loc9_26.4: init %empty_tuple.type = call constants.%Destroy.Op.bound.db5(constants.%.18a) +// CHECK:STDOUT: %Destroy.Op.call.loc8_26.5: init %empty_tuple.type = call constants.%Destroy.Op.bound.48f(constants.%.6f4) +// CHECK:STDOUT: %Destroy.Op.call.loc7_26.6: init %empty_tuple.type = call constants.%Destroy.Op.bound.f1d(constants.%.b4e) // CHECK:STDOUT: return %.loc12_35 to %return.param // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc12: @@ -1215,6 +1261,13 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %.loc13_26.3: %C.c60 = acquire_value %.loc13_26.2 [concrete = constants.%C.val.a4b] // 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.Op.call.loc13_26.1: init %empty_tuple.type = call constants.%Destroy.Op.bound.a51(constants.%.d2b) +// CHECK:STDOUT: %Destroy.Op.call.loc12_26.2: init %empty_tuple.type = call constants.%Destroy.Op.bound.311(constants.%.d3c) +// CHECK:STDOUT: %Destroy.Op.call.loc11_26.3: init %empty_tuple.type = call constants.%Destroy.Op.bound.ffc(constants.%.c3b) +// CHECK:STDOUT: %Destroy.Op.call.loc10_26.4: init %empty_tuple.type = call constants.%Destroy.Op.bound.818(constants.%.440) +// CHECK:STDOUT: %Destroy.Op.call.loc9_26.5: init %empty_tuple.type = call constants.%Destroy.Op.bound.db5(constants.%.18a) +// CHECK:STDOUT: %Destroy.Op.call.loc8_26.6: init %empty_tuple.type = call constants.%Destroy.Op.bound.48f(constants.%.6f4) +// CHECK:STDOUT: %Destroy.Op.call.loc7_26.7: init %empty_tuple.type = call constants.%Destroy.Op.bound.f1d(constants.%.b4e) // CHECK:STDOUT: return %.loc13_35 to %return.param // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc13: @@ -1244,6 +1297,14 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %.loc14_26.3: %C.304 = acquire_value %.loc14_26.2 [concrete = constants.%C.val.f9f] // 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.Op.call.loc14_26.1: init %empty_tuple.type = call constants.%Destroy.Op.bound.c64(constants.%.5dc) +// CHECK:STDOUT: %Destroy.Op.call.loc13_26.2: init %empty_tuple.type = call constants.%Destroy.Op.bound.a51(constants.%.d2b) +// CHECK:STDOUT: %Destroy.Op.call.loc12_26.3: init %empty_tuple.type = call constants.%Destroy.Op.bound.311(constants.%.d3c) +// CHECK:STDOUT: %Destroy.Op.call.loc11_26.4: init %empty_tuple.type = call constants.%Destroy.Op.bound.ffc(constants.%.c3b) +// CHECK:STDOUT: %Destroy.Op.call.loc10_26.5: init %empty_tuple.type = call constants.%Destroy.Op.bound.818(constants.%.440) +// CHECK:STDOUT: %Destroy.Op.call.loc9_26.6: init %empty_tuple.type = call constants.%Destroy.Op.bound.db5(constants.%.18a) +// CHECK:STDOUT: %Destroy.Op.call.loc8_26.7: init %empty_tuple.type = call constants.%Destroy.Op.bound.48f(constants.%.6f4) +// CHECK:STDOUT: %Destroy.Op.call.loc7_26.8: init %empty_tuple.type = call constants.%Destroy.Op.bound.f1d(constants.%.b4e) // CHECK:STDOUT: return %.loc14_35 to %return.param // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc14: @@ -1251,40 +1312,74 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, imports.%P.Make [concrete = constants.%Make] // CHECK:STDOUT: %.loc6_26.9: ref %D = splice_block %return.param {} // CHECK:STDOUT: %Make.call: init %D to %.loc6_26.9 = call %Make.ref() +// CHECK:STDOUT: %Destroy.Op.call.loc14_26.2: init %empty_tuple.type = call constants.%Destroy.Op.bound.c64(constants.%.5dc) +// CHECK:STDOUT: %Destroy.Op.call.loc13_26.3: init %empty_tuple.type = call constants.%Destroy.Op.bound.a51(constants.%.d2b) +// CHECK:STDOUT: %Destroy.Op.call.loc12_26.4: init %empty_tuple.type = call constants.%Destroy.Op.bound.311(constants.%.d3c) +// CHECK:STDOUT: %Destroy.Op.call.loc11_26.5: init %empty_tuple.type = call constants.%Destroy.Op.bound.ffc(constants.%.c3b) +// CHECK:STDOUT: %Destroy.Op.call.loc10_26.6: init %empty_tuple.type = call constants.%Destroy.Op.bound.818(constants.%.440) +// CHECK:STDOUT: %Destroy.Op.call.loc9_26.7: init %empty_tuple.type = call constants.%Destroy.Op.bound.db5(constants.%.18a) +// CHECK:STDOUT: %Destroy.Op.call.loc8_26.8: init %empty_tuple.type = call constants.%Destroy.Op.bound.48f(constants.%.6f4) +// CHECK:STDOUT: %Destroy.Op.call.loc7_26.9: init %empty_tuple.type = call constants.%Destroy.Op.bound.f1d(constants.%.b4e) // CHECK:STDOUT: return %Make.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @C.as.ImplicitAs.impl.Convert.1 [from "library.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc7(%self.param: ref %C.b00) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc7_26.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc7_26.2(%self.param: ref %C.b00) { +// CHECK:STDOUT: !entry: +// 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.Op.loc8(%self.param: ref %C.674) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8(%self.param: ref %C.674) { +// CHECK:STDOUT: !entry: +// 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.Op.loc9(%self.param: ref %C.681) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc9(%self.param: ref %C.681) { +// CHECK:STDOUT: !entry: +// 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.Op.loc10(%self.param: ref %C.7ac) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc10(%self.param: ref %C.7ac) { +// CHECK:STDOUT: !entry: +// 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.Op.loc11(%self.param: ref %C.89d) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc11(%self.param: ref %C.89d) { +// CHECK:STDOUT: !entry: +// 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.Op.loc12(%self.param: ref %C.f0a) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc12(%self.param: ref %C.f0a) { +// CHECK:STDOUT: !entry: +// 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.Op.loc13(%self.param: ref %C.c60) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc13(%self.param: ref %C.c60) { +// CHECK:STDOUT: !entry: +// 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.Op.loc14(%self.param: ref %C.304) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc14(%self.param: ref %C.304) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Make [from "library.carbon"]; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/returned_var.carbon b/toolchain/check/testdata/return/returned_var.carbon index b10dcb6ce406..d6cef59ceeec 100644 --- a/toolchain/check/testdata/return/returned_var.carbon +++ b/toolchain/check/testdata/return/returned_var.carbon @@ -36,6 +36,7 @@ fn G() -> i32 { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // 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: %C.elem: type = unbound_element_type %C, %i32 [concrete] // CHECK:STDOUT: %struct_type.a.b.501: type = struct_type {.a: %i32, .b: %i32} [concrete] // CHECK:STDOUT: %complete_type.705: = complete_type_witness %struct_type.a.b.501 [concrete] @@ -76,8 +77,8 @@ fn G() -> i32 { // CHECK:STDOUT: %bound_method.d2e: = bound_method %int_0.5c6, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc26_12.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -189,10 +190,15 @@ fn G() -> i32 { // CHECK:STDOUT: %i32.loc26: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %result: ref %i32 = ref_binding result, %result.var // CHECK:STDOUT: %.loc26_22: %i32 = acquire_value %result -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %result.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %result.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%result.var) // CHECK:STDOUT: return %.loc26_22 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc26_12.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc26_12.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// 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 c24bcdbd1ca4..07cd7ce7a282 100644 --- a/toolchain/check/testdata/return/returned_var_scope.carbon +++ b/toolchain/check/testdata/return/returned_var_scope.carbon @@ -43,6 +43,7 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %UnrelatedScopes.type: type = fn_type @UnrelatedScopes [concrete] // CHECK:STDOUT: %UnrelatedScopes: %UnrelatedScopes.type = struct_value () [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %true: bool = bool_literal true [concrete] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] @@ -66,8 +67,8 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %bound_method.38b: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc20_14.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] @@ -177,14 +178,19 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %bound_method.loc22_11.2: = bound_method %int_0.loc22, %specific_fn.loc22 [concrete = constants.%bound_method.d2e] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22: init %i32 = call %bound_method.loc22_11.2(%int_0.loc22) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc22: init %i32 = converted %int_0.loc22, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22 [concrete = constants.%int_0.6a9] -// CHECK:STDOUT: %Destroy.Op.bound.loc20: = bound_method %w.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc20: = bound_method %w.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc20: init %empty_tuple.type = call %Destroy.Op.bound.loc20(%w.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc17: = bound_method %v.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc17: = bound_method %v.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc17: init %empty_tuple.type = call %Destroy.Op.bound.loc17(%v.var) // CHECK:STDOUT: return %.loc22 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc20_14.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc20_14.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @EnclosingButAfter(%b.param: bool) -> out %return.param: %i32 { // CHECK:STDOUT: !entry: @@ -208,7 +214,7 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %i32.loc27: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %v: ref %i32 = ref_binding v, %v.var // CHECK:STDOUT: %.loc27_19: %i32 = acquire_value %v -// CHECK:STDOUT: %Destroy.Op.bound.loc27_14.1: = bound_method %v.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc27_14.1: = bound_method %v.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc27_14.1: init %empty_tuple.type = call %Destroy.Op.bound.loc27_14.1(%v.var) // CHECK:STDOUT: return %.loc27_19 // CHECK:STDOUT: @@ -229,9 +235,9 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %i32.loc30: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %w: ref %i32 = ref_binding w, %w.var // CHECK:STDOUT: %.loc30_17: %i32 = acquire_value %w -// CHECK:STDOUT: %Destroy.Op.bound.loc30: = bound_method %w.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc30: = bound_method %w.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc30: init %empty_tuple.type = call %Destroy.Op.bound.loc30(%w.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc27_14.2: = bound_method %v.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc27_14.2: = bound_method %v.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc27_14.2: init %empty_tuple.type = call %Destroy.Op.bound.loc27_14.2(%v.var) // CHECK:STDOUT: return %.loc30_17 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/literal_member_access.carbon b/toolchain/check/testdata/struct/literal_member_access.carbon index f3f210e4db4b..003547eab0f7 100644 --- a/toolchain/check/testdata/struct/literal_member_access.carbon +++ b/toolchain/check/testdata/struct/literal_member_access.carbon @@ -36,6 +36,7 @@ fn F() -> i32 { // CHECK:STDOUT: %pattern_type.7ce: 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] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete] // CHECK:STDOUT: %struct_type.a.b.c.4ca: type = struct_type {.a: Core.IntLiteral, .b: %struct_type.x.y.z, .c: Core.IntLiteral} [concrete] @@ -50,8 +51,8 @@ fn F() -> i32 { // CHECK:STDOUT: %.8e2: type = fn_type_with_self_type %Copy.WithSelf.Op.type.081, %Copy.facet [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.664, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc18_26.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -127,10 +128,20 @@ 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.Op.bound: = bound_method %.loc18_26.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc18_26.2, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc18_26.2) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %struct_type.x.y.z) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc18_26.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc18_26.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc18_26.3(%self.param: ref %struct_type.x.y.z) { +// CHECK:STDOUT: !entry: +// 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 47e159aea87b..4026127fc2f5 100644 --- a/toolchain/check/testdata/struct/nested_struct_in_place.carbon +++ b/toolchain/check/testdata/struct/nested_struct_in_place.carbon @@ -36,10 +36,11 @@ fn G() { // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %struct_type.a.b.2f9: type = struct_type {.a: %tuple.type.189, .b: %tuple.type.189} [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %pattern_type.3c2: type = pattern_type %struct_type.a.b.2f9 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc18_3.4 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -109,10 +110,25 @@ fn G() { // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %tuple.type.189, .b: %tuple.type.189} [concrete = constants.%struct_type.a.b.2f9] // CHECK:STDOUT: } // CHECK:STDOUT: %v: ref %struct_type.a.b.2f9 = ref_binding v, %v.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %v.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %v.var, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%v.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %struct_type.a.b.2f9) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc18_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc18_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc18_3.3(%self.param: ref %tuple.type.189) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc18_3.4(%self.param: ref %struct_type.a.b.2f9) { +// CHECK:STDOUT: !entry: +// 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 421632404329..310cfd2734d0 100644 --- a/toolchain/check/testdata/tuple/in_place_tuple_init.carbon +++ b/toolchain/check/testdata/tuple/in_place_tuple_init.carbon @@ -61,8 +61,9 @@ fn H() { // 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: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc7_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.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.824: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] @@ -107,12 +108,22 @@ 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.d07 to %.loc5_20.1 = call %F.ref.loc9() -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %v.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %v.var, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%v.var) // CHECK:STDOUT: return %F.call.loc9 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %tuple.type.d07) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc7_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc7_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc7_3.3(%self.param: ref %tuple.type.d07) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @H() -> out %return.param: %i32 { // CHECK:STDOUT: !entry: @@ -128,7 +139,7 @@ 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.Op.bound: = bound_method %.loc15_12.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc15_12.2, constants.%Destroy.Op.651ba6.3 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc15_12.2) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } @@ -147,9 +158,10 @@ fn H() { // CHECK:STDOUT: %tuple.type.f9f: type = tuple_type (%tuple.type.ff9, %tuple.type.ff9) [concrete] // CHECK:STDOUT: %tuple.9e5: %tuple.type.f9f = tuple_value (%tuple.e64, %tuple.e64) [concrete] // CHECK:STDOUT: %tuple.type.99b: type = tuple_type (%tuple.type.189, %tuple.type.189) [concrete] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %pattern_type.d88: type = pattern_type %tuple.type.99b [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc7 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc7_3.4 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] // CHECK:STDOUT: %tuple.type.3a3: type = tuple_type (type, %tuple.type.ff9, type) [concrete] // CHECK:STDOUT: %tuple.5fc: %tuple.type.3a3 = tuple_value (%i32, %tuple.e64, %i32) [concrete] // CHECK:STDOUT: %tuple.type.516: type = tuple_type (%i32, %tuple.type.189, %i32) [concrete] @@ -174,8 +186,8 @@ fn H() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5: = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete] // CHECK:STDOUT: %bound_method.646: = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc13 [concrete] -// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.5: type = fn_type @Destroy.Op.loc13 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.5: %Destroy.Op.type.bae255.5 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -215,12 +227,27 @@ fn H() { // CHECK:STDOUT: %.loc7_50.5: type = converted %.loc7_50.2, constants.%tuple.type.99b [concrete = constants.%tuple.type.99b] // CHECK:STDOUT: } // CHECK:STDOUT: %v: ref %tuple.type.99b = ref_binding v, %v.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %v.var, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %v.var, constants.%Destroy.Op.651ba6.4 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%v.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc7(%self.param: ref %tuple.type.99b) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc7_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc7_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc7_3.3(%self.param: ref %tuple.type.189) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc7_3.4(%self.param: ref %tuple.type.99b) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @H() { // CHECK:STDOUT: !entry: @@ -266,10 +293,13 @@ fn H() { // CHECK:STDOUT: %.loc13_43.4: type = converted %.loc13_43.2, constants.%tuple.type.516 [concrete = constants.%tuple.type.516] // CHECK:STDOUT: } // CHECK:STDOUT: %v: ref %tuple.type.516 = ref_binding v, %v.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %v.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %v.var, constants.%Destroy.Op.651ba6.5 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%v.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc13(%self.param: ref %tuple.type.516) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc13(%self.param: ref %tuple.type.516) { +// CHECK:STDOUT: !entry: +// 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 913776c9c669..f6f0344b1966 100644 --- a/toolchain/check/testdata/tuple/tuple_pattern.carbon +++ b/toolchain/check/testdata/tuple/tuple_pattern.carbon @@ -109,8 +109,8 @@ let (a: {}, b: {}) = ({}, {}, {}); // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %pattern_type.de4: type = pattern_type %tuple.type.b6b [concrete] // CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%v.param: %tuple.type.b6b) { @@ -199,14 +199,19 @@ let (a: {}, b: {}) = ({}, {}, {}); // CHECK:STDOUT: %.loc8_33.3: type = converted %.loc8_33.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: } // CHECK:STDOUT: %d: ref %empty_struct_type = ref_binding d, %tuple.elem1.loc8_3 -// CHECK:STDOUT: %Destroy.Op.bound.loc8: = bound_method %.var.loc8, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc8: = bound_method %.var.loc8, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc8: init %empty_tuple.type = call %Destroy.Op.bound.loc8(%.var.loc8) -// CHECK:STDOUT: %Destroy.Op.bound.loc7: = bound_method %.var.loc7, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc7: = bound_method %.var.loc7, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc7: init %empty_tuple.type = call %Destroy.Op.bound.loc7(%.var.loc7) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %tuple.type.b6b) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.2(%self.param: ref %tuple.type.b6b) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- variable.carbon // CHECK:STDOUT: @@ -218,8 +223,8 @@ let (a: {}, b: {}) = ({}, {}, {}); // CHECK:STDOUT: %tuple: %tuple.type.b6b = tuple_value (%empty_struct, %empty_struct) [concrete] // CHECK:STDOUT: %pattern_type.de4: type = pattern_type %tuple.type.b6b [concrete] // CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc7_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: %MakeTuple.type: type = fn_type @MakeTuple [concrete] // CHECK:STDOUT: %MakeTuple: %MakeTuple.type = struct_value () [concrete] // CHECK:STDOUT: } @@ -283,14 +288,19 @@ let (a: {}, b: {}) = ({}, {}, {}); // CHECK:STDOUT: %.loc7_33.3: type = converted %.loc7_33.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: } // CHECK:STDOUT: %y: ref %empty_struct_type = ref_binding y, %tuple.elem1.loc7_3 -// CHECK:STDOUT: %Destroy.Op.bound.loc7: = bound_method %.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc7: = bound_method %.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc7: init %empty_tuple.type = call %Destroy.Op.bound.loc7(%.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc6: = bound_method %tuple.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound.loc6: = bound_method %tuple.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc6: init %empty_tuple.type = call %Destroy.Op.bound.loc6(%tuple.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %tuple.type.b6b) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc7_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc7_3.2(%self.param: ref %tuple.type.b6b) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G() { // CHECK:STDOUT: !entry: @@ -346,7 +356,7 @@ let (a: {}, b: {}) = ({}, {}, {}); // CHECK:STDOUT: %.loc14_33.3: type = converted %.loc14_33.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: } // CHECK:STDOUT: %y: ref %empty_struct_type = ref_binding y, %tuple.elem1.loc14_3 -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.var) // CHECK:STDOUT: // CHECK:STDOUT: } @@ -376,7 +386,7 @@ let (a: {}, b: {}) = ({}, {}, {}); // CHECK:STDOUT: %.loc22_33.3: type = converted %.loc22_33.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: } // CHECK:STDOUT: %y: ref %empty_struct_type = ref_binding y, %tuple.elem1 -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.var) // 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 21b844625ce3..f0c0b7b83402 100644 --- a/toolchain/check/testdata/var/global_lookup_in_scope.carbon +++ b/toolchain/check/testdata/var/global_lookup_in_scope.carbon @@ -32,8 +32,8 @@ fn Main() { // CHECK:STDOUT: %Main.type: type = fn_type @Main [concrete] // CHECK:STDOUT: %Main: %Main.type = struct_value () [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc5_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -87,12 +87,17 @@ fn Main() { // CHECK:STDOUT: %struct_type.v: type = struct_type {.v: %empty_tuple.type} [concrete = constants.%struct_type.v] // CHECK:STDOUT: } // CHECK:STDOUT: %y: ref %struct_type.v = ref_binding y, %y.var -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %y.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %y.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%y.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %struct_type.v) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc5_3.1(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc5_3.2(%self.param: ref %struct_type.v) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/var/var_pattern.carbon b/toolchain/check/testdata/var/var_pattern.carbon index a30b3698491d..1a88fda389c8 100644 --- a/toolchain/check/testdata/var/var_pattern.carbon +++ b/toolchain/check/testdata/var/var_pattern.carbon @@ -279,8 +279,8 @@ fn G() { // CHECK:STDOUT: %pattern_type.5b8: type = pattern_type %tuple.type [concrete] // CHECK:STDOUT: %tuple: %tuple.type = tuple_value (%empty_tuple, %empty_tuple) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc5_3.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -334,12 +334,17 @@ fn G() { // CHECK:STDOUT: %.loc5_33.3: type = converted %.loc5_33.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %y: ref %empty_tuple.type = ref_binding y, %tuple.elem1.loc5_3 -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %tuple.type) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc5_3.1(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc5_3.2(%self.param: ref %tuple.type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- tuple_in_let_var.carbon // CHECK:STDOUT: @@ -353,8 +358,8 @@ fn G() { // CHECK:STDOUT: %pattern_type.5b8: type = pattern_type %tuple.type [concrete] // CHECK:STDOUT: %tuple: %tuple.type = tuple_value (%empty_tuple, %empty_tuple) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc5_7.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -408,12 +413,17 @@ fn G() { // CHECK:STDOUT: %.loc5_37.3: type = converted %.loc5_37.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %y: ref %empty_tuple.type = ref_binding y, %tuple.elem1.loc5_7 -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %tuple.type) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc5_7.1(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc5_7.2(%self.param: ref %tuple.type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- function.carbon // CHECK:STDOUT: @@ -692,9 +702,9 @@ fn G() { // CHECK:STDOUT: %tuple.d8f: %tuple.type.bcd = tuple_value (%empty_tuple, %empty_tuple) [concrete] // CHECK:STDOUT: %tuple.c9e: %tuple.type.a21 = tuple_value (%empty_tuple, %tuple.d8f) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc9_22 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc9_22.1 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc9_41 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc9_22.2 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -765,16 +775,19 @@ fn G() { // CHECK:STDOUT: %.loc9_56.3: type = converted %.loc9_56.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %z: ref %empty_tuple.type = ref_binding z, %z.var -// CHECK:STDOUT: %Destroy.Op.bound.loc9_22: = bound_method %.var, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.bound.loc9_22: = bound_method %.var, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc9_22: init %empty_tuple.type = call %Destroy.Op.bound.loc9_22(%.var) -// CHECK:STDOUT: %Destroy.Op.bound.loc9_41: = bound_method %z.var, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc9_41: = bound_method %z.var, constants.%Destroy.Op.651ba6.1 // CHECK:STDOUT: %Destroy.Op.call.loc9_41: init %empty_tuple.type = call %Destroy.Op.bound.loc9_41(%z.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc9_22(%self.param: ref %tuple.type.bcd) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc9_22.1(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc9_41(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc9_22.2(%self.param: ref %tuple.type.bcd) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_compile_time.carbon // CHECK:STDOUT: diff --git a/toolchain/driver/testdata/compile/optimize/optimize_debug.carbon b/toolchain/driver/testdata/compile/optimize/optimize_debug.carbon index 6ff25f3820c4..0881cf7c65fc 100644 --- a/toolchain/driver/testdata/compile/optimize/optimize_debug.carbon +++ b/toolchain/driver/testdata/compile/optimize/optimize_debug.carbon @@ -83,6 +83,12 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: uselistorder ptr %.loc19_11.array.index, { 1, 0 } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) local_unnamed_addr #0 !dbg !41 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !44 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nofree norecurse nosync nounwind memory(argmem: readwrite) } // CHECK:STDOUT: @@ -130,3 +136,7 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: !38 = distinct !DILocation(line: 20, column: 5, scope: !16) // CHECK:STDOUT: !39 = !DILocation(line: 18, column: 10, scope: !16) // CHECK:STDOUT: !40 = !DILocation(line: 15, column: 1, scope: !16) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 17, type: !34, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !42) +// CHECK:STDOUT: !42 = !{!43} +// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !41, type: !7) +// CHECK:STDOUT: !44 = !DILocation(line: 17, column: 3, scope: !41) diff --git a/toolchain/driver/testdata/compile/optimize/optimize_default.carbon b/toolchain/driver/testdata/compile/optimize/optimize_default.carbon index c26ac280060d..16220b4f6773 100644 --- a/toolchain/driver/testdata/compile/optimize/optimize_default.carbon +++ b/toolchain/driver/testdata/compile/optimize/optimize_default.carbon @@ -83,6 +83,12 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: uselistorder ptr %.loc19_11.array.index, { 1, 0 } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) local_unnamed_addr #0 !dbg !41 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !44 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nofree norecurse nosync nounwind memory(argmem: readwrite) } // CHECK:STDOUT: @@ -130,3 +136,7 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: !38 = distinct !DILocation(line: 20, column: 5, scope: !16) // CHECK:STDOUT: !39 = !DILocation(line: 18, column: 10, scope: !16) // CHECK:STDOUT: !40 = !DILocation(line: 15, column: 1, scope: !16) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 17, type: !34, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !42) +// CHECK:STDOUT: !42 = !{!43} +// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !41, type: !7) +// CHECK:STDOUT: !44 = !DILocation(line: 17, column: 3, scope: !41) diff --git a/toolchain/driver/testdata/compile/optimize/optimize_none.carbon b/toolchain/driver/testdata/compile/optimize/optimize_none.carbon index f49589dd0f4e..cb141d0c39e3 100644 --- a/toolchain/driver/testdata/compile/optimize/optimize_none.carbon +++ b/toolchain/driver/testdata/compile/optimize/optimize_none.carbon @@ -79,36 +79,43 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: br label %while.cond, !dbg !26 // CHECK:STDOUT: // CHECK:STDOUT: while.done: ; preds = %while.cond +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %n.var), !dbg !20 // CHECK:STDOUT: ret void, !dbg !27 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: noinline nounwind optnone +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !28 { +// 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) // 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 !28 { -// CHECK:STDOUT: call void @"_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.5375cfcbca6d9e35.Core.57ee91777b6354a8"(ptr %self, i32 1), !dbg !34 -// CHECK:STDOUT: ret void, !dbg !35 +// CHECK:STDOUT: define linkonce_odr void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !34 { +// CHECK:STDOUT: call void @"_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.5375cfcbca6d9e35.Core.57ee91777b6354a8"(ptr %self, i32 1), !dbg !38 +// CHECK:STDOUT: ret void, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: noinline nounwind optnone -// CHECK:STDOUT: define linkonce_odr void @"_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.5375cfcbca6d9e35.Core.57ee91777b6354a8"(ptr %self, i32 %other) #0 !dbg !36 { -// CHECK:STDOUT: %1 = call i32 @"_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d"(i32 %other), !dbg !42 -// CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !43 -// CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !43 -// CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !43 -// CHECK:STDOUT: ret void, !dbg !43 +// CHECK:STDOUT: define linkonce_odr void @"_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.5375cfcbca6d9e35.Core.57ee91777b6354a8"(ptr %self, i32 %other) #0 !dbg !40 { +// CHECK:STDOUT: %1 = call i32 @"_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d"(i32 %other), !dbg !46 +// CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !47 +// CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !47 +// CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !47 +// CHECK:STDOUT: ret void, !dbg !47 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: noinline nounwind optnone -// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d"(i32 %self) #0 !dbg !44 { -// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !49 -// CHECK:STDOUT: ret i32 %1, !dbg !50 +// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d"(i32 %self) #0 !dbg !48 { +// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !53 +// CHECK:STDOUT: ret i32 %1, !dbg !54 // 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 !51 { -// CHECK:STDOUT: ret i32 %self, !dbg !54 +// CHECK:STDOUT: define linkonce_odr i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self) #0 !dbg !55 { +// CHECK:STDOUT: ret i32 %self, !dbg !58 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { noinline nounwind optnone } @@ -145,30 +152,34 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: !25 = !DILocation(line: 20, column: 5, scope: !14) // CHECK:STDOUT: !26 = !DILocation(line: 18, column: 3, scope: !14) // CHECK:STDOUT: !27 = !DILocation(line: 15, column: 1, scope: !14) -// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !29, line: 363, type: !30, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !32) -// CHECK:STDOUT: !29 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") -// CHECK:STDOUT: !30 = !DISubroutineType(types: !31) -// CHECK:STDOUT: !31 = !{null, !7} -// CHECK:STDOUT: !32 = !{!33} -// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !28, type: !7) -// CHECK:STDOUT: !34 = !DILocation(line: 365, column: 5, scope: !28) -// CHECK:STDOUT: !35 = !DILocation(line: 363, column: 3, scope: !28) -// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.5375cfcbca6d9e35.Core.57ee91777b6354a8", scope: null, file: !29, line: 299, type: !37, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !39) -// CHECK:STDOUT: !37 = !DISubroutineType(types: !38) -// CHECK:STDOUT: !38 = !{null, !7, !7} -// CHECK:STDOUT: !39 = !{!40, !41} -// CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !36, type: !7) -// CHECK:STDOUT: !41 = !DILocalVariable(arg: 2, scope: !36, type: !7) -// CHECK:STDOUT: !42 = !DILocation(line: 4294967295, scope: !36) -// CHECK:STDOUT: !43 = !DILocation(line: 299, column: 3, scope: !36) -// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d", scope: null, file: !29, line: 62, type: !45, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !47) -// CHECK:STDOUT: !45 = !DISubroutineType(types: !46) -// CHECK:STDOUT: !46 = !{!7, !7} -// CHECK:STDOUT: !47 = !{!48} -// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !44, type: !7) -// CHECK:STDOUT: !49 = !DILocation(line: 64, column: 17, scope: !44) -// CHECK:STDOUT: !50 = !DILocation(line: 64, column: 5, scope: !44) -// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !29, line: 57, type: !45, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !52) -// CHECK:STDOUT: !52 = !{!53} -// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !51, type: !7) -// CHECK:STDOUT: !54 = !DILocation(line: 57, column: 36, scope: !51) +// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 17, type: !29, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !31) +// CHECK:STDOUT: !29 = !DISubroutineType(types: !30) +// CHECK:STDOUT: !30 = !{null, !7} +// CHECK:STDOUT: !31 = !{!32} +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !28, type: !7) +// CHECK:STDOUT: !33 = !DILocation(line: 17, column: 3, scope: !28) +// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !35, line: 363, type: !29, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !36) +// CHECK:STDOUT: !35 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") +// CHECK:STDOUT: !36 = !{!37} +// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !34, type: !7) +// CHECK:STDOUT: !38 = !DILocation(line: 365, column: 5, scope: !34) +// CHECK:STDOUT: !39 = !DILocation(line: 363, column: 3, scope: !34) +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.5375cfcbca6d9e35.Core.57ee91777b6354a8", scope: null, file: !35, line: 299, type: !41, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !43) +// CHECK:STDOUT: !41 = !DISubroutineType(types: !42) +// CHECK:STDOUT: !42 = !{null, !7, !7} +// CHECK:STDOUT: !43 = !{!44, !45} +// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !40, type: !7) +// CHECK:STDOUT: !45 = !DILocalVariable(arg: 2, scope: !40, type: !7) +// CHECK:STDOUT: !46 = !DILocation(line: 4294967295, scope: !40) +// CHECK:STDOUT: !47 = !DILocation(line: 299, column: 3, scope: !40) +// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d", scope: null, file: !35, line: 62, type: !49, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !51) +// CHECK:STDOUT: !49 = !DISubroutineType(types: !50) +// CHECK:STDOUT: !50 = !{!7, !7} +// CHECK:STDOUT: !51 = !{!52} +// CHECK:STDOUT: !52 = !DILocalVariable(arg: 1, scope: !48, type: !7) +// CHECK:STDOUT: !53 = !DILocation(line: 64, column: 17, scope: !48) +// CHECK:STDOUT: !54 = !DILocation(line: 64, column: 5, scope: !48) +// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !35, line: 57, type: !49, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !56) +// CHECK:STDOUT: !56 = !{!57} +// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !55, type: !7) +// CHECK:STDOUT: !58 = !DILocation(line: 57, column: 36, scope: !55) diff --git a/toolchain/driver/testdata/compile/optimize/optimize_size.carbon b/toolchain/driver/testdata/compile/optimize/optimize_size.carbon index a87ccc1772e2..4d66107d5045 100644 --- a/toolchain/driver/testdata/compile/optimize/optimize_size.carbon +++ b/toolchain/driver/testdata/compile/optimize/optimize_size.carbon @@ -78,36 +78,43 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: br label %while.cond, !dbg !26 // CHECK:STDOUT: // CHECK:STDOUT: while.done: ; preds = %while.cond +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %n.var), !dbg !20 // CHECK:STDOUT: ret void, !dbg !27 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: minsize nounwind optsize +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !28 { +// 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) // 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 !28 { -// CHECK:STDOUT: call void @"_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.5375cfcbca6d9e35.Core.57ee91777b6354a8"(ptr %self, i32 1), !dbg !34 -// CHECK:STDOUT: ret void, !dbg !35 +// CHECK:STDOUT: define linkonce_odr void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !34 { +// CHECK:STDOUT: call void @"_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.5375cfcbca6d9e35.Core.57ee91777b6354a8"(ptr %self, i32 1), !dbg !38 +// CHECK:STDOUT: ret void, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline minsize nounwind optsize -// CHECK:STDOUT: define linkonce_odr void @"_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.5375cfcbca6d9e35.Core.57ee91777b6354a8"(ptr %self, i32 %other) #2 !dbg !36 { -// CHECK:STDOUT: %1 = call i32 @"_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d"(i32 %other), !dbg !42 -// CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !43 -// CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !43 -// CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !43 -// CHECK:STDOUT: ret void, !dbg !43 +// CHECK:STDOUT: define linkonce_odr void @"_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.5375cfcbca6d9e35.Core.57ee91777b6354a8"(ptr %self, i32 %other) #2 !dbg !40 { +// CHECK:STDOUT: %1 = call i32 @"_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d"(i32 %other), !dbg !46 +// CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !47 +// CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !47 +// CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !47 +// CHECK:STDOUT: ret void, !dbg !47 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: minsize nounwind optsize -// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d"(i32 %self) #0 !dbg !44 { -// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !49 -// CHECK:STDOUT: ret i32 %1, !dbg !50 +// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d"(i32 %self) #0 !dbg !48 { +// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !53 +// CHECK:STDOUT: ret i32 %1, !dbg !54 // 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 !51 { -// CHECK:STDOUT: ret i32 %self, !dbg !54 +// CHECK:STDOUT: define linkonce_odr i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self) #0 !dbg !55 { +// CHECK:STDOUT: ret i32 %self, !dbg !58 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { minsize nounwind optsize } @@ -145,30 +152,34 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: !25 = !DILocation(line: 20, column: 5, scope: !14) // CHECK:STDOUT: !26 = !DILocation(line: 18, column: 3, scope: !14) // CHECK:STDOUT: !27 = !DILocation(line: 15, column: 1, scope: !14) -// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !29, line: 363, type: !30, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !32) -// CHECK:STDOUT: !29 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") -// CHECK:STDOUT: !30 = !DISubroutineType(types: !31) -// CHECK:STDOUT: !31 = !{null, !7} -// CHECK:STDOUT: !32 = !{!33} -// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !28, type: !7) -// CHECK:STDOUT: !34 = !DILocation(line: 365, column: 5, scope: !28) -// CHECK:STDOUT: !35 = !DILocation(line: 363, column: 3, scope: !28) -// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.5375cfcbca6d9e35.Core.57ee91777b6354a8", scope: null, file: !29, line: 299, type: !37, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !39) -// CHECK:STDOUT: !37 = !DISubroutineType(types: !38) -// CHECK:STDOUT: !38 = !{null, !7, !7} -// CHECK:STDOUT: !39 = !{!40, !41} -// CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !36, type: !7) -// CHECK:STDOUT: !41 = !DILocalVariable(arg: 2, scope: !36, type: !7) -// CHECK:STDOUT: !42 = !DILocation(line: 4294967295, scope: !36) -// CHECK:STDOUT: !43 = !DILocation(line: 299, column: 3, scope: !36) -// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d", scope: null, file: !29, line: 62, type: !45, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !47) -// CHECK:STDOUT: !45 = !DISubroutineType(types: !46) -// CHECK:STDOUT: !46 = !{!7, !7} -// CHECK:STDOUT: !47 = !{!48} -// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !44, type: !7) -// CHECK:STDOUT: !49 = !DILocation(line: 64, column: 17, scope: !44) -// CHECK:STDOUT: !50 = !DILocation(line: 64, column: 5, scope: !44) -// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !29, line: 57, type: !45, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !52) -// CHECK:STDOUT: !52 = !{!53} -// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !51, type: !7) -// CHECK:STDOUT: !54 = !DILocation(line: 57, column: 36, scope: !51) +// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 17, type: !29, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !31) +// CHECK:STDOUT: !29 = !DISubroutineType(types: !30) +// CHECK:STDOUT: !30 = !{null, !7} +// CHECK:STDOUT: !31 = !{!32} +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !28, type: !7) +// CHECK:STDOUT: !33 = !DILocation(line: 17, column: 3, scope: !28) +// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !35, line: 363, type: !29, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !36) +// CHECK:STDOUT: !35 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") +// CHECK:STDOUT: !36 = !{!37} +// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !34, type: !7) +// CHECK:STDOUT: !38 = !DILocation(line: 365, column: 5, scope: !34) +// CHECK:STDOUT: !39 = !DILocation(line: 363, column: 3, scope: !34) +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.5375cfcbca6d9e35.Core.57ee91777b6354a8", scope: null, file: !35, line: 299, type: !41, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !43) +// CHECK:STDOUT: !41 = !DISubroutineType(types: !42) +// CHECK:STDOUT: !42 = !{null, !7, !7} +// CHECK:STDOUT: !43 = !{!44, !45} +// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !40, type: !7) +// CHECK:STDOUT: !45 = !DILocalVariable(arg: 2, scope: !40, type: !7) +// CHECK:STDOUT: !46 = !DILocation(line: 4294967295, scope: !40) +// CHECK:STDOUT: !47 = !DILocation(line: 299, column: 3, scope: !40) +// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d", scope: null, file: !35, line: 62, type: !49, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !51) +// CHECK:STDOUT: !49 = !DISubroutineType(types: !50) +// CHECK:STDOUT: !50 = !{!7, !7} +// CHECK:STDOUT: !51 = !{!52} +// CHECK:STDOUT: !52 = !DILocalVariable(arg: 1, scope: !48, type: !7) +// CHECK:STDOUT: !53 = !DILocation(line: 64, column: 17, scope: !48) +// CHECK:STDOUT: !54 = !DILocation(line: 64, column: 5, scope: !48) +// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !35, line: 57, type: !49, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !56) +// CHECK:STDOUT: !56 = !{!57} +// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !55, type: !7) +// CHECK:STDOUT: !58 = !DILocation(line: 57, column: 36, scope: !55) diff --git a/toolchain/driver/testdata/compile/optimize/optimize_speed.carbon b/toolchain/driver/testdata/compile/optimize/optimize_speed.carbon index f683ef073ffd..c39efda96481 100644 --- a/toolchain/driver/testdata/compile/optimize/optimize_speed.carbon +++ b/toolchain/driver/testdata/compile/optimize/optimize_speed.carbon @@ -99,6 +99,12 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: uselistorder i32 %index.next.1, { 1, 0 } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) local_unnamed_addr #0 !dbg !43 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !46 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nofree norecurse nosync nounwind memory(argmem: readwrite) } // CHECK:STDOUT: @@ -148,3 +154,7 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: !40 = !{!"llvm.loop.isvectorized", i32 1} // CHECK:STDOUT: !41 = !{!"llvm.loop.unroll.runtime.disable"} // CHECK:STDOUT: !42 = !DILocation(line: 15, column: 1, scope: !16) +// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 17, type: !33, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !44) +// CHECK:STDOUT: !44 = !{!45} +// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !43, type: !7) +// CHECK:STDOUT: !46 = !DILocation(line: 17, column: 3, scope: !43) diff --git a/toolchain/lower/file_context.cpp b/toolchain/lower/file_context.cpp index 15dab05ae40b..0db095c5fbe4 100644 --- a/toolchain/lower/file_context.cpp +++ b/toolchain/lower/file_context.cpp @@ -760,12 +760,16 @@ auto FileContext::GetOrCreateLLVMFunction( // TODO: For an imported inline function, consider generating an // `available_externally` definition. - auto linkage = specific_id.has_value() ? llvm::Function::LinkOnceODRLinkage - : llvm::Function::ExternalLinkage; + auto linkage = llvm::Function::ExternalLinkage; if (function_id == sem_ir().global_ctor_id()) { // The global constructor name would collide with global constructors for // other files in the same package, so use an internal linkage symbol. linkage = llvm::Function::InternalLinkage; + } else if (specific_id.has_value()) { + // Specific functions are allowed to be duplicated across files. + // TODO: CoreWitness should have the same behavior; see its use of + // WeakODRLinkage in BuildFunctionDefinition. + linkage = llvm::Function::LinkOnceODRLinkage; } auto* llvm_function = llvm::Function::Create(function_type_info.type, linkage, @@ -912,6 +916,13 @@ auto FileContext::BuildFunctionBody(SemIR::FunctionId function_id, "Attempting to emit definition of inexact function: {0}", *function_info->llvm_function); + // TODO: Build CoreWitness functions when they're called instead of when + // they're defined. That should allow LinkOnceODRLinkage. + if (declaration_function.special_function_kind == + SemIR::Function::SpecialFunctionKind::CoreWitness) { + function_info->llvm_function->setLinkage(llvm::Function::WeakODRLinkage); + } + const auto& body_block_ids = definition_function.body_block_ids; CARBON_DCHECK(!body_block_ids.empty(), "No function body blocks found during lowering."); diff --git a/toolchain/lower/testdata/alias/local.carbon b/toolchain/lower/testdata/alias/local.carbon index 453fcbf2d57f..fc0f689d5909 100644 --- a/toolchain/lower/testdata/alias/local.carbon +++ b/toolchain/lower/testdata/alias/local.carbon @@ -26,9 +26,16 @@ fn F() -> i32 { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !8 // CHECK:STDOUT: store i32 0, ptr %a.var, align 4, !dbg !8 // CHECK:STDOUT: %.loc16 = load i32, ptr %a.var, align 4, !dbg !9 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %a.var), !dbg !8 // CHECK:STDOUT: ret i32 %.loc16, !dbg !10 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !11 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !16 +// 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: @@ -49,3 +56,9 @@ fn F() -> i32 { // CHECK:STDOUT: !8 = !DILocation(line: 14, column: 3, scope: !4) // CHECK:STDOUT: !9 = !DILocation(line: 16, column: 10, scope: !4) // CHECK:STDOUT: !10 = !DILocation(line: 16, column: 3, scope: !4) +// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 14, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !14) +// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) +// CHECK:STDOUT: !13 = !{null, !7} +// CHECK:STDOUT: !14 = !{!15} +// CHECK:STDOUT: !15 = !DILocalVariable(arg: 1, scope: !11, type: !7) +// CHECK:STDOUT: !16 = !DILocation(line: 14, column: 3, scope: !11) diff --git a/toolchain/lower/testdata/array/array_in_place.carbon b/toolchain/lower/testdata/array/array_in_place.carbon index 9e3d59cc3957..48c33eb8b982 100644 --- a/toolchain/lower/testdata/array/array_in_place.carbon +++ b/toolchain/lower/testdata/array/array_in_place.carbon @@ -30,9 +30,28 @@ fn G() { // CHECK:STDOUT: call void @_CF.Main(ptr %.loc16_47.6.array.index), !dbg !9 // CHECK:STDOUT: %.loc16_47.5.array.index = getelementptr inbounds [2 x { i32, i32, i32 }], ptr %_.var, i32 0, i64 1, !dbg !8 // CHECK:STDOUT: call void @_CF.Main(ptr %.loc16_47.5.array.index), !dbg !10 +// CHECK:STDOUT: call void @"_COp.bffd120e41a61f7f:core.Destroy.Core"(ptr %_.var), !dbg !7 // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !12 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.819e9e1e390140e8:core.Destroy.Core"(ptr %self) #0 !dbg !19 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !25 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.bffd120e41a61f7f:core.Destroy.Core"(ptr %self) #0 !dbg !26 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !29 +// 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: @@ -54,3 +73,21 @@ fn G() { // CHECK:STDOUT: !9 = !DILocation(line: 16, column: 39, scope: !4) // CHECK:STDOUT: !10 = !DILocation(line: 16, column: 44, scope: !4) // CHECK:STDOUT: !11 = !DILocation(line: 15, column: 1, scope: !4) +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 16, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !16) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null, !15} +// CHECK:STDOUT: !15 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !16 = !{!17} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15) +// CHECK:STDOUT: !18 = !DILocation(line: 16, column: 3, scope: !12) +// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "Op", linkageName: "_COp.819e9e1e390140e8:core.Destroy.Core", scope: null, file: !3, line: 16, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !23) +// CHECK:STDOUT: !20 = !DISubroutineType(types: !21) +// CHECK:STDOUT: !21 = !{null, !22} +// CHECK:STDOUT: !22 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !23 = !{!24} +// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !19, type: !22) +// CHECK:STDOUT: !25 = !DILocation(line: 16, column: 3, scope: !19) +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.bffd120e41a61f7f:core.Destroy.Core", scope: null, file: !3, line: 16, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !27) +// CHECK:STDOUT: !27 = !{!28} +// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !26, type: !22) +// CHECK:STDOUT: !29 = !DILocation(line: 16, column: 3, scope: !26) diff --git a/toolchain/lower/testdata/array/assign_return_value.carbon b/toolchain/lower/testdata/array/assign_return_value.carbon index 733dd2a30488..c3118f2af2b0 100644 --- a/toolchain/lower/testdata/array/assign_return_value.carbon +++ b/toolchain/lower/testdata/array/assign_return_value.carbon @@ -46,9 +46,29 @@ fn Run() { // CHECK:STDOUT: %.loc16_28.6 = load i32, ptr %tuple.elem1.tuple.elem, align 4, !dbg !14 // CHECK:STDOUT: %.loc16_28.7.array.index = getelementptr inbounds [2 x i32], ptr %_.var, i32 0, i64 1, !dbg !14 // CHECK:STDOUT: store i32 %.loc16_28.6, ptr %.loc16_28.7.array.index, align 4, !dbg !14 +// CHECK:STDOUT: call void @"_COp.8e354c83fe88ab86:core.Destroy.Core"(ptr %.loc16_28.1.temp), !dbg !14 +// CHECK:STDOUT: call void @"_COp.f53f00a5f9e218d2:core.Destroy.Core"(ptr %_.var), !dbg !13 // CHECK:STDOUT: ret void, !dbg !15 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !16 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !22 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.8e354c83fe88ab86:core.Destroy.Core"(ptr %self) #0 !dbg !23 { +// 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.f53f00a5f9e218d2:core.Destroy.Core"(ptr %self) #0 !dbg !29 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !32 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree 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: @@ -81,3 +101,20 @@ fn Run() { // CHECK:STDOUT: !13 = !DILocation(line: 16, column: 3, scope: !10) // CHECK:STDOUT: !14 = !DILocation(line: 16, column: 26, scope: !10) // CHECK:STDOUT: !15 = !DILocation(line: 15, column: 1, scope: !10) +// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 16, type: !17, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !20) +// CHECK:STDOUT: !17 = !DISubroutineType(types: !18) +// CHECK:STDOUT: !18 = !{null, !19} +// CHECK:STDOUT: !19 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !20 = !{!21} +// CHECK:STDOUT: !21 = !DILocalVariable(arg: 1, scope: !16, type: !19) +// CHECK:STDOUT: !22 = !DILocation(line: 16, column: 26, scope: !16) +// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8e354c83fe88ab86:core.Destroy.Core", scope: null, file: !3, line: 16, type: !24, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !26) +// CHECK:STDOUT: !24 = !DISubroutineType(types: !25) +// CHECK:STDOUT: !25 = !{null, !7} +// CHECK:STDOUT: !26 = !{!27} +// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !23, type: !7) +// CHECK:STDOUT: !28 = !DILocation(line: 16, column: 26, scope: !23) +// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f53f00a5f9e218d2:core.Destroy.Core", scope: null, file: !3, line: 16, type: !24, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !30) +// CHECK:STDOUT: !30 = !{!31} +// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !29, type: !7) +// CHECK:STDOUT: !32 = !DILocation(line: 16, column: 3, scope: !29) diff --git a/toolchain/lower/testdata/array/base.carbon b/toolchain/lower/testdata/array/base.carbon index 6f3cc78f0519..9a5e41087169 100644 --- a/toolchain/lower/testdata/array/base.carbon +++ b/toolchain/lower/testdata/array/base.carbon @@ -66,9 +66,56 @@ fn Run() { // CHECK:STDOUT: %.loc18_26.7 = load i32, ptr %tuple.elem2.loc18.tuple.elem, align 4, !dbg !16 // CHECK:STDOUT: %.loc18_26.8.array.index = getelementptr inbounds [3 x i32], ptr %_.var.loc18, i32 0, i64 2, !dbg !16 // CHECK:STDOUT: store i32 %.loc18_26.7, ptr %.loc18_26.8.array.index, align 4, !dbg !16 +// CHECK:STDOUT: call void @"_COp.bfd302cd235977c4:core.Destroy.Core"(ptr %_.var.loc18), !dbg !11 +// CHECK:STDOUT: call void @"_COp.819e9e1e390140e8:core.Destroy.Core"(ptr %d.var), !dbg !10 +// CHECK:STDOUT: call void @"_COp.fd2b1e64e898d326:core.Destroy.Core"(ptr %_.var.loc16), !dbg !9 +// CHECK:STDOUT: call void @"_COp.aca92e88ce95a52e:core.Destroy.Core"(ptr %_.var.loc15), !dbg !8 +// CHECK:STDOUT: call void @"_COp.d26f73ac8e1728e0:core.Destroy.Core"(ptr %_.var.loc14), !dbg !7 // CHECK:STDOUT: ret void, !dbg !17 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !18 { +// 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.bfd302cd235977c4:core.Destroy.Core"(ptr %self) #0 !dbg !25 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !31 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.819e9e1e390140e8:core.Destroy.Core"(ptr %self) #0 !dbg !32 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !35 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.fd2b1e64e898d326:core.Destroy.Core"(ptr %self) #0 !dbg !36 { +// 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.98006a366c2ffd6c:core.Destroy.Core"(ptr %self) #0 !dbg !40 { +// 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.aca92e88ce95a52e:core.Destroy.Core"(ptr %self) #0 !dbg !44 { +// 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.d26f73ac8e1728e0:core.Destroy.Core"(ptr %self) #0 !dbg !48 { +// CHECK:STDOUT: entry: +// 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: @@ -104,3 +151,37 @@ fn Run() { // CHECK:STDOUT: !15 = !DILocation(line: 17, column: 28, scope: !4) // CHECK:STDOUT: !16 = !DILocation(line: 18, column: 26, scope: !4) // CHECK:STDOUT: !17 = !DILocation(line: 13, column: 1, scope: !4) +// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 18, type: !19, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !22) +// CHECK:STDOUT: !19 = !DISubroutineType(types: !20) +// CHECK:STDOUT: !20 = !{null, !21} +// CHECK:STDOUT: !21 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !22 = !{!23} +// CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !18, type: !21) +// CHECK:STDOUT: !24 = !DILocation(line: 18, column: 3, scope: !18) +// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "Op", linkageName: "_COp.bfd302cd235977c4:core.Destroy.Core", scope: null, file: !3, line: 18, type: !26, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !29) +// CHECK:STDOUT: !26 = !DISubroutineType(types: !27) +// CHECK:STDOUT: !27 = !{null, !28} +// CHECK:STDOUT: !28 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !29 = !{!30} +// CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !25, type: !28) +// CHECK:STDOUT: !31 = !DILocation(line: 18, column: 3, scope: !25) +// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "Op", linkageName: "_COp.819e9e1e390140e8:core.Destroy.Core", scope: null, file: !3, line: 17, type: !26, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !33) +// CHECK:STDOUT: !33 = !{!34} +// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !32, type: !28) +// CHECK:STDOUT: !35 = !DILocation(line: 17, column: 3, scope: !32) +// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fd2b1e64e898d326:core.Destroy.Core", scope: null, file: !3, line: 16, type: !26, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !37) +// CHECK:STDOUT: !37 = !{!38} +// CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !36, type: !28) +// CHECK:STDOUT: !39 = !DILocation(line: 16, column: 3, scope: !36) +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "Op", linkageName: "_COp.98006a366c2ffd6c:core.Destroy.Core", scope: null, file: !3, line: 15, type: !26, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !41) +// CHECK:STDOUT: !41 = !{!42} +// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !40, type: !28) +// CHECK:STDOUT: !43 = !DILocation(line: 15, column: 3, scope: !40) +// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "Op", linkageName: "_COp.aca92e88ce95a52e:core.Destroy.Core", scope: null, file: !3, line: 15, type: !26, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !45) +// CHECK:STDOUT: !45 = !{!46} +// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !44, type: !28) +// CHECK:STDOUT: !47 = !DILocation(line: 15, column: 3, scope: !44) +// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d26f73ac8e1728e0:core.Destroy.Core", scope: null, file: !3, line: 14, type: !26, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !49) +// CHECK:STDOUT: !49 = !{!50} +// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !48, type: !28) +// CHECK:STDOUT: !51 = !DILocation(line: 14, column: 3, scope: !48) diff --git a/toolchain/lower/testdata/array/function_param.carbon b/toolchain/lower/testdata/array/function_param.carbon index c7616c17d6e2..86e7f03d3f4b 100644 --- a/toolchain/lower/testdata/array/function_param.carbon +++ b/toolchain/lower/testdata/array/function_param.carbon @@ -41,9 +41,22 @@ 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 !17 // CHECK:STDOUT: %.loc18_20.10.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_20.3.temp, i32 0, i64 2, !dbg !17 // CHECK:STDOUT: %F.call = call i32 @_CF.Main(ptr @array.loc18_20.15, i32 1), !dbg !18 +// CHECK:STDOUT: call void @"_COp.bfd302cd235977c4:core.Destroy.Core"(ptr @array), !dbg !17 // CHECK:STDOUT: ret i32 %F.call, !dbg !19 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !20 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !25 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.bfd302cd235977c4:core.Destroy.Core"(ptr %self) #0 !dbg !26 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !31 +// 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,3 +86,15 @@ fn G() -> i32 { // CHECK:STDOUT: !17 = !DILocation(line: 18, column: 12, scope: !14) // CHECK:STDOUT: !18 = !DILocation(line: 18, column: 10, scope: !14) // CHECK:STDOUT: !19 = !DILocation(line: 18, column: 3, scope: !14) +// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 18, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !23) +// CHECK:STDOUT: !21 = !DISubroutineType(types: !22) +// CHECK:STDOUT: !22 = !{null, !7} +// CHECK:STDOUT: !23 = !{!24} +// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !20, type: !7) +// CHECK:STDOUT: !25 = !DILocation(line: 18, column: 12, scope: !20) +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.bfd302cd235977c4:core.Destroy.Core", scope: null, file: !3, line: 18, type: !27, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !29) +// CHECK:STDOUT: !27 = !DISubroutineType(types: !28) +// CHECK:STDOUT: !28 = !{null, !8} +// CHECK:STDOUT: !29 = !{!30} +// CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !26, type: !8) +// CHECK:STDOUT: !31 = !DILocation(line: 18, column: 12, scope: !26) diff --git a/toolchain/lower/testdata/array/iterate.carbon b/toolchain/lower/testdata/array/iterate.carbon index 636adbff0473..5de42bb033dd 100644 --- a/toolchain/lower/testdata/array/iterate.carbon +++ b/toolchain/lower/testdata/array/iterate.carbon @@ -57,116 +57,155 @@ fn F() { // CHECK:STDOUT: br label %for.next, !dbg !10 // CHECK:STDOUT: // CHECK:STDOUT: for.done: ; preds = %for.next +// CHECK:STDOUT: call void @"_COp.50af35a8e2c36b7d:core.Destroy.Core"(ptr %.loc17_19.1.temp), !dbg !8 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %var), !dbg !8 +// CHECK:STDOUT: call void @"_COp.11a1b64e4863afd8:core.Destroy.Core"(ptr @array), !dbg !7 // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !12 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.b9f59d4d0f116c67:core.Destroy.Core"(ptr %self) #0 !dbg !19 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !22 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.59d039ff34f2fb65:core.Destroy.Core"(ptr %self) #0 !dbg !23 { +// 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.099822cde4c680b1:core.Destroy.Core"(ptr %self) #0 !dbg !30 { +// 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.50af35a8e2c36b7d:core.Destroy.Core"(ptr %self) #0 !dbg !34 { +// 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.11a1b64e4863afd8:core.Destroy.Core"(ptr %self) #0 !dbg !38 { +// CHECK:STDOUT: entry: +// 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: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CNewCursor.7711e6f0e1563534:Iterate.Core.355bb079bb00aa16"(ptr %self) #0 !dbg !12 { -// CHECK:STDOUT: ret i32 0, !dbg !20 +// CHECK:STDOUT: define linkonce_odr i32 @"_CNewCursor.7711e6f0e1563534:Iterate.Core.355bb079bb00aa16"(ptr %self) #0 !dbg !42 { +// CHECK:STDOUT: ret i32 0, !dbg !48 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CNext.7711e6f0e1563534:Iterate.Core.355bb079bb00aa16"(ptr sret({ i32, i1 }) %return, ptr %self, ptr %cursor) #0 !dbg !21 { -// CHECK:STDOUT: %1 = load i32, ptr %cursor, align 4, !dbg !27 -// CHECK:STDOUT: %2 = icmp slt i32 %1, 6, !dbg !27 -// CHECK:STDOUT: br i1 %2, label %3, label %7, !dbg !28 +// CHECK:STDOUT: define linkonce_odr void @"_CNext.7711e6f0e1563534:Iterate.Core.355bb079bb00aa16"(ptr sret({ i32, i1 }) %return, ptr %self, ptr %cursor) #0 !dbg !49 { +// CHECK:STDOUT: %1 = load i32, ptr %cursor, align 4, !dbg !55 +// CHECK:STDOUT: %2 = icmp slt i32 %1, 6, !dbg !55 +// CHECK:STDOUT: br i1 %2, label %3, label %7, !dbg !56 // CHECK:STDOUT: // CHECK:STDOUT: 3: ; preds = %0 -// CHECK:STDOUT: call void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %cursor), !dbg !29 -// CHECK:STDOUT: %4 = load i32, ptr %cursor, align 4, !dbg !30 -// CHECK:STDOUT: %5 = sub i32 %4, 1, !dbg !30 -// CHECK:STDOUT: %array.index = getelementptr inbounds [6 x i32], ptr %self, i32 0, i32 %5, !dbg !31 -// CHECK:STDOUT: %6 = load i32, ptr %array.index, align 4, !dbg !31 -// CHECK:STDOUT: call void @_CSome.Optional.Core.b5e6acce74484d77(ptr %return, i32 %6), !dbg !32 -// CHECK:STDOUT: ret void, !dbg !33 +// CHECK:STDOUT: call void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %cursor), !dbg !57 +// CHECK:STDOUT: %4 = load i32, ptr %cursor, align 4, !dbg !58 +// CHECK:STDOUT: %5 = sub i32 %4, 1, !dbg !58 +// CHECK:STDOUT: %array.index = getelementptr inbounds [6 x i32], ptr %self, i32 0, i32 %5, !dbg !59 +// CHECK:STDOUT: %6 = load i32, ptr %array.index, align 4, !dbg !59 +// CHECK:STDOUT: call void @_CSome.Optional.Core.b5e6acce74484d77(ptr %return, i32 %6), !dbg !60 +// CHECK:STDOUT: ret void, !dbg !61 // CHECK:STDOUT: // CHECK:STDOUT: 7: ; preds = %0 -// CHECK:STDOUT: call void @_CNone.Optional.Core.b5e6acce74484d77(ptr %return), !dbg !34 -// CHECK:STDOUT: ret void, !dbg !35 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.b5e6acce74484d77(ptr %self) #0 !dbg !36 { -// CHECK:STDOUT: %1 = call i1 @"_CHas.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1"(ptr %self), !dbg !42 -// CHECK:STDOUT: ret i1 %1, !dbg !43 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CGet.Optional.Core.b5e6acce74484d77(ptr %self) #0 !dbg !44 { -// CHECK:STDOUT: %1 = call i32 @"_CGet.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1"(ptr %self), !dbg !47 -// CHECK:STDOUT: ret i32 %1, !dbg !48 -// 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 !49 { -// CHECK:STDOUT: call void @"_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.e2da7149b7fcf782.Core.23ea0ff7335d4fdc"(ptr %self, i32 1), !dbg !55 -// CHECK:STDOUT: ret void, !dbg !56 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.b5e6acce74484d77(ptr sret({ i32, i1 }) %return, i32 %value) #0 !dbg !57 { -// CHECK:STDOUT: call void @"_CSome.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1"(ptr %return, i32 %value), !dbg !62 +// CHECK:STDOUT: call void @_CNone.Optional.Core.b5e6acce74484d77(ptr %return), !dbg !62 // CHECK:STDOUT: ret void, !dbg !63 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.b5e6acce74484d77(ptr sret({ i32, i1 }) %return) #0 !dbg !64 { -// CHECK:STDOUT: call void @"_CNone.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1"(ptr %return), !dbg !67 -// CHECK:STDOUT: ret void, !dbg !68 +// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.b5e6acce74484d77(ptr %self) #0 !dbg !64 { +// CHECK:STDOUT: %1 = call i1 @"_CHas.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1"(ptr %self), !dbg !70 +// CHECK:STDOUT: ret i1 %1, !dbg !71 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1"(ptr %value) #0 !dbg !69 { -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i32, i1 }, ptr %value, i32 0, i32 1, !dbg !72 -// CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !72 -// CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !72 -// CHECK:STDOUT: ret i1 %2, !dbg !73 +// CHECK:STDOUT: define linkonce_odr i32 @_CGet.Optional.Core.b5e6acce74484d77(ptr %self) #0 !dbg !72 { +// CHECK:STDOUT: %1 = call i32 @"_CGet.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1"(ptr %self), !dbg !75 +// CHECK:STDOUT: ret i32 %1, !dbg !76 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CGet.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1"(ptr %value) #0 !dbg !74 { -// CHECK:STDOUT: %value1 = getelementptr inbounds nuw { i32, i1 }, ptr %value, i32 0, i32 0, !dbg !77 -// CHECK:STDOUT: %1 = load i32, ptr %value1, align 4, !dbg !77 -// CHECK:STDOUT: ret i32 %1, !dbg !78 +// CHECK:STDOUT: define linkonce_odr void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !77 { +// CHECK:STDOUT: call void @"_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.e2da7149b7fcf782.Core.23ea0ff7335d4fdc"(ptr %self, i32 1), !dbg !81 +// CHECK:STDOUT: ret void, !dbg !82 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.b5e6acce74484d77(ptr sret({ i32, i1 }) %return, i32 %value) #0 !dbg !83 { +// CHECK:STDOUT: call void @"_CSome.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1"(ptr %return, i32 %value), !dbg !88 +// CHECK:STDOUT: ret void, !dbg !89 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.b5e6acce74484d77(ptr sret({ i32, i1 }) %return) #0 !dbg !90 { +// CHECK:STDOUT: call void @"_CNone.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1"(ptr %return), !dbg !93 +// CHECK:STDOUT: ret void, !dbg !94 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1"(ptr %value) #0 !dbg !95 { +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i32, i1 }, ptr %value, i32 0, i32 1, !dbg !98 +// CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !98 +// CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !98 +// CHECK:STDOUT: ret i1 %2, !dbg !99 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr i32 @"_CGet.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1"(ptr %value) #0 !dbg !100 { +// CHECK:STDOUT: %value1 = getelementptr inbounds nuw { i32, i1 }, ptr %value, i32 0, i32 0, !dbg !103 +// CHECK:STDOUT: %1 = load i32, ptr %value1, align 4, !dbg !103 +// CHECK:STDOUT: ret i32 %1, !dbg !104 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.e2da7149b7fcf782.Core.23ea0ff7335d4fdc"(ptr %self, i32 %other) #2 !dbg !79 { -// CHECK:STDOUT: %1 = call i32 @"_CConvert.93210ed0b06d6c25:ImplicitAs.11da3bb3c3dce533.Core.5da21217b3d19eab"(i32 %other), !dbg !85 -// CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !86 -// CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !86 -// CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !86 -// CHECK:STDOUT: ret void, !dbg !86 +// CHECK:STDOUT: define linkonce_odr void @"_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.e2da7149b7fcf782.Core.23ea0ff7335d4fdc"(ptr %self, i32 %other) #2 !dbg !105 { +// CHECK:STDOUT: %1 = call i32 @"_CConvert.93210ed0b06d6c25:ImplicitAs.11da3bb3c3dce533.Core.5da21217b3d19eab"(i32 %other), !dbg !111 +// CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !112 +// CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !112 +// CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !112 +// CHECK:STDOUT: ret void, !dbg !112 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CSome.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1"(ptr sret({ i32, i1 }) %return, i32 %self) #0 !dbg !87 { -// CHECK:STDOUT: %value = getelementptr inbounds nuw { i32, i1 }, ptr %return, i32 0, i32 0, !dbg !90 -// CHECK:STDOUT: store i32 %self, ptr %value, align 4, !dbg !90 -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i32, i1 }, ptr %return, i32 0, i32 1, !dbg !91 -// CHECK:STDOUT: store i8 1, ptr %has_value, align 1, !dbg !91 -// CHECK:STDOUT: ret void, !dbg !92 +// CHECK:STDOUT: define linkonce_odr void @"_CSome.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1"(ptr sret({ i32, i1 }) %return, i32 %self) #0 !dbg !113 { +// CHECK:STDOUT: %value = getelementptr inbounds nuw { i32, i1 }, ptr %return, i32 0, i32 0, !dbg !116 +// CHECK:STDOUT: store i32 %self, ptr %value, align 4, !dbg !116 +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i32, i1 }, ptr %return, i32 0, i32 1, !dbg !117 +// CHECK:STDOUT: store i8 1, ptr %has_value, align 1, !dbg !117 +// CHECK:STDOUT: ret void, !dbg !118 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CNone.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1"(ptr sret({ i32, i1 }) %return) #0 !dbg !93 { -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i32, i1 }, ptr %return, i32 0, i32 1, !dbg !94 -// CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !94 -// CHECK:STDOUT: ret void, !dbg !95 +// CHECK:STDOUT: define linkonce_odr void @"_CNone.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1"(ptr sret({ i32, i1 }) %return) #0 !dbg !119 { +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i32, i1 }, ptr %return, i32 0, i32 1, !dbg !120 +// CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !120 +// CHECK:STDOUT: ret void, !dbg !121 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.93210ed0b06d6c25:ImplicitAs.11da3bb3c3dce533.Core.5da21217b3d19eab"(i32 %self) #0 !dbg !96 { -// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !101 -// CHECK:STDOUT: ret i32 %1, !dbg !102 +// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.93210ed0b06d6c25:ImplicitAs.11da3bb3c3dce533.Core.5da21217b3d19eab"(i32 %self) #0 !dbg !122 { +// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !127 +// CHECK:STDOUT: ret i32 %1, !dbg !128 // 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 !103 { -// CHECK:STDOUT: ret i32 %self, !dbg !106 +// CHECK:STDOUT: define linkonce_odr i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self) #0 !dbg !129 { +// CHECK:STDOUT: ret i32 %self, !dbg !132 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -191,98 +230,124 @@ fn F() { // CHECK:STDOUT: !9 = !DILocation(line: 18, column: 5, scope: !4) // CHECK:STDOUT: !10 = !DILocation(line: 17, column: 3, scope: !4) // CHECK:STDOUT: !11 = !DILocation(line: 15, column: 1, scope: !4) -// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "NewCursor", linkageName: "_CNewCursor.7711e6f0e1563534:Iterate.Core.355bb079bb00aa16", scope: null, file: !13, line: 23, type: !14, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !18) -// CHECK:STDOUT: !13 = !DIFile(filename: "{{.*}}/prelude/iterate.carbon", directory: "") -// CHECK:STDOUT: !14 = !DISubroutineType(types: !15) -// CHECK:STDOUT: !15 = !{!16, !17} -// CHECK:STDOUT: !16 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !17 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !18 = !{!19} -// CHECK:STDOUT: !19 = !DILocalVariable(arg: 1, scope: !12, type: !17) -// CHECK:STDOUT: !20 = !DILocation(line: 23, column: 46, scope: !12) -// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.7711e6f0e1563534:Iterate.Core.355bb079bb00aa16", scope: null, file: !13, line: 24, type: !22, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !24) -// CHECK:STDOUT: !22 = !DISubroutineType(types: !23) -// CHECK:STDOUT: !23 = !{!17, !17, !17} -// CHECK:STDOUT: !24 = !{!25, !26} -// CHECK:STDOUT: !25 = !DILocalVariable(arg: 1, scope: !21, type: !17) -// CHECK:STDOUT: !26 = !DILocalVariable(arg: 2, scope: !21, type: !17) -// CHECK:STDOUT: !27 = !DILocation(line: 25, column: 9, scope: !21) -// CHECK:STDOUT: !28 = !DILocation(line: 25, column: 8, scope: !21) -// CHECK:STDOUT: !29 = !DILocation(line: 26, column: 7, scope: !21) -// CHECK:STDOUT: !30 = !DILocation(line: 27, column: 36, scope: !21) -// CHECK:STDOUT: !31 = !DILocation(line: 27, column: 31, scope: !21) -// CHECK:STDOUT: !32 = !DILocation(line: 27, column: 14, scope: !21) -// CHECK:STDOUT: !33 = !DILocation(line: 27, column: 7, scope: !21) -// CHECK:STDOUT: !34 = !DILocation(line: 29, column: 14, scope: !21) -// CHECK:STDOUT: !35 = !DILocation(line: 29, column: 7, scope: !21) -// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.b5e6acce74484d77", scope: null, file: !37, line: 33, type: !38, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !40) -// CHECK:STDOUT: !37 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !38 = !DISubroutineType(types: !39) -// CHECK:STDOUT: !39 = !{!17, !17} -// CHECK:STDOUT: !40 = !{!41} -// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !36, type: !17) -// CHECK:STDOUT: !42 = !DILocation(line: 34, column: 12, scope: !36) -// CHECK:STDOUT: !43 = !DILocation(line: 34, column: 5, scope: !36) -// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.b5e6acce74484d77", scope: null, file: !37, line: 36, type: !14, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !45) -// CHECK:STDOUT: !45 = !{!46} -// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !44, type: !17) -// CHECK:STDOUT: !47 = !DILocation(line: 37, column: 12, scope: !44) -// CHECK:STDOUT: !48 = !DILocation(line: 37, column: 5, scope: !44) -// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !50, line: 363, type: !51, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !53) -// CHECK:STDOUT: !50 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") -// CHECK:STDOUT: !51 = !DISubroutineType(types: !52) -// CHECK:STDOUT: !52 = !{null, !16} -// CHECK:STDOUT: !53 = !{!54} -// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !49, type: !16) -// CHECK:STDOUT: !55 = !DILocation(line: 365, column: 5, scope: !49) -// CHECK:STDOUT: !56 = !DILocation(line: 363, column: 3, scope: !49) -// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.b5e6acce74484d77", scope: null, file: !37, line: 30, type: !58, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !60) -// CHECK:STDOUT: !58 = !DISubroutineType(types: !59) -// CHECK:STDOUT: !59 = !{!17, !16} -// CHECK:STDOUT: !60 = !{!61} -// CHECK:STDOUT: !61 = !DILocalVariable(arg: 1, scope: !57, type: !16) -// CHECK:STDOUT: !62 = !DILocation(line: 31, column: 12, scope: !57) -// CHECK:STDOUT: !63 = !DILocation(line: 31, column: 5, scope: !57) -// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.b5e6acce74484d77", scope: null, file: !37, line: 27, type: !65, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !65 = !DISubroutineType(types: !66) -// CHECK:STDOUT: !66 = !{!17} -// CHECK:STDOUT: !67 = !DILocation(line: 28, column: 12, scope: !64) -// CHECK:STDOUT: !68 = !DILocation(line: 28, column: 5, scope: !64) -// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1", scope: null, file: !37, line: 132, type: !38, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !70) -// CHECK:STDOUT: !70 = !{!71} -// CHECK:STDOUT: !71 = !DILocalVariable(arg: 1, scope: !69, type: !17) -// CHECK:STDOUT: !72 = !DILocation(line: 133, column: 12, scope: !69) -// CHECK:STDOUT: !73 = !DILocation(line: 133, column: 5, scope: !69) -// CHECK:STDOUT: !74 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1", scope: null, file: !37, line: 135, type: !14, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !75) -// CHECK:STDOUT: !75 = !{!76} -// CHECK:STDOUT: !76 = !DILocalVariable(arg: 1, scope: !74, type: !17) -// CHECK:STDOUT: !77 = !DILocation(line: 136, column: 12, scope: !74) -// CHECK:STDOUT: !78 = !DILocation(line: 136, column: 5, scope: !74) -// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.e2da7149b7fcf782.Core.23ea0ff7335d4fdc", scope: null, file: !50, line: 299, type: !80, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !82) -// CHECK:STDOUT: !80 = !DISubroutineType(types: !81) -// CHECK:STDOUT: !81 = !{null, !16, !16} -// CHECK:STDOUT: !82 = !{!83, !84} -// CHECK:STDOUT: !83 = !DILocalVariable(arg: 1, scope: !79, type: !16) -// CHECK:STDOUT: !84 = !DILocalVariable(arg: 2, scope: !79, type: !16) -// CHECK:STDOUT: !85 = !DILocation(line: 4294967295, scope: !79) -// CHECK:STDOUT: !86 = !DILocation(line: 299, column: 3, scope: !79) -// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1", scope: null, file: !37, line: 122, type: !58, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !88) -// CHECK:STDOUT: !88 = !{!89} -// CHECK:STDOUT: !89 = !DILocalVariable(arg: 1, scope: !87, type: !16) -// CHECK:STDOUT: !90 = !DILocation(line: 128, column: 5, scope: !87) -// CHECK:STDOUT: !91 = !DILocation(line: 129, column: 5, scope: !87) -// CHECK:STDOUT: !92 = !DILocation(line: 130, column: 5, scope: !87) -// CHECK:STDOUT: !93 = distinct !DISubprogram(name: "None", linkageName: "_CNone.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1", scope: null, file: !37, line: 116, type: !65, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !94 = !DILocation(line: 119, column: 5, scope: !93) -// CHECK:STDOUT: !95 = !DILocation(line: 120, column: 5, scope: !93) -// CHECK:STDOUT: !96 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.93210ed0b06d6c25:ImplicitAs.11da3bb3c3dce533.Core.5da21217b3d19eab", scope: null, file: !50, line: 62, type: !97, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !99) -// CHECK:STDOUT: !97 = !DISubroutineType(types: !98) -// CHECK:STDOUT: !98 = !{!16, !16} -// CHECK:STDOUT: !99 = !{!100} -// CHECK:STDOUT: !100 = !DILocalVariable(arg: 1, scope: !96, type: !16) -// CHECK:STDOUT: !101 = !DILocation(line: 64, column: 17, scope: !96) -// CHECK:STDOUT: !102 = !DILocation(line: 64, column: 5, scope: !96) -// CHECK:STDOUT: !103 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !50, line: 57, type: !97, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !104) -// CHECK:STDOUT: !104 = !{!105} -// CHECK:STDOUT: !105 = !DILocalVariable(arg: 1, scope: !103, type: !16) -// CHECK:STDOUT: !106 = !DILocation(line: 57, column: 36, scope: !103) +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 17, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !16) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null, !15} +// CHECK:STDOUT: !15 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !16 = !{!17} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15) +// CHECK:STDOUT: !18 = !DILocation(line: 17, column: 7, scope: !12) +// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b9f59d4d0f116c67:core.Destroy.Core", scope: null, file: !3, line: 17, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !20) +// CHECK:STDOUT: !20 = !{!21} +// CHECK:STDOUT: !21 = !DILocalVariable(arg: 1, scope: !19, type: !15) +// CHECK:STDOUT: !22 = !DILocation(line: 17, column: 7, scope: !19) +// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "Op", linkageName: "_COp.59d039ff34f2fb65:core.Destroy.Core", scope: null, file: !3, line: 17, type: !24, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !27) +// CHECK:STDOUT: !24 = !DISubroutineType(types: !25) +// CHECK:STDOUT: !25 = !{null, !26} +// CHECK:STDOUT: !26 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !27 = !{!28} +// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !23, type: !26) +// CHECK:STDOUT: !29 = !DILocation(line: 17, column: 7, scope: !23) +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Op", linkageName: "_COp.099822cde4c680b1:core.Destroy.Core", scope: null, file: !3, line: 17, type: !24, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !31) +// CHECK:STDOUT: !31 = !{!32} +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !30, type: !26) +// CHECK:STDOUT: !33 = !DILocation(line: 17, column: 7, scope: !30) +// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "Op", linkageName: "_COp.50af35a8e2c36b7d:core.Destroy.Core", scope: null, file: !3, line: 17, type: !24, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !35) +// CHECK:STDOUT: !35 = !{!36} +// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !34, type: !26) +// CHECK:STDOUT: !37 = !DILocation(line: 17, column: 7, scope: !34) +// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Op", linkageName: "_COp.11a1b64e4863afd8:core.Destroy.Core", scope: null, file: !3, line: 16, type: !24, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !39) +// CHECK:STDOUT: !39 = !{!40} +// CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !38, type: !26) +// CHECK:STDOUT: !41 = !DILocation(line: 16, column: 26, scope: !38) +// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "NewCursor", linkageName: "_CNewCursor.7711e6f0e1563534:Iterate.Core.355bb079bb00aa16", scope: null, file: !43, line: 23, type: !44, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !46) +// CHECK:STDOUT: !43 = !DIFile(filename: "{{.*}}/prelude/iterate.carbon", directory: "") +// CHECK:STDOUT: !44 = !DISubroutineType(types: !45) +// CHECK:STDOUT: !45 = !{!15, !26} +// CHECK:STDOUT: !46 = !{!47} +// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !42, type: !26) +// CHECK:STDOUT: !48 = !DILocation(line: 23, column: 46, scope: !42) +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.7711e6f0e1563534:Iterate.Core.355bb079bb00aa16", scope: null, file: !43, line: 24, type: !50, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !52) +// CHECK:STDOUT: !50 = !DISubroutineType(types: !51) +// CHECK:STDOUT: !51 = !{!26, !26, !26} +// CHECK:STDOUT: !52 = !{!53, !54} +// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !49, type: !26) +// CHECK:STDOUT: !54 = !DILocalVariable(arg: 2, scope: !49, type: !26) +// CHECK:STDOUT: !55 = !DILocation(line: 25, column: 9, scope: !49) +// CHECK:STDOUT: !56 = !DILocation(line: 25, column: 8, scope: !49) +// CHECK:STDOUT: !57 = !DILocation(line: 26, column: 7, scope: !49) +// CHECK:STDOUT: !58 = !DILocation(line: 27, column: 36, scope: !49) +// CHECK:STDOUT: !59 = !DILocation(line: 27, column: 31, scope: !49) +// CHECK:STDOUT: !60 = !DILocation(line: 27, column: 14, scope: !49) +// CHECK:STDOUT: !61 = !DILocation(line: 27, column: 7, scope: !49) +// CHECK:STDOUT: !62 = !DILocation(line: 29, column: 14, scope: !49) +// CHECK:STDOUT: !63 = !DILocation(line: 29, column: 7, scope: !49) +// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.b5e6acce74484d77", scope: null, file: !65, line: 33, type: !66, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !68) +// CHECK:STDOUT: !65 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !66 = !DISubroutineType(types: !67) +// CHECK:STDOUT: !67 = !{!26, !26} +// CHECK:STDOUT: !68 = !{!69} +// CHECK:STDOUT: !69 = !DILocalVariable(arg: 1, scope: !64, type: !26) +// CHECK:STDOUT: !70 = !DILocation(line: 34, column: 12, scope: !64) +// CHECK:STDOUT: !71 = !DILocation(line: 34, column: 5, scope: !64) +// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.b5e6acce74484d77", scope: null, file: !65, line: 36, type: !44, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !73) +// CHECK:STDOUT: !73 = !{!74} +// CHECK:STDOUT: !74 = !DILocalVariable(arg: 1, scope: !72, type: !26) +// CHECK:STDOUT: !75 = !DILocation(line: 37, column: 12, scope: !72) +// CHECK:STDOUT: !76 = !DILocation(line: 37, column: 5, scope: !72) +// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !78, line: 363, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !79) +// CHECK:STDOUT: !78 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") +// CHECK:STDOUT: !79 = !{!80} +// CHECK:STDOUT: !80 = !DILocalVariable(arg: 1, scope: !77, type: !15) +// CHECK:STDOUT: !81 = !DILocation(line: 365, column: 5, scope: !77) +// CHECK:STDOUT: !82 = !DILocation(line: 363, column: 3, scope: !77) +// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.b5e6acce74484d77", scope: null, file: !65, line: 30, type: !84, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !86) +// CHECK:STDOUT: !84 = !DISubroutineType(types: !85) +// CHECK:STDOUT: !85 = !{!26, !15} +// CHECK:STDOUT: !86 = !{!87} +// CHECK:STDOUT: !87 = !DILocalVariable(arg: 1, scope: !83, type: !15) +// CHECK:STDOUT: !88 = !DILocation(line: 31, column: 12, scope: !83) +// CHECK:STDOUT: !89 = !DILocation(line: 31, column: 5, scope: !83) +// CHECK:STDOUT: !90 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.b5e6acce74484d77", scope: null, file: !65, line: 27, type: !91, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !91 = !DISubroutineType(types: !92) +// CHECK:STDOUT: !92 = !{!26} +// CHECK:STDOUT: !93 = !DILocation(line: 28, column: 12, scope: !90) +// CHECK:STDOUT: !94 = !DILocation(line: 28, column: 5, scope: !90) +// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1", scope: null, file: !65, line: 132, type: !66, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !96) +// CHECK:STDOUT: !96 = !{!97} +// CHECK:STDOUT: !97 = !DILocalVariable(arg: 1, scope: !95, type: !26) +// CHECK:STDOUT: !98 = !DILocation(line: 133, column: 12, scope: !95) +// CHECK:STDOUT: !99 = !DILocation(line: 133, column: 5, scope: !95) +// CHECK:STDOUT: !100 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1", scope: null, file: !65, line: 135, type: !44, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !101) +// CHECK:STDOUT: !101 = !{!102} +// CHECK:STDOUT: !102 = !DILocalVariable(arg: 1, scope: !100, type: !26) +// CHECK:STDOUT: !103 = !DILocation(line: 136, column: 12, scope: !100) +// CHECK:STDOUT: !104 = !DILocation(line: 136, column: 5, scope: !100) +// CHECK:STDOUT: !105 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.e2da7149b7fcf782.Core.23ea0ff7335d4fdc", scope: null, file: !78, line: 299, type: !106, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !108) +// CHECK:STDOUT: !106 = !DISubroutineType(types: !107) +// CHECK:STDOUT: !107 = !{null, !15, !15} +// CHECK:STDOUT: !108 = !{!109, !110} +// CHECK:STDOUT: !109 = !DILocalVariable(arg: 1, scope: !105, type: !15) +// CHECK:STDOUT: !110 = !DILocalVariable(arg: 2, scope: !105, type: !15) +// CHECK:STDOUT: !111 = !DILocation(line: 4294967295, scope: !105) +// CHECK:STDOUT: !112 = !DILocation(line: 299, column: 3, scope: !105) +// CHECK:STDOUT: !113 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1", scope: null, file: !65, line: 122, type: !84, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !114) +// CHECK:STDOUT: !114 = !{!115} +// CHECK:STDOUT: !115 = !DILocalVariable(arg: 1, scope: !113, type: !15) +// CHECK:STDOUT: !116 = !DILocation(line: 128, column: 5, scope: !113) +// CHECK:STDOUT: !117 = !DILocation(line: 129, column: 5, scope: !113) +// CHECK:STDOUT: !118 = !DILocation(line: 130, column: 5, scope: !113) +// CHECK:STDOUT: !119 = distinct !DISubprogram(name: "None", linkageName: "_CNone.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1", scope: null, file: !65, line: 116, type: !91, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !120 = !DILocation(line: 119, column: 5, scope: !119) +// CHECK:STDOUT: !121 = !DILocation(line: 120, column: 5, scope: !119) +// CHECK:STDOUT: !122 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.93210ed0b06d6c25:ImplicitAs.11da3bb3c3dce533.Core.5da21217b3d19eab", scope: null, file: !78, line: 62, type: !123, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !125) +// CHECK:STDOUT: !123 = !DISubroutineType(types: !124) +// CHECK:STDOUT: !124 = !{!15, !15} +// CHECK:STDOUT: !125 = !{!126} +// CHECK:STDOUT: !126 = !DILocalVariable(arg: 1, scope: !122, type: !15) +// CHECK:STDOUT: !127 = !DILocation(line: 64, column: 17, scope: !122) +// CHECK:STDOUT: !128 = !DILocation(line: 64, column: 5, scope: !122) +// CHECK:STDOUT: !129 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !78, line: 57, type: !123, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !130) +// CHECK:STDOUT: !130 = !{!131} +// CHECK:STDOUT: !131 = !DILocalVariable(arg: 1, scope: !129, type: !15) +// CHECK:STDOUT: !132 = !DILocation(line: 57, column: 36, scope: !129) diff --git a/toolchain/lower/testdata/builtins/char.carbon b/toolchain/lower/testdata/builtins/char.carbon index 1921c9677aa7..e6bdb67d297d 100644 --- a/toolchain/lower/testdata/builtins/char.carbon +++ b/toolchain/lower/testdata/builtins/char.carbon @@ -29,9 +29,16 @@ fn Example() -> char { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !8 // CHECK:STDOUT: store i8 97, ptr %c.var, align 1, !dbg !8 // CHECK:STDOUT: %.loc6 = load i8, ptr %c.var, align 1, !dbg !9 +// CHECK:STDOUT: call void @"_COp.e440520c1277b33b:core.Destroy.Core"(ptr %c.var), !dbg !8 // CHECK:STDOUT: ret i8 %.loc6, !dbg !10 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.e440520c1277b33b:core.Destroy.Core"(ptr %self) #0 !dbg !11 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !16 +// 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: @@ -52,3 +59,9 @@ fn Example() -> char { // CHECK:STDOUT: !8 = !DILocation(line: 5, column: 3, scope: !4) // CHECK:STDOUT: !9 = !DILocation(line: 6, column: 10, scope: !4) // CHECK:STDOUT: !10 = !DILocation(line: 6, column: 3, scope: !4) +// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Op", linkageName: "_COp.e440520c1277b33b:core.Destroy.Core", scope: null, file: !3, line: 5, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !14) +// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) +// CHECK:STDOUT: !13 = !{null, !7} +// CHECK:STDOUT: !14 = !{!15} +// CHECK:STDOUT: !15 = !DILocalVariable(arg: 1, scope: !11, type: !7) +// CHECK:STDOUT: !16 = !DILocation(line: 5, column: 3, scope: !11) diff --git a/toolchain/lower/testdata/builtins/cpp.carbon b/toolchain/lower/testdata/builtins/cpp.carbon index 31791bec4435..63fa2e8dba5a 100644 --- a/toolchain/lower/testdata/builtins/cpp.carbon +++ b/toolchain/lower/testdata/builtins/cpp.carbon @@ -80,13 +80,28 @@ fn Test() { // CHECK:STDOUT: %MakePointerSize.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %.loc26_47.1.temp, i32 0, i32 8, !dbg !16 // CHECK:STDOUT: store i64 4, ptr %MakePointerSize.call.init_list.size, align 8, !dbg !16 // CHECK:STDOUT: call void @_CTakePointerSize.Main(ptr %.loc26_47.1.temp), !dbg !19 +// CHECK:STDOUT: call void @"_COp.91faacee3b3f55ab:core.Destroy.Core"(ptr @array), !dbg !17 +// CHECK:STDOUT: call void @"_COp.91faacee3b3f55ab:core.Destroy.Core"(ptr @array), !dbg !15 // CHECK:STDOUT: ret void, !dbg !20 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !21 { +// 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.91faacee3b3f55ab:core.Destroy.Core"(ptr %self) #0 !dbg !28 { +// 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) // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @"_COp.91faacee3b3f55ab:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 3, 2, 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -117,3 +132,17 @@ fn Test() { // CHECK:STDOUT: !18 = !DILocation(line: 25, column: 3, scope: !11) // CHECK:STDOUT: !19 = !DILocation(line: 26, column: 3, scope: !11) // CHECK:STDOUT: !20 = !DILocation(line: 24, column: 1, scope: !11) +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !6, line: 26, type: !22, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !25) +// CHECK:STDOUT: !22 = !DISubroutineType(types: !23) +// CHECK:STDOUT: !23 = !{null, !24} +// CHECK:STDOUT: !24 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !25 = !{!26} +// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !21, type: !24) +// CHECK:STDOUT: !27 = !DILocation(line: 26, column: 35, scope: !21) +// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "Op", linkageName: "_COp.91faacee3b3f55ab:core.Destroy.Core", scope: null, file: !6, line: 26, type: !29, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !32) +// CHECK:STDOUT: !29 = !DISubroutineType(types: !30) +// CHECK:STDOUT: !30 = !{null, !31} +// CHECK:STDOUT: !31 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !32 = !{!33} +// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !28, type: !31) +// CHECK:STDOUT: !34 = !DILocation(line: 26, column: 35, scope: !28) diff --git a/toolchain/lower/testdata/builtins/maybe_unformed.carbon b/toolchain/lower/testdata/builtins/maybe_unformed.carbon index 06a932a1c916..a488f79dfa8c 100644 --- a/toolchain/lower/testdata/builtins/maybe_unformed.carbon +++ b/toolchain/lower/testdata/builtins/maybe_unformed.carbon @@ -89,52 +89,79 @@ fn PassAdapterBool() { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc28_21.1.temp), !dbg !25 // CHECK:STDOUT: call void @_CMakeBool.Main(ptr %.loc28_21.1.temp), !dbg !25 // CHECK:STDOUT: call void @_CTakeBool.Main(ptr %.loc28_21.1.temp), !dbg !26 +// CHECK:STDOUT: call void @"_COp.ac1fbb61b7f8ef04:core.Destroy.Core"(ptr %.loc28_21.1.temp), !dbg !25 // CHECK:STDOUT: ret void, !dbg !27 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CConvertBoolToUnformedBool.Main(ptr %b) #0 !dbg !28 { +// CHECK:STDOUT: define weak_odr void @"_COp.ac1fbb61b7f8ef04:core.Destroy.Core"(ptr %self) #0 !dbg !28 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CTakeBool.Main(ptr %b), !dbg !31 -// CHECK:STDOUT: ret void, !dbg !32 +// CHECK:STDOUT: ret void, !dbg !31 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CTakeAdapterI32.Main(i32 %_) #0 !dbg !33 { +// CHECK:STDOUT: define void @_CConvertBoolToUnformedBool.Main(ptr %b) #0 !dbg !32 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_CTakeBool.Main(ptr %b), !dbg !35 // CHECK:STDOUT: ret void, !dbg !36 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CTakeAdapterI32.Main(i32 %_) #0 !dbg !37 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !40 +// 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 !37 { +// CHECK:STDOUT: define void @_CPassAdapterI32.Main() #0 !dbg !41 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc48_33.1.temp = alloca i32, align 4, !dbg !38 -// CHECK:STDOUT: %MakeAdapterI32.call = call i32 @_CMakeAdapterI32.Main(), !dbg !38 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc48_33.1.temp), !dbg !38 -// CHECK:STDOUT: store i32 %MakeAdapterI32.call, ptr %.loc48_33.1.temp, align 4, !dbg !38 -// CHECK:STDOUT: %.loc48_33.3 = load i32, ptr %.loc48_33.1.temp, align 4, !dbg !38 -// CHECK:STDOUT: call void @_CTakeAdapterI32.Main(i32 %.loc48_33.3), !dbg !39 -// CHECK:STDOUT: ret void, !dbg !40 +// CHECK:STDOUT: %.loc48_33.1.temp = alloca i32, align 4, !dbg !42 +// CHECK:STDOUT: %MakeAdapterI32.call = call i32 @_CMakeAdapterI32.Main(), !dbg !42 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc48_33.1.temp), !dbg !42 +// CHECK:STDOUT: store i32 %MakeAdapterI32.call, ptr %.loc48_33.1.temp, align 4, !dbg !42 +// CHECK:STDOUT: %.loc48_33.3 = load i32, ptr %.loc48_33.1.temp, align 4, !dbg !42 +// CHECK:STDOUT: call void @_CTakeAdapterI32.Main(i32 %.loc48_33.3), !dbg !43 +// CHECK:STDOUT: call void @"_COp.7c44cad05a0553d4:core.Destroy.Core"(ptr %.loc48_33.1.temp), !dbg !42 +// CHECK:STDOUT: ret void, !dbg !44 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CTakeAdapterBool.Main(ptr %_) #0 !dbg !41 { +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !45 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !44 +// CHECK:STDOUT: ret void, !dbg !48 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7c44cad05a0553d4:core.Destroy.Core"(ptr %self) #0 !dbg !49 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !52 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CTakeAdapterBool.Main(ptr %_) #0 !dbg !53 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !56 // 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 !45 { +// CHECK:STDOUT: define void @_CPassAdapterBool.Main() #0 !dbg !57 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc55_35.1.temp = alloca i1, align 1, !dbg !46 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc55_35.1.temp), !dbg !46 -// CHECK:STDOUT: call void @_CMakeAdapterBool.Main(ptr %.loc55_35.1.temp), !dbg !46 -// CHECK:STDOUT: call void @_CTakeAdapterBool.Main(ptr %.loc55_35.1.temp), !dbg !47 -// CHECK:STDOUT: ret void, !dbg !48 +// CHECK:STDOUT: %.loc55_35.1.temp = alloca i1, align 1, !dbg !58 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc55_35.1.temp), !dbg !58 +// CHECK:STDOUT: call void @_CMakeAdapterBool.Main(ptr %.loc55_35.1.temp), !dbg !58 +// CHECK:STDOUT: call void @_CTakeAdapterBool.Main(ptr %.loc55_35.1.temp), !dbg !59 +// CHECK:STDOUT: call void @"_COp.a558197de8e552d4:core.Destroy.Core"(ptr %.loc55_35.1.temp), !dbg !58 +// CHECK:STDOUT: ret void, !dbg !60 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.a558197de8e552d4:core.Destroy.Core"(ptr %self) #0 !dbg !61 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !64 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -177,24 +204,40 @@ fn PassAdapterBool() { // CHECK:STDOUT: !25 = !DILocation(line: 28, column: 12, scope: !24) // CHECK:STDOUT: !26 = !DILocation(line: 28, column: 3, scope: !24) // CHECK:STDOUT: !27 = !DILocation(line: 26, column: 1, scope: !24) -// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "ConvertBoolToUnformedBool", linkageName: "_CConvertBoolToUnformedBool.Main", scope: null, file: !3, line: 31, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !29) +// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "Op", linkageName: "_COp.ac1fbb61b7f8ef04:core.Destroy.Core", scope: null, file: !3, line: 28, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !29) // CHECK:STDOUT: !29 = !{!30} // CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !28, type: !14) -// CHECK:STDOUT: !31 = !DILocation(line: 32, column: 3, scope: !28) -// CHECK:STDOUT: !32 = !DILocation(line: 31, column: 1, scope: !28) -// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "TakeAdapterI32", linkageName: "_CTakeAdapterI32.Main", scope: null, file: !3, line: 42, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !34) -// CHECK:STDOUT: !34 = !{!35} -// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !33, type: !7) -// CHECK:STDOUT: !36 = !DILocation(line: 42, column: 1, scope: !33) -// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "PassAdapterI32", linkageName: "_CPassAdapterI32.Main", scope: null, file: !3, line: 45, type: !19, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !38 = !DILocation(line: 48, column: 18, scope: !37) -// CHECK:STDOUT: !39 = !DILocation(line: 48, column: 3, scope: !37) -// CHECK:STDOUT: !40 = !DILocation(line: 45, column: 1, scope: !37) -// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "TakeAdapterBool", linkageName: "_CTakeAdapterBool.Main", scope: null, file: !3, line: 51, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !42) -// CHECK:STDOUT: !42 = !{!43} -// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !41, type: !14) -// CHECK:STDOUT: !44 = !DILocation(line: 51, column: 1, scope: !41) -// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "PassAdapterBool", linkageName: "_CPassAdapterBool.Main", scope: null, file: !3, line: 54, type: !19, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !46 = !DILocation(line: 55, column: 19, scope: !45) -// CHECK:STDOUT: !47 = !DILocation(line: 55, column: 3, scope: !45) -// CHECK:STDOUT: !48 = !DILocation(line: 54, column: 1, scope: !45) +// CHECK:STDOUT: !31 = !DILocation(line: 28, column: 12, scope: !28) +// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "ConvertBoolToUnformedBool", linkageName: "_CConvertBoolToUnformedBool.Main", scope: null, file: !3, line: 31, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !33) +// CHECK:STDOUT: !33 = !{!34} +// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !32, type: !14) +// CHECK:STDOUT: !35 = !DILocation(line: 32, column: 3, scope: !32) +// CHECK:STDOUT: !36 = !DILocation(line: 31, column: 1, scope: !32) +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "TakeAdapterI32", linkageName: "_CTakeAdapterI32.Main", scope: null, file: !3, line: 42, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !38) +// CHECK:STDOUT: !38 = !{!39} +// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !37, type: !7) +// CHECK:STDOUT: !40 = !DILocation(line: 42, column: 1, scope: !37) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "PassAdapterI32", linkageName: "_CPassAdapterI32.Main", scope: null, file: !3, line: 45, type: !19, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !42 = !DILocation(line: 48, column: 18, scope: !41) +// CHECK:STDOUT: !43 = !DILocation(line: 48, column: 3, scope: !41) +// CHECK:STDOUT: !44 = !DILocation(line: 45, column: 1, scope: !41) +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 48, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !46) +// CHECK:STDOUT: !46 = !{!47} +// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !45, type: !7) +// CHECK:STDOUT: !48 = !DILocation(line: 48, column: 18, scope: !45) +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7c44cad05a0553d4:core.Destroy.Core", scope: null, file: !3, line: 48, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !50) +// CHECK:STDOUT: !50 = !{!51} +// CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !49, type: !7) +// CHECK:STDOUT: !52 = !DILocation(line: 48, column: 18, scope: !49) +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "TakeAdapterBool", linkageName: "_CTakeAdapterBool.Main", scope: null, file: !3, line: 51, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !54) +// CHECK:STDOUT: !54 = !{!55} +// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !53, type: !14) +// CHECK:STDOUT: !56 = !DILocation(line: 51, column: 1, scope: !53) +// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "PassAdapterBool", linkageName: "_CPassAdapterBool.Main", scope: null, file: !3, line: 54, type: !19, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !58 = !DILocation(line: 55, column: 19, scope: !57) +// CHECK:STDOUT: !59 = !DILocation(line: 55, column: 3, scope: !57) +// CHECK:STDOUT: !60 = !DILocation(line: 54, column: 1, scope: !57) +// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a558197de8e552d4:core.Destroy.Core", scope: null, file: !3, line: 55, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !62) +// CHECK:STDOUT: !62 = !{!63} +// CHECK:STDOUT: !63 = !DILocalVariable(arg: 1, scope: !61, type: !14) +// CHECK:STDOUT: !64 = !DILocation(line: 55, column: 19, scope: !61) diff --git a/toolchain/lower/testdata/class/adapt.carbon b/toolchain/lower/testdata/class/adapt.carbon index 66545ca79528..e9a9700e0de6 100644 --- a/toolchain/lower/testdata/class/adapt.carbon +++ b/toolchain/lower/testdata/class/adapt.carbon @@ -93,9 +93,28 @@ fn DoStuff(a: Int) -> Int { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %pa.var), !dbg !24 // CHECK:STDOUT: call void @_CMake.PairAdapter.Main(ptr %pa.var), !dbg !25 // CHECK:STDOUT: %PairAdapter.GetB.call = call i32 @_CGetB.PairAdapter.Main(ptr %pa.var), !dbg !26 +// CHECK:STDOUT: call void @"_COp.d99147c205c0db06:core.Destroy.Core"(ptr %pa.var), !dbg !24 // CHECK:STDOUT: ret i32 %PairAdapter.GetB.call, !dbg !27 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !28 { +// 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.fb32c4dfca65e378:core.Destroy.Core"(ptr %self) #0 !dbg !34 { +// 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.d99147c205c0db06:core.Destroy.Core"(ptr %self) #0 !dbg !40 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !43 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree 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: @@ -137,6 +156,22 @@ fn DoStuff(a: Int) -> Int { // CHECK:STDOUT: !25 = !DILocation(line: 27, column: 25, scope: !21) // CHECK:STDOUT: !26 = !DILocation(line: 28, column: 10, scope: !21) // CHECK:STDOUT: !27 = !DILocation(line: 28, column: 3, scope: !21) +// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 27, type: !29, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !31) +// CHECK:STDOUT: !29 = !DISubroutineType(types: !30) +// CHECK:STDOUT: !30 = !{null, !16} +// CHECK:STDOUT: !31 = !{!32} +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !28, type: !16) +// CHECK:STDOUT: !33 = !DILocation(line: 27, column: 3, scope: !28) +// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fb32c4dfca65e378:core.Destroy.Core", scope: null, file: !3, line: 27, type: !35, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !37) +// CHECK:STDOUT: !35 = !DISubroutineType(types: !36) +// CHECK:STDOUT: !36 = !{null, !7} +// CHECK:STDOUT: !37 = !{!38} +// CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !34, type: !7) +// CHECK:STDOUT: !39 = !DILocation(line: 27, column: 3, scope: !34) +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d99147c205c0db06:core.Destroy.Core", scope: null, file: !3, line: 27, type: !35, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !41) +// CHECK:STDOUT: !41 = !{!42} +// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !40, type: !7) +// CHECK:STDOUT: !43 = !DILocation(line: 27, column: 3, scope: !40) // CHECK:STDOUT: ; ModuleID = 'adapt_int.carbon' // CHECK:STDOUT: source_filename = "adapt_int.carbon" // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/class/basic.carbon b/toolchain/lower/testdata/class/basic.carbon index a0d4b7f3543d..8861d7e5ec56 100644 --- a/toolchain/lower/testdata/class/basic.carbon +++ b/toolchain/lower/testdata/class/basic.carbon @@ -35,13 +35,34 @@ fn Run() { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !7 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !8 // CHECK:STDOUT: call void @_CF.Main(ptr %_.var, ptr %c.var), !dbg !9 +// CHECK:STDOUT: call void @"_COp.71e25083d63c4d6c:core.Destroy.Core"(ptr %_.var), !dbg !8 +// CHECK:STDOUT: call void @"_COp.71e25083d63c4d6c:core.Destroy.Core"(ptr %c.var), !dbg !7 // CHECK:STDOUT: ret void, !dbg !10 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !11 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.e7e7253cfbad8551:core.Destroy.Core"(ptr %self) #0 !dbg !18 { +// 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.71e25083d63c4d6c:core.Destroy.Core"(ptr %self) #0 !dbg !25 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !28 +// 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.71e25083d63c4d6c:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -61,3 +82,21 @@ fn Run() { // CHECK:STDOUT: !8 = !DILocation(line: 22, column: 3, scope: !4) // CHECK:STDOUT: !9 = !DILocation(line: 22, column: 14, scope: !4) // CHECK:STDOUT: !10 = !DILocation(line: 20, column: 1, scope: !4) +// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 22, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !15) +// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) +// CHECK:STDOUT: !13 = !{null, !14} +// CHECK:STDOUT: !14 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !15 = !{!16} +// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !11, type: !14) +// CHECK:STDOUT: !17 = !DILocation(line: 22, column: 3, scope: !11) +// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "Op", linkageName: "_COp.e7e7253cfbad8551:core.Destroy.Core", scope: null, file: !3, line: 22, type: !19, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !22) +// CHECK:STDOUT: !19 = !DISubroutineType(types: !20) +// CHECK:STDOUT: !20 = !{null, !21} +// CHECK:STDOUT: !21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !22 = !{!23} +// CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !18, type: !21) +// CHECK:STDOUT: !24 = !DILocation(line: 22, column: 3, scope: !18) +// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "Op", linkageName: "_COp.71e25083d63c4d6c:core.Destroy.Core", scope: null, file: !3, line: 22, type: !19, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !26) +// CHECK:STDOUT: !26 = !{!27} +// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !25, type: !21) +// CHECK:STDOUT: !28 = !DILocation(line: 22, column: 3, scope: !25) diff --git a/toolchain/lower/testdata/class/convert.carbon b/toolchain/lower/testdata/class/convert.carbon index 1305c3c07e61..503948087a93 100644 --- a/toolchain/lower/testdata/class/convert.carbon +++ b/toolchain/lower/testdata/class/convert.carbon @@ -53,9 +53,28 @@ fn DoIt() { // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %w.var, ptr align 4 @IntWrapper.val.loc24_3, i64 4, i1 false), !dbg !22 // CHECK:STDOUT: %IntWrapper.as.ImplicitAs.impl.Convert.call = call i32 @"_CConvert.IntWrapper.Main:ImplicitAs.b88d1103f417c6d4.Core"(ptr %w.var), !dbg !24 // CHECK:STDOUT: call void @_CConsume.Main(i32 %IntWrapper.as.ImplicitAs.impl.Convert.call), !dbg !25 +// CHECK:STDOUT: call void @"_COp.01fa374da497ff8a:core.Destroy.Core"(ptr %w.var), !dbg !22 // CHECK:STDOUT: ret void, !dbg !26 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !27 { +// 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.e7a76f28c4ef4db5:core.Destroy.Core"(ptr %self) #0 !dbg !31 { +// 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.01fa374da497ff8a:core.Destroy.Core"(ptr %self) #0 !dbg !37 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !40 +// 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,3 +115,17 @@ fn DoIt() { // CHECK:STDOUT: !24 = !DILocation(line: 25, column: 11, scope: !19) // CHECK:STDOUT: !25 = !DILocation(line: 25, column: 3, scope: !19) // CHECK:STDOUT: !26 = !DILocation(line: 23, column: 1, scope: !19) +// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 24, type: !14, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !28) +// CHECK:STDOUT: !28 = !{!29} +// CHECK:STDOUT: !29 = !DILocalVariable(arg: 1, scope: !27, type: !7) +// CHECK:STDOUT: !30 = !DILocation(line: 24, column: 3, scope: !27) +// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "Op", linkageName: "_COp.e7a76f28c4ef4db5:core.Destroy.Core", scope: null, file: !3, line: 24, type: !32, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !34) +// CHECK:STDOUT: !32 = !DISubroutineType(types: !33) +// CHECK:STDOUT: !33 = !{null, !8} +// CHECK:STDOUT: !34 = !{!35} +// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !31, type: !8) +// CHECK:STDOUT: !36 = !DILocation(line: 24, column: 3, scope: !31) +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.01fa374da497ff8a:core.Destroy.Core", scope: null, file: !3, line: 24, type: !32, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !38) +// CHECK:STDOUT: !38 = !{!39} +// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !37, type: !8) +// CHECK:STDOUT: !40 = !DILocation(line: 24, column: 3, scope: !37) diff --git a/toolchain/lower/testdata/class/field.carbon b/toolchain/lower/testdata/class/field.carbon index 91d7d8c02fee..423334e852ee 100644 --- a/toolchain/lower/testdata/class/field.carbon +++ b/toolchain/lower/testdata/class/field.carbon @@ -91,9 +91,28 @@ fn Run() { // CHECK:STDOUT: %.loc16.b = getelementptr inbounds nuw { i32, ptr }, ptr %c.var, i32 0, i32 1, !dbg !19 // CHECK:STDOUT: store ptr %c.var, ptr %.loc16.b, align 8, !dbg !19 // CHECK:STDOUT: %F.call = call i32 @_CF.Main(ptr %c.var), !dbg !20 +// CHECK:STDOUT: call void @"_COp.71e25083d63c4d6c:core.Destroy.Core"(ptr %c.var), !dbg !17 // CHECK:STDOUT: ret i32 %F.call, !dbg !21 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !22 { +// 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.e7e7253cfbad8551:core.Destroy.Core"(ptr %self) #0 !dbg !28 { +// 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.71e25083d63c4d6c:core.Destroy.Core"(ptr %self) #0 !dbg !34 { +// 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: @@ -125,6 +144,22 @@ fn Run() { // CHECK:STDOUT: !19 = !DILocation(line: 16, column: 3, scope: !14) // CHECK:STDOUT: !20 = !DILocation(line: 17, column: 10, scope: !14) // CHECK:STDOUT: !21 = !DILocation(line: 17, column: 3, scope: !14) +// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 14, type: !23, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !25) +// CHECK:STDOUT: !23 = !DISubroutineType(types: !24) +// CHECK:STDOUT: !24 = !{null, !7} +// CHECK:STDOUT: !25 = !{!26} +// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !22, type: !7) +// CHECK:STDOUT: !27 = !DILocation(line: 14, column: 3, scope: !22) +// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "Op", linkageName: "_COp.e7e7253cfbad8551:core.Destroy.Core", scope: null, file: !3, line: 14, type: !29, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !31) +// CHECK:STDOUT: !29 = !DISubroutineType(types: !30) +// CHECK:STDOUT: !30 = !{null, !8} +// CHECK:STDOUT: !31 = !{!32} +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !28, type: !8) +// CHECK:STDOUT: !33 = !DILocation(line: 14, column: 3, scope: !28) +// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "Op", linkageName: "_COp.71e25083d63c4d6c:core.Destroy.Core", scope: null, file: !3, line: 14, type: !29, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !35) +// CHECK:STDOUT: !35 = !{!36} +// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !34, type: !8) +// CHECK:STDOUT: !37 = !DILocation(line: 14, column: 3, scope: !34) // CHECK:STDOUT: ; ModuleID = 'inplace_init_with_nonconst.carbon' // CHECK:STDOUT: source_filename = "inplace_init_with_nonconst.carbon" // CHECK:STDOUT: @@ -141,9 +176,29 @@ fn Run() { // CHECK:STDOUT: store ptr %o.var, ptr %.loc15_33.2.a, align 8, !dbg !9 // CHECK:STDOUT: %.loc15_33.4.b = getelementptr inbounds nuw { ptr, {} }, ptr %_.var, i32 0, i32 1, !dbg !9 // 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 !9 +// CHECK:STDOUT: call void @"_COp.6354d5454c7bf77d:core.Destroy.Core"(ptr %_.var), !dbg !8 +// CHECK:STDOUT: call void @"_COp.49a4972657b05a86:core.Destroy.Core"(ptr %o.var), !dbg !7 // CHECK:STDOUT: ret void, !dbg !10 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.49a4972657b05a86:core.Destroy.Core"(ptr %self) #0 !dbg !11 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.93fc877b6ab5c8f9:core.Destroy.Core"(ptr %self) #0 !dbg !18 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !21 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.6354d5454c7bf77d:core.Destroy.Core"(ptr %self) #0 !dbg !22 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !25 +// 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: @@ -171,6 +226,21 @@ fn Run() { // CHECK:STDOUT: !8 = !DILocation(line: 15, column: 3, scope: !4) // CHECK:STDOUT: !9 = !DILocation(line: 15, column: 16, scope: !4) // CHECK:STDOUT: !10 = !DILocation(line: 11, column: 1, scope: !4) +// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Op", linkageName: "_COp.49a4972657b05a86:core.Destroy.Core", scope: null, file: !3, line: 15, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !15) +// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) +// CHECK:STDOUT: !13 = !{null, !14} +// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !15 = !{!16} +// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !11, type: !14) +// CHECK:STDOUT: !17 = !DILocation(line: 15, column: 3, scope: !11) +// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "Op", linkageName: "_COp.93fc877b6ab5c8f9:core.Destroy.Core", scope: null, file: !3, line: 15, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !19) +// CHECK:STDOUT: !19 = !{!20} +// CHECK:STDOUT: !20 = !DILocalVariable(arg: 1, scope: !18, type: !14) +// CHECK:STDOUT: !21 = !DILocation(line: 15, column: 3, scope: !18) +// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Op", linkageName: "_COp.6354d5454c7bf77d:core.Destroy.Core", scope: null, file: !3, line: 15, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !23) +// CHECK:STDOUT: !23 = !{!24} +// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !22, type: !14) +// CHECK:STDOUT: !25 = !DILocation(line: 15, column: 3, scope: !22) // CHECK:STDOUT: ; ModuleID = 'implicit_init_with_nonempty_nonconst.carbon' // CHECK:STDOUT: source_filename = "implicit_init_with_nonempty_nonconst.carbon" // CHECK:STDOUT: @@ -188,9 +258,41 @@ fn Run() { // CHECK:STDOUT: %.loc17_40.4.b = getelementptr inbounds nuw { ptr, { i32 } }, ptr %_.var, i32 0, i32 1, !dbg !9 // CHECK:STDOUT: %.loc17_39.3.v = getelementptr inbounds nuw { i32 }, ptr %.loc17_40.4.b, i32 0, i32 0, !dbg !10 // 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 !9 +// CHECK:STDOUT: call void @"_COp.6354d5454c7bf77d:core.Destroy.Core"(ptr %_.var), !dbg !8 +// CHECK:STDOUT: call void @"_COp.49a4972657b05a86:core.Destroy.Core"(ptr %o.var), !dbg !7 // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !12 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.8e62c7e21e7d5467:core.Destroy.Core"(ptr %self) #0 !dbg !19 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !25 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.49a4972657b05a86:core.Destroy.Core"(ptr %self) #0 !dbg !26 { +// 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.93fc877b6ab5c8f9:core.Destroy.Core"(ptr %self) #0 !dbg !30 { +// 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.6354d5454c7bf77d:core.Destroy.Core"(ptr %self) #0 !dbg !34 { +// 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: @@ -219,3 +321,29 @@ fn Run() { // CHECK:STDOUT: !9 = !DILocation(line: 17, column: 16, scope: !4) // CHECK:STDOUT: !10 = !DILocation(line: 17, column: 31, scope: !4) // CHECK:STDOUT: !11 = !DILocation(line: 13, column: 1, scope: !4) +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 17, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !16) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null, !15} +// CHECK:STDOUT: !15 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !16 = !{!17} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15) +// CHECK:STDOUT: !18 = !DILocation(line: 17, column: 3, scope: !12) +// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8e62c7e21e7d5467:core.Destroy.Core", scope: null, file: !3, line: 17, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !23) +// CHECK:STDOUT: !20 = !DISubroutineType(types: !21) +// CHECK:STDOUT: !21 = !{null, !22} +// CHECK:STDOUT: !22 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !23 = !{!24} +// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !19, type: !22) +// CHECK:STDOUT: !25 = !DILocation(line: 17, column: 3, scope: !19) +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.49a4972657b05a86:core.Destroy.Core", scope: null, file: !3, line: 17, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !27) +// CHECK:STDOUT: !27 = !{!28} +// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !26, type: !22) +// CHECK:STDOUT: !29 = !DILocation(line: 17, column: 3, scope: !26) +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Op", linkageName: "_COp.93fc877b6ab5c8f9:core.Destroy.Core", scope: null, file: !3, line: 17, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !31) +// CHECK:STDOUT: !31 = !{!32} +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !30, type: !22) +// CHECK:STDOUT: !33 = !DILocation(line: 17, column: 3, scope: !30) +// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "Op", linkageName: "_COp.6354d5454c7bf77d:core.Destroy.Core", scope: null, file: !3, line: 17, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !35) +// CHECK:STDOUT: !35 = !{!36} +// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !34, type: !22) +// CHECK:STDOUT: !37 = !DILocation(line: 17, column: 3, scope: !34) diff --git a/toolchain/lower/testdata/class/generic.carbon b/toolchain/lower/testdata/class/generic.carbon index 2116c2ffc2a3..7aa9d7eca7fb 100644 --- a/toolchain/lower/testdata/class/generic.carbon +++ b/toolchain/lower/testdata/class/generic.carbon @@ -296,46 +296,98 @@ fn AccessTuple() -> (i32, i32, i32) { // CHECK:STDOUT: %.loc16_37.5.w = getelementptr inbounds nuw { i1, i32 }, ptr %c.var, i32 0, i32 1, !dbg !9 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %c.var, ptr align 4 @C.val.310.loc16_3, i64 8, i1 false), !dbg !8 // CHECK:STDOUT: %C.GetBool.call = call i1 @_CGetBool.C.Main.64ccbb8e5d9a0b8e(ptr %c.var), !dbg !10 +// CHECK:STDOUT: call void @"_COp.7780cb0fc459ca93:core.Destroy.Core"(ptr %c.var), !dbg !8 // CHECK:STDOUT: ret i1 %C.GetBool.call, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CAccessInt.Main() #0 !dbg !12 { +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %c.var = alloca { i1, i32 }, align 8, !dbg !16 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !16 -// CHECK:STDOUT: %.loc21_37.2.v = getelementptr inbounds nuw { i1, i32 }, ptr %c.var, i32 0, i32 0, !dbg !17 -// CHECK:STDOUT: %.loc21_37.5.w = getelementptr inbounds nuw { i1, i32 }, ptr %c.var, i32 0, i32 1, !dbg !17 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %c.var, ptr align 4 @C.val.310.loc16_3, i64 8, i1 false), !dbg !16 -// CHECK:STDOUT: %C.GetT.call = call i32 @_CGetT.C.Main.64ccbb8e5d9a0b8e(ptr %c.var), !dbg !18 -// CHECK:STDOUT: ret i32 %C.GetT.call, !dbg !19 +// CHECK:STDOUT: ret void, !dbg !18 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CAccessEmpty.Main() #0 !dbg !20 { +// CHECK:STDOUT: define weak_odr void @"_COp.6ff8d75e287d0783:core.Destroy.Core"(ptr %self) #0 !dbg !19 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %c.var = alloca { i1, {} }, align 8, !dbg !23 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !23 -// CHECK:STDOUT: %.loc26_37.2.v = getelementptr inbounds nuw { i1, {} }, ptr %c.var, i32 0, i32 0, !dbg !24 -// CHECK:STDOUT: %.loc26_37.4.w = getelementptr inbounds nuw { i1, {} }, ptr %c.var, i32 0, i32 1, !dbg !24 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %c.var, ptr align 1 @C.val.8d5.loc26_3, i64 1, i1 false), !dbg !23 -// CHECK:STDOUT: call void @_CGetT.C.Main.335f6bfc3bd91486(ptr %c.var), !dbg !25 -// CHECK:STDOUT: ret void, !dbg !26 +// CHECK:STDOUT: ret void, !dbg !24 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CAccessTuple.Main(ptr sret({ i32, i32, i32 }) %return) #0 !dbg !27 { +// CHECK:STDOUT: define weak_odr void @"_COp.7780cb0fc459ca93:core.Destroy.Core"(ptr %self) #0 !dbg !25 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %c.var = alloca { i1, { i32, i32, i32 } }, align 8, !dbg !28 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !28 -// CHECK:STDOUT: %.loc31_57.2.v = getelementptr inbounds nuw { i1, { i32, i32, i32 } }, ptr %c.var, i32 0, i32 0, !dbg !29 -// CHECK:STDOUT: %.loc31_57.4.w = getelementptr inbounds nuw { i1, { i32, i32, i32 } }, ptr %c.var, i32 0, i32 1, !dbg !29 -// CHECK:STDOUT: %tuple.elem0.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %.loc31_57.4.w, i32 0, i32 0, !dbg !30 -// CHECK:STDOUT: %tuple.elem1.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %.loc31_57.4.w, i32 0, i32 1, !dbg !30 -// CHECK:STDOUT: %tuple.elem2.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %.loc31_57.4.w, i32 0, i32 2, !dbg !30 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %c.var, ptr align 4 @C.val.76f.loc31_3, i64 16, i1 false), !dbg !28 -// CHECK:STDOUT: call void @_CGetT.C.Main.3ae0849a77989a11(ptr %return, ptr %c.var), !dbg !31 -// CHECK:STDOUT: ret void, !dbg !32 +// CHECK:STDOUT: ret void, !dbg !28 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define i32 @_CAccessInt.Main() #0 !dbg !29 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %c.var = alloca { i1, i32 }, align 8, !dbg !32 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !32 +// CHECK:STDOUT: %.loc21_37.2.v = getelementptr inbounds nuw { i1, i32 }, ptr %c.var, i32 0, i32 0, !dbg !33 +// CHECK:STDOUT: %.loc21_37.5.w = getelementptr inbounds nuw { i1, i32 }, ptr %c.var, i32 0, i32 1, !dbg !33 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %c.var, ptr align 4 @C.val.310.loc16_3, i64 8, i1 false), !dbg !32 +// CHECK:STDOUT: %C.GetT.call = call i32 @_CGetT.C.Main.64ccbb8e5d9a0b8e(ptr %c.var), !dbg !34 +// CHECK:STDOUT: call void @"_COp.7780cb0fc459ca93:core.Destroy.Core"(ptr %c.var), !dbg !32 +// CHECK:STDOUT: ret i32 %C.GetT.call, !dbg !35 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CAccessEmpty.Main() #0 !dbg !36 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %c.var = alloca { i1, {} }, align 8, !dbg !39 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !39 +// CHECK:STDOUT: %.loc26_37.2.v = getelementptr inbounds nuw { i1, {} }, ptr %c.var, i32 0, i32 0, !dbg !40 +// CHECK:STDOUT: %.loc26_37.4.w = getelementptr inbounds nuw { i1, {} }, ptr %c.var, i32 0, i32 1, !dbg !40 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %c.var, ptr align 1 @C.val.8d5.loc26_3, i64 1, i1 false), !dbg !39 +// CHECK:STDOUT: call void @_CGetT.C.Main.335f6bfc3bd91486(ptr %c.var), !dbg !41 +// CHECK:STDOUT: call void @"_COp.79aed8447e046696:core.Destroy.Core"(ptr %c.var), !dbg !39 +// CHECK:STDOUT: ret void, !dbg !42 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.13efda571ed6c7c5:core.Destroy.Core"(ptr %self) #0 !dbg !43 { +// 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.79aed8447e046696:core.Destroy.Core"(ptr %self) #0 !dbg !47 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !50 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CAccessTuple.Main(ptr sret({ i32, i32, i32 }) %return) #0 !dbg !51 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %c.var = alloca { i1, { i32, i32, i32 } }, align 8, !dbg !52 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !52 +// CHECK:STDOUT: %.loc31_57.2.v = getelementptr inbounds nuw { i1, { i32, i32, i32 } }, ptr %c.var, i32 0, i32 0, !dbg !53 +// CHECK:STDOUT: %.loc31_57.4.w = getelementptr inbounds nuw { i1, { i32, i32, i32 } }, ptr %c.var, i32 0, i32 1, !dbg !53 +// CHECK:STDOUT: %tuple.elem0.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %.loc31_57.4.w, i32 0, i32 0, !dbg !54 +// CHECK:STDOUT: %tuple.elem1.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %.loc31_57.4.w, i32 0, i32 1, !dbg !54 +// CHECK:STDOUT: %tuple.elem2.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %.loc31_57.4.w, i32 0, i32 2, !dbg !54 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %c.var, ptr align 4 @C.val.76f.loc31_3, i64 16, i1 false), !dbg !52 +// CHECK:STDOUT: call void @_CGetT.C.Main.3ae0849a77989a11(ptr %return, ptr %c.var), !dbg !55 +// CHECK:STDOUT: call void @"_COp.ec83a704577f828e:core.Destroy.Core"(ptr %c.var), !dbg !52 +// CHECK:STDOUT: ret void, !dbg !56 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.819e9e1e390140e8:core.Destroy.Core"(ptr %self) #0 !dbg !57 { +// 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.bfc82a34bd610125:core.Destroy.Core"(ptr %self) #0 !dbg !61 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !64 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.ec83a704577f828e:core.Destroy.Core"(ptr %self) #0 !dbg !65 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !68 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -345,52 +397,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) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @_CGetBool.C.Main.64ccbb8e5d9a0b8e(ptr %self) #0 !dbg !33 { +// CHECK:STDOUT: define linkonce_odr i1 @_CGetBool.C.Main.64ccbb8e5d9a0b8e(ptr %self) #0 !dbg !69 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc6_16.1.v = getelementptr inbounds nuw { i1, i32 }, ptr %self, i32 0, i32 0, !dbg !38 -// CHECK:STDOUT: %.loc6_16.2 = load i8, ptr %.loc6_16.1.v, align 1, !dbg !38 -// CHECK:STDOUT: %.loc6_16.21 = trunc i8 %.loc6_16.2 to i1, !dbg !38 -// CHECK:STDOUT: ret i1 %.loc6_16.21, !dbg !39 +// CHECK:STDOUT: %.loc6_16.1.v = getelementptr inbounds nuw { i1, i32 }, ptr %self, i32 0, i32 0, !dbg !74 +// CHECK:STDOUT: %.loc6_16.2 = load i8, ptr %.loc6_16.1.v, align 1, !dbg !74 +// CHECK:STDOUT: %.loc6_16.21 = trunc i8 %.loc6_16.2 to i1, !dbg !74 +// CHECK:STDOUT: ret i1 %.loc6_16.21, !dbg !75 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CGetT.C.Main.64ccbb8e5d9a0b8e(ptr %self) #0 !dbg !40 { +// CHECK:STDOUT: define linkonce_odr i32 @_CGetT.C.Main.64ccbb8e5d9a0b8e(ptr %self) #0 !dbg !76 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc9_16.1.w = getelementptr inbounds nuw { i1, i32 }, ptr %self, i32 0, i32 1, !dbg !45 -// CHECK:STDOUT: %.loc9_16.2 = load i32, ptr %.loc9_16.1.w, align 4, !dbg !45 -// CHECK:STDOUT: ret i32 %.loc9_16.2, !dbg !46 +// CHECK:STDOUT: %.loc9_16.1.w = getelementptr inbounds nuw { i1, i32 }, ptr %self, i32 0, i32 1, !dbg !81 +// CHECK:STDOUT: %.loc9_16.2 = load i32, ptr %.loc9_16.1.w, align 4, !dbg !81 +// CHECK:STDOUT: ret i32 %.loc9_16.2, !dbg !82 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CGetT.C.Main.335f6bfc3bd91486(ptr %self) #0 !dbg !47 { +// CHECK:STDOUT: define linkonce_odr void @_CGetT.C.Main.335f6bfc3bd91486(ptr %self) #0 !dbg !83 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc9_16.1.w = getelementptr inbounds nuw { i1, {} }, ptr %self, i32 0, i32 1, !dbg !52 -// CHECK:STDOUT: ret void, !dbg !53 +// CHECK:STDOUT: %.loc9_16.1.w = getelementptr inbounds nuw { i1, {} }, ptr %self, i32 0, i32 1, !dbg !86 +// CHECK:STDOUT: ret void, !dbg !87 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CGetT.C.Main.3ae0849a77989a11(ptr sret({ i32, i32, i32 }) %return, ptr %self) #0 !dbg !54 { +// CHECK:STDOUT: define linkonce_odr void @_CGetT.C.Main.3ae0849a77989a11(ptr sret({ i32, i32, i32 }) %return, ptr %self) #0 !dbg !88 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc9_16.1.w = getelementptr inbounds nuw { i1, { i32, i32, i32 } }, ptr %self, i32 0, i32 1, !dbg !57 -// CHECK:STDOUT: call void @"_COp.a02bcb1b1383357d:Copy.Core.975a30a52004fa2c"(ptr %return, ptr %.loc9_16.1.w), !dbg !57 -// CHECK:STDOUT: ret void, !dbg !58 +// CHECK:STDOUT: %.loc9_16.1.w = getelementptr inbounds nuw { i1, { i32, i32, i32 } }, ptr %self, i32 0, i32 1, !dbg !91 +// CHECK:STDOUT: call void @"_COp.a02bcb1b1383357d:Copy.Core.975a30a52004fa2c"(ptr %return, ptr %.loc9_16.1.w), !dbg !91 +// CHECK:STDOUT: ret void, !dbg !92 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp.a02bcb1b1383357d:Copy.Core.975a30a52004fa2c"(ptr sret({ i32, i32, i32 }) %return, ptr %self) #0 !dbg !59 { -// CHECK:STDOUT: %tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %self, i32 0, i32 0, !dbg !63 -// CHECK:STDOUT: %tuple.elem.load = load i32, ptr %tuple.elem, align 4, !dbg !63 -// CHECK:STDOUT: %tuple.elem1 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 0, !dbg !64 -// CHECK:STDOUT: %tuple.elem2 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %self, i32 0, i32 1, !dbg !65 -// CHECK:STDOUT: %tuple.elem.load3 = load i32, ptr %tuple.elem2, align 4, !dbg !65 -// CHECK:STDOUT: %tuple.elem4 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 1, !dbg !64 -// CHECK:STDOUT: %tuple.elem5 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %self, i32 0, i32 2, !dbg !66 -// CHECK:STDOUT: %tuple.elem.load6 = load i32, ptr %tuple.elem5, align 4, !dbg !66 -// CHECK:STDOUT: %tuple.elem7 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 2, !dbg !64 -// CHECK:STDOUT: store i32 %tuple.elem.load, ptr %tuple.elem1, align 4, !dbg !64 -// CHECK:STDOUT: store i32 %tuple.elem.load3, ptr %tuple.elem4, align 4, !dbg !64 -// CHECK:STDOUT: store i32 %tuple.elem.load6, ptr %tuple.elem7, align 4, !dbg !64 -// CHECK:STDOUT: ret void, !dbg !67 +// CHECK:STDOUT: define linkonce_odr void @"_COp.a02bcb1b1383357d:Copy.Core.975a30a52004fa2c"(ptr sret({ i32, i32, i32 }) %return, ptr %self) #0 !dbg !93 { +// CHECK:STDOUT: %tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %self, i32 0, i32 0, !dbg !97 +// CHECK:STDOUT: %tuple.elem.load = load i32, ptr %tuple.elem, align 4, !dbg !97 +// CHECK:STDOUT: %tuple.elem1 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 0, !dbg !98 +// CHECK:STDOUT: %tuple.elem2 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %self, i32 0, i32 1, !dbg !99 +// CHECK:STDOUT: %tuple.elem.load3 = load i32, ptr %tuple.elem2, align 4, !dbg !99 +// CHECK:STDOUT: %tuple.elem4 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 1, !dbg !98 +// CHECK:STDOUT: %tuple.elem5 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %self, i32 0, i32 2, !dbg !100 +// CHECK:STDOUT: %tuple.elem.load6 = load i32, ptr %tuple.elem5, align 4, !dbg !100 +// CHECK:STDOUT: %tuple.elem7 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 2, !dbg !98 +// CHECK:STDOUT: store i32 %tuple.elem.load, ptr %tuple.elem1, align 4, !dbg !98 +// CHECK:STDOUT: store i32 %tuple.elem.load3, ptr %tuple.elem4, align 4, !dbg !98 +// CHECK:STDOUT: store i32 %tuple.elem.load6, ptr %tuple.elem7, align 4, !dbg !98 +// CHECK:STDOUT: ret void, !dbg !101 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -416,59 +468,93 @@ fn AccessTuple() -> (i32, i32, i32) { // CHECK:STDOUT: !9 = !DILocation(line: 16, column: 19, scope: !4) // CHECK:STDOUT: !10 = !DILocation(line: 17, column: 10, scope: !4) // CHECK:STDOUT: !11 = !DILocation(line: 17, column: 3, scope: !4) -// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "AccessInt", linkageName: "_CAccessInt.Main", scope: null, file: !3, line: 20, type: !13, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 16, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !16) // CHECK:STDOUT: !13 = !DISubroutineType(types: !14) -// CHECK:STDOUT: !14 = !{!15} +// CHECK:STDOUT: !14 = !{null, !15} // CHECK:STDOUT: !15 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !16 = !DILocation(line: 21, column: 3, scope: !12) -// CHECK:STDOUT: !17 = !DILocation(line: 21, column: 19, scope: !12) -// CHECK:STDOUT: !18 = !DILocation(line: 22, column: 10, scope: !12) -// CHECK:STDOUT: !19 = !DILocation(line: 22, column: 3, scope: !12) -// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "AccessEmpty", linkageName: "_CAccessEmpty.Main", scope: null, file: !3, line: 25, type: !21, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !21 = !DISubroutineType(types: !22) -// CHECK:STDOUT: !22 = !{null} -// CHECK:STDOUT: !23 = !DILocation(line: 26, column: 3, scope: !20) -// CHECK:STDOUT: !24 = !DILocation(line: 26, column: 18, scope: !20) -// CHECK:STDOUT: !25 = !DILocation(line: 27, column: 10, scope: !20) -// CHECK:STDOUT: !26 = !DILocation(line: 27, column: 3, scope: !20) -// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "AccessTuple", linkageName: "_CAccessTuple.Main", scope: null, file: !3, line: 30, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !28 = !DILocation(line: 31, column: 3, scope: !27) -// CHECK:STDOUT: !29 = !DILocation(line: 31, column: 31, scope: !27) -// CHECK:STDOUT: !30 = !DILocation(line: 31, column: 48, scope: !27) -// CHECK:STDOUT: !31 = !DILocation(line: 32, column: 10, scope: !27) -// CHECK:STDOUT: !32 = !DILocation(line: 32, column: 3, scope: !27) -// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "GetBool", linkageName: "_CGetBool.C.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 5, type: !34, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !36) -// CHECK:STDOUT: !34 = !DISubroutineType(types: !35) -// CHECK:STDOUT: !35 = !{!7, !7} -// CHECK:STDOUT: !36 = !{!37} -// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !33, type: !7) -// CHECK:STDOUT: !38 = !DILocation(line: 6, column: 12, scope: !33) -// CHECK:STDOUT: !39 = !DILocation(line: 6, column: 5, scope: !33) -// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "GetT", linkageName: "_CGetT.C.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 8, type: !41, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !43) -// CHECK:STDOUT: !41 = !DISubroutineType(types: !42) -// CHECK:STDOUT: !42 = !{!15, !7} -// CHECK:STDOUT: !43 = !{!44} -// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !40, type: !7) -// CHECK:STDOUT: !45 = !DILocation(line: 9, column: 12, scope: !40) -// CHECK:STDOUT: !46 = !DILocation(line: 9, column: 5, scope: !40) -// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "GetT", linkageName: "_CGetT.C.Main.335f6bfc3bd91486", scope: null, file: !3, line: 8, type: !48, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !50) -// CHECK:STDOUT: !48 = !DISubroutineType(types: !49) -// CHECK:STDOUT: !49 = !{null, !7} -// CHECK:STDOUT: !50 = !{!51} -// CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !47, type: !7) -// CHECK:STDOUT: !52 = !DILocation(line: 9, column: 12, scope: !47) -// CHECK:STDOUT: !53 = !DILocation(line: 9, column: 5, scope: !47) -// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "GetT", linkageName: "_CGetT.C.Main.3ae0849a77989a11", scope: null, file: !3, line: 8, type: !34, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !55) -// CHECK:STDOUT: !55 = !{!56} -// CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !54, type: !7) -// CHECK:STDOUT: !57 = !DILocation(line: 9, column: 12, scope: !54) -// CHECK:STDOUT: !58 = !DILocation(line: 9, column: 5, scope: !54) -// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a02bcb1b1383357d:Copy.Core.975a30a52004fa2c", scope: null, file: !60, line: 54, type: !34, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !61) -// CHECK:STDOUT: !60 = !DIFile(filename: "min_prelude/parts/copy.carbon", directory: "") -// CHECK:STDOUT: !61 = !{!62} -// CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !59, type: !7) -// CHECK:STDOUT: !63 = !DILocation(line: 55, column: 13, scope: !59) -// CHECK:STDOUT: !64 = !DILocation(line: 55, column: 12, scope: !59) -// CHECK:STDOUT: !65 = !DILocation(line: 55, column: 26, scope: !59) -// CHECK:STDOUT: !66 = !DILocation(line: 55, column: 39, scope: !59) -// CHECK:STDOUT: !67 = !DILocation(line: 55, column: 5, scope: !59) +// CHECK:STDOUT: !16 = !{!17} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15) +// CHECK:STDOUT: !18 = !DILocation(line: 16, column: 3, scope: !12) +// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "Op", linkageName: "_COp.6ff8d75e287d0783:core.Destroy.Core", scope: null, file: !3, line: 16, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !22) +// CHECK:STDOUT: !20 = !DISubroutineType(types: !21) +// CHECK:STDOUT: !21 = !{null, !7} +// CHECK:STDOUT: !22 = !{!23} +// CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !19, type: !7) +// CHECK:STDOUT: !24 = !DILocation(line: 16, column: 3, scope: !19) +// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7780cb0fc459ca93:core.Destroy.Core", scope: null, file: !3, line: 16, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !26) +// CHECK:STDOUT: !26 = !{!27} +// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !25, type: !7) +// CHECK:STDOUT: !28 = !DILocation(line: 16, column: 3, scope: !25) +// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "AccessInt", linkageName: "_CAccessInt.Main", scope: null, file: !3, line: 20, type: !30, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !30 = !DISubroutineType(types: !31) +// CHECK:STDOUT: !31 = !{!15} +// CHECK:STDOUT: !32 = !DILocation(line: 21, column: 3, scope: !29) +// CHECK:STDOUT: !33 = !DILocation(line: 21, column: 19, scope: !29) +// CHECK:STDOUT: !34 = !DILocation(line: 22, column: 10, scope: !29) +// CHECK:STDOUT: !35 = !DILocation(line: 22, column: 3, scope: !29) +// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "AccessEmpty", linkageName: "_CAccessEmpty.Main", scope: null, file: !3, line: 25, type: !37, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !37 = !DISubroutineType(types: !38) +// CHECK:STDOUT: !38 = !{null} +// CHECK:STDOUT: !39 = !DILocation(line: 26, column: 3, scope: !36) +// CHECK:STDOUT: !40 = !DILocation(line: 26, column: 18, scope: !36) +// CHECK:STDOUT: !41 = !DILocation(line: 27, column: 10, scope: !36) +// CHECK:STDOUT: !42 = !DILocation(line: 27, column: 3, scope: !36) +// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "Op", linkageName: "_COp.13efda571ed6c7c5:core.Destroy.Core", scope: null, file: !3, line: 26, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !44) +// CHECK:STDOUT: !44 = !{!45} +// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !43, type: !7) +// CHECK:STDOUT: !46 = !DILocation(line: 26, column: 3, scope: !43) +// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "Op", linkageName: "_COp.79aed8447e046696:core.Destroy.Core", scope: null, file: !3, line: 26, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !48) +// CHECK:STDOUT: !48 = !{!49} +// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !47, type: !7) +// CHECK:STDOUT: !50 = !DILocation(line: 26, column: 3, scope: !47) +// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "AccessTuple", linkageName: "_CAccessTuple.Main", scope: null, file: !3, line: 30, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !52 = !DILocation(line: 31, column: 3, scope: !51) +// CHECK:STDOUT: !53 = !DILocation(line: 31, column: 31, scope: !51) +// CHECK:STDOUT: !54 = !DILocation(line: 31, column: 48, scope: !51) +// CHECK:STDOUT: !55 = !DILocation(line: 32, column: 10, scope: !51) +// CHECK:STDOUT: !56 = !DILocation(line: 32, column: 3, scope: !51) +// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "Op", linkageName: "_COp.819e9e1e390140e8:core.Destroy.Core", scope: null, file: !3, line: 31, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !58) +// CHECK:STDOUT: !58 = !{!59} +// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !57, type: !7) +// CHECK:STDOUT: !60 = !DILocation(line: 31, column: 3, scope: !57) +// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "Op", linkageName: "_COp.bfc82a34bd610125:core.Destroy.Core", scope: null, file: !3, line: 31, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !62) +// CHECK:STDOUT: !62 = !{!63} +// CHECK:STDOUT: !63 = !DILocalVariable(arg: 1, scope: !61, type: !7) +// CHECK:STDOUT: !64 = !DILocation(line: 31, column: 3, scope: !61) +// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "Op", linkageName: "_COp.ec83a704577f828e:core.Destroy.Core", scope: null, file: !3, line: 31, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !66) +// CHECK:STDOUT: !66 = !{!67} +// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !65, type: !7) +// CHECK:STDOUT: !68 = !DILocation(line: 31, column: 3, scope: !65) +// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "GetBool", linkageName: "_CGetBool.C.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 5, type: !70, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !72) +// CHECK:STDOUT: !70 = !DISubroutineType(types: !71) +// CHECK:STDOUT: !71 = !{!7, !7} +// CHECK:STDOUT: !72 = !{!73} +// CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !69, type: !7) +// CHECK:STDOUT: !74 = !DILocation(line: 6, column: 12, scope: !69) +// CHECK:STDOUT: !75 = !DILocation(line: 6, column: 5, scope: !69) +// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "GetT", linkageName: "_CGetT.C.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 8, type: !77, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !79) +// CHECK:STDOUT: !77 = !DISubroutineType(types: !78) +// CHECK:STDOUT: !78 = !{!15, !7} +// CHECK:STDOUT: !79 = !{!80} +// CHECK:STDOUT: !80 = !DILocalVariable(arg: 1, scope: !76, type: !7) +// CHECK:STDOUT: !81 = !DILocation(line: 9, column: 12, scope: !76) +// CHECK:STDOUT: !82 = !DILocation(line: 9, column: 5, scope: !76) +// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "GetT", linkageName: "_CGetT.C.Main.335f6bfc3bd91486", scope: null, file: !3, line: 8, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !84) +// CHECK:STDOUT: !84 = !{!85} +// CHECK:STDOUT: !85 = !DILocalVariable(arg: 1, scope: !83, type: !7) +// CHECK:STDOUT: !86 = !DILocation(line: 9, column: 12, scope: !83) +// CHECK:STDOUT: !87 = !DILocation(line: 9, column: 5, scope: !83) +// CHECK:STDOUT: !88 = distinct !DISubprogram(name: "GetT", linkageName: "_CGetT.C.Main.3ae0849a77989a11", scope: null, file: !3, line: 8, type: !70, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !89) +// CHECK:STDOUT: !89 = !{!90} +// CHECK:STDOUT: !90 = !DILocalVariable(arg: 1, scope: !88, type: !7) +// CHECK:STDOUT: !91 = !DILocation(line: 9, column: 12, scope: !88) +// CHECK:STDOUT: !92 = !DILocation(line: 9, column: 5, scope: !88) +// CHECK:STDOUT: !93 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a02bcb1b1383357d:Copy.Core.975a30a52004fa2c", scope: null, file: !94, line: 54, type: !70, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !95) +// CHECK:STDOUT: !94 = !DIFile(filename: "min_prelude/parts/copy.carbon", directory: "") +// CHECK:STDOUT: !95 = !{!96} +// CHECK:STDOUT: !96 = !DILocalVariable(arg: 1, scope: !93, type: !7) +// CHECK:STDOUT: !97 = !DILocation(line: 55, column: 13, scope: !93) +// CHECK:STDOUT: !98 = !DILocation(line: 55, column: 12, scope: !93) +// CHECK:STDOUT: !99 = !DILocation(line: 55, column: 26, scope: !93) +// CHECK:STDOUT: !100 = !DILocation(line: 55, column: 39, scope: !93) +// CHECK:STDOUT: !101 = !DILocation(line: 55, column: 5, scope: !93) diff --git a/toolchain/lower/testdata/class/virtual.carbon b/toolchain/lower/testdata/class/virtual.carbon index 58ede3aff29d..95541235d16c 100644 --- a/toolchain/lower/testdata/class/virtual.carbon +++ b/toolchain/lower/testdata/class/virtual.carbon @@ -253,6 +253,10 @@ fn Make() { // 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 !12 // CHECK:STDOUT: store ptr @"_CDerived.Classes.$vtable", ptr %.loc9_49.7.vptr, align 8, !dbg !12 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc12), !dbg !10 +// CHECK:STDOUT: call void @"_COp.428e66b4e6184a3f:core.Destroy.Core"(ptr %_.var.loc12), !dbg !10 +// CHECK:STDOUT: call void @"_COp.428e66b4e6184a3f:core.Destroy.Core"(ptr %_.var.loc9), !dbg !9 +// CHECK:STDOUT: call void @"_COp.74903cc702c34bd7:core.Destroy.Core"(ptr %_.var.loc8), !dbg !8 +// CHECK:STDOUT: call void @"_COp.46f79b7aa2c021ce:core.Destroy.Core"(ptr %_.var.loc7), !dbg !7 // CHECK:STDOUT: ret void, !dbg !14 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -261,12 +265,42 @@ fn Make() { // CHECK:STDOUT: declare void @_CFn.Derived.Classes(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CUse.Create(ptr %v) #0 !dbg !15 { +// CHECK:STDOUT: define weak_odr void @"_COp.46f79b7aa2c021ce:core.Destroy.Core"(ptr %self) #0 !dbg !15 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Intermediate.Fn.call.vtable = load ptr, ptr %v, align 8, !dbg !21 -// CHECK:STDOUT: %Intermediate.Fn.call = call ptr @llvm.load.relative.i32(ptr %Intermediate.Fn.call.vtable, i32 0), !dbg !21 -// CHECK:STDOUT: call void %Intermediate.Fn.call(ptr %v), !dbg !21 -// CHECK:STDOUT: ret void, !dbg !22 +// CHECK:STDOUT: ret void, !dbg !21 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.27bf1b16dfaccdce:core.Destroy.Core"(ptr %self) #0 !dbg !22 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !25 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.74903cc702c34bd7:core.Destroy.Core"(ptr %self) #0 !dbg !26 { +// 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.d9cbe8847a86e0d2:core.Destroy.Core"(ptr %self) #0 !dbg !30 { +// 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.428e66b4e6184a3f:core.Destroy.Core"(ptr %self) #0 !dbg !34 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !37 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CUse.Create(ptr %v) #0 !dbg !38 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %Intermediate.Fn.call.vtable = load ptr, ptr %v, align 8, !dbg !41 +// CHECK:STDOUT: %Intermediate.Fn.call = call ptr @llvm.load.relative.i32(ptr %Intermediate.Fn.call.vtable, i32 0), !dbg !41 +// CHECK:STDOUT: call void %Intermediate.Fn.call(ptr %v), !dbg !41 +// CHECK:STDOUT: ret void, !dbg !42 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -279,6 +313,7 @@ fn Make() { // CHECK:STDOUT: declare ptr @llvm.load.relative.i32(ptr, i32) #3 // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @"_COp.428e66b4e6184a3f: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: @@ -305,14 +340,34 @@ fn Make() { // CHECK:STDOUT: !12 = !DILocation(line: 9, column: 28, scope: !4) // CHECK:STDOUT: !13 = !DILocation(line: 9, column: 37, scope: !4) // CHECK:STDOUT: !14 = !DILocation(line: 6, column: 1, scope: !4) -// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "Use", linkageName: "_CUse.Create", scope: null, file: !3, line: 15, type: !16, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !19) +// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "Op", linkageName: "_COp.46f79b7aa2c021ce:core.Destroy.Core", scope: null, file: !3, line: 12, type: !16, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !19) // CHECK:STDOUT: !16 = !DISubroutineType(types: !17) // CHECK:STDOUT: !17 = !{null, !18} // CHECK:STDOUT: !18 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !19 = !{!20} // CHECK:STDOUT: !20 = !DILocalVariable(arg: 1, scope: !15, type: !18) -// CHECK:STDOUT: !21 = !DILocation(line: 16, column: 3, scope: !15) -// CHECK:STDOUT: !22 = !DILocation(line: 15, column: 1, scope: !15) +// CHECK:STDOUT: !21 = !DILocation(line: 12, column: 3, scope: !15) +// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Op", linkageName: "_COp.27bf1b16dfaccdce:core.Destroy.Core", scope: null, file: !3, line: 12, type: !16, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !23) +// CHECK:STDOUT: !23 = !{!24} +// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !22, type: !18) +// CHECK:STDOUT: !25 = !DILocation(line: 12, column: 3, scope: !22) +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.74903cc702c34bd7:core.Destroy.Core", scope: null, file: !3, line: 12, type: !16, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !27) +// CHECK:STDOUT: !27 = !{!28} +// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !26, type: !18) +// CHECK:STDOUT: !29 = !DILocation(line: 12, column: 3, scope: !26) +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d9cbe8847a86e0d2:core.Destroy.Core", scope: null, file: !3, line: 12, type: !16, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !31) +// CHECK:STDOUT: !31 = !{!32} +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !30, type: !18) +// CHECK:STDOUT: !33 = !DILocation(line: 12, column: 3, scope: !30) +// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "Op", linkageName: "_COp.428e66b4e6184a3f:core.Destroy.Core", scope: null, file: !3, line: 12, type: !16, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !35) +// CHECK:STDOUT: !35 = !{!36} +// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !34, type: !18) +// CHECK:STDOUT: !37 = !DILocation(line: 12, column: 3, scope: !34) +// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Use", linkageName: "_CUse.Create", scope: null, file: !3, line: 15, type: !16, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !39) +// CHECK:STDOUT: !39 = !{!40} +// CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !38, type: !18) +// CHECK:STDOUT: !41 = !DILocation(line: 16, column: 3, scope: !38) +// CHECK:STDOUT: !42 = !DILocation(line: 15, column: 1, scope: !38) // CHECK:STDOUT: ; ModuleID = 'create_named_ctor.carbon' // CHECK:STDOUT: source_filename = "create_named_ctor.carbon" // CHECK:STDOUT: @@ -447,9 +502,30 @@ fn Make() { // CHECK:STDOUT: %.loc13_24.2.vptr = getelementptr inbounds nuw { ptr, i32 }, ptr %_.var, i32 0, i32 0, !dbg !20 // CHECK:STDOUT: %.loc13_24.5.m = getelementptr inbounds nuw { ptr, i32 }, ptr %_.var, i32 0, i32 1, !dbg !20 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %_.var, ptr align 8 @Base.val.loc13_3, i64 16, i1 false), !dbg !16 +// CHECK:STDOUT: call void @"_COp.dbf7676be30a7aa8:core.Destroy.Core"(ptr %_.var), !dbg !16 +// CHECK:STDOUT: call void @"_COp.dbf7676be30a7aa8:core.Destroy.Core"(ptr %v.var), !dbg !15 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %i.var), !dbg !14 // CHECK:STDOUT: ret void, !dbg !21 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !22 { +// 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.a832eab4299edb30:core.Destroy.Core"(ptr %self) #0 !dbg !29 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.dbf7676be30a7aa8:core.Destroy.Core"(ptr %self) #0 !dbg !33 { +// CHECK:STDOUT: entry: +// 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: @@ -457,6 +533,7 @@ fn Make() { // CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @"_COp.dbf7676be30a7aa8:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 2, 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -488,6 +565,21 @@ fn Make() { // CHECK:STDOUT: !19 = !DILocation(line: 12, column: 3, scope: !11) // CHECK:STDOUT: !20 = !DILocation(line: 13, column: 17, scope: !11) // CHECK:STDOUT: !21 = !DILocation(line: 9, column: 1, scope: !11) +// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 13, type: !23, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !26) +// CHECK:STDOUT: !23 = !DISubroutineType(types: !24) +// CHECK:STDOUT: !24 = !{null, !25} +// CHECK:STDOUT: !25 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !26 = !{!27} +// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !22, type: !25) +// CHECK:STDOUT: !28 = !DILocation(line: 13, column: 3, scope: !22) +// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a832eab4299edb30:core.Destroy.Core", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !30) +// CHECK:STDOUT: !30 = !{!31} +// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !29, type: !7) +// CHECK:STDOUT: !32 = !DILocation(line: 13, column: 3, scope: !29) +// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "Op", linkageName: "_COp.dbf7676be30a7aa8:core.Destroy.Core", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !34) +// CHECK:STDOUT: !34 = !{!35} +// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !33, type: !7) +// CHECK:STDOUT: !36 = !DILocation(line: 13, column: 3, scope: !33) // CHECK:STDOUT: ; ModuleID = 'member_brace_init.carbon' // CHECK:STDOUT: source_filename = "member_brace_init.carbon" // CHECK:STDOUT: @@ -508,9 +600,34 @@ fn Make() { // CHECK:STDOUT: %.loc13_32.7.vptr = getelementptr inbounds nuw { ptr }, ptr %.loc13_32.6.base, i32 0, i32 0, !dbg !8 // 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 !8 // CHECK:STDOUT: store ptr @"_CDerived.Main.$vtable", ptr %.loc13_32.7.vptr, align 8, !dbg !8 +// CHECK:STDOUT: call void @"_COp.12e0d0434542305a:core.Destroy.Core"(ptr %_.var), !dbg !7 // CHECK:STDOUT: ret void, !dbg !10 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.a8f528cd70a29ff8:core.Destroy.Core"(ptr %self) #0 !dbg !11 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.96a711151205ee34:core.Destroy.Core"(ptr %self) #0 !dbg !18 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !21 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.4bfa84f6e0b7c617:core.Destroy.Core"(ptr %self) #0 !dbg !22 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !25 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.12e0d0434542305a:core.Destroy.Core"(ptr %self) #0 !dbg !26 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !29 +// 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: @@ -535,6 +652,25 @@ fn Make() { // CHECK:STDOUT: !8 = !DILocation(line: 13, column: 21, scope: !4) // CHECK:STDOUT: !9 = !DILocation(line: 13, column: 30, scope: !4) // CHECK:STDOUT: !10 = !DILocation(line: 12, column: 1, scope: !4) +// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a8f528cd70a29ff8:core.Destroy.Core", scope: null, file: !3, line: 13, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !15) +// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) +// CHECK:STDOUT: !13 = !{null, !14} +// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !15 = !{!16} +// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !11, type: !14) +// CHECK:STDOUT: !17 = !DILocation(line: 13, column: 3, scope: !11) +// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "Op", linkageName: "_COp.96a711151205ee34:core.Destroy.Core", scope: null, file: !3, line: 13, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !19) +// CHECK:STDOUT: !19 = !{!20} +// CHECK:STDOUT: !20 = !DILocalVariable(arg: 1, scope: !18, type: !14) +// CHECK:STDOUT: !21 = !DILocation(line: 13, column: 3, scope: !18) +// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Op", linkageName: "_COp.4bfa84f6e0b7c617:core.Destroy.Core", scope: null, file: !3, line: 13, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !23) +// CHECK:STDOUT: !23 = !{!24} +// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !22, type: !14) +// CHECK:STDOUT: !25 = !DILocation(line: 13, column: 3, scope: !22) +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.12e0d0434542305a:core.Destroy.Core", scope: null, file: !3, line: 13, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !27) +// CHECK:STDOUT: !27 = !{!28} +// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !26, type: !14) +// CHECK:STDOUT: !29 = !DILocation(line: 13, column: 3, scope: !26) // CHECK:STDOUT: ; ModuleID = 'call.carbon' // CHECK:STDOUT: source_filename = "call.carbon" // CHECK:STDOUT: @@ -597,9 +733,34 @@ fn Make() { // CHECK:STDOUT: %Derived.F.call.vtable = load ptr, ptr %v.var, align 8, !dbg !10 // CHECK:STDOUT: %Derived.F.call = call ptr @llvm.load.relative.i32(ptr %Derived.F.call.vtable, i32 0), !dbg !10 // CHECK:STDOUT: call void %Derived.F.call(ptr %v.var), !dbg !10 +// CHECK:STDOUT: call void @"_COp.12e0d0434542305a:core.Destroy.Core"(ptr %v.var), !dbg !7 // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.a8f528cd70a29ff8:core.Destroy.Core"(ptr %self) #0 !dbg !12 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.96a711151205ee34:core.Destroy.Core"(ptr %self) #0 !dbg !19 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !22 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.4bfa84f6e0b7c617:core.Destroy.Core"(ptr %self) #0 !dbg !23 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !26 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.12e0d0434542305a:core.Destroy.Core"(ptr %self) #0 !dbg !27 { +// 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) // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #1 // CHECK:STDOUT: @@ -629,6 +790,25 @@ fn Make() { // CHECK:STDOUT: !9 = !DILocation(line: 14, column: 30, scope: !4) // CHECK:STDOUT: !10 = !DILocation(line: 15, column: 3, scope: !4) // CHECK:STDOUT: !11 = !DILocation(line: 13, column: 1, scope: !4) +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a8f528cd70a29ff8:core.Destroy.Core", scope: null, file: !3, line: 14, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !16) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null, !15} +// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !16 = !{!17} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15) +// CHECK:STDOUT: !18 = !DILocation(line: 14, column: 3, scope: !12) +// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "Op", linkageName: "_COp.96a711151205ee34:core.Destroy.Core", scope: null, file: !3, line: 14, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !20) +// CHECK:STDOUT: !20 = !{!21} +// CHECK:STDOUT: !21 = !DILocalVariable(arg: 1, scope: !19, type: !15) +// CHECK:STDOUT: !22 = !DILocation(line: 14, column: 3, scope: !19) +// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "Op", linkageName: "_COp.4bfa84f6e0b7c617:core.Destroy.Core", scope: null, file: !3, line: 14, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !24) +// CHECK:STDOUT: !24 = !{!25} +// CHECK:STDOUT: !25 = !DILocalVariable(arg: 1, scope: !23, type: !15) +// CHECK:STDOUT: !26 = !DILocation(line: 14, column: 3, scope: !23) +// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "Op", linkageName: "_COp.12e0d0434542305a:core.Destroy.Core", scope: null, file: !3, line: 14, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !28) +// CHECK:STDOUT: !28 = !{!29} +// CHECK:STDOUT: !29 = !DILocalVariable(arg: 1, scope: !27, type: !15) +// CHECK:STDOUT: !30 = !DILocation(line: 14, column: 3, scope: !27) // CHECK:STDOUT: ; ModuleID = 'generic_noop.carbon' // CHECK:STDOUT: source_filename = "generic_noop.carbon" // CHECK:STDOUT: @@ -658,23 +838,63 @@ fn Make() { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc17), !dbg !8 // CHECK:STDOUT: %.loc17_22.2.vptr = getelementptr inbounds nuw { ptr }, ptr %_.var.loc17, i32 0, i32 0, !dbg !10 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %_.var.loc17, ptr align 8 @Base.val.c5e.loc17_3, i64 8, i1 false), !dbg !8 +// CHECK:STDOUT: call void @"_COp.98cef783bfe00900:core.Destroy.Core"(ptr %_.var.loc17), !dbg !8 +// CHECK:STDOUT: call void @"_COp.4cabc7f3a3e0371f:core.Destroy.Core"(ptr %_.var.loc16), !dbg !7 // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Base.Main.0a7c28d4c8b7893d(ptr %self) #0 !dbg !12 { +// CHECK:STDOUT: define weak_odr void @"_COp.b8216ad694fdad1d:core.Destroy.Core"(ptr %self) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca {}, align 8, !dbg !18 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !18 -// CHECK:STDOUT: ret void, !dbg !19 +// CHECK:STDOUT: ret void, !dbg !18 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Base.Main.bdccbdc18ce76efa(ptr %self) #0 !dbg !20 { +// CHECK:STDOUT: define weak_odr void @"_COp.a65450da9a7ba013:core.Destroy.Core"(ptr %self) #0 !dbg !19 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca { {} }, align 8, !dbg !23 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !23 -// CHECK:STDOUT: ret void, !dbg !24 +// CHECK:STDOUT: ret void, !dbg !22 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.47037bb76eb05287:core.Destroy.Core"(ptr %self) #0 !dbg !23 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !26 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.a8f528cd70a29ff8:core.Destroy.Core"(ptr %self) #0 !dbg !27 { +// 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.98cef783bfe00900:core.Destroy.Core"(ptr %self) #0 !dbg !31 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !34 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.4cabc7f3a3e0371f:core.Destroy.Core"(ptr %self) #0 !dbg !35 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !38 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CF.Base.Main.0a7c28d4c8b7893d(ptr %self) #0 !dbg !39 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %_.var = alloca {}, align 8, !dbg !42 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !42 +// CHECK:STDOUT: call void @"_COp.b8216ad694fdad1d:core.Destroy.Core"(ptr %_.var), !dbg !42 +// CHECK:STDOUT: ret void, !dbg !43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CF.Base.Main.bdccbdc18ce76efa(ptr %self) #0 !dbg !44 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %_.var = alloca { {} }, align 8, !dbg !47 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !47 +// CHECK:STDOUT: call void @"_COp.47037bb76eb05287:core.Destroy.Core"(ptr %_.var), !dbg !47 +// CHECK:STDOUT: ret void, !dbg !48 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -706,19 +926,43 @@ fn Make() { // CHECK:STDOUT: !9 = !DILocation(line: 16, column: 21, scope: !4) // CHECK:STDOUT: !10 = !DILocation(line: 17, column: 21, scope: !4) // CHECK:STDOUT: !11 = !DILocation(line: 15, column: 1, scope: !4) -// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "F", linkageName: "_CF.Base.Main.0a7c28d4c8b7893d", scope: null, file: !3, line: 5, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !16) +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b8216ad694fdad1d:core.Destroy.Core", scope: null, file: !3, line: 16, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !16) // CHECK:STDOUT: !13 = !DISubroutineType(types: !14) // CHECK:STDOUT: !14 = !{null, !15} // CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !16 = !{!17} // CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15) -// CHECK:STDOUT: !18 = !DILocation(line: 6, column: 5, scope: !12) -// CHECK:STDOUT: !19 = !DILocation(line: 5, column: 3, scope: !12) -// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "F", linkageName: "_CF.Base.Main.bdccbdc18ce76efa", scope: null, file: !3, line: 5, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !21) -// CHECK:STDOUT: !21 = !{!22} -// CHECK:STDOUT: !22 = !DILocalVariable(arg: 1, scope: !20, type: !15) -// CHECK:STDOUT: !23 = !DILocation(line: 6, column: 5, scope: !20) -// CHECK:STDOUT: !24 = !DILocation(line: 5, column: 3, scope: !20) +// CHECK:STDOUT: !18 = !DILocation(line: 16, column: 10, scope: !12) +// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a65450da9a7ba013:core.Destroy.Core", scope: null, file: !3, line: 17, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !20) +// CHECK:STDOUT: !20 = !{!21} +// CHECK:STDOUT: !21 = !DILocalVariable(arg: 1, scope: !19, type: !15) +// CHECK:STDOUT: !22 = !DILocation(line: 17, column: 10, scope: !19) +// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "Op", linkageName: "_COp.47037bb76eb05287:core.Destroy.Core", scope: null, file: !3, line: 17, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !24) +// CHECK:STDOUT: !24 = !{!25} +// CHECK:STDOUT: !25 = !DILocalVariable(arg: 1, scope: !23, type: !15) +// CHECK:STDOUT: !26 = !DILocation(line: 17, column: 10, scope: !23) +// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a8f528cd70a29ff8:core.Destroy.Core", scope: null, file: !3, line: 17, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !28) +// CHECK:STDOUT: !28 = !{!29} +// CHECK:STDOUT: !29 = !DILocalVariable(arg: 1, scope: !27, type: !15) +// CHECK:STDOUT: !30 = !DILocation(line: 17, column: 3, scope: !27) +// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "Op", linkageName: "_COp.98cef783bfe00900:core.Destroy.Core", scope: null, file: !3, line: 17, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !32) +// CHECK:STDOUT: !32 = !{!33} +// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !31, type: !15) +// CHECK:STDOUT: !34 = !DILocation(line: 17, column: 3, scope: !31) +// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "Op", linkageName: "_COp.4cabc7f3a3e0371f:core.Destroy.Core", scope: null, file: !3, line: 16, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !36) +// CHECK:STDOUT: !36 = !{!37} +// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !35, type: !15) +// CHECK:STDOUT: !38 = !DILocation(line: 16, column: 3, scope: !35) +// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "F", linkageName: "_CF.Base.Main.0a7c28d4c8b7893d", scope: null, file: !3, line: 5, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !40) +// CHECK:STDOUT: !40 = !{!41} +// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !39, type: !15) +// CHECK:STDOUT: !42 = !DILocation(line: 6, column: 5, scope: !39) +// CHECK:STDOUT: !43 = !DILocation(line: 5, column: 3, scope: !39) +// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "F", linkageName: "_CF.Base.Main.bdccbdc18ce76efa", scope: null, file: !3, line: 5, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !45) +// CHECK:STDOUT: !45 = !{!46} +// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !44, type: !15) +// CHECK:STDOUT: !47 = !DILocation(line: 6, column: 5, scope: !44) +// CHECK:STDOUT: !48 = !DILocation(line: 5, column: 3, scope: !44) // CHECK:STDOUT: ; ModuleID = 'generic_base.carbon' // CHECK:STDOUT: source_filename = "generic_base.carbon" // CHECK:STDOUT: @@ -729,15 +973,40 @@ fn Make() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %_.var = alloca { { ptr } }, align 8, !dbg !7 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !7 +// CHECK:STDOUT: call void @"_COp.12e0d0434542305a:core.Destroy.Core"(ptr %_.var), !dbg !7 // CHECK:STDOUT: ret void, !dbg !8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Base.Main.c914672a22d4cb10(ptr %self) #0 !dbg !9 { +// CHECK:STDOUT: define weak_odr void @"_COp.a8f528cd70a29ff8:core.Destroy.Core"(ptr %self) #0 !dbg !9 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !15 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.8ac3c4c0cf7cf991:core.Destroy.Core"(ptr %self) #0 !dbg !16 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.16489017edc6364e:core.Destroy.Core"(ptr %self) #0 !dbg !20 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !23 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.12e0d0434542305a:core.Destroy.Core"(ptr %self) #0 !dbg !24 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !27 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CF.Base.Main.c914672a22d4cb10(ptr %self) #0 !dbg !28 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !31 +// 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: @@ -756,10 +1025,26 @@ fn Make() { // CHECK:STDOUT: !6 = !{null} // CHECK:STDOUT: !7 = !DILocation(line: 15, column: 3, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 14, column: 1, scope: !4) -// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "F", linkageName: "_CF.Base.Main.c914672a22d4cb10", scope: null, file: !3, line: 5, type: !10, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !13) +// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a8f528cd70a29ff8:core.Destroy.Core", scope: null, file: !3, line: 15, type: !10, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !13) // CHECK:STDOUT: !10 = !DISubroutineType(types: !11) // CHECK:STDOUT: !11 = !{null, !12} // CHECK:STDOUT: !12 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !13 = !{!14} // CHECK:STDOUT: !14 = !DILocalVariable(arg: 1, scope: !9, type: !12) -// CHECK:STDOUT: !15 = !DILocation(line: 5, column: 3, scope: !9) +// CHECK:STDOUT: !15 = !DILocation(line: 15, column: 3, scope: !9) +// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8ac3c4c0cf7cf991:core.Destroy.Core", scope: null, file: !3, line: 15, type: !10, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !17) +// CHECK:STDOUT: !17 = !{!18} +// CHECK:STDOUT: !18 = !DILocalVariable(arg: 1, scope: !16, type: !12) +// CHECK:STDOUT: !19 = !DILocation(line: 15, column: 3, scope: !16) +// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "Op", linkageName: "_COp.16489017edc6364e:core.Destroy.Core", scope: null, file: !3, line: 15, type: !10, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !21) +// CHECK:STDOUT: !21 = !{!22} +// CHECK:STDOUT: !22 = !DILocalVariable(arg: 1, scope: !20, type: !12) +// CHECK:STDOUT: !23 = !DILocation(line: 15, column: 3, scope: !20) +// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "Op", linkageName: "_COp.12e0d0434542305a:core.Destroy.Core", scope: null, file: !3, line: 15, type: !10, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !25) +// CHECK:STDOUT: !25 = !{!26} +// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !24, type: !12) +// CHECK:STDOUT: !27 = !DILocation(line: 15, column: 3, scope: !24) +// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "F", linkageName: "_CF.Base.Main.c914672a22d4cb10", scope: null, file: !3, line: 5, type: !10, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !29) +// CHECK:STDOUT: !29 = !{!30} +// CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !28, type: !12) +// CHECK:STDOUT: !31 = !DILocation(line: 5, column: 3, scope: !28) diff --git a/toolchain/lower/testdata/for/bindings.carbon b/toolchain/lower/testdata/for/bindings.carbon index ffdc60649d44..10141c4b2680 100644 --- a/toolchain/lower/testdata/for/bindings.carbon +++ b/toolchain/lower/testdata/for/bindings.carbon @@ -71,9 +71,55 @@ fn For() { // CHECK:STDOUT: br label %for.next, !dbg !11 // CHECK:STDOUT: // CHECK:STDOUT: for.done: ; preds = %for.next +// CHECK:STDOUT: call void @"_COp.8e354c83fe88ab86:core.Destroy.Core"(ptr %.loc29_33.8.temp), !dbg !8 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %n.var), !dbg !9 +// CHECK:STDOUT: call void @"_COp.9a6e0f157f6aaaf4:core.Destroy.Core"(ptr %.loc29_33.1.temp), !dbg !8 +// CHECK:STDOUT: call void @"_COp.a27a6de502cec337:core.Destroy.Core"(ptr %r.var), !dbg !7 // CHECK:STDOUT: ret void, !dbg !12 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !13 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.8e354c83fe88ab86:core.Destroy.Core"(ptr %self) #0 !dbg !20 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !26 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.eba7b12fbfc5bcf2:core.Destroy.Core"(ptr %self) #0 !dbg !27 { +// 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.d0e333d8efe6ef1d:core.Destroy.Core"(ptr %self) #0 !dbg !31 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !34 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.27527d1de6170640:core.Destroy.Core"(ptr %self) #0 !dbg !35 { +// 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.9a6e0f157f6aaaf4:core.Destroy.Core"(ptr %self) #0 !dbg !39 { +// 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.a27a6de502cec337:core.Destroy.Core"(ptr %self) #0 !dbg !43 { +// CHECK:STDOUT: entry: +// 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: @@ -81,69 +127,69 @@ fn For() { // CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CNewCursor.EmptyRange.1ccc388edee5a786.Main:Iterate.Core.8d745d19e7d6c4bd"(ptr %self) #0 !dbg !13 { +// CHECK:STDOUT: define linkonce_odr void @"_CNewCursor.EmptyRange.1ccc388edee5a786.Main:Iterate.Core.8d745d19e7d6c4bd"(ptr %self) #0 !dbg !47 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !19 +// CHECK:STDOUT: ret void, !dbg !50 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CNext.EmptyRange.1ccc388edee5a786.Main:Iterate.Core.8d745d19e7d6c4bd"(ptr sret({ { i32, i32 }, i1 }) %return, ptr %self, ptr %_) #0 !dbg !20 { +// CHECK:STDOUT: define linkonce_odr void @"_CNext.EmptyRange.1ccc388edee5a786.Main:Iterate.Core.8d745d19e7d6c4bd"(ptr sret({ { i32, i32 }, i1 }) %return, ptr %self, ptr %_) #0 !dbg !51 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CNone.Optional.Core.6b64456bb8003a40(ptr %return), !dbg !26 -// CHECK:STDOUT: ret void, !dbg !27 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.6b64456bb8003a40(ptr %self) #0 !dbg !28 { -// CHECK:STDOUT: %1 = call i1 @"_CHas.3e8267224c5dc9c2:OptionalStorage.Core.8d745d19e7d6c4bd"(ptr %self), !dbg !34 -// CHECK:STDOUT: ret i1 %1, !dbg !35 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CGet.Optional.Core.6b64456bb8003a40(ptr sret({ i32, i32 }) %return, ptr %self) #0 !dbg !36 { -// CHECK:STDOUT: call void @"_CGet.3e8267224c5dc9c2:OptionalStorage.Core.8d745d19e7d6c4bd"(ptr %return, ptr %self), !dbg !39 -// CHECK:STDOUT: ret void, !dbg !40 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.6b64456bb8003a40(ptr sret({ { i32, i32 }, i1 }) %return) #0 !dbg !41 { -// CHECK:STDOUT: call void @"_CNone.3e8267224c5dc9c2:OptionalStorage.Core.8d745d19e7d6c4bd"(ptr %return), !dbg !44 -// CHECK:STDOUT: ret void, !dbg !45 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.3e8267224c5dc9c2:OptionalStorage.Core.8d745d19e7d6c4bd"(ptr %value) #0 !dbg !46 { -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { { i32, i32 }, i1 }, ptr %value, i32 0, i32 1, !dbg !49 -// CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !49 -// CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !49 -// CHECK:STDOUT: ret i1 %2, !dbg !50 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CGet.3e8267224c5dc9c2:OptionalStorage.Core.8d745d19e7d6c4bd"(ptr sret({ i32, i32 }) %return, ptr %value) #0 !dbg !51 { -// CHECK:STDOUT: %value1 = getelementptr inbounds nuw { { i32, i32 }, i1 }, ptr %value, i32 0, i32 0, !dbg !54 -// CHECK:STDOUT: call void @"_COp.e4daa70d026fdea2:Copy.Core.3e36085cb869f630"(ptr %return, ptr %value1), !dbg !54 -// CHECK:STDOUT: ret void, !dbg !55 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CNone.3e8267224c5dc9c2:OptionalStorage.Core.8d745d19e7d6c4bd"(ptr sret({ { i32, i32 }, i1 }) %return) #0 !dbg !56 { -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { { i32, i32 }, i1 }, ptr %return, i32 0, i32 1, !dbg !57 -// CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !57 +// CHECK:STDOUT: call void @_CNone.Optional.Core.6b64456bb8003a40(ptr %return), !dbg !57 // CHECK:STDOUT: ret void, !dbg !58 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp.e4daa70d026fdea2:Copy.Core.3e36085cb869f630"(ptr sret({ i32, i32 }) %return, ptr %self) #0 !dbg !59 { -// CHECK:STDOUT: %tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 0, !dbg !63 -// CHECK:STDOUT: %tuple.elem.load = load i32, ptr %tuple.elem, align 4, !dbg !63 -// CHECK:STDOUT: %tuple.elem1 = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0, !dbg !64 -// CHECK:STDOUT: %tuple.elem2 = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !65 -// CHECK:STDOUT: %tuple.elem.load3 = load i32, ptr %tuple.elem2, align 4, !dbg !65 -// CHECK:STDOUT: %tuple.elem4 = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !64 -// CHECK:STDOUT: store i32 %tuple.elem.load, ptr %tuple.elem1, align 4, !dbg !64 -// CHECK:STDOUT: store i32 %tuple.elem.load3, ptr %tuple.elem4, align 4, !dbg !64 -// CHECK:STDOUT: ret void, !dbg !66 +// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.6b64456bb8003a40(ptr %self) #0 !dbg !59 { +// CHECK:STDOUT: %1 = call i1 @"_CHas.3e8267224c5dc9c2:OptionalStorage.Core.8d745d19e7d6c4bd"(ptr %self), !dbg !65 +// CHECK:STDOUT: ret i1 %1, !dbg !66 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CGet.Optional.Core.6b64456bb8003a40(ptr sret({ i32, i32 }) %return, ptr %self) #0 !dbg !67 { +// CHECK:STDOUT: call void @"_CGet.3e8267224c5dc9c2:OptionalStorage.Core.8d745d19e7d6c4bd"(ptr %return, ptr %self), !dbg !70 +// CHECK:STDOUT: ret void, !dbg !71 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.6b64456bb8003a40(ptr sret({ { i32, i32 }, i1 }) %return) #0 !dbg !72 { +// CHECK:STDOUT: call void @"_CNone.3e8267224c5dc9c2:OptionalStorage.Core.8d745d19e7d6c4bd"(ptr %return), !dbg !75 +// CHECK:STDOUT: ret void, !dbg !76 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.3e8267224c5dc9c2:OptionalStorage.Core.8d745d19e7d6c4bd"(ptr %value) #0 !dbg !77 { +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { { i32, i32 }, i1 }, ptr %value, i32 0, i32 1, !dbg !80 +// CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !80 +// CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !80 +// CHECK:STDOUT: ret i1 %2, !dbg !81 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @"_CGet.3e8267224c5dc9c2:OptionalStorage.Core.8d745d19e7d6c4bd"(ptr sret({ i32, i32 }) %return, ptr %value) #0 !dbg !82 { +// CHECK:STDOUT: %value1 = getelementptr inbounds nuw { { i32, i32 }, i1 }, ptr %value, i32 0, i32 0, !dbg !85 +// CHECK:STDOUT: call void @"_COp.e4daa70d026fdea2:Copy.Core.3e36085cb869f630"(ptr %return, ptr %value1), !dbg !85 +// CHECK:STDOUT: ret void, !dbg !86 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @"_CNone.3e8267224c5dc9c2:OptionalStorage.Core.8d745d19e7d6c4bd"(ptr sret({ { i32, i32 }, i1 }) %return) #0 !dbg !87 { +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { { i32, i32 }, i1 }, ptr %return, i32 0, i32 1, !dbg !88 +// CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !88 +// CHECK:STDOUT: ret void, !dbg !89 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @"_COp.e4daa70d026fdea2:Copy.Core.3e36085cb869f630"(ptr sret({ i32, i32 }) %return, ptr %self) #0 !dbg !90 { +// CHECK:STDOUT: %tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 0, !dbg !94 +// CHECK:STDOUT: %tuple.elem.load = load i32, ptr %tuple.elem, align 4, !dbg !94 +// CHECK:STDOUT: %tuple.elem1 = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0, !dbg !95 +// CHECK:STDOUT: %tuple.elem2 = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !96 +// CHECK:STDOUT: %tuple.elem.load3 = load i32, ptr %tuple.elem2, align 4, !dbg !96 +// CHECK:STDOUT: %tuple.elem4 = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !95 +// CHECK:STDOUT: store i32 %tuple.elem.load, ptr %tuple.elem1, align 4, !dbg !95 +// CHECK:STDOUT: store i32 %tuple.elem.load3, ptr %tuple.elem4, align 4, !dbg !95 +// CHECK:STDOUT: ret void, !dbg !97 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -169,57 +215,88 @@ fn For() { // CHECK:STDOUT: !10 = !DILocation(line: 30, column: 5, scope: !4) // CHECK:STDOUT: !11 = !DILocation(line: 29, column: 3, scope: !4) // CHECK:STDOUT: !12 = !DILocation(line: 26, column: 1, scope: !4) -// CHECK:STDOUT: !13 = distinct !DISubprogram(name: "NewCursor", linkageName: "_CNewCursor.EmptyRange.1ccc388edee5a786.Main:Iterate.Core.8d745d19e7d6c4bd", scope: null, file: !3, line: 15, type: !14, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !17) +// CHECK:STDOUT: !13 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 27, type: !14, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !17) // CHECK:STDOUT: !14 = !DISubroutineType(types: !15) // CHECK:STDOUT: !15 = !{null, !16} -// CHECK:STDOUT: !16 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !16 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) // CHECK:STDOUT: !17 = !{!18} // CHECK:STDOUT: !18 = !DILocalVariable(arg: 1, scope: !13, type: !16) -// CHECK:STDOUT: !19 = !DILocation(line: 16, column: 7, scope: !13) -// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.EmptyRange.1ccc388edee5a786.Main:Iterate.Core.8d745d19e7d6c4bd", scope: null, file: !3, line: 18, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !23) +// CHECK:STDOUT: !19 = !DILocation(line: 27, column: 10, scope: !13) +// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8e354c83fe88ab86:core.Destroy.Core", scope: null, file: !3, line: 27, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !24) // CHECK:STDOUT: !21 = !DISubroutineType(types: !22) -// CHECK:STDOUT: !22 = !{!16, !16, !16} -// CHECK:STDOUT: !23 = !{!24, !25} -// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !20, type: !16) -// CHECK:STDOUT: !25 = !DILocalVariable(arg: 2, scope: !20, type: !16) -// CHECK:STDOUT: !26 = !DILocation(line: 19, column: 14, scope: !20) -// CHECK:STDOUT: !27 = !DILocation(line: 19, column: 7, scope: !20) -// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.6b64456bb8003a40", scope: null, file: !29, line: 33, type: !30, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !32) -// CHECK:STDOUT: !29 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !30 = !DISubroutineType(types: !31) -// CHECK:STDOUT: !31 = !{!16, !16} +// CHECK:STDOUT: !22 = !{null, !23} +// CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !24 = !{!25} +// CHECK:STDOUT: !25 = !DILocalVariable(arg: 1, scope: !20, type: !23) +// CHECK:STDOUT: !26 = !DILocation(line: 27, column: 10, scope: !20) +// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "Op", linkageName: "_COp.eba7b12fbfc5bcf2:core.Destroy.Core", scope: null, file: !3, line: 29, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !28) +// CHECK:STDOUT: !28 = !{!29} +// CHECK:STDOUT: !29 = !DILocalVariable(arg: 1, scope: !27, type: !23) +// CHECK:STDOUT: !30 = !DILocation(line: 29, column: 7, scope: !27) +// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d0e333d8efe6ef1d:core.Destroy.Core", scope: null, file: !3, line: 29, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !32) // CHECK:STDOUT: !32 = !{!33} -// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !28, type: !16) -// CHECK:STDOUT: !34 = !DILocation(line: 34, column: 12, scope: !28) -// CHECK:STDOUT: !35 = !DILocation(line: 34, column: 5, scope: !28) -// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.6b64456bb8003a40", scope: null, file: !29, line: 36, type: !30, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !37) -// CHECK:STDOUT: !37 = !{!38} -// CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !36, type: !16) -// CHECK:STDOUT: !39 = !DILocation(line: 37, column: 12, scope: !36) -// CHECK:STDOUT: !40 = !DILocation(line: 37, column: 5, scope: !36) -// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.6b64456bb8003a40", scope: null, file: !29, line: 27, type: !42, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !42 = !DISubroutineType(types: !43) -// CHECK:STDOUT: !43 = !{!16} -// CHECK:STDOUT: !44 = !DILocation(line: 28, column: 12, scope: !41) -// CHECK:STDOUT: !45 = !DILocation(line: 28, column: 5, scope: !41) -// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.3e8267224c5dc9c2:OptionalStorage.Core.8d745d19e7d6c4bd", scope: null, file: !29, line: 132, type: !30, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !47) -// CHECK:STDOUT: !47 = !{!48} -// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !46, type: !16) -// CHECK:STDOUT: !49 = !DILocation(line: 133, column: 12, scope: !46) -// CHECK:STDOUT: !50 = !DILocation(line: 133, column: 5, scope: !46) -// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.3e8267224c5dc9c2:OptionalStorage.Core.8d745d19e7d6c4bd", scope: null, file: !29, line: 135, type: !30, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !52) -// CHECK:STDOUT: !52 = !{!53} -// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !51, type: !16) -// CHECK:STDOUT: !54 = !DILocation(line: 136, column: 12, scope: !51) -// CHECK:STDOUT: !55 = !DILocation(line: 136, column: 5, scope: !51) -// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "None", linkageName: "_CNone.3e8267224c5dc9c2:OptionalStorage.Core.8d745d19e7d6c4bd", scope: null, file: !29, line: 116, type: !42, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !57 = !DILocation(line: 119, column: 5, scope: !56) -// CHECK:STDOUT: !58 = !DILocation(line: 120, column: 5, scope: !56) -// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "Op", linkageName: "_COp.e4daa70d026fdea2:Copy.Core.3e36085cb869f630", scope: null, file: !60, line: 58, type: !30, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !61) -// CHECK:STDOUT: !60 = !DIFile(filename: "{{.*}}/prelude/copy.carbon", directory: "") -// CHECK:STDOUT: !61 = !{!62} -// CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !59, type: !16) -// CHECK:STDOUT: !63 = !DILocation(line: 59, column: 13, scope: !59) -// CHECK:STDOUT: !64 = !DILocation(line: 59, column: 12, scope: !59) -// CHECK:STDOUT: !65 = !DILocation(line: 59, column: 26, scope: !59) -// CHECK:STDOUT: !66 = !DILocation(line: 59, column: 5, scope: !59) +// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !31, type: !23) +// CHECK:STDOUT: !34 = !DILocation(line: 29, column: 7, scope: !31) +// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "Op", linkageName: "_COp.27527d1de6170640:core.Destroy.Core", scope: null, file: !3, line: 29, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !36) +// CHECK:STDOUT: !36 = !{!37} +// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !35, type: !23) +// CHECK:STDOUT: !38 = !DILocation(line: 29, column: 7, scope: !35) +// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "Op", linkageName: "_COp.9a6e0f157f6aaaf4:core.Destroy.Core", scope: null, file: !3, line: 29, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !40) +// CHECK:STDOUT: !40 = !{!41} +// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !39, type: !23) +// CHECK:STDOUT: !42 = !DILocation(line: 29, column: 7, scope: !39) +// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a27a6de502cec337:core.Destroy.Core", scope: null, file: !3, line: 27, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !44) +// CHECK:STDOUT: !44 = !{!45} +// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !43, type: !23) +// CHECK:STDOUT: !46 = !DILocation(line: 27, column: 3, scope: !43) +// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "NewCursor", linkageName: "_CNewCursor.EmptyRange.1ccc388edee5a786.Main:Iterate.Core.8d745d19e7d6c4bd", scope: null, file: !3, line: 15, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !48) +// CHECK:STDOUT: !48 = !{!49} +// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !47, type: !23) +// CHECK:STDOUT: !50 = !DILocation(line: 16, column: 7, scope: !47) +// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.EmptyRange.1ccc388edee5a786.Main:Iterate.Core.8d745d19e7d6c4bd", scope: null, file: !3, line: 18, type: !52, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !54) +// CHECK:STDOUT: !52 = !DISubroutineType(types: !53) +// CHECK:STDOUT: !53 = !{!23, !23, !23} +// CHECK:STDOUT: !54 = !{!55, !56} +// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !51, type: !23) +// CHECK:STDOUT: !56 = !DILocalVariable(arg: 2, scope: !51, type: !23) +// CHECK:STDOUT: !57 = !DILocation(line: 19, column: 14, scope: !51) +// CHECK:STDOUT: !58 = !DILocation(line: 19, column: 7, scope: !51) +// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.6b64456bb8003a40", scope: null, file: !60, line: 33, type: !61, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !63) +// CHECK:STDOUT: !60 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !61 = !DISubroutineType(types: !62) +// CHECK:STDOUT: !62 = !{!23, !23} +// CHECK:STDOUT: !63 = !{!64} +// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !59, type: !23) +// CHECK:STDOUT: !65 = !DILocation(line: 34, column: 12, scope: !59) +// CHECK:STDOUT: !66 = !DILocation(line: 34, column: 5, scope: !59) +// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.6b64456bb8003a40", scope: null, file: !60, line: 36, type: !61, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !68) +// CHECK:STDOUT: !68 = !{!69} +// CHECK:STDOUT: !69 = !DILocalVariable(arg: 1, scope: !67, type: !23) +// CHECK:STDOUT: !70 = !DILocation(line: 37, column: 12, scope: !67) +// CHECK:STDOUT: !71 = !DILocation(line: 37, column: 5, scope: !67) +// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.6b64456bb8003a40", scope: null, file: !60, line: 27, type: !73, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !73 = !DISubroutineType(types: !74) +// CHECK:STDOUT: !74 = !{!23} +// CHECK:STDOUT: !75 = !DILocation(line: 28, column: 12, scope: !72) +// CHECK:STDOUT: !76 = !DILocation(line: 28, column: 5, scope: !72) +// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.3e8267224c5dc9c2:OptionalStorage.Core.8d745d19e7d6c4bd", scope: null, file: !60, line: 132, type: !61, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !78) +// CHECK:STDOUT: !78 = !{!79} +// CHECK:STDOUT: !79 = !DILocalVariable(arg: 1, scope: !77, type: !23) +// CHECK:STDOUT: !80 = !DILocation(line: 133, column: 12, scope: !77) +// CHECK:STDOUT: !81 = !DILocation(line: 133, column: 5, scope: !77) +// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.3e8267224c5dc9c2:OptionalStorage.Core.8d745d19e7d6c4bd", scope: null, file: !60, line: 135, type: !61, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !83) +// CHECK:STDOUT: !83 = !{!84} +// CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !82, type: !23) +// CHECK:STDOUT: !85 = !DILocation(line: 136, column: 12, scope: !82) +// CHECK:STDOUT: !86 = !DILocation(line: 136, column: 5, scope: !82) +// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "None", linkageName: "_CNone.3e8267224c5dc9c2:OptionalStorage.Core.8d745d19e7d6c4bd", scope: null, file: !60, line: 116, type: !73, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !88 = !DILocation(line: 119, column: 5, scope: !87) +// CHECK:STDOUT: !89 = !DILocation(line: 120, column: 5, scope: !87) +// CHECK:STDOUT: !90 = distinct !DISubprogram(name: "Op", linkageName: "_COp.e4daa70d026fdea2:Copy.Core.3e36085cb869f630", scope: null, file: !91, line: 58, type: !61, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !92) +// CHECK:STDOUT: !91 = !DIFile(filename: "{{.*}}/prelude/copy.carbon", directory: "") +// CHECK:STDOUT: !92 = !{!93} +// CHECK:STDOUT: !93 = !DILocalVariable(arg: 1, scope: !90, type: !23) +// CHECK:STDOUT: !94 = !DILocation(line: 59, column: 13, scope: !90) +// CHECK:STDOUT: !95 = !DILocation(line: 59, column: 12, scope: !90) +// CHECK:STDOUT: !96 = !DILocation(line: 59, column: 26, scope: !90) +// CHECK:STDOUT: !97 = !DILocation(line: 59, column: 5, scope: !90) diff --git a/toolchain/lower/testdata/for/break_continue.carbon b/toolchain/lower/testdata/for/break_continue.carbon index 2c2293eb5e04..8c16f03fd956 100644 --- a/toolchain/lower/testdata/for/break_continue.carbon +++ b/toolchain/lower/testdata/for/break_continue.carbon @@ -72,125 +72,172 @@ fn For() { // CHECK:STDOUT: br label %for.next, !dbg !16 // CHECK:STDOUT: // CHECK:STDOUT: for.done: ; preds = %if.then.loc21, %for.next +// CHECK:STDOUT: call void @"_COp.fed90f94367ce0d0:core.Destroy.Core"(ptr %.loc20_33.1.temp), !dbg !8 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %var), !dbg !8 +// CHECK:STDOUT: call void @"_COp.4f0cde2dfabc7dc4:core.Destroy.Core"(ptr %.loc20_32.1.temp), !dbg !7 // CHECK:STDOUT: ret void, !dbg !17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CRange.Core(ptr sret({ i32, i32 }), i32) // 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 !18 { -// CHECK:STDOUT: %start = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 0, !dbg !26 -// CHECK:STDOUT: %1 = load i32, ptr %start, align 4, !dbg !26 -// CHECK:STDOUT: ret i32 %1, !dbg !27 +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !18 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !25 // 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 !28 { -// CHECK:STDOUT: %1 = alloca i32, align 4, !dbg !34 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !34 -// CHECK:STDOUT: %2 = load i32, ptr %cursor, align 4, !dbg !35 -// CHECK:STDOUT: store i32 %2, ptr %1, align 4, !dbg !34 -// CHECK:STDOUT: %end = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !36 -// CHECK:STDOUT: %3 = load i32, ptr %end, align 4, !dbg !36 -// CHECK:STDOUT: %4 = load i32, ptr %1, align 4, !dbg !37 -// CHECK:STDOUT: %5 = icmp slt i32 %4, %3, !dbg !37 -// CHECK:STDOUT: br i1 %5, label %6, label %8, !dbg !38 +// CHECK:STDOUT: define weak_odr void @"_COp.b9f59d4d0f116c67:core.Destroy.Core"(ptr %self) #0 !dbg !26 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !29 +// CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: 6: ; preds = %0 -// CHECK:STDOUT: call void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %cursor), !dbg !39 -// CHECK:STDOUT: %7 = load i32, ptr %1, align 4, !dbg !40 -// CHECK:STDOUT: call void @_CSome.Optional.Core.a0986cb4211ec3fb(ptr %return, i32 %7), !dbg !41 -// CHECK:STDOUT: ret void, !dbg !42 +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.59d039ff34f2fb65:core.Destroy.Core"(ptr %self) #0 !dbg !30 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !36 +// CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: 8: ; preds = %0 -// CHECK:STDOUT: call void @_CNone.Optional.Core.a0986cb4211ec3fb(ptr %return), !dbg !43 +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.63778fe3d7a17e90:core.Destroy.Core"(ptr %self) #0 !dbg !37 { +// 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.fed90f94367ce0d0:core.Destroy.Core"(ptr %self) #0 !dbg !41 { +// CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !44 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.a0986cb4211ec3fb(ptr %self) #0 !dbg !45 { -// CHECK:STDOUT: %1 = call i1 @"_CHas.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5"(ptr %self), !dbg !51 -// CHECK:STDOUT: ret i1 %1, !dbg !52 +// CHECK:STDOUT: define weak_odr void @"_COp.b7795080e9163697:core.Destroy.Core"(ptr %self) #0 !dbg !45 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !48 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CGet.Optional.Core.a0986cb4211ec3fb(ptr %self) #0 !dbg !53 { -// CHECK:STDOUT: %1 = call i32 @"_CGet.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5"(ptr %self), !dbg !56 -// CHECK:STDOUT: ret i32 %1, !dbg !57 +// CHECK:STDOUT: define weak_odr void @"_COp.4f0cde2dfabc7dc4:core.Destroy.Core"(ptr %self) #0 !dbg !49 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !52 +// 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 !53 { +// CHECK:STDOUT: %start = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 0, !dbg !58 +// CHECK:STDOUT: %1 = load i32, ptr %start, align 4, !dbg !58 +// CHECK:STDOUT: ret i32 %1, !dbg !59 +// 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 !60 { +// CHECK:STDOUT: %1 = alloca i32, align 4, !dbg !66 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !66 +// CHECK:STDOUT: %2 = load i32, ptr %cursor, align 4, !dbg !67 +// CHECK:STDOUT: store i32 %2, ptr %1, align 4, !dbg !66 +// CHECK:STDOUT: %end = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !68 +// CHECK:STDOUT: %3 = load i32, ptr %end, align 4, !dbg !68 +// CHECK:STDOUT: %4 = load i32, ptr %1, align 4, !dbg !69 +// CHECK:STDOUT: %5 = icmp slt i32 %4, %3, !dbg !69 +// CHECK:STDOUT: br i1 %5, label %6, label %8, !dbg !70 +// CHECK:STDOUT: +// CHECK:STDOUT: 6: ; preds = %0 +// CHECK:STDOUT: call void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %cursor), !dbg !71 +// CHECK:STDOUT: %7 = load i32, ptr %1, align 4, !dbg !72 +// CHECK:STDOUT: call void @_CSome.Optional.Core.a0986cb4211ec3fb(ptr %return, i32 %7), !dbg !73 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %1), !dbg !66 +// CHECK:STDOUT: ret void, !dbg !74 +// CHECK:STDOUT: +// CHECK:STDOUT: 8: ; preds = %0 +// CHECK:STDOUT: call void @_CNone.Optional.Core.a0986cb4211ec3fb(ptr %return), !dbg !75 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %1), !dbg !66 +// CHECK:STDOUT: ret void, !dbg !76 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.a0986cb4211ec3fb(ptr %self) #0 !dbg !77 { +// CHECK:STDOUT: %1 = call i1 @"_CHas.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5"(ptr %self), !dbg !83 +// CHECK:STDOUT: ret i1 %1, !dbg !84 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr i32 @_CGet.Optional.Core.a0986cb4211ec3fb(ptr %self) #0 !dbg !85 { +// CHECK:STDOUT: %1 = call i32 @"_CGet.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5"(ptr %self), !dbg !88 +// CHECK:STDOUT: ret i32 %1, !dbg !89 // 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 !58 { -// CHECK:STDOUT: call void @"_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.5375cfcbca6d9e35.Core.57ee91777b6354a8"(ptr %self, i32 1), !dbg !64 -// CHECK:STDOUT: ret void, !dbg !65 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.a0986cb4211ec3fb(ptr sret({ i32, i1 }) %return, i32 %value) #0 !dbg !66 { -// CHECK:STDOUT: call void @"_CSome.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5"(ptr %return, i32 %value), !dbg !71 -// CHECK:STDOUT: ret void, !dbg !72 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.a0986cb4211ec3fb(ptr sret({ i32, i1 }) %return) #0 !dbg !73 { -// CHECK:STDOUT: call void @"_CNone.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5"(ptr %return), !dbg !76 -// CHECK:STDOUT: ret void, !dbg !77 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5"(ptr %value) #0 !dbg !78 { -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i32, i1 }, ptr %value, i32 0, i32 1, !dbg !81 -// CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !81 -// CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !81 -// CHECK:STDOUT: ret i1 %2, !dbg !82 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CGet.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5"(ptr %value) #0 !dbg !83 { -// CHECK:STDOUT: %value1 = getelementptr inbounds nuw { i32, i1 }, ptr %value, i32 0, i32 0, !dbg !86 -// CHECK:STDOUT: %1 = load i32, ptr %value1, align 4, !dbg !86 -// CHECK:STDOUT: ret i32 %1, !dbg !87 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.5375cfcbca6d9e35.Core.57ee91777b6354a8"(ptr %self, i32 %other) #2 !dbg !88 { -// CHECK:STDOUT: %1 = call i32 @"_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d"(i32 %other), !dbg !94 -// CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !95 -// CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !95 -// CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !95 +// CHECK:STDOUT: define linkonce_odr void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !90 { +// CHECK:STDOUT: call void @"_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.5375cfcbca6d9e35.Core.57ee91777b6354a8"(ptr %self, i32 1), !dbg !94 // CHECK:STDOUT: ret void, !dbg !95 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CSome.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5"(ptr sret({ i32, i1 }) %return, i32 %self) #0 !dbg !96 { -// CHECK:STDOUT: %value = getelementptr inbounds nuw { i32, i1 }, ptr %return, i32 0, i32 0, !dbg !99 -// CHECK:STDOUT: store i32 %self, ptr %value, align 4, !dbg !99 -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i32, i1 }, ptr %return, i32 0, i32 1, !dbg !100 -// CHECK:STDOUT: store i8 1, ptr %has_value, align 1, !dbg !100 -// CHECK:STDOUT: ret void, !dbg !101 +// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.a0986cb4211ec3fb(ptr sret({ i32, i1 }) %return, i32 %value) #0 !dbg !96 { +// CHECK:STDOUT: call void @"_CSome.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5"(ptr %return, i32 %value), !dbg !101 +// CHECK:STDOUT: ret void, !dbg !102 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CNone.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5"(ptr sret({ i32, i1 }) %return) #0 !dbg !102 { -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i32, i1 }, ptr %return, i32 0, i32 1, !dbg !103 -// CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !103 -// CHECK:STDOUT: ret void, !dbg !104 +// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.a0986cb4211ec3fb(ptr sret({ i32, i1 }) %return) #0 !dbg !103 { +// CHECK:STDOUT: call void @"_CNone.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5"(ptr %return), !dbg !106 +// CHECK:STDOUT: ret void, !dbg !107 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d"(i32 %self) #0 !dbg !105 { -// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !110 -// CHECK:STDOUT: ret i32 %1, !dbg !111 +// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5"(ptr %value) #0 !dbg !108 { +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i32, i1 }, ptr %value, i32 0, i32 1, !dbg !111 +// CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !111 +// CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !111 +// CHECK:STDOUT: ret i1 %2, !dbg !112 // 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 !112 { -// CHECK:STDOUT: ret i32 %self, !dbg !115 +// CHECK:STDOUT: define linkonce_odr i32 @"_CGet.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5"(ptr %value) #0 !dbg !113 { +// CHECK:STDOUT: %value1 = getelementptr inbounds nuw { i32, i1 }, ptr %value, i32 0, i32 0, !dbg !116 +// CHECK:STDOUT: %1 = load i32, ptr %value1, align 4, !dbg !116 +// CHECK:STDOUT: ret i32 %1, !dbg !117 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind +// CHECK:STDOUT: define linkonce_odr void @"_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.5375cfcbca6d9e35.Core.57ee91777b6354a8"(ptr %self, i32 %other) #2 !dbg !118 { +// CHECK:STDOUT: %1 = call i32 @"_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d"(i32 %other), !dbg !124 +// CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !125 +// CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !125 +// CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !125 +// CHECK:STDOUT: ret void, !dbg !125 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @"_CSome.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5"(ptr sret({ i32, i1 }) %return, i32 %self) #0 !dbg !126 { +// CHECK:STDOUT: %value = getelementptr inbounds nuw { i32, i1 }, ptr %return, i32 0, i32 0, !dbg !129 +// CHECK:STDOUT: store i32 %self, ptr %value, align 4, !dbg !129 +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i32, i1 }, ptr %return, i32 0, i32 1, !dbg !130 +// CHECK:STDOUT: store i8 1, ptr %has_value, align 1, !dbg !130 +// CHECK:STDOUT: ret void, !dbg !131 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @"_CNone.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5"(ptr sret({ i32, i1 }) %return) #0 !dbg !132 { +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { 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: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d"(i32 %self) #0 !dbg !135 { +// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !140 +// CHECK:STDOUT: ret i32 %1, !dbg !141 +// 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 !142 { +// CHECK:STDOUT: ret i32 %self, !dbg !145 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -221,101 +268,131 @@ fn For() { // CHECK:STDOUT: !15 = !DILocation(line: 23, column: 5, scope: !4) // CHECK:STDOUT: !16 = !DILocation(line: 20, column: 3, scope: !4) // CHECK:STDOUT: !17 = !DILocation(line: 19, column: 1, scope: !4) -// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "NewCursor", linkageName: "_CNewCursor.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8", scope: null, file: !19, line: 25, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !24) +// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !19, line: 24, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !23) // CHECK:STDOUT: !19 = !DIFile(filename: "{{.*}}/range.carbon", directory: "") // CHECK:STDOUT: !20 = !DISubroutineType(types: !21) -// CHECK:STDOUT: !21 = !{!22, !23} +// CHECK:STDOUT: !21 = !{null, !22} // CHECK:STDOUT: !22 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !24 = !{!25} -// CHECK:STDOUT: !25 = !DILocalVariable(arg: 1, scope: !18, type: !23) -// CHECK:STDOUT: !26 = !DILocation(line: 25, column: 51, scope: !18) -// CHECK:STDOUT: !27 = !DILocation(line: 25, column: 44, scope: !18) -// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8", scope: null, file: !19, line: 26, type: !29, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !31) -// CHECK:STDOUT: !29 = !DISubroutineType(types: !30) -// CHECK:STDOUT: !30 = !{!23, !23, !23} -// CHECK:STDOUT: !31 = !{!32, !33} -// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !28, type: !23) -// CHECK:STDOUT: !33 = !DILocalVariable(arg: 2, scope: !28, type: !23) -// CHECK:STDOUT: !34 = !DILocation(line: 27, column: 7, scope: !28) -// CHECK:STDOUT: !35 = !DILocation(line: 27, column: 27, scope: !28) -// CHECK:STDOUT: !36 = !DILocation(line: 28, column: 19, scope: !28) -// CHECK:STDOUT: !37 = !DILocation(line: 28, column: 11, scope: !28) -// CHECK:STDOUT: !38 = !DILocation(line: 28, column: 10, scope: !28) -// CHECK:STDOUT: !39 = !DILocation(line: 29, column: 9, scope: !28) -// CHECK:STDOUT: !40 = !DILocation(line: 30, column: 38, scope: !28) -// CHECK:STDOUT: !41 = !DILocation(line: 30, column: 16, scope: !28) -// CHECK:STDOUT: !42 = !DILocation(line: 30, column: 9, scope: !28) -// CHECK:STDOUT: !43 = !DILocation(line: 32, column: 16, scope: !28) -// CHECK:STDOUT: !44 = !DILocation(line: 32, column: 9, scope: !28) -// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.a0986cb4211ec3fb", scope: null, file: !46, line: 33, type: !47, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !49) -// CHECK:STDOUT: !46 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !47 = !DISubroutineType(types: !48) -// CHECK:STDOUT: !48 = !{!23, !23} -// CHECK:STDOUT: !49 = !{!50} -// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !45, type: !23) -// CHECK:STDOUT: !51 = !DILocation(line: 34, column: 12, scope: !45) -// CHECK:STDOUT: !52 = !DILocation(line: 34, column: 5, scope: !45) -// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.a0986cb4211ec3fb", scope: null, file: !46, line: 36, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !54) -// CHECK:STDOUT: !54 = !{!55} -// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !53, type: !23) -// CHECK:STDOUT: !56 = !DILocation(line: 37, column: 12, scope: !53) -// CHECK:STDOUT: !57 = !DILocation(line: 37, column: 5, scope: !53) -// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !59, line: 363, type: !60, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !62) -// CHECK:STDOUT: !59 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") -// CHECK:STDOUT: !60 = !DISubroutineType(types: !61) -// CHECK:STDOUT: !61 = !{null, !22} -// CHECK:STDOUT: !62 = !{!63} -// CHECK:STDOUT: !63 = !DILocalVariable(arg: 1, scope: !58, type: !22) -// CHECK:STDOUT: !64 = !DILocation(line: 365, column: 5, scope: !58) -// CHECK:STDOUT: !65 = !DILocation(line: 363, column: 3, scope: !58) -// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.a0986cb4211ec3fb", scope: null, file: !46, line: 30, type: !67, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !69) -// CHECK:STDOUT: !67 = !DISubroutineType(types: !68) -// CHECK:STDOUT: !68 = !{!23, !22} -// CHECK:STDOUT: !69 = !{!70} -// CHECK:STDOUT: !70 = !DILocalVariable(arg: 1, scope: !66, type: !22) -// CHECK:STDOUT: !71 = !DILocation(line: 31, column: 12, scope: !66) -// CHECK:STDOUT: !72 = !DILocation(line: 31, column: 5, scope: !66) -// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.a0986cb4211ec3fb", scope: null, file: !46, line: 27, type: !74, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !74 = !DISubroutineType(types: !75) -// CHECK:STDOUT: !75 = !{!23} -// CHECK:STDOUT: !76 = !DILocation(line: 28, column: 12, scope: !73) -// CHECK:STDOUT: !77 = !DILocation(line: 28, column: 5, scope: !73) -// CHECK:STDOUT: !78 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5", scope: null, file: !46, line: 132, type: !47, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !79) -// CHECK:STDOUT: !79 = !{!80} -// CHECK:STDOUT: !80 = !DILocalVariable(arg: 1, scope: !78, type: !23) -// CHECK:STDOUT: !81 = !DILocation(line: 133, column: 12, scope: !78) -// CHECK:STDOUT: !82 = !DILocation(line: 133, column: 5, scope: !78) -// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5", scope: null, file: !46, line: 135, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !84) -// CHECK:STDOUT: !84 = !{!85} -// CHECK:STDOUT: !85 = !DILocalVariable(arg: 1, scope: !83, type: !23) -// CHECK:STDOUT: !86 = !DILocation(line: 136, column: 12, scope: !83) -// CHECK:STDOUT: !87 = !DILocation(line: 136, column: 5, scope: !83) -// CHECK:STDOUT: !88 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.5375cfcbca6d9e35.Core.57ee91777b6354a8", scope: null, file: !59, line: 299, type: !89, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !91) -// CHECK:STDOUT: !89 = !DISubroutineType(types: !90) -// CHECK:STDOUT: !90 = !{null, !22, !22} -// CHECK:STDOUT: !91 = !{!92, !93} -// CHECK:STDOUT: !92 = !DILocalVariable(arg: 1, scope: !88, type: !22) -// CHECK:STDOUT: !93 = !DILocalVariable(arg: 2, scope: !88, type: !22) -// CHECK:STDOUT: !94 = !DILocation(line: 4294967295, scope: !88) -// CHECK:STDOUT: !95 = !DILocation(line: 299, column: 3, scope: !88) -// CHECK:STDOUT: !96 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5", scope: null, file: !46, line: 122, type: !67, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !97) -// CHECK:STDOUT: !97 = !{!98} -// CHECK:STDOUT: !98 = !DILocalVariable(arg: 1, scope: !96, type: !22) -// CHECK:STDOUT: !99 = !DILocation(line: 128, column: 5, scope: !96) -// CHECK:STDOUT: !100 = !DILocation(line: 129, column: 5, scope: !96) -// CHECK:STDOUT: !101 = !DILocation(line: 130, column: 5, scope: !96) -// CHECK:STDOUT: !102 = distinct !DISubprogram(name: "None", linkageName: "_CNone.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5", scope: null, file: !46, line: 116, type: !74, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !103 = !DILocation(line: 119, column: 5, scope: !102) -// CHECK:STDOUT: !104 = !DILocation(line: 120, column: 5, scope: !102) -// CHECK:STDOUT: !105 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d", scope: null, file: !59, line: 62, type: !106, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !108) -// CHECK:STDOUT: !106 = !DISubroutineType(types: !107) -// CHECK:STDOUT: !107 = !{!22, !22} -// CHECK:STDOUT: !108 = !{!109} -// CHECK:STDOUT: !109 = !DILocalVariable(arg: 1, scope: !105, type: !22) -// CHECK:STDOUT: !110 = !DILocation(line: 64, column: 17, scope: !105) -// CHECK:STDOUT: !111 = !DILocation(line: 64, column: 5, scope: !105) -// CHECK:STDOUT: !112 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !59, line: 57, type: !106, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !113) -// CHECK:STDOUT: !113 = !{!114} -// CHECK:STDOUT: !114 = !DILocalVariable(arg: 1, scope: !112, type: !22) -// CHECK:STDOUT: !115 = !DILocation(line: 57, column: 36, scope: !112) +// CHECK:STDOUT: !23 = !{!24} +// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !18, type: !22) +// CHECK:STDOUT: !25 = !DILocation(line: 24, column: 65, scope: !18) +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b9f59d4d0f116c67:core.Destroy.Core", scope: null, file: !3, line: 20, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !27) +// CHECK:STDOUT: !27 = !{!28} +// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !26, type: !22) +// CHECK:STDOUT: !29 = !DILocation(line: 20, column: 7, scope: !26) +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Op", linkageName: "_COp.59d039ff34f2fb65:core.Destroy.Core", scope: null, file: !3, line: 20, type: !31, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !34) +// CHECK:STDOUT: !31 = !DISubroutineType(types: !32) +// CHECK:STDOUT: !32 = !{null, !33} +// CHECK:STDOUT: !33 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !34 = !{!35} +// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !30, type: !33) +// CHECK:STDOUT: !36 = !DILocation(line: 20, column: 7, scope: !30) +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.63778fe3d7a17e90:core.Destroy.Core", scope: null, file: !3, line: 20, type: !31, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !38) +// CHECK:STDOUT: !38 = !{!39} +// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !37, type: !33) +// CHECK:STDOUT: !40 = !DILocation(line: 20, column: 7, scope: !37) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fed90f94367ce0d0:core.Destroy.Core", scope: null, file: !3, line: 20, type: !31, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !42) +// CHECK:STDOUT: !42 = !{!43} +// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !41, type: !33) +// CHECK:STDOUT: !44 = !DILocation(line: 20, column: 7, scope: !41) +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b7795080e9163697:core.Destroy.Core", scope: null, file: !3, line: 20, type: !31, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !46) +// CHECK:STDOUT: !46 = !{!47} +// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !45, type: !33) +// CHECK:STDOUT: !48 = !DILocation(line: 20, column: 18, scope: !45) +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "Op", linkageName: "_COp.4f0cde2dfabc7dc4:core.Destroy.Core", scope: null, file: !3, line: 20, type: !31, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !50) +// CHECK:STDOUT: !50 = !{!51} +// CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !49, type: !33) +// CHECK:STDOUT: !52 = !DILocation(line: 20, column: 18, scope: !49) +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "NewCursor", linkageName: "_CNewCursor.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8", scope: null, file: !19, line: 25, type: !54, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !56) +// CHECK:STDOUT: !54 = !DISubroutineType(types: !55) +// CHECK:STDOUT: !55 = !{!22, !33} +// CHECK:STDOUT: !56 = !{!57} +// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !53, type: !33) +// CHECK:STDOUT: !58 = !DILocation(line: 25, column: 51, scope: !53) +// CHECK:STDOUT: !59 = !DILocation(line: 25, column: 44, scope: !53) +// CHECK:STDOUT: !60 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8", scope: null, file: !19, line: 26, type: !61, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !63) +// CHECK:STDOUT: !61 = !DISubroutineType(types: !62) +// CHECK:STDOUT: !62 = !{!33, !33, !33} +// CHECK:STDOUT: !63 = !{!64, !65} +// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !60, type: !33) +// CHECK:STDOUT: !65 = !DILocalVariable(arg: 2, scope: !60, type: !33) +// CHECK:STDOUT: !66 = !DILocation(line: 27, column: 7, scope: !60) +// CHECK:STDOUT: !67 = !DILocation(line: 27, column: 27, scope: !60) +// CHECK:STDOUT: !68 = !DILocation(line: 28, column: 19, scope: !60) +// CHECK:STDOUT: !69 = !DILocation(line: 28, column: 11, scope: !60) +// CHECK:STDOUT: !70 = !DILocation(line: 28, column: 10, scope: !60) +// CHECK:STDOUT: !71 = !DILocation(line: 29, column: 9, scope: !60) +// CHECK:STDOUT: !72 = !DILocation(line: 30, column: 38, scope: !60) +// CHECK:STDOUT: !73 = !DILocation(line: 30, column: 16, scope: !60) +// CHECK:STDOUT: !74 = !DILocation(line: 30, column: 9, scope: !60) +// CHECK:STDOUT: !75 = !DILocation(line: 32, column: 16, scope: !60) +// CHECK:STDOUT: !76 = !DILocation(line: 32, column: 9, scope: !60) +// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.a0986cb4211ec3fb", scope: null, file: !78, line: 33, type: !79, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !81) +// CHECK:STDOUT: !78 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !79 = !DISubroutineType(types: !80) +// CHECK:STDOUT: !80 = !{!33, !33} +// CHECK:STDOUT: !81 = !{!82} +// CHECK:STDOUT: !82 = !DILocalVariable(arg: 1, scope: !77, type: !33) +// CHECK:STDOUT: !83 = !DILocation(line: 34, column: 12, scope: !77) +// CHECK:STDOUT: !84 = !DILocation(line: 34, column: 5, scope: !77) +// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.a0986cb4211ec3fb", scope: null, file: !78, line: 36, type: !54, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !86) +// CHECK:STDOUT: !86 = !{!87} +// CHECK:STDOUT: !87 = !DILocalVariable(arg: 1, scope: !85, type: !33) +// CHECK:STDOUT: !88 = !DILocation(line: 37, column: 12, scope: !85) +// CHECK:STDOUT: !89 = !DILocation(line: 37, column: 5, scope: !85) +// CHECK:STDOUT: !90 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !91, line: 363, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !92) +// CHECK:STDOUT: !91 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") +// CHECK:STDOUT: !92 = !{!93} +// CHECK:STDOUT: !93 = !DILocalVariable(arg: 1, scope: !90, type: !22) +// CHECK:STDOUT: !94 = !DILocation(line: 365, column: 5, scope: !90) +// CHECK:STDOUT: !95 = !DILocation(line: 363, column: 3, scope: !90) +// CHECK:STDOUT: !96 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.a0986cb4211ec3fb", scope: null, file: !78, line: 30, type: !97, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !99) +// CHECK:STDOUT: !97 = !DISubroutineType(types: !98) +// CHECK:STDOUT: !98 = !{!33, !22} +// CHECK:STDOUT: !99 = !{!100} +// CHECK:STDOUT: !100 = !DILocalVariable(arg: 1, scope: !96, type: !22) +// CHECK:STDOUT: !101 = !DILocation(line: 31, column: 12, scope: !96) +// CHECK:STDOUT: !102 = !DILocation(line: 31, column: 5, scope: !96) +// CHECK:STDOUT: !103 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.a0986cb4211ec3fb", scope: null, file: !78, line: 27, type: !104, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !104 = !DISubroutineType(types: !105) +// CHECK:STDOUT: !105 = !{!33} +// CHECK:STDOUT: !106 = !DILocation(line: 28, column: 12, scope: !103) +// CHECK:STDOUT: !107 = !DILocation(line: 28, column: 5, scope: !103) +// CHECK:STDOUT: !108 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5", scope: null, file: !78, line: 132, type: !79, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !109) +// CHECK:STDOUT: !109 = !{!110} +// CHECK:STDOUT: !110 = !DILocalVariable(arg: 1, scope: !108, type: !33) +// CHECK:STDOUT: !111 = !DILocation(line: 133, column: 12, scope: !108) +// CHECK:STDOUT: !112 = !DILocation(line: 133, column: 5, scope: !108) +// CHECK:STDOUT: !113 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5", scope: null, file: !78, line: 135, type: !54, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !114) +// CHECK:STDOUT: !114 = !{!115} +// CHECK:STDOUT: !115 = !DILocalVariable(arg: 1, scope: !113, type: !33) +// CHECK:STDOUT: !116 = !DILocation(line: 136, column: 12, scope: !113) +// CHECK:STDOUT: !117 = !DILocation(line: 136, column: 5, scope: !113) +// CHECK:STDOUT: !118 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.5375cfcbca6d9e35.Core.57ee91777b6354a8", scope: null, file: !91, line: 299, type: !119, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !121) +// CHECK:STDOUT: !119 = !DISubroutineType(types: !120) +// CHECK:STDOUT: !120 = !{null, !22, !22} +// CHECK:STDOUT: !121 = !{!122, !123} +// CHECK:STDOUT: !122 = !DILocalVariable(arg: 1, scope: !118, type: !22) +// CHECK:STDOUT: !123 = !DILocalVariable(arg: 2, scope: !118, type: !22) +// CHECK:STDOUT: !124 = !DILocation(line: 4294967295, scope: !118) +// CHECK:STDOUT: !125 = !DILocation(line: 299, column: 3, scope: !118) +// CHECK:STDOUT: !126 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5", scope: null, file: !78, line: 122, type: !97, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !127) +// CHECK:STDOUT: !127 = !{!128} +// CHECK:STDOUT: !128 = !DILocalVariable(arg: 1, scope: !126, type: !22) +// CHECK:STDOUT: !129 = !DILocation(line: 128, column: 5, scope: !126) +// CHECK:STDOUT: !130 = !DILocation(line: 129, column: 5, scope: !126) +// CHECK:STDOUT: !131 = !DILocation(line: 130, column: 5, scope: !126) +// CHECK:STDOUT: !132 = distinct !DISubprogram(name: "None", linkageName: "_CNone.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5", scope: null, file: !78, line: 116, type: !104, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !133 = !DILocation(line: 119, column: 5, scope: !132) +// CHECK:STDOUT: !134 = !DILocation(line: 120, column: 5, scope: !132) +// CHECK:STDOUT: !135 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d", scope: null, file: !91, line: 62, type: !136, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !138) +// CHECK:STDOUT: !136 = !DISubroutineType(types: !137) +// CHECK:STDOUT: !137 = !{!22, !22} +// CHECK:STDOUT: !138 = !{!139} +// CHECK:STDOUT: !139 = !DILocalVariable(arg: 1, scope: !135, type: !22) +// CHECK:STDOUT: !140 = !DILocation(line: 64, column: 17, scope: !135) +// CHECK:STDOUT: !141 = !DILocation(line: 64, column: 5, scope: !135) +// CHECK:STDOUT: !142 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !91, line: 57, type: !136, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !143) +// CHECK:STDOUT: !143 = !{!144} +// CHECK:STDOUT: !144 = !DILocalVariable(arg: 1, scope: !142, type: !22) +// CHECK:STDOUT: !145 = !DILocation(line: 57, column: 36, scope: !142) diff --git a/toolchain/lower/testdata/for/for.carbon b/toolchain/lower/testdata/for/for.carbon index 506a005bf5b2..60e7a1a1253d 100644 --- a/toolchain/lower/testdata/for/for.carbon +++ b/toolchain/lower/testdata/for/for.carbon @@ -60,125 +60,172 @@ fn For() { // CHECK:STDOUT: // CHECK:STDOUT: for.done: ; preds = %for.next // CHECK:STDOUT: call void @_CH.Main(), !dbg !12 +// CHECK:STDOUT: call void @"_COp.fed90f94367ce0d0:core.Destroy.Core"(ptr %.loc21_33.1.temp), !dbg !8 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %var), !dbg !8 +// CHECK:STDOUT: call void @"_COp.4f0cde2dfabc7dc4:core.Destroy.Core"(ptr %.loc21_32.1.temp), !dbg !7 // CHECK:STDOUT: ret void, !dbg !13 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CRange.Core(ptr sret({ i32, i32 }), i32) // 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 !14 { -// CHECK:STDOUT: %start = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 0, !dbg !22 -// CHECK:STDOUT: %1 = load i32, ptr %start, align 4, !dbg !22 -// CHECK:STDOUT: ret i32 %1, !dbg !23 +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !14 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !21 // 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 !24 { -// CHECK:STDOUT: %1 = alloca i32, align 4, !dbg !30 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !30 -// CHECK:STDOUT: %2 = load i32, ptr %cursor, align 4, !dbg !31 -// CHECK:STDOUT: store i32 %2, ptr %1, align 4, !dbg !30 -// CHECK:STDOUT: %end = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !32 -// CHECK:STDOUT: %3 = load i32, ptr %end, align 4, !dbg !32 -// CHECK:STDOUT: %4 = load i32, ptr %1, align 4, !dbg !33 -// CHECK:STDOUT: %5 = icmp slt i32 %4, %3, !dbg !33 -// CHECK:STDOUT: br i1 %5, label %6, label %8, !dbg !34 +// CHECK:STDOUT: define weak_odr void @"_COp.b9f59d4d0f116c67:core.Destroy.Core"(ptr %self) #0 !dbg !22 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !25 +// CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: 6: ; preds = %0 -// CHECK:STDOUT: call void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %cursor), !dbg !35 -// CHECK:STDOUT: %7 = load i32, ptr %1, align 4, !dbg !36 -// CHECK:STDOUT: call void @_CSome.Optional.Core.a0986cb4211ec3fb(ptr %return, i32 %7), !dbg !37 -// CHECK:STDOUT: ret void, !dbg !38 +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.59d039ff34f2fb65:core.Destroy.Core"(ptr %self) #0 !dbg !26 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !32 +// CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: 8: ; preds = %0 -// CHECK:STDOUT: call void @_CNone.Optional.Core.a0986cb4211ec3fb(ptr %return), !dbg !39 +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.63778fe3d7a17e90:core.Destroy.Core"(ptr %self) #0 !dbg !33 { +// 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.fed90f94367ce0d0:core.Destroy.Core"(ptr %self) #0 !dbg !37 { +// CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !40 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.a0986cb4211ec3fb(ptr %self) #0 !dbg !41 { -// CHECK:STDOUT: %1 = call i1 @"_CHas.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5"(ptr %self), !dbg !47 -// CHECK:STDOUT: ret i1 %1, !dbg !48 +// CHECK:STDOUT: define weak_odr void @"_COp.b7795080e9163697:core.Destroy.Core"(ptr %self) #0 !dbg !41 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !44 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CGet.Optional.Core.a0986cb4211ec3fb(ptr %self) #0 !dbg !49 { -// CHECK:STDOUT: %1 = call i32 @"_CGet.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5"(ptr %self), !dbg !52 -// CHECK:STDOUT: ret i32 %1, !dbg !53 +// CHECK:STDOUT: define weak_odr void @"_COp.4f0cde2dfabc7dc4:core.Destroy.Core"(ptr %self) #0 !dbg !45 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !48 +// 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 !49 { +// CHECK:STDOUT: %start = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 0, !dbg !54 +// CHECK:STDOUT: %1 = load i32, ptr %start, align 4, !dbg !54 +// CHECK:STDOUT: ret i32 %1, !dbg !55 +// 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 !56 { +// CHECK:STDOUT: %1 = alloca i32, align 4, !dbg !62 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !62 +// CHECK:STDOUT: %2 = load i32, ptr %cursor, align 4, !dbg !63 +// CHECK:STDOUT: store i32 %2, ptr %1, align 4, !dbg !62 +// CHECK:STDOUT: %end = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !64 +// CHECK:STDOUT: %3 = load i32, ptr %end, align 4, !dbg !64 +// CHECK:STDOUT: %4 = load i32, ptr %1, align 4, !dbg !65 +// CHECK:STDOUT: %5 = icmp slt i32 %4, %3, !dbg !65 +// CHECK:STDOUT: br i1 %5, label %6, label %8, !dbg !66 +// CHECK:STDOUT: +// CHECK:STDOUT: 6: ; preds = %0 +// CHECK:STDOUT: call void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %cursor), !dbg !67 +// CHECK:STDOUT: %7 = load i32, ptr %1, align 4, !dbg !68 +// CHECK:STDOUT: call void @_CSome.Optional.Core.a0986cb4211ec3fb(ptr %return, i32 %7), !dbg !69 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %1), !dbg !62 +// CHECK:STDOUT: ret void, !dbg !70 +// CHECK:STDOUT: +// CHECK:STDOUT: 8: ; preds = %0 +// CHECK:STDOUT: call void @_CNone.Optional.Core.a0986cb4211ec3fb(ptr %return), !dbg !71 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %1), !dbg !62 +// CHECK:STDOUT: ret void, !dbg !72 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.a0986cb4211ec3fb(ptr %self) #0 !dbg !73 { +// CHECK:STDOUT: %1 = call i1 @"_CHas.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5"(ptr %self), !dbg !79 +// CHECK:STDOUT: ret i1 %1, !dbg !80 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr i32 @_CGet.Optional.Core.a0986cb4211ec3fb(ptr %self) #0 !dbg !81 { +// CHECK:STDOUT: %1 = call i32 @"_CGet.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5"(ptr %self), !dbg !84 +// CHECK:STDOUT: ret i32 %1, !dbg !85 // 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 !54 { -// CHECK:STDOUT: call void @"_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.5375cfcbca6d9e35.Core.57ee91777b6354a8"(ptr %self, i32 1), !dbg !60 -// CHECK:STDOUT: ret void, !dbg !61 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.a0986cb4211ec3fb(ptr sret({ i32, i1 }) %return, i32 %value) #0 !dbg !62 { -// CHECK:STDOUT: call void @"_CSome.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5"(ptr %return, i32 %value), !dbg !67 -// CHECK:STDOUT: ret void, !dbg !68 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.a0986cb4211ec3fb(ptr sret({ i32, i1 }) %return) #0 !dbg !69 { -// CHECK:STDOUT: call void @"_CNone.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5"(ptr %return), !dbg !72 -// CHECK:STDOUT: ret void, !dbg !73 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5"(ptr %value) #0 !dbg !74 { -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i32, i1 }, ptr %value, i32 0, i32 1, !dbg !77 -// CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !77 -// CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !77 -// CHECK:STDOUT: ret i1 %2, !dbg !78 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CGet.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5"(ptr %value) #0 !dbg !79 { -// CHECK:STDOUT: %value1 = getelementptr inbounds nuw { i32, i1 }, ptr %value, i32 0, i32 0, !dbg !82 -// CHECK:STDOUT: %1 = load i32, ptr %value1, align 4, !dbg !82 -// CHECK:STDOUT: ret i32 %1, !dbg !83 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.5375cfcbca6d9e35.Core.57ee91777b6354a8"(ptr %self, i32 %other) #2 !dbg !84 { -// CHECK:STDOUT: %1 = call i32 @"_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d"(i32 %other), !dbg !90 -// CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !91 -// CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !91 -// CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !91 +// CHECK:STDOUT: define linkonce_odr void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !86 { +// CHECK:STDOUT: call void @"_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.5375cfcbca6d9e35.Core.57ee91777b6354a8"(ptr %self, i32 1), !dbg !90 // CHECK:STDOUT: ret void, !dbg !91 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CSome.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5"(ptr sret({ i32, i1 }) %return, i32 %self) #0 !dbg !92 { -// CHECK:STDOUT: %value = getelementptr inbounds nuw { i32, i1 }, ptr %return, i32 0, i32 0, !dbg !95 -// CHECK:STDOUT: store i32 %self, ptr %value, align 4, !dbg !95 -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i32, i1 }, ptr %return, i32 0, i32 1, !dbg !96 -// CHECK:STDOUT: store i8 1, ptr %has_value, align 1, !dbg !96 -// CHECK:STDOUT: ret void, !dbg !97 +// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.a0986cb4211ec3fb(ptr sret({ i32, i1 }) %return, i32 %value) #0 !dbg !92 { +// CHECK:STDOUT: call void @"_CSome.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5"(ptr %return, i32 %value), !dbg !97 +// CHECK:STDOUT: ret void, !dbg !98 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CNone.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5"(ptr sret({ i32, i1 }) %return) #0 !dbg !98 { -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i32, i1 }, ptr %return, i32 0, i32 1, !dbg !99 -// CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !99 -// CHECK:STDOUT: ret void, !dbg !100 +// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.a0986cb4211ec3fb(ptr sret({ i32, i1 }) %return) #0 !dbg !99 { +// CHECK:STDOUT: call void @"_CNone.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5"(ptr %return), !dbg !102 +// CHECK:STDOUT: ret void, !dbg !103 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d"(i32 %self) #0 !dbg !101 { -// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !106 -// CHECK:STDOUT: ret i32 %1, !dbg !107 +// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5"(ptr %value) #0 !dbg !104 { +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i32, i1 }, ptr %value, i32 0, i32 1, !dbg !107 +// CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !107 +// CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !107 +// CHECK:STDOUT: ret i1 %2, !dbg !108 // 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 !108 { -// CHECK:STDOUT: ret i32 %self, !dbg !111 +// CHECK:STDOUT: define linkonce_odr i32 @"_CGet.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5"(ptr %value) #0 !dbg !109 { +// CHECK:STDOUT: %value1 = getelementptr inbounds nuw { i32, i1 }, ptr %value, i32 0, i32 0, !dbg !112 +// CHECK:STDOUT: %1 = load i32, ptr %value1, align 4, !dbg !112 +// CHECK:STDOUT: ret i32 %1, !dbg !113 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind +// CHECK:STDOUT: define linkonce_odr void @"_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.5375cfcbca6d9e35.Core.57ee91777b6354a8"(ptr %self, i32 %other) #2 !dbg !114 { +// CHECK:STDOUT: %1 = call i32 @"_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d"(i32 %other), !dbg !120 +// CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !121 +// CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !121 +// CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !121 +// CHECK:STDOUT: ret void, !dbg !121 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @"_CSome.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5"(ptr sret({ i32, i1 }) %return, i32 %self) #0 !dbg !122 { +// CHECK:STDOUT: %value = getelementptr inbounds nuw { i32, i1 }, ptr %return, i32 0, i32 0, !dbg !125 +// CHECK:STDOUT: store i32 %self, ptr %value, align 4, !dbg !125 +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i32, i1 }, ptr %return, i32 0, i32 1, !dbg !126 +// CHECK:STDOUT: store i8 1, ptr %has_value, align 1, !dbg !126 +// CHECK:STDOUT: ret void, !dbg !127 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @"_CNone.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5"(ptr sret({ i32, i1 }) %return) #0 !dbg !128 { +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i32, i1 }, ptr %return, i32 0, i32 1, !dbg !129 +// CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !129 +// CHECK:STDOUT: ret void, !dbg !130 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d"(i32 %self) #0 !dbg !131 { +// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !136 +// CHECK:STDOUT: ret i32 %1, !dbg !137 +// 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 !138 { +// CHECK:STDOUT: ret i32 %self, !dbg !141 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -205,101 +252,131 @@ fn For() { // CHECK:STDOUT: !11 = !DILocation(line: 21, column: 3, scope: !4) // CHECK:STDOUT: !12 = !DILocation(line: 24, column: 3, scope: !4) // CHECK:STDOUT: !13 = !DILocation(line: 19, column: 1, scope: !4) -// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "NewCursor", linkageName: "_CNewCursor.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8", scope: null, file: !15, line: 25, type: !16, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !20) +// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !15, line: 24, type: !16, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !19) // CHECK:STDOUT: !15 = !DIFile(filename: "{{.*}}/range.carbon", directory: "") // CHECK:STDOUT: !16 = !DISubroutineType(types: !17) -// CHECK:STDOUT: !17 = !{!18, !19} +// CHECK:STDOUT: !17 = !{null, !18} // CHECK:STDOUT: !18 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !19 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !20 = !{!21} -// CHECK:STDOUT: !21 = !DILocalVariable(arg: 1, scope: !14, type: !19) -// CHECK:STDOUT: !22 = !DILocation(line: 25, column: 51, scope: !14) -// CHECK:STDOUT: !23 = !DILocation(line: 25, column: 44, scope: !14) -// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8", scope: null, file: !15, line: 26, type: !25, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !27) -// CHECK:STDOUT: !25 = !DISubroutineType(types: !26) -// CHECK:STDOUT: !26 = !{!19, !19, !19} -// CHECK:STDOUT: !27 = !{!28, !29} -// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !24, type: !19) -// CHECK:STDOUT: !29 = !DILocalVariable(arg: 2, scope: !24, type: !19) -// CHECK:STDOUT: !30 = !DILocation(line: 27, column: 7, scope: !24) -// CHECK:STDOUT: !31 = !DILocation(line: 27, column: 27, scope: !24) -// CHECK:STDOUT: !32 = !DILocation(line: 28, column: 19, scope: !24) -// CHECK:STDOUT: !33 = !DILocation(line: 28, column: 11, scope: !24) -// CHECK:STDOUT: !34 = !DILocation(line: 28, column: 10, scope: !24) -// CHECK:STDOUT: !35 = !DILocation(line: 29, column: 9, scope: !24) -// CHECK:STDOUT: !36 = !DILocation(line: 30, column: 38, scope: !24) -// CHECK:STDOUT: !37 = !DILocation(line: 30, column: 16, scope: !24) -// CHECK:STDOUT: !38 = !DILocation(line: 30, column: 9, scope: !24) -// CHECK:STDOUT: !39 = !DILocation(line: 32, column: 16, scope: !24) -// CHECK:STDOUT: !40 = !DILocation(line: 32, column: 9, scope: !24) -// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.a0986cb4211ec3fb", scope: null, file: !42, line: 33, type: !43, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !45) -// CHECK:STDOUT: !42 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !43 = !DISubroutineType(types: !44) -// CHECK:STDOUT: !44 = !{!19, !19} -// CHECK:STDOUT: !45 = !{!46} -// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !41, type: !19) -// CHECK:STDOUT: !47 = !DILocation(line: 34, column: 12, scope: !41) -// CHECK:STDOUT: !48 = !DILocation(line: 34, column: 5, scope: !41) -// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.a0986cb4211ec3fb", scope: null, file: !42, line: 36, type: !16, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !50) -// CHECK:STDOUT: !50 = !{!51} -// CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !49, type: !19) -// CHECK:STDOUT: !52 = !DILocation(line: 37, column: 12, scope: !49) -// CHECK:STDOUT: !53 = !DILocation(line: 37, column: 5, scope: !49) -// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !55, line: 363, type: !56, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !58) -// CHECK:STDOUT: !55 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") -// CHECK:STDOUT: !56 = !DISubroutineType(types: !57) -// CHECK:STDOUT: !57 = !{null, !18} -// CHECK:STDOUT: !58 = !{!59} -// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !54, type: !18) -// CHECK:STDOUT: !60 = !DILocation(line: 365, column: 5, scope: !54) -// CHECK:STDOUT: !61 = !DILocation(line: 363, column: 3, scope: !54) -// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.a0986cb4211ec3fb", scope: null, file: !42, line: 30, type: !63, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !65) -// CHECK:STDOUT: !63 = !DISubroutineType(types: !64) -// CHECK:STDOUT: !64 = !{!19, !18} -// CHECK:STDOUT: !65 = !{!66} -// CHECK:STDOUT: !66 = !DILocalVariable(arg: 1, scope: !62, type: !18) -// CHECK:STDOUT: !67 = !DILocation(line: 31, column: 12, scope: !62) -// CHECK:STDOUT: !68 = !DILocation(line: 31, column: 5, scope: !62) -// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.a0986cb4211ec3fb", scope: null, file: !42, line: 27, type: !70, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !70 = !DISubroutineType(types: !71) -// CHECK:STDOUT: !71 = !{!19} -// CHECK:STDOUT: !72 = !DILocation(line: 28, column: 12, scope: !69) -// CHECK:STDOUT: !73 = !DILocation(line: 28, column: 5, scope: !69) -// CHECK:STDOUT: !74 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5", scope: null, file: !42, line: 132, type: !43, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !75) -// CHECK:STDOUT: !75 = !{!76} -// CHECK:STDOUT: !76 = !DILocalVariable(arg: 1, scope: !74, type: !19) -// CHECK:STDOUT: !77 = !DILocation(line: 133, column: 12, scope: !74) -// CHECK:STDOUT: !78 = !DILocation(line: 133, column: 5, scope: !74) -// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5", scope: null, file: !42, line: 135, type: !16, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !80) -// CHECK:STDOUT: !80 = !{!81} -// CHECK:STDOUT: !81 = !DILocalVariable(arg: 1, scope: !79, type: !19) -// CHECK:STDOUT: !82 = !DILocation(line: 136, column: 12, scope: !79) -// CHECK:STDOUT: !83 = !DILocation(line: 136, column: 5, scope: !79) -// CHECK:STDOUT: !84 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.5375cfcbca6d9e35.Core.57ee91777b6354a8", scope: null, file: !55, line: 299, type: !85, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !87) -// CHECK:STDOUT: !85 = !DISubroutineType(types: !86) -// CHECK:STDOUT: !86 = !{null, !18, !18} -// CHECK:STDOUT: !87 = !{!88, !89} -// CHECK:STDOUT: !88 = !DILocalVariable(arg: 1, scope: !84, type: !18) -// CHECK:STDOUT: !89 = !DILocalVariable(arg: 2, scope: !84, type: !18) -// CHECK:STDOUT: !90 = !DILocation(line: 4294967295, scope: !84) -// CHECK:STDOUT: !91 = !DILocation(line: 299, column: 3, scope: !84) -// CHECK:STDOUT: !92 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5", scope: null, file: !42, line: 122, type: !63, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !93) -// CHECK:STDOUT: !93 = !{!94} -// CHECK:STDOUT: !94 = !DILocalVariable(arg: 1, scope: !92, type: !18) -// CHECK:STDOUT: !95 = !DILocation(line: 128, column: 5, scope: !92) -// CHECK:STDOUT: !96 = !DILocation(line: 129, column: 5, scope: !92) -// CHECK:STDOUT: !97 = !DILocation(line: 130, column: 5, scope: !92) -// CHECK:STDOUT: !98 = distinct !DISubprogram(name: "None", linkageName: "_CNone.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5", scope: null, file: !42, line: 116, type: !70, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !99 = !DILocation(line: 119, column: 5, scope: !98) -// CHECK:STDOUT: !100 = !DILocation(line: 120, column: 5, scope: !98) -// CHECK:STDOUT: !101 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d", scope: null, file: !55, line: 62, type: !102, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !104) -// CHECK:STDOUT: !102 = !DISubroutineType(types: !103) -// CHECK:STDOUT: !103 = !{!18, !18} -// CHECK:STDOUT: !104 = !{!105} -// CHECK:STDOUT: !105 = !DILocalVariable(arg: 1, scope: !101, type: !18) -// CHECK:STDOUT: !106 = !DILocation(line: 64, column: 17, scope: !101) -// CHECK:STDOUT: !107 = !DILocation(line: 64, column: 5, scope: !101) -// CHECK:STDOUT: !108 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !55, line: 57, type: !102, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !109) -// CHECK:STDOUT: !109 = !{!110} -// CHECK:STDOUT: !110 = !DILocalVariable(arg: 1, scope: !108, type: !18) -// CHECK:STDOUT: !111 = !DILocation(line: 57, column: 36, scope: !108) +// CHECK:STDOUT: !19 = !{!20} +// CHECK:STDOUT: !20 = !DILocalVariable(arg: 1, scope: !14, type: !18) +// CHECK:STDOUT: !21 = !DILocation(line: 24, column: 65, scope: !14) +// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b9f59d4d0f116c67:core.Destroy.Core", scope: null, file: !3, line: 21, type: !16, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !23) +// CHECK:STDOUT: !23 = !{!24} +// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !22, type: !18) +// CHECK:STDOUT: !25 = !DILocation(line: 21, column: 7, scope: !22) +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.59d039ff34f2fb65:core.Destroy.Core", scope: null, file: !3, line: 21, type: !27, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !30) +// CHECK:STDOUT: !27 = !DISubroutineType(types: !28) +// CHECK:STDOUT: !28 = !{null, !29} +// CHECK:STDOUT: !29 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !30 = !{!31} +// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !26, type: !29) +// CHECK:STDOUT: !32 = !DILocation(line: 21, column: 7, scope: !26) +// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "Op", linkageName: "_COp.63778fe3d7a17e90:core.Destroy.Core", scope: null, file: !3, line: 21, type: !27, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !34) +// CHECK:STDOUT: !34 = !{!35} +// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !33, type: !29) +// CHECK:STDOUT: !36 = !DILocation(line: 21, column: 7, scope: !33) +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fed90f94367ce0d0:core.Destroy.Core", scope: null, file: !3, line: 21, type: !27, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !38) +// CHECK:STDOUT: !38 = !{!39} +// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !37, type: !29) +// CHECK:STDOUT: !40 = !DILocation(line: 21, column: 7, scope: !37) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b7795080e9163697:core.Destroy.Core", scope: null, file: !3, line: 21, type: !27, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !42) +// CHECK:STDOUT: !42 = !{!43} +// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !41, type: !29) +// CHECK:STDOUT: !44 = !DILocation(line: 21, column: 18, scope: !41) +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Op", linkageName: "_COp.4f0cde2dfabc7dc4:core.Destroy.Core", scope: null, file: !3, line: 21, type: !27, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !46) +// CHECK:STDOUT: !46 = !{!47} +// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !45, type: !29) +// CHECK:STDOUT: !48 = !DILocation(line: 21, column: 18, scope: !45) +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "NewCursor", linkageName: "_CNewCursor.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8", scope: null, file: !15, line: 25, type: !50, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !52) +// CHECK:STDOUT: !50 = !DISubroutineType(types: !51) +// CHECK:STDOUT: !51 = !{!18, !29} +// CHECK:STDOUT: !52 = !{!53} +// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !49, type: !29) +// CHECK:STDOUT: !54 = !DILocation(line: 25, column: 51, scope: !49) +// CHECK:STDOUT: !55 = !DILocation(line: 25, column: 44, scope: !49) +// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8", scope: null, file: !15, line: 26, type: !57, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !59) +// CHECK:STDOUT: !57 = !DISubroutineType(types: !58) +// CHECK:STDOUT: !58 = !{!29, !29, !29} +// CHECK:STDOUT: !59 = !{!60, !61} +// CHECK:STDOUT: !60 = !DILocalVariable(arg: 1, scope: !56, type: !29) +// CHECK:STDOUT: !61 = !DILocalVariable(arg: 2, scope: !56, type: !29) +// CHECK:STDOUT: !62 = !DILocation(line: 27, column: 7, scope: !56) +// CHECK:STDOUT: !63 = !DILocation(line: 27, column: 27, scope: !56) +// CHECK:STDOUT: !64 = !DILocation(line: 28, column: 19, scope: !56) +// CHECK:STDOUT: !65 = !DILocation(line: 28, column: 11, scope: !56) +// CHECK:STDOUT: !66 = !DILocation(line: 28, column: 10, scope: !56) +// CHECK:STDOUT: !67 = !DILocation(line: 29, column: 9, scope: !56) +// CHECK:STDOUT: !68 = !DILocation(line: 30, column: 38, scope: !56) +// CHECK:STDOUT: !69 = !DILocation(line: 30, column: 16, scope: !56) +// CHECK:STDOUT: !70 = !DILocation(line: 30, column: 9, scope: !56) +// CHECK:STDOUT: !71 = !DILocation(line: 32, column: 16, scope: !56) +// CHECK:STDOUT: !72 = !DILocation(line: 32, column: 9, scope: !56) +// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.a0986cb4211ec3fb", scope: null, file: !74, line: 33, type: !75, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !77) +// CHECK:STDOUT: !74 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !75 = !DISubroutineType(types: !76) +// CHECK:STDOUT: !76 = !{!29, !29} +// CHECK:STDOUT: !77 = !{!78} +// CHECK:STDOUT: !78 = !DILocalVariable(arg: 1, scope: !73, type: !29) +// CHECK:STDOUT: !79 = !DILocation(line: 34, column: 12, scope: !73) +// CHECK:STDOUT: !80 = !DILocation(line: 34, column: 5, scope: !73) +// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.a0986cb4211ec3fb", scope: null, file: !74, line: 36, type: !50, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !82) +// CHECK:STDOUT: !82 = !{!83} +// CHECK:STDOUT: !83 = !DILocalVariable(arg: 1, scope: !81, type: !29) +// CHECK:STDOUT: !84 = !DILocation(line: 37, column: 12, scope: !81) +// CHECK:STDOUT: !85 = !DILocation(line: 37, column: 5, scope: !81) +// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !87, line: 363, type: !16, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !88) +// CHECK:STDOUT: !87 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") +// CHECK:STDOUT: !88 = !{!89} +// CHECK:STDOUT: !89 = !DILocalVariable(arg: 1, scope: !86, type: !18) +// CHECK:STDOUT: !90 = !DILocation(line: 365, column: 5, scope: !86) +// CHECK:STDOUT: !91 = !DILocation(line: 363, column: 3, scope: !86) +// CHECK:STDOUT: !92 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.a0986cb4211ec3fb", scope: null, file: !74, line: 30, type: !93, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !95) +// CHECK:STDOUT: !93 = !DISubroutineType(types: !94) +// CHECK:STDOUT: !94 = !{!29, !18} +// CHECK:STDOUT: !95 = !{!96} +// CHECK:STDOUT: !96 = !DILocalVariable(arg: 1, scope: !92, type: !18) +// CHECK:STDOUT: !97 = !DILocation(line: 31, column: 12, scope: !92) +// CHECK:STDOUT: !98 = !DILocation(line: 31, column: 5, scope: !92) +// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.a0986cb4211ec3fb", scope: null, file: !74, line: 27, type: !100, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !100 = !DISubroutineType(types: !101) +// CHECK:STDOUT: !101 = !{!29} +// CHECK:STDOUT: !102 = !DILocation(line: 28, column: 12, scope: !99) +// CHECK:STDOUT: !103 = !DILocation(line: 28, column: 5, scope: !99) +// CHECK:STDOUT: !104 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5", scope: null, file: !74, line: 132, type: !75, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !105) +// CHECK:STDOUT: !105 = !{!106} +// CHECK:STDOUT: !106 = !DILocalVariable(arg: 1, scope: !104, type: !29) +// CHECK:STDOUT: !107 = !DILocation(line: 133, column: 12, scope: !104) +// CHECK:STDOUT: !108 = !DILocation(line: 133, column: 5, scope: !104) +// CHECK:STDOUT: !109 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5", scope: null, file: !74, line: 135, type: !50, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !110) +// CHECK:STDOUT: !110 = !{!111} +// CHECK:STDOUT: !111 = !DILocalVariable(arg: 1, scope: !109, type: !29) +// CHECK:STDOUT: !112 = !DILocation(line: 136, column: 12, scope: !109) +// CHECK:STDOUT: !113 = !DILocation(line: 136, column: 5, scope: !109) +// CHECK:STDOUT: !114 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.5375cfcbca6d9e35.Core.57ee91777b6354a8", scope: null, file: !87, line: 299, type: !115, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !117) +// CHECK:STDOUT: !115 = !DISubroutineType(types: !116) +// CHECK:STDOUT: !116 = !{null, !18, !18} +// CHECK:STDOUT: !117 = !{!118, !119} +// CHECK:STDOUT: !118 = !DILocalVariable(arg: 1, scope: !114, type: !18) +// CHECK:STDOUT: !119 = !DILocalVariable(arg: 2, scope: !114, type: !18) +// CHECK:STDOUT: !120 = !DILocation(line: 4294967295, scope: !114) +// CHECK:STDOUT: !121 = !DILocation(line: 299, column: 3, scope: !114) +// CHECK:STDOUT: !122 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5", scope: null, file: !74, line: 122, type: !93, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !123) +// CHECK:STDOUT: !123 = !{!124} +// CHECK:STDOUT: !124 = !DILocalVariable(arg: 1, scope: !122, type: !18) +// CHECK:STDOUT: !125 = !DILocation(line: 128, column: 5, scope: !122) +// CHECK:STDOUT: !126 = !DILocation(line: 129, column: 5, scope: !122) +// CHECK:STDOUT: !127 = !DILocation(line: 130, column: 5, scope: !122) +// CHECK:STDOUT: !128 = distinct !DISubprogram(name: "None", linkageName: "_CNone.3e8267224c5dc9c2:OptionalStorage.Core.0b1ea4541e2057b5", scope: null, file: !74, line: 116, type: !100, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !129 = !DILocation(line: 119, column: 5, scope: !128) +// CHECK:STDOUT: !130 = !DILocation(line: 120, column: 5, scope: !128) +// CHECK:STDOUT: !131 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d", scope: null, file: !87, line: 62, type: !132, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !134) +// CHECK:STDOUT: !132 = !DISubroutineType(types: !133) +// CHECK:STDOUT: !133 = !{!18, !18} +// CHECK:STDOUT: !134 = !{!135} +// CHECK:STDOUT: !135 = !DILocalVariable(arg: 1, scope: !131, type: !18) +// CHECK:STDOUT: !136 = !DILocation(line: 64, column: 17, scope: !131) +// CHECK:STDOUT: !137 = !DILocation(line: 64, column: 5, scope: !131) +// CHECK:STDOUT: !138 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !87, line: 57, type: !132, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !139) +// CHECK:STDOUT: !139 = !{!140} +// CHECK:STDOUT: !140 = !DILocalVariable(arg: 1, scope: !138, type: !18) +// CHECK:STDOUT: !141 = !DILocation(line: 57, column: 36, scope: !138) diff --git a/toolchain/lower/testdata/function/call/form.carbon b/toolchain/lower/testdata/function/call/form.carbon index 508689001d8a..904db3ee0882 100644 --- a/toolchain/lower/testdata/function/call/form.carbon +++ b/toolchain/lower/testdata/function/call/form.carbon @@ -77,9 +77,16 @@ fn G() { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %y.var), !dbg !7 // CHECK:STDOUT: store i32 0, ptr %y.var, align 4, !dbg !7 // CHECK:STDOUT: call void @_CF.Main(ptr %y.var), !dbg !8 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %y.var), !dbg !7 // CHECK:STDOUT: ret void, !dbg !9 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !10 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !16 +// 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: @@ -99,6 +106,13 @@ fn G() { // CHECK:STDOUT: !7 = !DILocation(line: 6, column: 3, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 7, column: 3, scope: !4) // CHECK:STDOUT: !9 = !DILocation(line: 5, column: 1, scope: !4) +// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 6, type: !11, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !14) +// CHECK:STDOUT: !11 = !DISubroutineType(types: !12) +// CHECK:STDOUT: !12 = !{null, !13} +// CHECK:STDOUT: !13 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !14 = !{!15} +// CHECK:STDOUT: !15 = !DILocalVariable(arg: 1, scope: !10, type: !13) +// CHECK:STDOUT: !16 = !DILocation(line: 6, column: 3, scope: !10) // CHECK:STDOUT: ; ModuleID = 'var_form_param.carbon' // CHECK:STDOUT: source_filename = "var_form_param.carbon" // CHECK:STDOUT: @@ -112,9 +126,16 @@ fn G() { // CHECK:STDOUT: %.loc3_7.1.temp = alloca i32, align 4, !dbg !7 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc3_7.1.temp), !dbg !7 // CHECK:STDOUT: call void @_CF.Main(ptr @int_0.6a9), !dbg !8 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr @int_0.6a9), !dbg !7 // CHECK:STDOUT: ret void, !dbg !9 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !10 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !16 +// 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: @@ -134,6 +155,13 @@ fn G() { // CHECK:STDOUT: !7 = !DILocation(line: 3, column: 6, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 6, column: 3, scope: !4) // CHECK:STDOUT: !9 = !DILocation(line: 5, column: 1, scope: !4) +// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 3, type: !11, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !14) +// CHECK:STDOUT: !11 = !DISubroutineType(types: !12) +// CHECK:STDOUT: !12 = !{null, !13} +// CHECK:STDOUT: !13 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !14 = !{!15} +// CHECK:STDOUT: !15 = !DILocalVariable(arg: 1, scope: !10, type: !13) +// CHECK:STDOUT: !16 = !DILocation(line: 3, column: 6, scope: !10) // CHECK:STDOUT: ; ModuleID = 'val_form_param.carbon' // CHECK:STDOUT: source_filename = "val_form_param.carbon" // CHECK:STDOUT: @@ -198,9 +226,16 @@ fn G() { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !7 // CHECK:STDOUT: %F.call = call i32 @_CF.Main(), !dbg !8 // CHECK:STDOUT: store i32 %F.call, ptr %x.var, align 4, !dbg !7 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %x.var), !dbg !7 // CHECK:STDOUT: ret void, !dbg !9 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !10 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !16 +// 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: @@ -220,6 +255,13 @@ fn G() { // CHECK:STDOUT: !7 = !DILocation(line: 6, column: 14, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 6, column: 27, scope: !4) // CHECK:STDOUT: !9 = !DILocation(line: 5, column: 1, scope: !4) +// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 6, type: !11, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !14) +// CHECK:STDOUT: !11 = !DISubroutineType(types: !12) +// CHECK:STDOUT: !12 = !{null, !13} +// CHECK:STDOUT: !13 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !14 = !{!15} +// CHECK:STDOUT: !15 = !DILocalVariable(arg: 1, scope: !10, type: !13) +// CHECK:STDOUT: !16 = !DILocation(line: 6, column: 14, scope: !10) // CHECK:STDOUT: ; ModuleID = 'val_return_form.carbon' // CHECK:STDOUT: source_filename = "val_return_form.carbon" // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/call/i32.carbon b/toolchain/lower/testdata/function/call/i32.carbon index 25092bd50eee..8039d15daf7c 100644 --- a/toolchain/lower/testdata/function/call/i32.carbon +++ b/toolchain/lower/testdata/function/call/i32.carbon @@ -34,9 +34,16 @@ fn Main() { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !14 // CHECK:STDOUT: %Echo.call = call i32 @_CEcho.Main(i32 1), !dbg !15 // CHECK:STDOUT: store i32 %Echo.call, ptr %_.var, align 4, !dbg !14 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %_.var), !dbg !14 // CHECK:STDOUT: ret void, !dbg !16 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !17 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !22 +// 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,3 +70,9 @@ fn Main() { // CHECK:STDOUT: !14 = !DILocation(line: 18, column: 3, scope: !11) // CHECK:STDOUT: !15 = !DILocation(line: 18, column: 16, scope: !11) // CHECK:STDOUT: !16 = !DILocation(line: 17, column: 1, scope: !11) +// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 18, type: !18, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !20) +// CHECK:STDOUT: !18 = !DISubroutineType(types: !19) +// CHECK:STDOUT: !19 = !{null, !7} +// CHECK:STDOUT: !20 = !{!21} +// CHECK:STDOUT: !21 = !DILocalVariable(arg: 1, scope: !17, type: !7) +// CHECK:STDOUT: !22 = !DILocation(line: 18, column: 3, scope: !17) diff --git a/toolchain/lower/testdata/function/call/ref_param.carbon b/toolchain/lower/testdata/function/call/ref_param.carbon index b5554b8fcfd8..ccb84e70bcf9 100644 --- a/toolchain/lower/testdata/function/call/ref_param.carbon +++ b/toolchain/lower/testdata/function/call/ref_param.carbon @@ -33,9 +33,16 @@ fn Main() { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !14 // CHECK:STDOUT: store i32 0, ptr %a.var, align 4, !dbg !14 // CHECK:STDOUT: call void @_CDoNothing.Main(ptr %a.var), !dbg !15 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %a.var), !dbg !14 // CHECK:STDOUT: ret void, !dbg !16 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !17 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !20 +// 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: @@ -62,3 +69,7 @@ fn Main() { // CHECK:STDOUT: !14 = !DILocation(line: 16, column: 3, scope: !11) // CHECK:STDOUT: !15 = !DILocation(line: 17, column: 3, scope: !11) // CHECK:STDOUT: !16 = !DILocation(line: 15, column: 1, scope: !11) +// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 16, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !18) +// CHECK:STDOUT: !18 = !{!19} +// CHECK:STDOUT: !19 = !DILocalVariable(arg: 1, scope: !17, type: !7) +// CHECK:STDOUT: !20 = !DILocation(line: 16, column: 3, scope: !17) diff --git a/toolchain/lower/testdata/function/call/ref_return.carbon b/toolchain/lower/testdata/function/call/ref_return.carbon index 92b4db01fed8..43362e816eb7 100644 --- a/toolchain/lower/testdata/function/call/ref_return.carbon +++ b/toolchain/lower/testdata/function/call/ref_return.carbon @@ -36,9 +36,16 @@ fn Main() { // CHECK:STDOUT: store i32 0, ptr %a.var, align 4, !dbg !15 // CHECK:STDOUT: %Echo.call = call ptr @_CEcho.Main(ptr %a.var), !dbg !16 // CHECK:STDOUT: store i32 1, ptr %Echo.call, align 4, !dbg !16 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %a.var), !dbg !15 // CHECK:STDOUT: ret void, !dbg !17 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !18 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !23 +// 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: @@ -66,3 +73,9 @@ fn Main() { // CHECK:STDOUT: !15 = !DILocation(line: 18, column: 3, scope: !12) // CHECK:STDOUT: !16 = !DILocation(line: 19, column: 3, scope: !12) // CHECK:STDOUT: !17 = !DILocation(line: 17, column: 1, scope: !12) +// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 18, type: !19, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !21) +// CHECK:STDOUT: !19 = !DISubroutineType(types: !20) +// CHECK:STDOUT: !20 = !{null, !8} +// CHECK:STDOUT: !21 = !{!22} +// CHECK:STDOUT: !22 = !DILocalVariable(arg: 1, scope: !18, type: !8) +// CHECK:STDOUT: !23 = !DILocation(line: 18, column: 3, scope: !18) 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 1cc04a019903..eb6a9c7dc271 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 @@ -46,9 +46,22 @@ fn Main() { // CHECK:STDOUT: %.loc18_21.1.temp = alloca { i32, i32, i32 }, align 8, !dbg !19 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_21.1.temp), !dbg !19 // CHECK:STDOUT: call void @_CF.Main(ptr %.loc18_21.1.temp, { i32 } { i32 1 }, ptr @tuple.11a.loc18_20.6), !dbg !19 +// CHECK:STDOUT: call void @"_COp.819e9e1e390140e8:core.Destroy.Core"(ptr %.loc18_21.1.temp), !dbg !19 // CHECK:STDOUT: ret void, !dbg !20 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !21 { +// 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.819e9e1e390140e8:core.Destroy.Core"(ptr %self) #0 !dbg !28 { +// 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) // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #1 // CHECK:STDOUT: @@ -79,3 +92,16 @@ fn Main() { // CHECK:STDOUT: !18 = !{null} // CHECK:STDOUT: !19 = !DILocation(line: 18, column: 3, scope: !16) // CHECK:STDOUT: !20 = !DILocation(line: 17, column: 1, scope: !16) +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 18, type: !22, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !25) +// CHECK:STDOUT: !22 = !DISubroutineType(types: !23) +// CHECK:STDOUT: !23 = !{null, !24} +// CHECK:STDOUT: !24 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !25 = !{!26} +// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !21, type: !24) +// CHECK:STDOUT: !27 = !DILocation(line: 18, column: 3, scope: !21) +// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "Op", linkageName: "_COp.819e9e1e390140e8:core.Destroy.Core", scope: null, file: !3, line: 18, type: !29, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !31) +// CHECK:STDOUT: !29 = !DISubroutineType(types: !30) +// CHECK:STDOUT: !30 = !{null, !7} +// CHECK:STDOUT: !31 = !{!32} +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !28, type: !7) +// CHECK:STDOUT: !33 = !DILocation(line: 18, column: 3, scope: !28) diff --git a/toolchain/lower/testdata/function/call/var_param.carbon b/toolchain/lower/testdata/function/call/var_param.carbon index a38cda3f185b..2cb20b3999bc 100644 --- a/toolchain/lower/testdata/function/call/var_param.carbon +++ b/toolchain/lower/testdata/function/call/var_param.carbon @@ -34,9 +34,16 @@ fn Main() { // CHECK:STDOUT: store i32 0, ptr %a.var, align 4, !dbg !14 // CHECK:STDOUT: %.loc17 = load i32, ptr %a.var, align 4, !dbg !15 // CHECK:STDOUT: call void @_CDoNothing.Main(i32 %.loc17), !dbg !16 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %a.var), !dbg !14 // CHECK:STDOUT: ret void, !dbg !17 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !18 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !21 +// 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,3 +71,7 @@ fn Main() { // CHECK:STDOUT: !15 = !DILocation(line: 17, column: 13, scope: !11) // CHECK:STDOUT: !16 = !DILocation(line: 17, column: 3, scope: !11) // CHECK:STDOUT: !17 = !DILocation(line: 15, column: 1, scope: !11) +// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 16, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !19) +// CHECK:STDOUT: !19 = !{!20} +// CHECK:STDOUT: !20 = !DILocalVariable(arg: 1, scope: !18, type: !7) +// CHECK:STDOUT: !21 = !DILocation(line: 16, column: 3, scope: !18) diff --git a/toolchain/lower/testdata/function/definition/destroy.carbon b/toolchain/lower/testdata/function/definition/destroy.carbon index 01e1cafb4fc2..39708ad00330 100644 --- a/toolchain/lower/testdata/function/definition/destroy.carbon +++ b/toolchain/lower/testdata/function/definition/destroy.carbon @@ -93,9 +93,16 @@ fn InitLet() { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_6.2.temp), !dbg !14 // CHECK:STDOUT: call void @_CF.Main(ptr @C.val.loc12_6.6), !dbg !15 // CHECK:STDOUT: call void @_CG.Main(), !dbg !16 +// CHECK:STDOUT: call void @"_COp.71e25083d63c4d6c:core.Destroy.Core"(ptr @C.val), !dbg !14 // CHECK:STDOUT: ret void, !dbg !17 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.71e25083d63c4d6c:core.Destroy.Core"(ptr %self) #0 !dbg !18 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !21 +// 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: @@ -123,6 +130,10 @@ fn InitLet() { // CHECK:STDOUT: !15 = !DILocation(line: 12, column: 3, scope: !11) // CHECK:STDOUT: !16 = !DILocation(line: 15, column: 3, scope: !11) // CHECK:STDOUT: !17 = !DILocation(line: 11, column: 1, scope: !11) +// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "Op", linkageName: "_COp.71e25083d63c4d6c:core.Destroy.Core", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !19) +// CHECK:STDOUT: !19 = !{!20} +// CHECK:STDOUT: !20 = !DILocalVariable(arg: 1, scope: !18, type: !7) +// CHECK:STDOUT: !21 = !DILocation(line: 12, column: 5, scope: !18) // CHECK:STDOUT: ; ModuleID = 'var_param.carbon' // CHECK:STDOUT: source_filename = "var_param.carbon" // CHECK:STDOUT: @@ -143,9 +154,16 @@ fn InitLet() { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc6_6.1.temp), !dbg !14 // CHECK:STDOUT: call void @_CF.Main(ptr @C.val), !dbg !15 // CHECK:STDOUT: call void @_CG.Main(), !dbg !16 +// CHECK:STDOUT: call void @"_COp.71e25083d63c4d6c:core.Destroy.Core"(ptr @C.val), !dbg !14 // CHECK:STDOUT: ret void, !dbg !17 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.71e25083d63c4d6c:core.Destroy.Core"(ptr %self) #0 !dbg !18 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !21 +// 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: @@ -173,6 +191,10 @@ fn InitLet() { // CHECK:STDOUT: !15 = !DILocation(line: 12, column: 3, scope: !11) // CHECK:STDOUT: !16 = !DILocation(line: 15, column: 3, scope: !11) // CHECK:STDOUT: !17 = !DILocation(line: 11, column: 1, scope: !11) +// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "Op", linkageName: "_COp.71e25083d63c4d6c:core.Destroy.Core", scope: null, file: !3, line: 6, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !19) +// CHECK:STDOUT: !19 = !{!20} +// CHECK:STDOUT: !20 = !DILocalVariable(arg: 1, scope: !18, type: !7) +// CHECK:STDOUT: !21 = !DILocation(line: 6, column: 6, scope: !18) // CHECK:STDOUT: ; ModuleID = 'return_slot.carbon' // CHECK:STDOUT: source_filename = "return_slot.carbon" // CHECK:STDOUT: @@ -201,17 +223,25 @@ fn InitLet() { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !15 // CHECK:STDOUT: call void @_CF.Main(ptr %_.var), !dbg !16 // CHECK:STDOUT: call void @_CG.Main(), !dbg !17 +// CHECK:STDOUT: call void @"_COp.71e25083d63c4d6c:core.Destroy.Core"(ptr %_.var), !dbg !15 // CHECK:STDOUT: ret void, !dbg !18 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CInitLet.Main() #0 !dbg !19 { +// CHECK:STDOUT: define weak_odr void @"_COp.71e25083d63c4d6c:core.Destroy.Core"(ptr %self) #0 !dbg !19 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc22_16.1.temp = alloca {}, align 8, !dbg !20 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc22_16.1.temp), !dbg !20 -// CHECK:STDOUT: call void @_CF.Main(ptr %.loc22_16.1.temp), !dbg !20 -// CHECK:STDOUT: call void @_CG.Main(), !dbg !21 -// 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 @_CInitLet.Main() #0 !dbg !25 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc22_16.1.temp = alloca {}, align 8, !dbg !26 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc22_16.1.temp), !dbg !26 +// CHECK:STDOUT: call void @_CF.Main(ptr %.loc22_16.1.temp), !dbg !26 +// CHECK:STDOUT: call void @_CG.Main(), !dbg !27 +// CHECK:STDOUT: call void @"_COp.71e25083d63c4d6c:core.Destroy.Core"(ptr %.loc22_16.1.temp), !dbg !26 +// CHECK:STDOUT: ret void, !dbg !28 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) @@ -249,7 +279,13 @@ fn InitLet() { // CHECK:STDOUT: !16 = !DILocation(line: 17, column: 14, scope: !12) // CHECK:STDOUT: !17 = !DILocation(line: 18, column: 3, scope: !12) // CHECK:STDOUT: !18 = !DILocation(line: 16, column: 1, scope: !12) -// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "InitLet", linkageName: "_CInitLet.Main", scope: null, file: !3, line: 21, type: !13, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !20 = !DILocation(line: 22, column: 14, scope: !19) -// CHECK:STDOUT: !21 = !DILocation(line: 23, column: 3, scope: !19) -// CHECK:STDOUT: !22 = !DILocation(line: 21, column: 1, scope: !19) +// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "Op", linkageName: "_COp.71e25083d63c4d6c:core.Destroy.Core", scope: null, file: !3, line: 17, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !22) +// CHECK:STDOUT: !20 = !DISubroutineType(types: !21) +// CHECK:STDOUT: !21 = !{null, !7} +// CHECK:STDOUT: !22 = !{!23} +// CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !19, type: !7) +// CHECK:STDOUT: !24 = !DILocation(line: 17, column: 3, scope: !19) +// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "InitLet", linkageName: "_CInitLet.Main", scope: null, file: !3, line: 21, type: !13, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !26 = !DILocation(line: 22, column: 14, scope: !25) +// CHECK:STDOUT: !27 = !DILocation(line: 23, column: 3, scope: !25) +// CHECK:STDOUT: !28 = !DILocation(line: 21, column: 1, scope: !25) diff --git a/toolchain/lower/testdata/function/definition/var_param.carbon b/toolchain/lower/testdata/function/definition/var_param.carbon index 4687ed683913..5fe2d9fd1020 100644 --- a/toolchain/lower/testdata/function/definition/var_param.carbon +++ b/toolchain/lower/testdata/function/definition/var_param.carbon @@ -87,13 +87,34 @@ fn Call() { // CHECK:STDOUT: call void @_CVarThenLet.Main(ptr @int_1.5d2, ptr @X.val.loc27_18.6), !dbg !48 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc21_23.1.temp), !dbg !44 // CHECK:STDOUT: call void @_CLetThenVar.Main(i32 1, ptr @X.val), !dbg !49 +// CHECK:STDOUT: call void @"_COp.607f187990247af9:core.Destroy.Core"(ptr @X.val), !dbg !44 +// CHECK:STDOUT: call void @"_COp.607f187990247af9:core.Destroy.Core"(ptr @X.val), !dbg !43 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr @int_1.5d2), !dbg !42 +// CHECK:STDOUT: call void @"_COp.607f187990247af9:core.Destroy.Core"(ptr @X.val), !dbg !41 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr @int_1.5d2), !dbg !40 +// CHECK:STDOUT: call void @"_COp.607f187990247af9:core.Destroy.Core"(ptr @X.val), !dbg !39 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr @int_1.5d2), !dbg !38 // CHECK:STDOUT: ret void, !dbg !50 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.607f187990247af9:core.Destroy.Core"(ptr %self) #0 !dbg !51 { +// 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.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !55 { +// 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)) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @"_COp.607f187990247af9:core.Destroy.Core", { 3, 2, 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_COp.7e389eab4a7e5487:core.Destroy.Core", { 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 } @@ -153,3 +174,11 @@ fn Call() { // CHECK:STDOUT: !48 = !DILocation(line: 27, column: 3, scope: !35) // CHECK:STDOUT: !49 = !DILocation(line: 28, column: 3, scope: !35) // CHECK:STDOUT: !50 = !DILocation(line: 23, column: 1, scope: !35) +// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "Op", linkageName: "_COp.607f187990247af9:core.Destroy.Core", scope: null, file: !3, line: 21, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !52) +// CHECK:STDOUT: !52 = !{!53} +// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !51, type: !14) +// CHECK:STDOUT: !54 = !DILocation(line: 21, column: 23, scope: !51) +// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 20, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !56) +// CHECK:STDOUT: !56 = !{!57} +// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !55, type: !7) +// CHECK:STDOUT: !58 = !DILocation(line: 20, column: 15, scope: !55) diff --git a/toolchain/lower/testdata/function/generic/call.carbon b/toolchain/lower/testdata/function/generic/call.carbon index 73988a267576..f9fb418ab118 100644 --- a/toolchain/lower/testdata/function/generic/call.carbon +++ b/toolchain/lower/testdata/function/generic/call.carbon @@ -59,9 +59,37 @@ fn G() { // CHECK:STDOUT: %.loc28 = load double, ptr %m.var, align 8, !dbg !15 // CHECK:STDOUT: call void @_CF.Main.d4b5665541d5d7a8(double %.loc28), !dbg !16 // CHECK:STDOUT: call void @_CF.Main.5754c7a55c7cbe4a(%type zeroinitializer), !dbg !17 +// CHECK:STDOUT: call void @"_COp.98006a366c2ffd6c:core.Destroy.Core"(ptr %m.var), !dbg !10 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %n.var), !dbg !9 +// CHECK:STDOUT: call void @"_COp.bad4d5b3ac96d9d9:core.Destroy.Core"(ptr %d.var), !dbg !8 +// CHECK:STDOUT: call void @"_COp.71e25083d63c4d6c:core.Destroy.Core"(ptr %c.var), !dbg !7 // CHECK:STDOUT: ret void, !dbg !18 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.98006a366c2ffd6c:core.Destroy.Core"(ptr %self) #0 !dbg !19 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !25 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !26 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.bad4d5b3ac96d9d9:core.Destroy.Core"(ptr %self) #0 !dbg !33 { +// 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.71e25083d63c4d6c:core.Destroy.Core"(ptr %self) #0 !dbg !37 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !40 +// 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: @@ -69,27 +97,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) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Main.0c4ab795cec6cb27(ptr %_) #0 !dbg !19 { +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.0c4ab795cec6cb27(ptr %_) #0 !dbg !41 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !25 +// CHECK:STDOUT: ret void, !dbg !44 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Main.b88d1103f417c6d4(i32 %_) #0 !dbg !26 { +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.b88d1103f417c6d4(i32 %_) #0 !dbg !45 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !32 +// CHECK:STDOUT: ret void, !dbg !48 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Main.d4b5665541d5d7a8(double %_) #0 !dbg !33 { +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.d4b5665541d5d7a8(double %_) #0 !dbg !49 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !36 +// CHECK:STDOUT: ret void, !dbg !52 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Main.5754c7a55c7cbe4a(%type %_) #0 !dbg !37 { +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.5754c7a55c7cbe4a(%type %_) #0 !dbg !53 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !40 +// CHECK:STDOUT: ret void, !dbg !56 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -123,25 +151,41 @@ fn G() { // CHECK:STDOUT: !16 = !DILocation(line: 28, column: 3, scope: !4) // CHECK:STDOUT: !17 = !DILocation(line: 29, column: 3, scope: !4) // CHECK:STDOUT: !18 = !DILocation(line: 19, column: 1, scope: !4) -// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.0c4ab795cec6cb27", scope: null, file: !3, line: 13, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !23) +// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "Op", linkageName: "_COp.98006a366c2ffd6c:core.Destroy.Core", scope: null, file: !3, line: 23, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !23) // CHECK:STDOUT: !20 = !DISubroutineType(types: !21) // CHECK:STDOUT: !21 = !{null, !22} // CHECK:STDOUT: !22 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !23 = !{!24} // CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !19, type: !22) -// CHECK:STDOUT: !25 = !DILocation(line: 13, column: 1, scope: !19) -// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.b88d1103f417c6d4", scope: null, file: !3, line: 13, type: !27, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !30) +// CHECK:STDOUT: !25 = !DILocation(line: 23, column: 3, scope: !19) +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 22, type: !27, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !30) // CHECK:STDOUT: !27 = !DISubroutineType(types: !28) // CHECK:STDOUT: !28 = !{null, !29} // CHECK:STDOUT: !29 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) // CHECK:STDOUT: !30 = !{!31} // CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !26, type: !29) -// CHECK:STDOUT: !32 = !DILocation(line: 13, column: 1, scope: !26) -// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.d4b5665541d5d7a8", scope: null, file: !3, line: 13, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !34) +// CHECK:STDOUT: !32 = !DILocation(line: 22, column: 3, scope: !26) +// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "Op", linkageName: "_COp.bad4d5b3ac96d9d9:core.Destroy.Core", scope: null, file: !3, line: 21, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !34) // CHECK:STDOUT: !34 = !{!35} // CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !33, type: !22) -// CHECK:STDOUT: !36 = !DILocation(line: 13, column: 1, scope: !33) -// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.5754c7a55c7cbe4a", scope: null, file: !3, line: 13, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !38) +// CHECK:STDOUT: !36 = !DILocation(line: 21, column: 3, scope: !33) +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.71e25083d63c4d6c:core.Destroy.Core", scope: null, file: !3, line: 20, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !38) // CHECK:STDOUT: !38 = !{!39} // CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !37, type: !22) -// CHECK:STDOUT: !40 = !DILocation(line: 13, column: 1, scope: !37) +// CHECK:STDOUT: !40 = !DILocation(line: 20, column: 3, scope: !37) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.0c4ab795cec6cb27", scope: null, file: !3, line: 13, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !42) +// CHECK:STDOUT: !42 = !{!43} +// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !41, type: !22) +// CHECK:STDOUT: !44 = !DILocation(line: 13, column: 1, scope: !41) +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.b88d1103f417c6d4", scope: null, file: !3, line: 13, type: !27, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !46) +// CHECK:STDOUT: !46 = !{!47} +// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !45, type: !29) +// CHECK:STDOUT: !48 = !DILocation(line: 13, column: 1, scope: !45) +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.d4b5665541d5d7a8", scope: null, file: !3, line: 13, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !50) +// CHECK:STDOUT: !50 = !{!51} +// CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !49, type: !22) +// CHECK:STDOUT: !52 = !DILocation(line: 13, column: 1, scope: !49) +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.5754c7a55c7cbe4a", scope: null, file: !3, line: 13, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !54) +// CHECK:STDOUT: !54 = !{!55} +// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !53, type: !22) +// CHECK:STDOUT: !56 = !DILocation(line: 13, column: 1, scope: !53) diff --git a/toolchain/lower/testdata/function/generic/call_basic.carbon b/toolchain/lower/testdata/function/generic/call_basic.carbon index d678acec7fbb..89d75389b7d4 100644 --- a/toolchain/lower/testdata/function/generic/call_basic.carbon +++ b/toolchain/lower/testdata/function/generic/call_basic.carbon @@ -70,23 +70,43 @@ fn M() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CM.Main() #0 !dbg !11 { +// CHECK:STDOUT: define weak_odr void @"_COp.71e25083d63c4d6c:core.Destroy.Core"(ptr %self) #0 !dbg !11 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !14 -// CHECK:STDOUT: %p.var = alloca double, align 8, !dbg !15 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !14 -// CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !14 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %p.var), !dbg !15 -// CHECK:STDOUT: store double 1.000000e+00, ptr %p.var, align 8, !dbg !15 -// CHECK:STDOUT: %.loc52 = load i32, ptr %n.var, align 4, !dbg !16 -// CHECK:STDOUT: call void @_CF.Main.b88d1103f417c6d4(i32 %.loc52), !dbg !17 -// CHECK:STDOUT: %.loc53_18 = load i32, ptr %n.var, align 4, !dbg !18 -// CHECK:STDOUT: %G.call.loc53 = call i32 @_CG.Main.bfb441135f07cbe1(i32 %.loc53_18), !dbg !19 -// CHECK:STDOUT: %.loc54 = load double, ptr %p.var, align 8, !dbg !20 -// CHECK:STDOUT: call void @_CF.Main.d4b5665541d5d7a8(double %.loc54), !dbg !21 -// CHECK:STDOUT: %.loc55_18 = load double, ptr %p.var, align 8, !dbg !22 -// CHECK:STDOUT: %G.call.loc55 = call double @_CG.Main.29cf1dfeccef7249(double %.loc55_18), !dbg !23 -// CHECK:STDOUT: ret void, !dbg !24 +// CHECK:STDOUT: ret void, !dbg !16 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.98006a366c2ffd6c:core.Destroy.Core"(ptr %self) #0 !dbg !17 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CM.Main() #0 !dbg !21 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !24 +// CHECK:STDOUT: %p.var = alloca double, align 8, !dbg !25 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !24 +// CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !24 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %p.var), !dbg !25 +// CHECK:STDOUT: store double 1.000000e+00, ptr %p.var, align 8, !dbg !25 +// CHECK:STDOUT: %.loc52 = load i32, ptr %n.var, align 4, !dbg !26 +// CHECK:STDOUT: call void @_CF.Main.b88d1103f417c6d4(i32 %.loc52), !dbg !27 +// CHECK:STDOUT: %.loc53_18 = load i32, ptr %n.var, align 4, !dbg !28 +// CHECK:STDOUT: %G.call.loc53 = call i32 @_CG.Main.bfb441135f07cbe1(i32 %.loc53_18), !dbg !29 +// CHECK:STDOUT: %.loc54 = load double, ptr %p.var, align 8, !dbg !30 +// CHECK:STDOUT: call void @_CF.Main.d4b5665541d5d7a8(double %.loc54), !dbg !31 +// CHECK:STDOUT: %.loc55_18 = load double, ptr %p.var, align 8, !dbg !32 +// CHECK:STDOUT: %G.call.loc55 = call double @_CG.Main.29cf1dfeccef7249(double %.loc55_18), !dbg !33 +// CHECK:STDOUT: call void @"_COp.98006a366c2ffd6c:core.Destroy.Core"(ptr %p.var), !dbg !25 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %n.var), !dbg !24 +// CHECK:STDOUT: ret void, !dbg !34 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !35 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !41 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) @@ -96,136 +116,148 @@ fn M() { // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Main.b88d1103f417c6d4(i32 %_) #0 !dbg !25 { +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.b88d1103f417c6d4(i32 %_) #0 !dbg !42 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !31 +// CHECK:STDOUT: ret void, !dbg !45 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CG.Main.bfb441135f07cbe1(i32 %x) #0 !dbg !32 { +// CHECK:STDOUT: define linkonce_odr i32 @_CG.Main.bfb441135f07cbe1(i32 %x) #0 !dbg !46 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc29_6.2.temp = alloca i32, align 4, !dbg !37 -// CHECK:STDOUT: %.loc31_8.2.temp = alloca i32, align 4, !dbg !38 -// CHECK:STDOUT: %.loc31_9.2.temp = alloca i32, align 4, !dbg !39 -// CHECK:STDOUT: %var_f64.var = alloca double, align 8, !dbg !40 -// CHECK:STDOUT: %ptr_i32.var = alloca ptr, align 8, !dbg !41 -// CHECK:STDOUT: %ptr_f64.var = alloca ptr, align 8, !dbg !42 -// CHECK:STDOUT: %ptr_i8.var = alloca ptr, align 8, !dbg !43 -// CHECK:STDOUT: %c.var = alloca {}, align 8, !dbg !44 -// CHECK:STDOUT: %.loc43_6.2.temp = alloca {}, align 8, !dbg !45 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc29_6.2.temp), !dbg !37 -// CHECK:STDOUT: %H.call.loc29 = call i32 @_CH.Main.64ccbb8e5d9a0b8e(i32 %x), !dbg !37 -// CHECK:STDOUT: store i32 %H.call.loc29, ptr %.loc29_6.2.temp, align 4, !dbg !37 -// CHECK:STDOUT: %H.call.loc30 = call %type @_CH.Main.582d60b54baf6b63(%type zeroinitializer), !dbg !46 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc31_8.2.temp), !dbg !38 -// CHECK:STDOUT: %G.call = call i32 @_CG.Main.bfb441135f07cbe1(i32 %x), !dbg !38 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc31_9.2.temp), !dbg !39 -// CHECK:STDOUT: store i32 %G.call, ptr %.loc31_8.2.temp, align 4, !dbg !38 -// CHECK:STDOUT: %.loc31_8.4 = load i32, ptr %.loc31_8.2.temp, align 4, !dbg !38 -// CHECK:STDOUT: %H.call.loc31 = call i32 @_CH.Main.64ccbb8e5d9a0b8e(i32 %.loc31_8.4), !dbg !39 -// CHECK:STDOUT: store i32 %H.call.loc31, ptr %.loc31_9.2.temp, align 4, !dbg !39 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %var_f64.var), !dbg !40 -// CHECK:STDOUT: store double poison, ptr %var_f64.var, align 8, !dbg !40 -// CHECK:STDOUT: %.loc35_5 = load double, ptr %var_f64.var, align 8, !dbg !47 -// CHECK:STDOUT: %H.call.loc35 = call double @_CH.Main.de5b400758c39a65(double %.loc35_5), !dbg !48 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_i32.var), !dbg !41 -// CHECK:STDOUT: store ptr poison, ptr %ptr_i32.var, align 8, !dbg !41 -// CHECK:STDOUT: %.loc37_5 = load ptr, ptr %ptr_i32.var, align 8, !dbg !49 -// CHECK:STDOUT: %H.call.loc37 = call ptr @_CH.Main.779b9c0f3b54a7f8(ptr %.loc37_5), !dbg !50 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_f64.var), !dbg !42 -// CHECK:STDOUT: store ptr poison, ptr %ptr_f64.var, align 8, !dbg !42 -// CHECK:STDOUT: %.loc39_5 = load ptr, ptr %ptr_f64.var, align 8, !dbg !51 -// CHECK:STDOUT: %H.call.loc39 = call ptr @_CH.Main.779b9c0f3b54a7f8(ptr %.loc39_5), !dbg !52 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_i8.var), !dbg !43 -// CHECK:STDOUT: store ptr poison, ptr %ptr_i8.var, align 8, !dbg !43 -// CHECK:STDOUT: %.loc41_5 = load ptr, ptr %ptr_i8.var, align 8, !dbg !53 -// CHECK:STDOUT: %H.call.loc41 = call ptr @_CH.Main.779b9c0f3b54a7f8(ptr %.loc41_5), !dbg !54 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !44 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc43_6.2.temp), !dbg !45 -// CHECK:STDOUT: call void @_CH.Main.706e9f413f1bae3d(ptr %.loc43_6.2.temp, ptr %c.var), !dbg !45 -// CHECK:STDOUT: ret i32 %x, !dbg !55 +// CHECK:STDOUT: %.loc29_6.2.temp = alloca i32, align 4, !dbg !51 +// CHECK:STDOUT: %.loc31_8.2.temp = alloca i32, align 4, !dbg !52 +// CHECK:STDOUT: %.loc31_9.2.temp = alloca i32, align 4, !dbg !53 +// CHECK:STDOUT: %var_f64.var = alloca double, align 8, !dbg !54 +// CHECK:STDOUT: %ptr_i32.var = alloca ptr, align 8, !dbg !55 +// CHECK:STDOUT: %ptr_f64.var = alloca ptr, align 8, !dbg !56 +// CHECK:STDOUT: %ptr_i8.var = alloca ptr, align 8, !dbg !57 +// CHECK:STDOUT: %c.var = alloca {}, align 8, !dbg !58 +// CHECK:STDOUT: %.loc43_6.2.temp = alloca {}, align 8, !dbg !59 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc29_6.2.temp), !dbg !51 +// CHECK:STDOUT: %H.call.loc29 = call i32 @_CH.Main.64ccbb8e5d9a0b8e(i32 %x), !dbg !51 +// CHECK:STDOUT: store i32 %H.call.loc29, ptr %.loc29_6.2.temp, align 4, !dbg !51 +// CHECK:STDOUT: %H.call.loc30 = call %type @_CH.Main.582d60b54baf6b63(%type zeroinitializer), !dbg !60 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc31_8.2.temp), !dbg !52 +// CHECK:STDOUT: %G.call = call i32 @_CG.Main.bfb441135f07cbe1(i32 %x), !dbg !52 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc31_9.2.temp), !dbg !53 +// CHECK:STDOUT: store i32 %G.call, ptr %.loc31_8.2.temp, align 4, !dbg !52 +// CHECK:STDOUT: %.loc31_8.4 = load i32, ptr %.loc31_8.2.temp, align 4, !dbg !52 +// CHECK:STDOUT: %H.call.loc31 = call i32 @_CH.Main.64ccbb8e5d9a0b8e(i32 %.loc31_8.4), !dbg !53 +// CHECK:STDOUT: store i32 %H.call.loc31, ptr %.loc31_9.2.temp, align 4, !dbg !53 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %var_f64.var), !dbg !54 +// CHECK:STDOUT: store double poison, ptr %var_f64.var, align 8, !dbg !54 +// CHECK:STDOUT: %.loc35_5 = load double, ptr %var_f64.var, align 8, !dbg !61 +// CHECK:STDOUT: %H.call.loc35 = call double @_CH.Main.de5b400758c39a65(double %.loc35_5), !dbg !62 +// 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: %.loc37_5 = load ptr, ptr %ptr_i32.var, align 8, !dbg !63 +// CHECK:STDOUT: %H.call.loc37 = call ptr @_CH.Main.779b9c0f3b54a7f8(ptr %.loc37_5), !dbg !64 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_f64.var), !dbg !56 +// CHECK:STDOUT: store ptr poison, ptr %ptr_f64.var, align 8, !dbg !56 +// CHECK:STDOUT: %.loc39_5 = load ptr, ptr %ptr_f64.var, align 8, !dbg !65 +// CHECK:STDOUT: %H.call.loc39 = call ptr @_CH.Main.779b9c0f3b54a7f8(ptr %.loc39_5), !dbg !66 +// 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: %.loc41_5 = load ptr, ptr %ptr_i8.var, align 8, !dbg !67 +// CHECK:STDOUT: %H.call.loc41 = call ptr @_CH.Main.779b9c0f3b54a7f8(ptr %.loc41_5), !dbg !68 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !58 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc43_6.2.temp), !dbg !59 +// CHECK:STDOUT: call void @_CH.Main.706e9f413f1bae3d(ptr %.loc43_6.2.temp, ptr %c.var), !dbg !59 +// CHECK:STDOUT: call void @"_COp.71e25083d63c4d6c:core.Destroy.Core"(ptr %.loc43_6.2.temp), !dbg !59 +// CHECK:STDOUT: call void @"_COp.71e25083d63c4d6c:core.Destroy.Core"(ptr %c.var), !dbg !58 +// CHECK:STDOUT: call void @"_COp.98006a366c2ffd6c:core.Destroy.Core"(ptr %var_f64.var), !dbg !54 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %.loc31_9.2.temp), !dbg !53 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %.loc31_8.2.temp), !dbg !52 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %.loc29_6.2.temp), !dbg !51 +// CHECK:STDOUT: ret i32 %x, !dbg !69 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Main.d4b5665541d5d7a8(double %_) #0 !dbg !56 { +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.d4b5665541d5d7a8(double %_) #0 !dbg !70 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !61 +// CHECK:STDOUT: ret void, !dbg !73 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CG.Main.29cf1dfeccef7249(double %x) #0 !dbg !62 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc29_6.2.temp = alloca double, align 8, !dbg !65 -// CHECK:STDOUT: %.loc31_8.2.temp = alloca double, align 8, !dbg !66 -// CHECK:STDOUT: %.loc31_9.2.temp = alloca double, align 8, !dbg !67 -// CHECK:STDOUT: %var_f64.var = alloca double, align 8, !dbg !68 -// CHECK:STDOUT: %ptr_i32.var = alloca ptr, align 8, !dbg !69 -// CHECK:STDOUT: %ptr_f64.var = alloca ptr, align 8, !dbg !70 -// CHECK:STDOUT: %ptr_i8.var = alloca ptr, align 8, !dbg !71 -// CHECK:STDOUT: %c.var = alloca {}, align 8, !dbg !72 -// CHECK:STDOUT: %.loc43_6.2.temp = alloca {}, align 8, !dbg !73 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc29_6.2.temp), !dbg !65 -// CHECK:STDOUT: %H.call.loc29 = call double @_CH.Main.de5b400758c39a65(double %x), !dbg !65 -// CHECK:STDOUT: store double %H.call.loc29, ptr %.loc29_6.2.temp, align 8, !dbg !65 -// CHECK:STDOUT: %H.call.loc30 = call %type @_CH.Main.582d60b54baf6b63(%type zeroinitializer), !dbg !74 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc31_8.2.temp), !dbg !66 -// CHECK:STDOUT: %G.call = call double @_CG.Main.29cf1dfeccef7249(double %x), !dbg !66 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc31_9.2.temp), !dbg !67 -// CHECK:STDOUT: store double %G.call, ptr %.loc31_8.2.temp, align 8, !dbg !66 -// CHECK:STDOUT: %.loc31_8.4 = load double, ptr %.loc31_8.2.temp, align 8, !dbg !66 -// CHECK:STDOUT: %H.call.loc31 = call double @_CH.Main.de5b400758c39a65(double %.loc31_8.4), !dbg !67 -// CHECK:STDOUT: store double %H.call.loc31, ptr %.loc31_9.2.temp, align 8, !dbg !67 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %var_f64.var), !dbg !68 -// CHECK:STDOUT: store double poison, ptr %var_f64.var, align 8, !dbg !68 -// CHECK:STDOUT: %.loc35_5 = load double, ptr %var_f64.var, align 8, !dbg !75 -// CHECK:STDOUT: %H.call.loc35 = call double @_CH.Main.de5b400758c39a65(double %.loc35_5), !dbg !76 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_i32.var), !dbg !69 -// CHECK:STDOUT: store ptr poison, ptr %ptr_i32.var, align 8, !dbg !69 -// CHECK:STDOUT: %.loc37_5 = load ptr, ptr %ptr_i32.var, align 8, !dbg !77 -// CHECK:STDOUT: %H.call.loc37 = call ptr @_CH.Main.779b9c0f3b54a7f8(ptr %.loc37_5), !dbg !78 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_f64.var), !dbg !70 -// CHECK:STDOUT: store ptr poison, ptr %ptr_f64.var, align 8, !dbg !70 -// CHECK:STDOUT: %.loc39_5 = load ptr, ptr %ptr_f64.var, align 8, !dbg !79 -// CHECK:STDOUT: %H.call.loc39 = call ptr @_CH.Main.779b9c0f3b54a7f8(ptr %.loc39_5), !dbg !80 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_i8.var), !dbg !71 -// CHECK:STDOUT: store ptr poison, ptr %ptr_i8.var, align 8, !dbg !71 -// CHECK:STDOUT: %.loc41_5 = load ptr, ptr %ptr_i8.var, align 8, !dbg !81 -// CHECK:STDOUT: %H.call.loc41 = call ptr @_CH.Main.779b9c0f3b54a7f8(ptr %.loc41_5), !dbg !82 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !72 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc43_6.2.temp), !dbg !73 -// CHECK:STDOUT: call void @_CH.Main.706e9f413f1bae3d(ptr %.loc43_6.2.temp, ptr %c.var), !dbg !73 -// CHECK:STDOUT: ret double %x, !dbg !83 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CH.Main.64ccbb8e5d9a0b8e(i32 %x) #0 !dbg !84 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: ret i32 %x, !dbg !87 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr %type @_CH.Main.582d60b54baf6b63(%type %x) #0 !dbg !88 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: ret %type %x, !dbg !91 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CH.Main.de5b400758c39a65(double %x) #0 !dbg !92 { +// CHECK:STDOUT: define linkonce_odr double @_CG.Main.29cf1dfeccef7249(double %x) #0 !dbg !74 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc29_6.2.temp = alloca double, align 8, !dbg !77 +// CHECK:STDOUT: %.loc31_8.2.temp = alloca double, align 8, !dbg !78 +// CHECK:STDOUT: %.loc31_9.2.temp = alloca double, align 8, !dbg !79 +// CHECK:STDOUT: %var_f64.var = alloca double, align 8, !dbg !80 +// CHECK:STDOUT: %ptr_i32.var = alloca ptr, align 8, !dbg !81 +// CHECK:STDOUT: %ptr_f64.var = alloca ptr, align 8, !dbg !82 +// CHECK:STDOUT: %ptr_i8.var = alloca ptr, align 8, !dbg !83 +// CHECK:STDOUT: %c.var = alloca {}, align 8, !dbg !84 +// CHECK:STDOUT: %.loc43_6.2.temp = alloca {}, align 8, !dbg !85 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc29_6.2.temp), !dbg !77 +// CHECK:STDOUT: %H.call.loc29 = call double @_CH.Main.de5b400758c39a65(double %x), !dbg !77 +// CHECK:STDOUT: store double %H.call.loc29, ptr %.loc29_6.2.temp, align 8, !dbg !77 +// CHECK:STDOUT: %H.call.loc30 = call %type @_CH.Main.582d60b54baf6b63(%type zeroinitializer), !dbg !86 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc31_8.2.temp), !dbg !78 +// CHECK:STDOUT: %G.call = call double @_CG.Main.29cf1dfeccef7249(double %x), !dbg !78 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc31_9.2.temp), !dbg !79 +// CHECK:STDOUT: store double %G.call, ptr %.loc31_8.2.temp, align 8, !dbg !78 +// CHECK:STDOUT: %.loc31_8.4 = load double, ptr %.loc31_8.2.temp, align 8, !dbg !78 +// CHECK:STDOUT: %H.call.loc31 = call double @_CH.Main.de5b400758c39a65(double %.loc31_8.4), !dbg !79 +// CHECK:STDOUT: store double %H.call.loc31, ptr %.loc31_9.2.temp, align 8, !dbg !79 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %var_f64.var), !dbg !80 +// CHECK:STDOUT: store double poison, ptr %var_f64.var, align 8, !dbg !80 +// CHECK:STDOUT: %.loc35_5 = load double, ptr %var_f64.var, align 8, !dbg !87 +// CHECK:STDOUT: %H.call.loc35 = call double @_CH.Main.de5b400758c39a65(double %.loc35_5), !dbg !88 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_i32.var), !dbg !81 +// CHECK:STDOUT: store ptr poison, ptr %ptr_i32.var, align 8, !dbg !81 +// CHECK:STDOUT: %.loc37_5 = load ptr, ptr %ptr_i32.var, align 8, !dbg !89 +// CHECK:STDOUT: %H.call.loc37 = call ptr @_CH.Main.779b9c0f3b54a7f8(ptr %.loc37_5), !dbg !90 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_f64.var), !dbg !82 +// CHECK:STDOUT: store ptr poison, ptr %ptr_f64.var, align 8, !dbg !82 +// CHECK:STDOUT: %.loc39_5 = load ptr, ptr %ptr_f64.var, align 8, !dbg !91 +// CHECK:STDOUT: %H.call.loc39 = call ptr @_CH.Main.779b9c0f3b54a7f8(ptr %.loc39_5), !dbg !92 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_i8.var), !dbg !83 +// CHECK:STDOUT: store ptr poison, ptr %ptr_i8.var, align 8, !dbg !83 +// CHECK:STDOUT: %.loc41_5 = load ptr, ptr %ptr_i8.var, align 8, !dbg !93 +// CHECK:STDOUT: %H.call.loc41 = call ptr @_CH.Main.779b9c0f3b54a7f8(ptr %.loc41_5), !dbg !94 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !84 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc43_6.2.temp), !dbg !85 +// CHECK:STDOUT: call void @_CH.Main.706e9f413f1bae3d(ptr %.loc43_6.2.temp, ptr %c.var), !dbg !85 +// CHECK:STDOUT: call void @"_COp.71e25083d63c4d6c:core.Destroy.Core"(ptr %.loc43_6.2.temp), !dbg !85 +// CHECK:STDOUT: call void @"_COp.71e25083d63c4d6c:core.Destroy.Core"(ptr %c.var), !dbg !84 +// CHECK:STDOUT: call void @"_COp.98006a366c2ffd6c:core.Destroy.Core"(ptr %var_f64.var), !dbg !80 +// CHECK:STDOUT: call void @"_COp.98006a366c2ffd6c:core.Destroy.Core"(ptr %.loc31_9.2.temp), !dbg !79 +// CHECK:STDOUT: call void @"_COp.98006a366c2ffd6c:core.Destroy.Core"(ptr %.loc31_8.2.temp), !dbg !78 +// CHECK:STDOUT: call void @"_COp.98006a366c2ffd6c:core.Destroy.Core"(ptr %.loc29_6.2.temp), !dbg !77 // CHECK:STDOUT: ret double %x, !dbg !95 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CH.Main.779b9c0f3b54a7f8(ptr %x) #0 !dbg !96 { +// CHECK:STDOUT: define linkonce_odr i32 @_CH.Main.64ccbb8e5d9a0b8e(i32 %x) #0 !dbg !96 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret ptr %x, !dbg !99 +// CHECK:STDOUT: ret i32 %x, !dbg !99 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CH.Main.706e9f413f1bae3d(ptr sret({}) %return, ptr %x) #0 !dbg !100 { +// CHECK:STDOUT: define linkonce_odr %type @_CH.Main.582d60b54baf6b63(%type %x) #0 !dbg !100 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_COp.C.Main:Copy.Core"(ptr %return, ptr %x), !dbg !103 -// CHECK:STDOUT: ret void, !dbg !104 +// CHECK:STDOUT: ret %type %x, !dbg !103 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr double @_CH.Main.de5b400758c39a65(double %x) #0 !dbg !104 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret double %x, !dbg !107 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr ptr @_CH.Main.779b9c0f3b54a7f8(ptr %x) #0 !dbg !108 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret ptr %x, !dbg !111 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CH.Main.706e9f413f1bae3d(ptr sret({}) %return, ptr %x) #0 !dbg !112 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_COp.C.Main:Copy.Core"(ptr %return, ptr %x), !dbg !115 +// CHECK:STDOUT: ret void, !dbg !116 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -254,97 +286,109 @@ fn M() { // CHECK:STDOUT: !8 = !{!9} // CHECK:STDOUT: !9 = !DILocalVariable(arg: 1, scope: !4, type: !7) // CHECK:STDOUT: !10 = !DILocation(line: 15, column: 42, scope: !4) -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "M", linkageName: "_CM.Main", scope: null, file: !3, line: 48, type: !12, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Op", linkageName: "_COp.71e25083d63c4d6c:core.Destroy.Core", scope: null, file: !3, line: 43, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !14) // CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 49, column: 3, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 50, column: 3, scope: !11) -// CHECK:STDOUT: !16 = !DILocation(line: 52, column: 5, scope: !11) -// CHECK:STDOUT: !17 = !DILocation(line: 52, column: 3, scope: !11) -// CHECK:STDOUT: !18 = !DILocation(line: 53, column: 18, scope: !11) -// CHECK:STDOUT: !19 = !DILocation(line: 53, column: 16, scope: !11) -// CHECK:STDOUT: !20 = !DILocation(line: 54, column: 5, scope: !11) -// CHECK:STDOUT: !21 = !DILocation(line: 54, column: 3, scope: !11) -// CHECK:STDOUT: !22 = !DILocation(line: 55, column: 18, scope: !11) -// CHECK:STDOUT: !23 = !DILocation(line: 55, column: 16, scope: !11) -// CHECK:STDOUT: !24 = !DILocation(line: 48, column: 1, scope: !11) -// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.b88d1103f417c6d4", scope: null, file: !3, line: 19, type: !26, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !29) -// CHECK:STDOUT: !26 = !DISubroutineType(types: !27) -// CHECK:STDOUT: !27 = !{null, !28} -// CHECK:STDOUT: !28 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !29 = !{!30} -// CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !25, type: !28) -// CHECK:STDOUT: !31 = !DILocation(line: 19, column: 1, scope: !25) -// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.bfb441135f07cbe1", scope: null, file: !3, line: 28, type: !33, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !35) -// CHECK:STDOUT: !33 = !DISubroutineType(types: !34) -// CHECK:STDOUT: !34 = !{!28, !28} -// CHECK:STDOUT: !35 = !{!36} -// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !32, type: !28) -// CHECK:STDOUT: !37 = !DILocation(line: 29, column: 3, scope: !32) -// CHECK:STDOUT: !38 = !DILocation(line: 31, column: 5, scope: !32) -// CHECK:STDOUT: !39 = !DILocation(line: 31, column: 3, scope: !32) -// CHECK:STDOUT: !40 = !DILocation(line: 34, column: 3, scope: !32) -// CHECK:STDOUT: !41 = !DILocation(line: 36, column: 3, scope: !32) -// CHECK:STDOUT: !42 = !DILocation(line: 38, column: 3, scope: !32) -// CHECK:STDOUT: !43 = !DILocation(line: 40, column: 3, scope: !32) -// CHECK:STDOUT: !44 = !DILocation(line: 42, column: 3, scope: !32) -// CHECK:STDOUT: !45 = !DILocation(line: 43, column: 3, scope: !32) -// CHECK:STDOUT: !46 = !DILocation(line: 30, column: 3, scope: !32) -// CHECK:STDOUT: !47 = !DILocation(line: 35, column: 5, scope: !32) -// CHECK:STDOUT: !48 = !DILocation(line: 35, column: 3, scope: !32) -// CHECK:STDOUT: !49 = !DILocation(line: 37, column: 5, scope: !32) -// CHECK:STDOUT: !50 = !DILocation(line: 37, column: 3, scope: !32) -// CHECK:STDOUT: !51 = !DILocation(line: 39, column: 5, scope: !32) -// CHECK:STDOUT: !52 = !DILocation(line: 39, column: 3, scope: !32) -// CHECK:STDOUT: !53 = !DILocation(line: 41, column: 5, scope: !32) -// CHECK:STDOUT: !54 = !DILocation(line: 41, column: 3, scope: !32) -// CHECK:STDOUT: !55 = !DILocation(line: 45, column: 3, scope: !32) -// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.d4b5665541d5d7a8", scope: null, file: !3, line: 19, type: !57, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !59) -// CHECK:STDOUT: !57 = !DISubroutineType(types: !58) -// CHECK:STDOUT: !58 = !{null, !7} -// CHECK:STDOUT: !59 = !{!60} -// CHECK:STDOUT: !60 = !DILocalVariable(arg: 1, scope: !56, type: !7) -// CHECK:STDOUT: !61 = !DILocation(line: 19, column: 1, scope: !56) -// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.29cf1dfeccef7249", scope: null, file: !3, line: 28, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !63) -// CHECK:STDOUT: !63 = !{!64} -// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !62, type: !7) -// CHECK:STDOUT: !65 = !DILocation(line: 29, column: 3, scope: !62) -// CHECK:STDOUT: !66 = !DILocation(line: 31, column: 5, scope: !62) -// CHECK:STDOUT: !67 = !DILocation(line: 31, column: 3, scope: !62) -// CHECK:STDOUT: !68 = !DILocation(line: 34, column: 3, scope: !62) -// CHECK:STDOUT: !69 = !DILocation(line: 36, column: 3, scope: !62) -// CHECK:STDOUT: !70 = !DILocation(line: 38, column: 3, scope: !62) -// CHECK:STDOUT: !71 = !DILocation(line: 40, column: 3, scope: !62) -// CHECK:STDOUT: !72 = !DILocation(line: 42, column: 3, scope: !62) -// CHECK:STDOUT: !73 = !DILocation(line: 43, column: 3, scope: !62) -// CHECK:STDOUT: !74 = !DILocation(line: 30, column: 3, scope: !62) -// CHECK:STDOUT: !75 = !DILocation(line: 35, column: 5, scope: !62) -// CHECK:STDOUT: !76 = !DILocation(line: 35, column: 3, scope: !62) -// CHECK:STDOUT: !77 = !DILocation(line: 37, column: 5, scope: !62) -// CHECK:STDOUT: !78 = !DILocation(line: 37, column: 3, scope: !62) -// CHECK:STDOUT: !79 = !DILocation(line: 39, column: 5, scope: !62) -// CHECK:STDOUT: !80 = !DILocation(line: 39, column: 3, scope: !62) -// CHECK:STDOUT: !81 = !DILocation(line: 41, column: 5, scope: !62) -// CHECK:STDOUT: !82 = !DILocation(line: 41, column: 3, scope: !62) -// CHECK:STDOUT: !83 = !DILocation(line: 45, column: 3, scope: !62) -// CHECK:STDOUT: !84 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 22, type: !33, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !85) -// CHECK:STDOUT: !85 = !{!86} -// CHECK:STDOUT: !86 = !DILocalVariable(arg: 1, scope: !84, type: !28) -// CHECK:STDOUT: !87 = !DILocation(line: 23, column: 3, scope: !84) -// CHECK:STDOUT: !88 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main.582d60b54baf6b63", scope: null, file: !3, line: 22, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !89) -// CHECK:STDOUT: !89 = !{!90} -// CHECK:STDOUT: !90 = !DILocalVariable(arg: 1, scope: !88, type: !7) -// CHECK:STDOUT: !91 = !DILocation(line: 23, column: 3, scope: !88) -// CHECK:STDOUT: !92 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main.de5b400758c39a65", scope: null, file: !3, line: 22, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !93) -// CHECK:STDOUT: !93 = !{!94} -// CHECK:STDOUT: !94 = !DILocalVariable(arg: 1, scope: !92, type: !7) -// CHECK:STDOUT: !95 = !DILocation(line: 23, column: 3, scope: !92) -// CHECK:STDOUT: !96 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 22, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !97) +// CHECK:STDOUT: !13 = !{null, !7} +// CHECK:STDOUT: !14 = !{!15} +// CHECK:STDOUT: !15 = !DILocalVariable(arg: 1, scope: !11, type: !7) +// CHECK:STDOUT: !16 = !DILocation(line: 43, column: 3, scope: !11) +// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "Op", linkageName: "_COp.98006a366c2ffd6c:core.Destroy.Core", scope: null, file: !3, line: 34, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !18) +// CHECK:STDOUT: !18 = !{!19} +// CHECK:STDOUT: !19 = !DILocalVariable(arg: 1, scope: !17, type: !7) +// CHECK:STDOUT: !20 = !DILocation(line: 34, column: 3, scope: !17) +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "M", linkageName: "_CM.Main", scope: null, file: !3, line: 48, type: !22, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !22 = !DISubroutineType(types: !23) +// CHECK:STDOUT: !23 = !{null} +// CHECK:STDOUT: !24 = !DILocation(line: 49, column: 3, scope: !21) +// CHECK:STDOUT: !25 = !DILocation(line: 50, column: 3, scope: !21) +// CHECK:STDOUT: !26 = !DILocation(line: 52, column: 5, scope: !21) +// CHECK:STDOUT: !27 = !DILocation(line: 52, column: 3, scope: !21) +// CHECK:STDOUT: !28 = !DILocation(line: 53, column: 18, scope: !21) +// CHECK:STDOUT: !29 = !DILocation(line: 53, column: 16, scope: !21) +// CHECK:STDOUT: !30 = !DILocation(line: 54, column: 5, scope: !21) +// CHECK:STDOUT: !31 = !DILocation(line: 54, column: 3, scope: !21) +// CHECK:STDOUT: !32 = !DILocation(line: 55, column: 18, scope: !21) +// CHECK:STDOUT: !33 = !DILocation(line: 55, column: 16, scope: !21) +// CHECK:STDOUT: !34 = !DILocation(line: 48, column: 1, scope: !21) +// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 53, type: !36, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !39) +// CHECK:STDOUT: !36 = !DISubroutineType(types: !37) +// CHECK:STDOUT: !37 = !{null, !38} +// CHECK:STDOUT: !38 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !39 = !{!40} +// CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !35, type: !38) +// CHECK:STDOUT: !41 = !DILocation(line: 53, column: 16, scope: !35) +// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.b88d1103f417c6d4", scope: null, file: !3, line: 19, type: !36, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !43) +// CHECK:STDOUT: !43 = !{!44} +// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !42, type: !38) +// CHECK:STDOUT: !45 = !DILocation(line: 19, column: 1, scope: !42) +// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.bfb441135f07cbe1", scope: null, file: !3, line: 28, type: !47, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !49) +// CHECK:STDOUT: !47 = !DISubroutineType(types: !48) +// CHECK:STDOUT: !48 = !{!38, !38} +// CHECK:STDOUT: !49 = !{!50} +// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !46, type: !38) +// CHECK:STDOUT: !51 = !DILocation(line: 29, column: 3, scope: !46) +// CHECK:STDOUT: !52 = !DILocation(line: 31, column: 5, scope: !46) +// CHECK:STDOUT: !53 = !DILocation(line: 31, column: 3, scope: !46) +// CHECK:STDOUT: !54 = !DILocation(line: 34, column: 3, scope: !46) +// CHECK:STDOUT: !55 = !DILocation(line: 36, column: 3, scope: !46) +// CHECK:STDOUT: !56 = !DILocation(line: 38, column: 3, scope: !46) +// CHECK:STDOUT: !57 = !DILocation(line: 40, column: 3, scope: !46) +// CHECK:STDOUT: !58 = !DILocation(line: 42, column: 3, scope: !46) +// CHECK:STDOUT: !59 = !DILocation(line: 43, column: 3, scope: !46) +// CHECK:STDOUT: !60 = !DILocation(line: 30, column: 3, scope: !46) +// CHECK:STDOUT: !61 = !DILocation(line: 35, column: 5, scope: !46) +// CHECK:STDOUT: !62 = !DILocation(line: 35, column: 3, scope: !46) +// CHECK:STDOUT: !63 = !DILocation(line: 37, column: 5, scope: !46) +// CHECK:STDOUT: !64 = !DILocation(line: 37, column: 3, scope: !46) +// CHECK:STDOUT: !65 = !DILocation(line: 39, column: 5, scope: !46) +// CHECK:STDOUT: !66 = !DILocation(line: 39, column: 3, scope: !46) +// CHECK:STDOUT: !67 = !DILocation(line: 41, column: 5, scope: !46) +// CHECK:STDOUT: !68 = !DILocation(line: 41, column: 3, scope: !46) +// CHECK:STDOUT: !69 = !DILocation(line: 45, column: 3, scope: !46) +// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.d4b5665541d5d7a8", scope: null, file: !3, line: 19, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !71) +// CHECK:STDOUT: !71 = !{!72} +// CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !70, type: !7) +// CHECK:STDOUT: !73 = !DILocation(line: 19, column: 1, scope: !70) +// CHECK:STDOUT: !74 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.29cf1dfeccef7249", scope: null, file: !3, line: 28, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !75) +// CHECK:STDOUT: !75 = !{!76} +// CHECK:STDOUT: !76 = !DILocalVariable(arg: 1, scope: !74, type: !7) +// CHECK:STDOUT: !77 = !DILocation(line: 29, column: 3, scope: !74) +// CHECK:STDOUT: !78 = !DILocation(line: 31, column: 5, scope: !74) +// CHECK:STDOUT: !79 = !DILocation(line: 31, column: 3, scope: !74) +// CHECK:STDOUT: !80 = !DILocation(line: 34, column: 3, scope: !74) +// CHECK:STDOUT: !81 = !DILocation(line: 36, column: 3, scope: !74) +// CHECK:STDOUT: !82 = !DILocation(line: 38, column: 3, scope: !74) +// CHECK:STDOUT: !83 = !DILocation(line: 40, column: 3, scope: !74) +// CHECK:STDOUT: !84 = !DILocation(line: 42, column: 3, scope: !74) +// CHECK:STDOUT: !85 = !DILocation(line: 43, column: 3, scope: !74) +// CHECK:STDOUT: !86 = !DILocation(line: 30, column: 3, scope: !74) +// CHECK:STDOUT: !87 = !DILocation(line: 35, column: 5, scope: !74) +// CHECK:STDOUT: !88 = !DILocation(line: 35, column: 3, scope: !74) +// CHECK:STDOUT: !89 = !DILocation(line: 37, column: 5, scope: !74) +// CHECK:STDOUT: !90 = !DILocation(line: 37, column: 3, scope: !74) +// CHECK:STDOUT: !91 = !DILocation(line: 39, column: 5, scope: !74) +// CHECK:STDOUT: !92 = !DILocation(line: 39, column: 3, scope: !74) +// CHECK:STDOUT: !93 = !DILocation(line: 41, column: 5, scope: !74) +// CHECK:STDOUT: !94 = !DILocation(line: 41, column: 3, scope: !74) +// CHECK:STDOUT: !95 = !DILocation(line: 45, column: 3, scope: !74) +// CHECK:STDOUT: !96 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 22, type: !47, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !97) // CHECK:STDOUT: !97 = !{!98} -// CHECK:STDOUT: !98 = !DILocalVariable(arg: 1, scope: !96, type: !7) +// CHECK:STDOUT: !98 = !DILocalVariable(arg: 1, scope: !96, type: !38) // CHECK:STDOUT: !99 = !DILocation(line: 23, column: 3, scope: !96) -// CHECK:STDOUT: !100 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main.706e9f413f1bae3d", scope: null, file: !3, line: 22, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !101) +// CHECK:STDOUT: !100 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main.582d60b54baf6b63", scope: null, file: !3, line: 22, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !101) // CHECK:STDOUT: !101 = !{!102} // CHECK:STDOUT: !102 = !DILocalVariable(arg: 1, scope: !100, type: !7) -// CHECK:STDOUT: !103 = !DILocation(line: 23, column: 10, scope: !100) -// CHECK:STDOUT: !104 = !DILocation(line: 23, column: 3, scope: !100) +// CHECK:STDOUT: !103 = !DILocation(line: 23, column: 3, scope: !100) +// CHECK:STDOUT: !104 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main.de5b400758c39a65", scope: null, file: !3, line: 22, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !105) +// CHECK:STDOUT: !105 = !{!106} +// CHECK:STDOUT: !106 = !DILocalVariable(arg: 1, scope: !104, type: !7) +// CHECK:STDOUT: !107 = !DILocation(line: 23, column: 3, scope: !104) +// CHECK:STDOUT: !108 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 22, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !109) +// CHECK:STDOUT: !109 = !{!110} +// CHECK:STDOUT: !110 = !DILocalVariable(arg: 1, scope: !108, type: !7) +// CHECK:STDOUT: !111 = !DILocation(line: 23, column: 3, scope: !108) +// CHECK:STDOUT: !112 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main.706e9f413f1bae3d", scope: null, file: !3, line: 22, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !113) +// CHECK:STDOUT: !113 = !{!114} +// CHECK:STDOUT: !114 = !DILocalVariable(arg: 1, scope: !112, type: !7) +// CHECK:STDOUT: !115 = !DILocation(line: 23, column: 10, scope: !112) +// CHECK:STDOUT: !116 = !DILocation(line: 23, column: 3, scope: !112) diff --git a/toolchain/lower/testdata/function/generic/call_basic_depth.carbon b/toolchain/lower/testdata/function/generic/call_basic_depth.carbon index 6bbd705407a4..2221df33c649 100644 --- a/toolchain/lower/testdata/function/generic/call_basic_depth.carbon +++ b/toolchain/lower/testdata/function/generic/call_basic_depth.carbon @@ -54,37 +54,47 @@ fn M() -> i32 { // CHECK:STDOUT: %G.call = call i32 @_CG.Main.bfb441135f07cbe1(i32 %.loc35_9), !dbg !13 // CHECK:STDOUT: store i32 %G.call, ptr %m.var, align 4, !dbg !14 // CHECK:STDOUT: %.loc36 = load i32, ptr %m.var, align 4, !dbg !15 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %m.var), !dbg !9 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %n.var), !dbg !8 // CHECK:STDOUT: ret i32 %.loc36, !dbg !16 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !17 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !22 +// 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.b88d1103f417c6d4(i32 %_) #0 !dbg !17 { +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.b88d1103f417c6d4(i32 %_) #0 !dbg !23 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !22 +// CHECK:STDOUT: ret void, !dbg !26 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CG.Main.bfb441135f07cbe1(i32 %x) #0 !dbg !23 { +// CHECK:STDOUT: define linkonce_odr i32 @_CG.Main.bfb441135f07cbe1(i32 %x) #0 !dbg !27 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc25_6.2.temp = alloca i32, align 4, !dbg !28 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_6.2.temp), !dbg !28 -// CHECK:STDOUT: %H.call = call i32 @_CH.Main.64ccbb8e5d9a0b8e(i32 %x), !dbg !28 -// CHECK:STDOUT: store i32 %H.call, ptr %.loc25_6.2.temp, align 4, !dbg !28 -// CHECK:STDOUT: call void @_CF.Main.b88d1103f417c6d4(i32 %x), !dbg !29 -// CHECK:STDOUT: ret i32 %x, !dbg !30 +// CHECK:STDOUT: %.loc25_6.2.temp = alloca i32, align 4, !dbg !32 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_6.2.temp), !dbg !32 +// CHECK:STDOUT: %H.call = call i32 @_CH.Main.64ccbb8e5d9a0b8e(i32 %x), !dbg !32 +// CHECK:STDOUT: store i32 %H.call, ptr %.loc25_6.2.temp, align 4, !dbg !32 +// CHECK:STDOUT: call void @_CF.Main.b88d1103f417c6d4(i32 %x), !dbg !33 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %.loc25_6.2.temp), !dbg !32 +// CHECK:STDOUT: ret i32 %x, !dbg !34 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CH.Main.64ccbb8e5d9a0b8e(i32 %x) #0 !dbg !31 { +// CHECK:STDOUT: define linkonce_odr i32 @_CH.Main.64ccbb8e5d9a0b8e(i32 %x) #0 !dbg !35 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.Main.b88d1103f417c6d4(i32 %x), !dbg !34 -// CHECK:STDOUT: ret i32 %x, !dbg !35 +// CHECK:STDOUT: call void @_CF.Main.b88d1103f417c6d4(i32 %x), !dbg !38 +// CHECK:STDOUT: ret i32 %x, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @"_COp.7e389eab4a7e5487:core.Destroy.Core", { 0, 2, 1 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 0, 2, 1 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -110,22 +120,26 @@ fn M() -> i32 { // CHECK:STDOUT: !14 = !DILocation(line: 35, column: 3, scope: !4) // CHECK:STDOUT: !15 = !DILocation(line: 36, column: 10, scope: !4) // CHECK:STDOUT: !16 = !DILocation(line: 36, column: 3, scope: !4) -// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.b88d1103f417c6d4", scope: null, file: !3, line: 16, type: !18, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !20) +// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 35, type: !18, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !20) // CHECK:STDOUT: !18 = !DISubroutineType(types: !19) // CHECK:STDOUT: !19 = !{null, !7} // CHECK:STDOUT: !20 = !{!21} // CHECK:STDOUT: !21 = !DILocalVariable(arg: 1, scope: !17, type: !7) -// CHECK:STDOUT: !22 = !DILocation(line: 16, column: 1, scope: !17) -// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.bfb441135f07cbe1", scope: null, file: !3, line: 24, type: !24, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !26) -// CHECK:STDOUT: !24 = !DISubroutineType(types: !25) -// CHECK:STDOUT: !25 = !{!7, !7} -// CHECK:STDOUT: !26 = !{!27} -// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !23, type: !7) -// CHECK:STDOUT: !28 = !DILocation(line: 25, column: 3, scope: !23) -// CHECK:STDOUT: !29 = !DILocation(line: 26, column: 3, scope: !23) -// CHECK:STDOUT: !30 = !DILocation(line: 27, column: 3, scope: !23) -// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 19, type: !24, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !32) -// CHECK:STDOUT: !32 = !{!33} -// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !31, type: !7) -// CHECK:STDOUT: !34 = !DILocation(line: 20, column: 3, scope: !31) -// CHECK:STDOUT: !35 = !DILocation(line: 21, column: 3, scope: !31) +// CHECK:STDOUT: !22 = !DILocation(line: 35, column: 7, scope: !17) +// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.b88d1103f417c6d4", scope: null, file: !3, line: 16, type: !18, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !24) +// CHECK:STDOUT: !24 = !{!25} +// CHECK:STDOUT: !25 = !DILocalVariable(arg: 1, scope: !23, type: !7) +// CHECK:STDOUT: !26 = !DILocation(line: 16, column: 1, scope: !23) +// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.bfb441135f07cbe1", scope: null, file: !3, line: 24, type: !28, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !30) +// CHECK:STDOUT: !28 = !DISubroutineType(types: !29) +// CHECK:STDOUT: !29 = !{!7, !7} +// CHECK:STDOUT: !30 = !{!31} +// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !27, type: !7) +// CHECK:STDOUT: !32 = !DILocation(line: 25, column: 3, scope: !27) +// CHECK:STDOUT: !33 = !DILocation(line: 26, column: 3, scope: !27) +// CHECK:STDOUT: !34 = !DILocation(line: 27, column: 3, scope: !27) +// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 19, type: !28, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !36) +// CHECK:STDOUT: !36 = !{!37} +// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !35, type: !7) +// CHECK:STDOUT: !38 = !DILocation(line: 20, column: 3, scope: !35) +// CHECK:STDOUT: !39 = !DILocation(line: 21, column: 3, scope: !35) diff --git a/toolchain/lower/testdata/function/generic/call_deref_ptr.carbon b/toolchain/lower/testdata/function/generic/call_deref_ptr.carbon index f0a9b8dbb863..777268cf87ad 100644 --- a/toolchain/lower/testdata/function/generic/call_deref_ptr.carbon +++ b/toolchain/lower/testdata/function/generic/call_deref_ptr.carbon @@ -61,63 +61,77 @@ fn M() { // CHECK:STDOUT: ret void, !dbg !13 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !14 { +// 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.98006a366c2ffd6c:core.Destroy.Core"(ptr %self) #0 !dbg !21 { +// CHECK:STDOUT: entry: +// 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 @_CF.Main.bfb441135f07cbe1(ptr %x) #0 !dbg !14 { +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.bfb441135f07cbe1(ptr %x) #0 !dbg !28 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %A.call = call %type @_CA.Main.582d60b54baf6b63(%type zeroinitializer), !dbg !20 -// CHECK:STDOUT: call void @_CB.Main.bfb441135f07cbe1(ptr %x), !dbg !21 -// CHECK:STDOUT: ret void, !dbg !22 +// CHECK:STDOUT: %A.call = call %type @_CA.Main.582d60b54baf6b63(%type zeroinitializer), !dbg !31 +// CHECK:STDOUT: call void @_CB.Main.bfb441135f07cbe1(ptr %x), !dbg !32 +// CHECK:STDOUT: ret void, !dbg !33 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Main.29cf1dfeccef7249(ptr %x) #0 !dbg !23 { +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.29cf1dfeccef7249(ptr %x) #0 !dbg !34 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %A.call = call %type @_CA.Main.582d60b54baf6b63(%type zeroinitializer), !dbg !26 -// CHECK:STDOUT: call void @_CB.Main.29cf1dfeccef7249(ptr %x), !dbg !27 -// CHECK:STDOUT: ret void, !dbg !28 +// CHECK:STDOUT: %A.call = call %type @_CA.Main.582d60b54baf6b63(%type zeroinitializer), !dbg !37 +// CHECK:STDOUT: call void @_CB.Main.29cf1dfeccef7249(ptr %x), !dbg !38 +// CHECK:STDOUT: ret void, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr %type @_CA.Main.582d60b54baf6b63(%type %x) #0 !dbg !29 { +// CHECK:STDOUT: define linkonce_odr %type @_CA.Main.582d60b54baf6b63(%type %x) #0 !dbg !40 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret %type %x, !dbg !34 +// CHECK:STDOUT: ret %type %x, !dbg !45 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CB.Main.bfb441135f07cbe1(ptr %x) #0 !dbg !35 { +// CHECK:STDOUT: define linkonce_odr void @_CB.Main.bfb441135f07cbe1(ptr %x) #0 !dbg !46 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc27_7.2.temp = alloca i32, align 4, !dbg !38 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc27_7.2.temp), !dbg !38 -// CHECK:STDOUT: %.loc27_5.2 = load i32, ptr %x, align 4, !dbg !39 -// CHECK:STDOUT: %D.call = call i32 @_CD.Main.64ccbb8e5d9a0b8e(i32 %.loc27_5.2), !dbg !38 -// CHECK:STDOUT: store i32 %D.call, ptr %.loc27_7.2.temp, align 4, !dbg !38 -// CHECK:STDOUT: ret void, !dbg !40 +// CHECK:STDOUT: %.loc27_7.2.temp = alloca i32, align 4, !dbg !49 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc27_7.2.temp), !dbg !49 +// CHECK:STDOUT: %.loc27_5.2 = load i32, ptr %x, align 4, !dbg !50 +// CHECK:STDOUT: %D.call = call i32 @_CD.Main.64ccbb8e5d9a0b8e(i32 %.loc27_5.2), !dbg !49 +// CHECK:STDOUT: store i32 %D.call, ptr %.loc27_7.2.temp, align 4, !dbg !49 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %.loc27_7.2.temp), !dbg !49 +// CHECK:STDOUT: ret void, !dbg !51 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CB.Main.29cf1dfeccef7249(ptr %x) #0 !dbg !41 { +// CHECK:STDOUT: define linkonce_odr void @_CB.Main.29cf1dfeccef7249(ptr %x) #0 !dbg !52 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc27_7.2.temp = alloca double, align 8, !dbg !44 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc27_7.2.temp), !dbg !44 -// CHECK:STDOUT: %.loc27_5.2 = load double, ptr %x, align 8, !dbg !45 -// CHECK:STDOUT: %D.call = call double @_CD.Main.de5b400758c39a65(double %.loc27_5.2), !dbg !44 -// CHECK:STDOUT: store double %D.call, ptr %.loc27_7.2.temp, align 8, !dbg !44 -// CHECK:STDOUT: ret void, !dbg !46 +// CHECK:STDOUT: %.loc27_7.2.temp = alloca double, align 8, !dbg !55 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc27_7.2.temp), !dbg !55 +// CHECK:STDOUT: %.loc27_5.2 = load double, ptr %x, align 8, !dbg !56 +// CHECK:STDOUT: %D.call = call double @_CD.Main.de5b400758c39a65(double %.loc27_5.2), !dbg !55 +// CHECK:STDOUT: store double %D.call, ptr %.loc27_7.2.temp, align 8, !dbg !55 +// CHECK:STDOUT: call void @"_COp.98006a366c2ffd6c:core.Destroy.Core"(ptr %.loc27_7.2.temp), !dbg !55 +// CHECK:STDOUT: ret void, !dbg !57 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CD.Main.64ccbb8e5d9a0b8e(i32 %x) #0 !dbg !47 { +// CHECK:STDOUT: define linkonce_odr i32 @_CD.Main.64ccbb8e5d9a0b8e(i32 %x) #0 !dbg !58 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret i32 %x, !dbg !53 +// CHECK:STDOUT: ret i32 %x, !dbg !63 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CD.Main.de5b400758c39a65(double %x) #0 !dbg !54 { +// CHECK:STDOUT: define linkonce_odr double @_CD.Main.de5b400758c39a65(double %x) #0 !dbg !64 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret double %x, !dbg !57 +// CHECK:STDOUT: ret double %x, !dbg !67 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -144,47 +158,57 @@ fn M() { // CHECK:STDOUT: !11 = !DILocation(line: 40, column: 5, scope: !4) // CHECK:STDOUT: !12 = !DILocation(line: 40, column: 3, scope: !4) // CHECK:STDOUT: !13 = !DILocation(line: 35, column: 1, scope: !4) -// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.bfb441135f07cbe1", scope: null, file: !3, line: 30, type: !15, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !18) +// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 39, type: !15, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !18) // CHECK:STDOUT: !15 = !DISubroutineType(types: !16) // CHECK:STDOUT: !16 = !{null, !17} -// CHECK:STDOUT: !17 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !17 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) // CHECK:STDOUT: !18 = !{!19} // CHECK:STDOUT: !19 = !DILocalVariable(arg: 1, scope: !14, type: !17) -// CHECK:STDOUT: !20 = !DILocation(line: 31, column: 3, scope: !14) -// CHECK:STDOUT: !21 = !DILocation(line: 32, column: 3, scope: !14) -// CHECK:STDOUT: !22 = !DILocation(line: 30, column: 1, scope: !14) -// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.29cf1dfeccef7249", scope: null, file: !3, line: 30, type: !15, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !24) -// CHECK:STDOUT: !24 = !{!25} -// CHECK:STDOUT: !25 = !DILocalVariable(arg: 1, scope: !23, type: !17) -// CHECK:STDOUT: !26 = !DILocation(line: 31, column: 3, scope: !23) -// CHECK:STDOUT: !27 = !DILocation(line: 32, column: 3, scope: !23) -// CHECK:STDOUT: !28 = !DILocation(line: 30, column: 1, scope: !23) -// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.582d60b54baf6b63", scope: null, file: !3, line: 18, type: !30, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !32) -// CHECK:STDOUT: !30 = !DISubroutineType(types: !31) -// CHECK:STDOUT: !31 = !{!17, !17} -// CHECK:STDOUT: !32 = !{!33} -// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !29, type: !17) -// CHECK:STDOUT: !34 = !DILocation(line: 19, column: 3, scope: !29) -// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.bfb441135f07cbe1", scope: null, file: !3, line: 26, type: !15, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !36) -// CHECK:STDOUT: !36 = !{!37} -// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !35, type: !17) -// CHECK:STDOUT: !38 = !DILocation(line: 27, column: 3, scope: !35) -// CHECK:STDOUT: !39 = !DILocation(line: 27, column: 5, scope: !35) -// CHECK:STDOUT: !40 = !DILocation(line: 26, column: 1, scope: !35) -// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.29cf1dfeccef7249", scope: null, file: !3, line: 26, type: !15, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !42) -// CHECK:STDOUT: !42 = !{!43} -// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !41, type: !17) -// CHECK:STDOUT: !44 = !DILocation(line: 27, column: 3, scope: !41) -// CHECK:STDOUT: !45 = !DILocation(line: 27, column: 5, scope: !41) -// CHECK:STDOUT: !46 = !DILocation(line: 26, column: 1, scope: !41) -// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 22, type: !48, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !51) -// CHECK:STDOUT: !48 = !DISubroutineType(types: !49) -// CHECK:STDOUT: !49 = !{!50, !50} -// CHECK:STDOUT: !50 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !51 = !{!52} -// CHECK:STDOUT: !52 = !DILocalVariable(arg: 1, scope: !47, type: !50) -// CHECK:STDOUT: !53 = !DILocation(line: 23, column: 3, scope: !47) -// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.de5b400758c39a65", scope: null, file: !3, line: 22, type: !30, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !55) -// CHECK:STDOUT: !55 = !{!56} -// CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !54, type: !17) -// CHECK:STDOUT: !57 = !DILocation(line: 23, column: 3, scope: !54) +// CHECK:STDOUT: !20 = !DILocation(line: 39, column: 3, scope: !14) +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "Op", linkageName: "_COp.98006a366c2ffd6c:core.Destroy.Core", scope: null, file: !3, line: 40, type: !22, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !25) +// CHECK:STDOUT: !22 = !DISubroutineType(types: !23) +// CHECK:STDOUT: !23 = !{null, !24} +// CHECK:STDOUT: !24 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !25 = !{!26} +// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !21, type: !24) +// CHECK:STDOUT: !27 = !DILocation(line: 40, column: 3, scope: !21) +// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.bfb441135f07cbe1", scope: null, file: !3, line: 30, type: !22, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !29) +// CHECK:STDOUT: !29 = !{!30} +// CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !28, type: !24) +// CHECK:STDOUT: !31 = !DILocation(line: 31, column: 3, scope: !28) +// CHECK:STDOUT: !32 = !DILocation(line: 32, column: 3, scope: !28) +// CHECK:STDOUT: !33 = !DILocation(line: 30, column: 1, scope: !28) +// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.29cf1dfeccef7249", scope: null, file: !3, line: 30, type: !22, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !35) +// CHECK:STDOUT: !35 = !{!36} +// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !34, type: !24) +// CHECK:STDOUT: !37 = !DILocation(line: 31, column: 3, scope: !34) +// CHECK:STDOUT: !38 = !DILocation(line: 32, column: 3, scope: !34) +// CHECK:STDOUT: !39 = !DILocation(line: 30, column: 1, scope: !34) +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.582d60b54baf6b63", scope: null, file: !3, line: 18, type: !41, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !43) +// CHECK:STDOUT: !41 = !DISubroutineType(types: !42) +// CHECK:STDOUT: !42 = !{!24, !24} +// CHECK:STDOUT: !43 = !{!44} +// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !40, type: !24) +// CHECK:STDOUT: !45 = !DILocation(line: 19, column: 3, scope: !40) +// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.bfb441135f07cbe1", scope: null, file: !3, line: 26, type: !22, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !47) +// CHECK:STDOUT: !47 = !{!48} +// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !46, type: !24) +// CHECK:STDOUT: !49 = !DILocation(line: 27, column: 3, scope: !46) +// CHECK:STDOUT: !50 = !DILocation(line: 27, column: 5, scope: !46) +// CHECK:STDOUT: !51 = !DILocation(line: 26, column: 1, scope: !46) +// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.29cf1dfeccef7249", scope: null, file: !3, line: 26, type: !22, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !53) +// CHECK:STDOUT: !53 = !{!54} +// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !52, type: !24) +// CHECK:STDOUT: !55 = !DILocation(line: 27, column: 3, scope: !52) +// CHECK:STDOUT: !56 = !DILocation(line: 27, column: 5, scope: !52) +// CHECK:STDOUT: !57 = !DILocation(line: 26, column: 1, scope: !52) +// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 22, type: !59, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !61) +// CHECK:STDOUT: !59 = !DISubroutineType(types: !60) +// CHECK:STDOUT: !60 = !{!17, !17} +// CHECK:STDOUT: !61 = !{!62} +// CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !58, type: !17) +// CHECK:STDOUT: !63 = !DILocation(line: 23, column: 3, scope: !58) +// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.de5b400758c39a65", scope: null, file: !3, line: 22, type: !41, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !65) +// CHECK:STDOUT: !65 = !{!66} +// CHECK:STDOUT: !66 = !DILocalVariable(arg: 1, scope: !64, type: !24) +// CHECK:STDOUT: !67 = !DILocation(line: 23, column: 3, scope: !64) 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 881d93e1e677..893ed0afa100 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 @@ -55,44 +55,51 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @"_CF.Y.Main:I.Main"() #0 !dbg !10 { +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !10 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 2), !dbg !14 -// CHECK:STDOUT: ret i32 2, !dbg !15 +// CHECK:STDOUT: ret void, !dbg !16 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @main() #0 !dbg !16 { +// CHECK:STDOUT: define i32 @"_CF.Y.Main:I.Main"() #0 !dbg !17 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CG.Main.27a852a6bab6ed2e(), !dbg !19 -// CHECK:STDOUT: call void @_CG.Main.2de7c972fe093485(), !dbg !20 -// CHECK:STDOUT: ret void, !dbg !21 +// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 2), !dbg !20 +// CHECK:STDOUT: ret i32 2, !dbg !21 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @main() #0 !dbg !22 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_CG.Main.27a852a6bab6ed2e(), !dbg !25 +// CHECK:STDOUT: call void @_CG.Main.2de7c972fe093485(), !dbg !26 +// CHECK:STDOUT: ret void, !dbg !27 // 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.27a852a6bab6ed2e() #0 !dbg !22 { +// CHECK:STDOUT: define linkonce_odr void @_CG.Main.27a852a6bab6ed2e() #0 !dbg !28 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc37_20.1.temp = alloca i1, align 1, !dbg !23 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc37_20.1.temp), !dbg !23 -// CHECK:STDOUT: %I.WithSelf.F.call = call i1 @"_CF.X.Main:I.Main"(), !dbg !23 -// CHECK:STDOUT: %.loc37_20.2 = zext i1 %I.WithSelf.F.call to i8, !dbg !23 -// CHECK:STDOUT: store i8 %.loc37_20.2, ptr %.loc37_20.1.temp, align 1, !dbg !23 -// CHECK:STDOUT: %.loc37_20.3 = load i8, ptr %.loc37_20.1.temp, align 1, !dbg !23 -// CHECK:STDOUT: %.loc37_20.31 = trunc i8 %.loc37_20.3 to i1, !dbg !23 -// CHECK:STDOUT: ret void, !dbg !24 +// CHECK:STDOUT: %.loc37_20.1.temp = alloca i1, align 1, !dbg !29 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc37_20.1.temp), !dbg !29 +// CHECK:STDOUT: %I.WithSelf.F.call = call i1 @"_CF.X.Main:I.Main"(), !dbg !29 +// CHECK:STDOUT: %.loc37_20.2 = zext i1 %I.WithSelf.F.call to i8, !dbg !29 +// CHECK:STDOUT: store i8 %.loc37_20.2, ptr %.loc37_20.1.temp, align 1, !dbg !29 +// CHECK:STDOUT: %.loc37_20.3 = load i8, ptr %.loc37_20.1.temp, align 1, !dbg !29 +// CHECK:STDOUT: %.loc37_20.31 = trunc i8 %.loc37_20.3 to i1, !dbg !29 +// CHECK:STDOUT: ret void, !dbg !30 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CG.Main.2de7c972fe093485() #0 !dbg !25 { +// CHECK:STDOUT: define linkonce_odr void @_CG.Main.2de7c972fe093485() #0 !dbg !31 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc37_20.1.temp = alloca i32, align 4, !dbg !26 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc37_20.1.temp), !dbg !26 -// CHECK:STDOUT: %I.WithSelf.F.call = call i32 @"_CF.Y.Main:I.Main"(), !dbg !26 -// CHECK:STDOUT: store i32 %I.WithSelf.F.call, ptr %.loc37_20.1.temp, align 4, !dbg !26 -// CHECK:STDOUT: %.loc37_20.3 = load i32, ptr %.loc37_20.1.temp, align 4, !dbg !26 -// CHECK:STDOUT: ret void, !dbg !27 +// CHECK:STDOUT: %.loc37_20.1.temp = alloca i32, align 4, !dbg !32 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc37_20.1.temp), !dbg !32 +// CHECK:STDOUT: %I.WithSelf.F.call = call i32 @"_CF.Y.Main:I.Main"(), !dbg !32 +// CHECK:STDOUT: store i32 %I.WithSelf.F.call, ptr %.loc37_20.1.temp, align 4, !dbg !32 +// CHECK:STDOUT: %.loc37_20.3 = load i32, ptr %.loc37_20.1.temp, align 4, !dbg !32 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %.loc37_20.1.temp), !dbg !32 +// CHECK:STDOUT: ret void, !dbg !33 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -118,21 +125,27 @@ fn Run() { // CHECK:STDOUT: !7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !8 = !DILocation(line: 22, column: 5, scope: !4) // CHECK:STDOUT: !9 = !DILocation(line: 23, column: 5, scope: !4) -// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "F", linkageName: "_CF.Y.Main:I.Main", scope: null, file: !3, line: 28, type: !11, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 27, type: !11, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !14) // CHECK:STDOUT: !11 = !DISubroutineType(types: !12) -// CHECK:STDOUT: !12 = !{!13} +// CHECK:STDOUT: !12 = !{null, !13} // CHECK:STDOUT: !13 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !14 = !DILocation(line: 29, column: 5, scope: !10) -// CHECK:STDOUT: !15 = !DILocation(line: 30, column: 5, scope: !10) -// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !3, line: 40, type: !17, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !17 = !DISubroutineType(types: !18) -// CHECK:STDOUT: !18 = !{null} -// CHECK:STDOUT: !19 = !DILocation(line: 41, column: 3, scope: !16) -// CHECK:STDOUT: !20 = !DILocation(line: 42, column: 3, scope: !16) -// CHECK:STDOUT: !21 = !DILocation(line: 40, column: 1, scope: !16) -// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.27a852a6bab6ed2e", scope: null, file: !3, line: 36, type: !17, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !23 = !DILocation(line: 37, column: 16, scope: !22) -// CHECK:STDOUT: !24 = !DILocation(line: 36, column: 1, scope: !22) -// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.2de7c972fe093485", scope: null, file: !3, line: 36, type: !17, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !26 = !DILocation(line: 37, column: 16, scope: !25) -// CHECK:STDOUT: !27 = !DILocation(line: 36, column: 1, scope: !25) +// CHECK:STDOUT: !14 = !{!15} +// CHECK:STDOUT: !15 = !DILocalVariable(arg: 1, scope: !10, type: !13) +// CHECK:STDOUT: !16 = !DILocation(line: 27, column: 24, scope: !10) +// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "F", linkageName: "_CF.Y.Main:I.Main", scope: null, file: !3, line: 28, type: !18, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !18 = !DISubroutineType(types: !19) +// CHECK:STDOUT: !19 = !{!13} +// CHECK:STDOUT: !20 = !DILocation(line: 29, column: 5, scope: !17) +// CHECK:STDOUT: !21 = !DILocation(line: 30, column: 5, scope: !17) +// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !3, line: 40, type: !23, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !23 = !DISubroutineType(types: !24) +// CHECK:STDOUT: !24 = !{null} +// CHECK:STDOUT: !25 = !DILocation(line: 41, column: 3, scope: !22) +// CHECK:STDOUT: !26 = !DILocation(line: 42, column: 3, scope: !22) +// CHECK:STDOUT: !27 = !DILocation(line: 40, column: 1, scope: !22) +// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.27a852a6bab6ed2e", scope: null, file: !3, line: 36, type: !23, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !29 = !DILocation(line: 37, column: 16, scope: !28) +// CHECK:STDOUT: !30 = !DILocation(line: 36, column: 1, scope: !28) +// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.2de7c972fe093485", scope: null, file: !3, line: 36, type: !23, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !32 = !DILocation(line: 37, column: 16, scope: !31) +// CHECK:STDOUT: !33 = !DILocation(line: 36, column: 1, scope: !31) diff --git a/toolchain/lower/testdata/function/generic/call_different_specific.carbon b/toolchain/lower/testdata/function/generic/call_different_specific.carbon index 784ab60c63f2..d2d3c3eeca98 100644 --- a/toolchain/lower/testdata/function/generic/call_different_specific.carbon +++ b/toolchain/lower/testdata/function/generic/call_different_specific.carbon @@ -58,62 +58,76 @@ fn M(ptr_i32: i32*, ptr_f64: f64*) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Main.bfb441135f07cbe1(ptr %x) #0 !dbg !14 { +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !14 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %A.call = call %type @_CA.Main.582d60b54baf6b63(%type zeroinitializer), !dbg !19 -// CHECK:STDOUT: call void @_CB.Main.bfb441135f07cbe1(ptr %x), !dbg !20 -// CHECK:STDOUT: ret void, !dbg !21 +// CHECK:STDOUT: ret void, !dbg !20 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Main.29cf1dfeccef7249(ptr %x) #0 !dbg !22 { +// CHECK:STDOUT: define weak_odr void @"_COp.98006a366c2ffd6c:core.Destroy.Core"(ptr %self) #0 !dbg !21 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %A.call = call %type @_CA.Main.582d60b54baf6b63(%type zeroinitializer), !dbg !25 -// CHECK:STDOUT: call void @_CB.Main.29cf1dfeccef7249(ptr %x), !dbg !26 -// CHECK:STDOUT: ret void, !dbg !27 +// CHECK:STDOUT: ret void, !dbg !26 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr %type @_CA.Main.582d60b54baf6b63(%type %x) #0 !dbg !28 { +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.bfb441135f07cbe1(ptr %x) #0 !dbg !27 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret %type %x, !dbg !33 +// CHECK:STDOUT: %A.call = call %type @_CA.Main.582d60b54baf6b63(%type zeroinitializer), !dbg !30 +// CHECK:STDOUT: call void @_CB.Main.bfb441135f07cbe1(ptr %x), !dbg !31 +// CHECK:STDOUT: ret void, !dbg !32 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CB.Main.bfb441135f07cbe1(ptr %x) #0 !dbg !34 { +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.29cf1dfeccef7249(ptr %x) #0 !dbg !33 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc34_7.2.temp = alloca i32, align 4, !dbg !37 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc34_7.2.temp), !dbg !37 -// CHECK:STDOUT: %.loc34_5.2 = load i32, ptr %x, align 4, !dbg !38 -// CHECK:STDOUT: %D.call = call i32 @_CD.Main.64ccbb8e5d9a0b8e(i32 %.loc34_5.2), !dbg !37 -// CHECK:STDOUT: store i32 %D.call, ptr %.loc34_7.2.temp, align 4, !dbg !37 -// CHECK:STDOUT: ret void, !dbg !39 +// CHECK:STDOUT: %A.call = call %type @_CA.Main.582d60b54baf6b63(%type zeroinitializer), !dbg !36 +// CHECK:STDOUT: call void @_CB.Main.29cf1dfeccef7249(ptr %x), !dbg !37 +// CHECK:STDOUT: ret void, !dbg !38 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CB.Main.29cf1dfeccef7249(ptr %x) #0 !dbg !40 { +// CHECK:STDOUT: define linkonce_odr %type @_CA.Main.582d60b54baf6b63(%type %x) #0 !dbg !39 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc34_7.2.temp = alloca double, align 8, !dbg !43 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc34_7.2.temp), !dbg !43 -// CHECK:STDOUT: %.loc34_5.2 = load double, ptr %x, align 8, !dbg !44 -// CHECK:STDOUT: %D.call = call double @_CD.Main.de5b400758c39a65(double %.loc34_5.2), !dbg !43 -// CHECK:STDOUT: store double %D.call, ptr %.loc34_7.2.temp, align 8, !dbg !43 -// CHECK:STDOUT: ret void, !dbg !45 +// CHECK:STDOUT: ret %type %x, !dbg !44 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CB.Main.bfb441135f07cbe1(ptr %x) #0 !dbg !45 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc34_7.2.temp = alloca i32, align 4, !dbg !48 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc34_7.2.temp), !dbg !48 +// CHECK:STDOUT: %.loc34_5.2 = load i32, ptr %x, align 4, !dbg !49 +// CHECK:STDOUT: %D.call = call i32 @_CD.Main.64ccbb8e5d9a0b8e(i32 %.loc34_5.2), !dbg !48 +// CHECK:STDOUT: store i32 %D.call, ptr %.loc34_7.2.temp, align 4, !dbg !48 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %.loc34_7.2.temp), !dbg !48 +// CHECK:STDOUT: ret void, !dbg !50 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CB.Main.29cf1dfeccef7249(ptr %x) #0 !dbg !51 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc34_7.2.temp = alloca double, align 8, !dbg !54 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc34_7.2.temp), !dbg !54 +// CHECK:STDOUT: %.loc34_5.2 = load double, ptr %x, align 8, !dbg !55 +// CHECK:STDOUT: %D.call = call double @_CD.Main.de5b400758c39a65(double %.loc34_5.2), !dbg !54 +// CHECK:STDOUT: store double %D.call, ptr %.loc34_7.2.temp, align 8, !dbg !54 +// CHECK:STDOUT: call void @"_COp.98006a366c2ffd6c:core.Destroy.Core"(ptr %.loc34_7.2.temp), !dbg !54 +// 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: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CD.Main.64ccbb8e5d9a0b8e(i32 %x) #0 !dbg !46 { +// CHECK:STDOUT: define linkonce_odr i32 @_CD.Main.64ccbb8e5d9a0b8e(i32 %x) #0 !dbg !57 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret i32 %x, !dbg !52 +// CHECK:STDOUT: ret i32 %x, !dbg !62 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CD.Main.de5b400758c39a65(double %x) #0 !dbg !53 { +// CHECK:STDOUT: define linkonce_odr double @_CD.Main.de5b400758c39a65(double %x) #0 !dbg !63 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret double %x, !dbg !56 +// CHECK:STDOUT: ret double %x, !dbg !66 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -140,46 +154,56 @@ fn M(ptr_i32: i32*, ptr_f64: f64*) { // CHECK:STDOUT: !11 = !DILocation(line: 43, column: 3, scope: !4) // CHECK:STDOUT: !12 = !DILocation(line: 44, column: 3, scope: !4) // CHECK:STDOUT: !13 = !DILocation(line: 42, column: 1, scope: !4) -// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.bfb441135f07cbe1", scope: null, file: !3, line: 37, type: !15, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !17) +// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 43, type: !15, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !18) // CHECK:STDOUT: !15 = !DISubroutineType(types: !16) -// CHECK:STDOUT: !16 = !{null, !7} -// CHECK:STDOUT: !17 = !{!18} -// CHECK:STDOUT: !18 = !DILocalVariable(arg: 1, scope: !14, type: !7) -// CHECK:STDOUT: !19 = !DILocation(line: 38, column: 3, scope: !14) -// CHECK:STDOUT: !20 = !DILocation(line: 39, column: 3, scope: !14) -// CHECK:STDOUT: !21 = !DILocation(line: 37, column: 1, scope: !14) -// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.29cf1dfeccef7249", scope: null, file: !3, line: 37, type: !15, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !23) -// CHECK:STDOUT: !23 = !{!24} -// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !22, type: !7) -// CHECK:STDOUT: !25 = !DILocation(line: 38, column: 3, scope: !22) -// CHECK:STDOUT: !26 = !DILocation(line: 39, column: 3, scope: !22) -// CHECK:STDOUT: !27 = !DILocation(line: 37, column: 1, scope: !22) -// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.582d60b54baf6b63", scope: null, file: !3, line: 25, type: !29, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !31) -// CHECK:STDOUT: !29 = !DISubroutineType(types: !30) -// CHECK:STDOUT: !30 = !{!7, !7} -// CHECK:STDOUT: !31 = !{!32} -// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !28, type: !7) -// CHECK:STDOUT: !33 = !DILocation(line: 26, column: 3, scope: !28) -// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.bfb441135f07cbe1", scope: null, file: !3, line: 33, type: !15, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !35) -// CHECK:STDOUT: !35 = !{!36} -// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !34, type: !7) -// CHECK:STDOUT: !37 = !DILocation(line: 34, column: 3, scope: !34) -// CHECK:STDOUT: !38 = !DILocation(line: 34, column: 5, scope: !34) -// CHECK:STDOUT: !39 = !DILocation(line: 33, column: 1, scope: !34) -// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.29cf1dfeccef7249", scope: null, file: !3, line: 33, type: !15, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !41) -// CHECK:STDOUT: !41 = !{!42} -// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !40, type: !7) -// CHECK:STDOUT: !43 = !DILocation(line: 34, column: 3, scope: !40) -// CHECK:STDOUT: !44 = !DILocation(line: 34, column: 5, scope: !40) -// CHECK:STDOUT: !45 = !DILocation(line: 33, column: 1, scope: !40) -// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 29, type: !47, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !50) -// CHECK:STDOUT: !47 = !DISubroutineType(types: !48) -// CHECK:STDOUT: !48 = !{!49, !49} -// CHECK:STDOUT: !49 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !50 = !{!51} -// CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !46, type: !49) -// CHECK:STDOUT: !52 = !DILocation(line: 30, column: 3, scope: !46) -// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.de5b400758c39a65", scope: null, file: !3, line: 29, type: !29, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !54) -// CHECK:STDOUT: !54 = !{!55} -// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !53, type: !7) -// CHECK:STDOUT: !56 = !DILocation(line: 30, column: 3, scope: !53) +// CHECK:STDOUT: !16 = !{null, !17} +// CHECK:STDOUT: !17 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !18 = !{!19} +// CHECK:STDOUT: !19 = !DILocalVariable(arg: 1, scope: !14, type: !17) +// CHECK:STDOUT: !20 = !DILocation(line: 43, column: 3, scope: !14) +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "Op", linkageName: "_COp.98006a366c2ffd6c:core.Destroy.Core", scope: null, file: !3, line: 44, type: !22, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !24) +// CHECK:STDOUT: !22 = !DISubroutineType(types: !23) +// CHECK:STDOUT: !23 = !{null, !7} +// CHECK:STDOUT: !24 = !{!25} +// CHECK:STDOUT: !25 = !DILocalVariable(arg: 1, scope: !21, type: !7) +// CHECK:STDOUT: !26 = !DILocation(line: 44, column: 3, scope: !21) +// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.bfb441135f07cbe1", scope: null, file: !3, line: 37, type: !22, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !28) +// CHECK:STDOUT: !28 = !{!29} +// CHECK:STDOUT: !29 = !DILocalVariable(arg: 1, scope: !27, type: !7) +// CHECK:STDOUT: !30 = !DILocation(line: 38, column: 3, scope: !27) +// CHECK:STDOUT: !31 = !DILocation(line: 39, column: 3, scope: !27) +// CHECK:STDOUT: !32 = !DILocation(line: 37, column: 1, scope: !27) +// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.29cf1dfeccef7249", scope: null, file: !3, line: 37, type: !22, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !34) +// CHECK:STDOUT: !34 = !{!35} +// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !33, type: !7) +// CHECK:STDOUT: !36 = !DILocation(line: 38, column: 3, scope: !33) +// CHECK:STDOUT: !37 = !DILocation(line: 39, column: 3, scope: !33) +// CHECK:STDOUT: !38 = !DILocation(line: 37, column: 1, scope: !33) +// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.582d60b54baf6b63", scope: null, file: !3, line: 25, type: !40, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !42) +// CHECK:STDOUT: !40 = !DISubroutineType(types: !41) +// CHECK:STDOUT: !41 = !{!7, !7} +// CHECK:STDOUT: !42 = !{!43} +// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !39, type: !7) +// CHECK:STDOUT: !44 = !DILocation(line: 26, column: 3, scope: !39) +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.bfb441135f07cbe1", scope: null, file: !3, line: 33, type: !22, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !46) +// CHECK:STDOUT: !46 = !{!47} +// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !45, type: !7) +// CHECK:STDOUT: !48 = !DILocation(line: 34, column: 3, scope: !45) +// CHECK:STDOUT: !49 = !DILocation(line: 34, column: 5, scope: !45) +// CHECK:STDOUT: !50 = !DILocation(line: 33, column: 1, scope: !45) +// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.29cf1dfeccef7249", scope: null, file: !3, line: 33, type: !22, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !52) +// CHECK:STDOUT: !52 = !{!53} +// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !51, type: !7) +// CHECK:STDOUT: !54 = !DILocation(line: 34, column: 3, scope: !51) +// CHECK:STDOUT: !55 = !DILocation(line: 34, column: 5, scope: !51) +// CHECK:STDOUT: !56 = !DILocation(line: 33, column: 1, scope: !51) +// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 29, type: !58, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !60) +// CHECK:STDOUT: !58 = !DISubroutineType(types: !59) +// CHECK:STDOUT: !59 = !{!17, !17} +// CHECK:STDOUT: !60 = !{!61} +// CHECK:STDOUT: !61 = !DILocalVariable(arg: 1, scope: !57, type: !17) +// CHECK:STDOUT: !62 = !DILocation(line: 30, column: 3, scope: !57) +// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.de5b400758c39a65", scope: null, file: !3, line: 29, type: !40, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !64) +// CHECK:STDOUT: !64 = !{!65} +// CHECK:STDOUT: !65 = !DILocalVariable(arg: 1, scope: !63, type: !7) +// CHECK:STDOUT: !66 = !DILocation(line: 30, column: 3, scope: !63) diff --git a/toolchain/lower/testdata/function/generic/call_method.carbon b/toolchain/lower/testdata/function/generic/call_method.carbon index 46888c4b6eb9..ac0aee803b65 100644 --- a/toolchain/lower/testdata/function/generic/call_method.carbon +++ b/toolchain/lower/testdata/function/generic/call_method.carbon @@ -38,9 +38,23 @@ fn CallF() -> i32 { // CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !9 // CHECK:STDOUT: %.loc22_14 = load i32, ptr %n.var, align 4, !dbg !10 // CHECK:STDOUT: %C.F.call = call i32 @_CF.C.Main.64ccbb8e5d9a0b8e(ptr %c.var, i32 %.loc22_14), !dbg !11 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %n.var), !dbg !9 +// CHECK:STDOUT: call void @"_COp.71e25083d63c4d6c:core.Destroy.Core"(ptr %c.var), !dbg !8 // CHECK:STDOUT: ret i32 %C.F.call, !dbg !12 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !13 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.71e25083d63c4d6c:core.Destroy.Core"(ptr %self) #0 !dbg !19 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !25 +// 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: @@ -48,9 +62,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) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CF.C.Main.64ccbb8e5d9a0b8e(ptr %self, i32 %x) #0 !dbg !13 { +// CHECK:STDOUT: define linkonce_odr i32 @_CF.C.Main.64ccbb8e5d9a0b8e(ptr %self, i32 %x) #0 !dbg !26 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret i32 %x, !dbg !20 +// CHECK:STDOUT: ret i32 %x, !dbg !32 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -76,11 +90,23 @@ fn CallF() -> i32 { // CHECK:STDOUT: !10 = !DILocation(line: 22, column: 14, scope: !4) // CHECK:STDOUT: !11 = !DILocation(line: 22, column: 10, scope: !4) // CHECK:STDOUT: !12 = !DILocation(line: 22, column: 3, scope: !4) -// CHECK:STDOUT: !13 = distinct !DISubprogram(name: "F", linkageName: "_CF.C.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 14, type: !14, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !17) +// CHECK:STDOUT: !13 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 21, type: !14, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !16) // CHECK:STDOUT: !14 = !DISubroutineType(types: !15) -// CHECK:STDOUT: !15 = !{!7, !16, !7} -// CHECK:STDOUT: !16 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !17 = !{!18, !19} -// CHECK:STDOUT: !18 = !DILocalVariable(arg: 1, scope: !13, type: !16) -// CHECK:STDOUT: !19 = !DILocalVariable(arg: 2, scope: !13, type: !7) -// CHECK:STDOUT: !20 = !DILocation(line: 15, column: 5, scope: !13) +// CHECK:STDOUT: !15 = !{null, !7} +// CHECK:STDOUT: !16 = !{!17} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !13, type: !7) +// CHECK:STDOUT: !18 = !DILocation(line: 21, column: 3, scope: !13) +// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "Op", linkageName: "_COp.71e25083d63c4d6c:core.Destroy.Core", scope: null, file: !3, line: 20, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !23) +// CHECK:STDOUT: !20 = !DISubroutineType(types: !21) +// CHECK:STDOUT: !21 = !{null, !22} +// CHECK:STDOUT: !22 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !23 = !{!24} +// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !19, type: !22) +// CHECK:STDOUT: !25 = !DILocation(line: 20, column: 3, scope: !19) +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "F", linkageName: "_CF.C.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 14, type: !27, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !29) +// CHECK:STDOUT: !27 = !DISubroutineType(types: !28) +// CHECK:STDOUT: !28 = !{!7, !22, !7} +// CHECK:STDOUT: !29 = !{!30, !31} +// CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !26, type: !22) +// CHECK:STDOUT: !31 = !DILocalVariable(arg: 2, scope: !26, type: !7) +// CHECK:STDOUT: !32 = !DILocation(line: 15, column: 5, scope: !26) diff --git a/toolchain/lower/testdata/function/generic/call_recursive_basic.carbon b/toolchain/lower/testdata/function/generic/call_recursive_basic.carbon index 6dad3beb822d..decb3057aa71 100644 --- a/toolchain/lower/testdata/function/generic/call_recursive_basic.carbon +++ b/toolchain/lower/testdata/function/generic/call_recursive_basic.carbon @@ -81,9 +81,31 @@ fn M() { // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %c.var, ptr align 1 @C.val.loc15_51, i64 0, i1 false), !dbg !18 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc40_9.4.temp), !dbg !19 // CHECK:STDOUT: call void @_CF.Main.706e9f413f1bae3d(ptr %.loc40_9.4.temp, ptr %c.var, i32 0), !dbg !19 +// CHECK:STDOUT: call void @"_COp.71e25083d63c4d6c:core.Destroy.Core"(ptr %.loc40_9.4.temp), !dbg !19 +// CHECK:STDOUT: call void @"_COp.71e25083d63c4d6c:core.Destroy.Core"(ptr %c.var), !dbg !18 +// CHECK:STDOUT: call void @"_COp.98006a366c2ffd6c:core.Destroy.Core"(ptr %m.var), !dbg !15 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %n.var), !dbg !14 // CHECK:STDOUT: ret void, !dbg !28 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.71e25083d63c4d6c:core.Destroy.Core"(ptr %self) #0 !dbg !29 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !34 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.98006a366c2ffd6c:core.Destroy.Core"(ptr %self) #0 !dbg !35 { +// 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.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !39 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !45 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree 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: @@ -91,67 +113,68 @@ fn M() { // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count) #0 !dbg !29 { +// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count) #0 !dbg !46 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 0, !dbg !36 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !37 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 0, !dbg !52 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !53 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: ret i32 %x, !dbg !38 +// CHECK:STDOUT: ret i32 %x, !dbg !54 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !39 -// CHECK:STDOUT: %F.call = call i32 @_CF.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !40 -// CHECK:STDOUT: ret i32 %F.call, !dbg !41 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !55 +// CHECK:STDOUT: %F.call = call i32 @_CF.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !56 +// CHECK:STDOUT: ret i32 %F.call, !dbg !57 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CF.Main.de5b400758c39a65(double %x, i32 %count) #0 !dbg !42 { +// CHECK:STDOUT: define linkonce_odr double @_CF.Main.de5b400758c39a65(double %x, i32 %count) #0 !dbg !58 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 0, !dbg !48 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !49 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 0, !dbg !64 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !65 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: ret double %x, !dbg !50 +// CHECK:STDOUT: ret double %x, !dbg !66 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !51 -// CHECK:STDOUT: %F.call = call double @_CF.Main.de5b400758c39a65(double %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !52 -// CHECK:STDOUT: ret double %F.call, !dbg !53 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !67 +// CHECK:STDOUT: %F.call = call double @_CF.Main.de5b400758c39a65(double %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !68 +// CHECK:STDOUT: ret double %F.call, !dbg !69 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CF.Main.779b9c0f3b54a7f8(ptr %x, i32 %count) #0 !dbg !54 { +// CHECK:STDOUT: define linkonce_odr ptr @_CF.Main.779b9c0f3b54a7f8(ptr %x, i32 %count) #0 !dbg !70 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 0, !dbg !58 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !59 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 0, !dbg !74 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !75 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: ret ptr %x, !dbg !60 +// CHECK:STDOUT: ret ptr %x, !dbg !76 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !61 -// CHECK:STDOUT: %F.call = call ptr @_CF.Main.779b9c0f3b54a7f8(ptr %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !62 -// CHECK:STDOUT: ret ptr %F.call, !dbg !63 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !77 +// CHECK:STDOUT: %F.call = call ptr @_CF.Main.779b9c0f3b54a7f8(ptr %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !78 +// CHECK:STDOUT: ret ptr %F.call, !dbg !79 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Main.706e9f413f1bae3d(ptr sret({}) %return, ptr %x, i32 %count) #0 !dbg !64 { +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.706e9f413f1bae3d(ptr sret({}) %return, ptr %x, i32 %count) #0 !dbg !80 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 0, !dbg !68 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !69 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 0, !dbg !84 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !85 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: call void @"_COp.C.Main:Copy.Core"(ptr %return, ptr %x), !dbg !70 -// CHECK:STDOUT: ret void, !dbg !71 +// CHECK:STDOUT: call void @"_COp.C.Main:Copy.Core"(ptr %return, ptr %x), !dbg !86 +// CHECK:STDOUT: ret void, !dbg !87 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !72 -// CHECK:STDOUT: call void @_CF.Main.706e9f413f1bae3d(ptr %return, ptr %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !73 -// CHECK:STDOUT: ret void, !dbg !74 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !88 +// CHECK:STDOUT: call void @_CF.Main.706e9f413f1bae3d(ptr %return, ptr %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !89 +// CHECK:STDOUT: ret void, !dbg !90 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @"_COp.71e25083d63c4d6c: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.779b9c0f3b54a7f8, { 1, 2, 0 } @@ -192,49 +215,65 @@ fn M() { // CHECK:STDOUT: !26 = !DILocation(line: 37, column: 5, scope: !11) // CHECK:STDOUT: !27 = !DILocation(line: 37, column: 3, scope: !11) // CHECK:STDOUT: !28 = !DILocation(line: 28, column: 1, scope: !11) -// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 21, type: !30, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !33) +// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "Op", linkageName: "_COp.71e25083d63c4d6c:core.Destroy.Core", scope: null, file: !3, line: 40, type: !30, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !32) // CHECK:STDOUT: !30 = !DISubroutineType(types: !31) -// CHECK:STDOUT: !31 = !{!32, !32, !32} -// CHECK:STDOUT: !32 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !33 = !{!34, !35} -// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !29, type: !32) -// CHECK:STDOUT: !35 = !DILocalVariable(arg: 2, scope: !29, type: !32) -// CHECK:STDOUT: !36 = !DILocation(line: 22, column: 7, scope: !29) -// CHECK:STDOUT: !37 = !DILocation(line: 22, column: 6, scope: !29) -// CHECK:STDOUT: !38 = !DILocation(line: 23, column: 5, scope: !29) -// CHECK:STDOUT: !39 = !DILocation(line: 25, column: 15, scope: !29) -// CHECK:STDOUT: !40 = !DILocation(line: 25, column: 10, scope: !29) -// CHECK:STDOUT: !41 = !DILocation(line: 25, column: 3, scope: !29) -// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.de5b400758c39a65", scope: null, file: !3, line: 21, type: !43, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !45) -// CHECK:STDOUT: !43 = !DISubroutineType(types: !44) -// CHECK:STDOUT: !44 = !{!7, !7, !32} -// CHECK:STDOUT: !45 = !{!46, !47} -// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !42, type: !7) -// CHECK:STDOUT: !47 = !DILocalVariable(arg: 2, scope: !42, type: !32) -// CHECK:STDOUT: !48 = !DILocation(line: 22, column: 7, scope: !42) -// CHECK:STDOUT: !49 = !DILocation(line: 22, column: 6, scope: !42) -// CHECK:STDOUT: !50 = !DILocation(line: 23, column: 5, scope: !42) -// CHECK:STDOUT: !51 = !DILocation(line: 25, column: 15, scope: !42) -// CHECK:STDOUT: !52 = !DILocation(line: 25, column: 10, scope: !42) -// CHECK:STDOUT: !53 = !DILocation(line: 25, column: 3, scope: !42) -// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 21, type: !43, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !55) -// CHECK:STDOUT: !55 = !{!56, !57} -// CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !54, type: !7) -// CHECK:STDOUT: !57 = !DILocalVariable(arg: 2, scope: !54, type: !32) -// CHECK:STDOUT: !58 = !DILocation(line: 22, column: 7, scope: !54) -// CHECK:STDOUT: !59 = !DILocation(line: 22, column: 6, scope: !54) -// CHECK:STDOUT: !60 = !DILocation(line: 23, column: 5, scope: !54) -// CHECK:STDOUT: !61 = !DILocation(line: 25, column: 15, scope: !54) -// CHECK:STDOUT: !62 = !DILocation(line: 25, column: 10, scope: !54) -// CHECK:STDOUT: !63 = !DILocation(line: 25, column: 3, scope: !54) -// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.706e9f413f1bae3d", scope: null, file: !3, line: 21, type: !43, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !65) -// CHECK:STDOUT: !65 = !{!66, !67} -// CHECK:STDOUT: !66 = !DILocalVariable(arg: 1, scope: !64, type: !7) -// CHECK:STDOUT: !67 = !DILocalVariable(arg: 2, scope: !64, type: !32) -// CHECK:STDOUT: !68 = !DILocation(line: 22, column: 7, scope: !64) -// CHECK:STDOUT: !69 = !DILocation(line: 22, column: 6, scope: !64) -// CHECK:STDOUT: !70 = !DILocation(line: 23, column: 12, scope: !64) -// CHECK:STDOUT: !71 = !DILocation(line: 23, column: 5, scope: !64) -// CHECK:STDOUT: !72 = !DILocation(line: 25, column: 15, scope: !64) -// CHECK:STDOUT: !73 = !DILocation(line: 25, column: 10, scope: !64) -// CHECK:STDOUT: !74 = !DILocation(line: 25, column: 3, scope: !64) +// CHECK:STDOUT: !31 = !{null, !7} +// CHECK:STDOUT: !32 = !{!33} +// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !29, type: !7) +// CHECK:STDOUT: !34 = !DILocation(line: 40, column: 3, scope: !29) +// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "Op", linkageName: "_COp.98006a366c2ffd6c:core.Destroy.Core", scope: null, file: !3, line: 30, type: !30, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !36) +// CHECK:STDOUT: !36 = !{!37} +// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !35, type: !7) +// CHECK:STDOUT: !38 = !DILocation(line: 30, column: 3, scope: !35) +// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 29, type: !40, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !43) +// CHECK:STDOUT: !40 = !DISubroutineType(types: !41) +// CHECK:STDOUT: !41 = !{null, !42} +// CHECK:STDOUT: !42 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !43 = !{!44} +// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !39, type: !42) +// CHECK:STDOUT: !45 = !DILocation(line: 29, column: 3, scope: !39) +// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 21, type: !47, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !49) +// CHECK:STDOUT: !47 = !DISubroutineType(types: !48) +// CHECK:STDOUT: !48 = !{!42, !42, !42} +// CHECK:STDOUT: !49 = !{!50, !51} +// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !46, type: !42) +// CHECK:STDOUT: !51 = !DILocalVariable(arg: 2, scope: !46, type: !42) +// CHECK:STDOUT: !52 = !DILocation(line: 22, column: 7, scope: !46) +// CHECK:STDOUT: !53 = !DILocation(line: 22, column: 6, scope: !46) +// CHECK:STDOUT: !54 = !DILocation(line: 23, column: 5, scope: !46) +// CHECK:STDOUT: !55 = !DILocation(line: 25, column: 15, scope: !46) +// CHECK:STDOUT: !56 = !DILocation(line: 25, column: 10, scope: !46) +// CHECK:STDOUT: !57 = !DILocation(line: 25, column: 3, scope: !46) +// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.de5b400758c39a65", scope: null, file: !3, line: 21, type: !59, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !61) +// CHECK:STDOUT: !59 = !DISubroutineType(types: !60) +// CHECK:STDOUT: !60 = !{!7, !7, !42} +// CHECK:STDOUT: !61 = !{!62, !63} +// CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !58, type: !7) +// CHECK:STDOUT: !63 = !DILocalVariable(arg: 2, scope: !58, type: !42) +// CHECK:STDOUT: !64 = !DILocation(line: 22, column: 7, scope: !58) +// CHECK:STDOUT: !65 = !DILocation(line: 22, column: 6, scope: !58) +// CHECK:STDOUT: !66 = !DILocation(line: 23, column: 5, scope: !58) +// CHECK:STDOUT: !67 = !DILocation(line: 25, column: 15, scope: !58) +// CHECK:STDOUT: !68 = !DILocation(line: 25, column: 10, scope: !58) +// CHECK:STDOUT: !69 = !DILocation(line: 25, column: 3, scope: !58) +// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 21, type: !59, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !71) +// CHECK:STDOUT: !71 = !{!72, !73} +// CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !70, type: !7) +// CHECK:STDOUT: !73 = !DILocalVariable(arg: 2, scope: !70, type: !42) +// CHECK:STDOUT: !74 = !DILocation(line: 22, column: 7, scope: !70) +// CHECK:STDOUT: !75 = !DILocation(line: 22, column: 6, scope: !70) +// CHECK:STDOUT: !76 = !DILocation(line: 23, column: 5, scope: !70) +// CHECK:STDOUT: !77 = !DILocation(line: 25, column: 15, scope: !70) +// CHECK:STDOUT: !78 = !DILocation(line: 25, column: 10, scope: !70) +// CHECK:STDOUT: !79 = !DILocation(line: 25, column: 3, scope: !70) +// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.706e9f413f1bae3d", scope: null, file: !3, line: 21, type: !59, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !81) +// CHECK:STDOUT: !81 = !{!82, !83} +// CHECK:STDOUT: !82 = !DILocalVariable(arg: 1, scope: !80, type: !7) +// CHECK:STDOUT: !83 = !DILocalVariable(arg: 2, scope: !80, type: !42) +// CHECK:STDOUT: !84 = !DILocation(line: 22, column: 7, scope: !80) +// CHECK:STDOUT: !85 = !DILocation(line: 22, column: 6, scope: !80) +// CHECK:STDOUT: !86 = !DILocation(line: 23, column: 12, scope: !80) +// CHECK:STDOUT: !87 = !DILocation(line: 23, column: 5, scope: !80) +// CHECK:STDOUT: !88 = !DILocation(line: 25, column: 15, scope: !80) +// CHECK:STDOUT: !89 = !DILocation(line: 25, column: 10, scope: !80) +// CHECK:STDOUT: !90 = !DILocation(line: 25, column: 3, scope: !80) diff --git a/toolchain/lower/testdata/function/generic/call_recursive_diamond.carbon b/toolchain/lower/testdata/function/generic/call_recursive_diamond.carbon index 812ec78c59ec..2eaf4521a8c7 100644 --- a/toolchain/lower/testdata/function/generic/call_recursive_diamond.carbon +++ b/toolchain/lower/testdata/function/generic/call_recursive_diamond.carbon @@ -84,153 +84,167 @@ fn M() { // CHECK:STDOUT: %A.call.loc55 = call ptr @_CA.Main.779b9c0f3b54a7f8(ptr %.loc55_5, i32 0), !dbg !16 // CHECK:STDOUT: %.loc56_5 = load ptr, ptr %ptr_f64.var, align 8, !dbg !17 // CHECK:STDOUT: %A.call.loc56 = call ptr @_CA.Main.779b9c0f3b54a7f8(ptr %.loc56_5, i32 0), !dbg !18 +// CHECK:STDOUT: call void @"_COp.98006a366c2ffd6c:core.Destroy.Core"(ptr %m.var), !dbg !8 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %n.var), !dbg !7 // CHECK:STDOUT: ret void, !dbg !19 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.98006a366c2ffd6c:core.Destroy.Core"(ptr %self) #0 !dbg !20 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !26 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !27 { +// 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) // 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.64ccbb8e5d9a0b8e(i32 %x, i32 %count) #0 !dbg !20 { +// CHECK:STDOUT: define linkonce_odr i32 @_CA.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count) #0 !dbg !34 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !dbg !27 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then.loc22, label %if.else.loc22, !dbg !28 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !dbg !40 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then.loc22, label %if.else.loc22, !dbg !41 // CHECK:STDOUT: // CHECK:STDOUT: if.then.loc22: ; preds = %entry -// CHECK:STDOUT: ret i32 %x, !dbg !29 +// CHECK:STDOUT: ret i32 %x, !dbg !42 // CHECK:STDOUT: // CHECK:STDOUT: if.else.loc22: ; preds = %entry -// CHECK:STDOUT: %Int.as.ModWith.impl.Op.call = srem i32 %count, 2, !dbg !30 -// CHECK:STDOUT: %Int.as.EqWith.impl.Equal.call = icmp eq i32 %Int.as.ModWith.impl.Op.call, 0, !dbg !30 -// CHECK:STDOUT: br i1 %Int.as.EqWith.impl.Equal.call, label %if.then.loc25, label %if.else.loc25, !dbg !31 +// CHECK:STDOUT: %Int.as.ModWith.impl.Op.call = srem i32 %count, 2, !dbg !43 +// CHECK:STDOUT: %Int.as.EqWith.impl.Equal.call = icmp eq i32 %Int.as.ModWith.impl.Op.call, 0, !dbg !43 +// CHECK:STDOUT: br i1 %Int.as.EqWith.impl.Equal.call, label %if.then.loc25, label %if.else.loc25, !dbg !44 // CHECK:STDOUT: // CHECK:STDOUT: if.then.loc25: ; preds = %if.else.loc22 -// CHECK:STDOUT: %B.call = call i32 @_CB.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count), !dbg !32 -// CHECK:STDOUT: ret i32 %B.call, !dbg !33 +// CHECK:STDOUT: %B.call = call i32 @_CB.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count), !dbg !45 +// CHECK:STDOUT: ret i32 %B.call, !dbg !46 // CHECK:STDOUT: // CHECK:STDOUT: if.else.loc25: ; preds = %if.else.loc22 -// CHECK:STDOUT: %C.call = call i32 @_CC.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count), !dbg !34 -// CHECK:STDOUT: ret i32 %C.call, !dbg !35 +// CHECK:STDOUT: %C.call = call i32 @_CC.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count), !dbg !47 +// CHECK:STDOUT: ret i32 %C.call, !dbg !48 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CA.Main.de5b400758c39a65(double %x, i32 %count) #0 !dbg !36 { +// CHECK:STDOUT: define linkonce_odr double @_CA.Main.de5b400758c39a65(double %x, i32 %count) #0 !dbg !49 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !dbg !43 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then.loc22, label %if.else.loc22, !dbg !44 +// 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.loc22, label %if.else.loc22, !dbg !56 // CHECK:STDOUT: // CHECK:STDOUT: if.then.loc22: ; preds = %entry -// CHECK:STDOUT: ret double %x, !dbg !45 +// CHECK:STDOUT: ret double %x, !dbg !57 // CHECK:STDOUT: // CHECK:STDOUT: if.else.loc22: ; preds = %entry -// CHECK:STDOUT: %Int.as.ModWith.impl.Op.call = srem i32 %count, 2, !dbg !46 -// CHECK:STDOUT: %Int.as.EqWith.impl.Equal.call = icmp eq i32 %Int.as.ModWith.impl.Op.call, 0, !dbg !46 -// CHECK:STDOUT: br i1 %Int.as.EqWith.impl.Equal.call, label %if.then.loc25, label %if.else.loc25, !dbg !47 +// CHECK:STDOUT: %Int.as.ModWith.impl.Op.call = srem i32 %count, 2, !dbg !58 +// CHECK:STDOUT: %Int.as.EqWith.impl.Equal.call = icmp eq i32 %Int.as.ModWith.impl.Op.call, 0, !dbg !58 +// CHECK:STDOUT: br i1 %Int.as.EqWith.impl.Equal.call, label %if.then.loc25, label %if.else.loc25, !dbg !59 // CHECK:STDOUT: // CHECK:STDOUT: if.then.loc25: ; preds = %if.else.loc22 -// CHECK:STDOUT: %B.call = call double @_CB.Main.de5b400758c39a65(double %x, i32 %count), !dbg !48 -// CHECK:STDOUT: ret double %B.call, !dbg !49 +// CHECK:STDOUT: %B.call = call double @_CB.Main.de5b400758c39a65(double %x, i32 %count), !dbg !60 +// CHECK:STDOUT: ret double %B.call, !dbg !61 // CHECK:STDOUT: // CHECK:STDOUT: if.else.loc25: ; preds = %if.else.loc22 -// CHECK:STDOUT: %C.call = call double @_CC.Main.de5b400758c39a65(double %x, i32 %count), !dbg !50 -// CHECK:STDOUT: ret double %C.call, !dbg !51 +// CHECK:STDOUT: %C.call = call double @_CC.Main.de5b400758c39a65(double %x, i32 %count), !dbg !62 +// CHECK:STDOUT: ret double %C.call, !dbg !63 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CA.Main.779b9c0f3b54a7f8(ptr %x, i32 %count) #0 !dbg !52 { +// CHECK:STDOUT: define linkonce_odr ptr @_CA.Main.779b9c0f3b54a7f8(ptr %x, i32 %count) #0 !dbg !64 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !dbg !56 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then.loc22, label %if.else.loc22, !dbg !57 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !dbg !68 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then.loc22, label %if.else.loc22, !dbg !69 // CHECK:STDOUT: // CHECK:STDOUT: if.then.loc22: ; preds = %entry -// CHECK:STDOUT: ret ptr %x, !dbg !58 +// CHECK:STDOUT: ret ptr %x, !dbg !70 // CHECK:STDOUT: // CHECK:STDOUT: if.else.loc22: ; 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.loc25, label %if.else.loc25, !dbg !60 +// CHECK:STDOUT: %Int.as.ModWith.impl.Op.call = srem i32 %count, 2, !dbg !71 +// CHECK:STDOUT: %Int.as.EqWith.impl.Equal.call = icmp eq i32 %Int.as.ModWith.impl.Op.call, 0, !dbg !71 +// CHECK:STDOUT: br i1 %Int.as.EqWith.impl.Equal.call, label %if.then.loc25, label %if.else.loc25, !dbg !72 // CHECK:STDOUT: // CHECK:STDOUT: if.then.loc25: ; preds = %if.else.loc22 -// CHECK:STDOUT: %B.call = call ptr @_CB.Main.779b9c0f3b54a7f8(ptr %x, i32 %count), !dbg !61 -// CHECK:STDOUT: ret ptr %B.call, !dbg !62 +// CHECK:STDOUT: %B.call = call ptr @_CB.Main.779b9c0f3b54a7f8(ptr %x, i32 %count), !dbg !73 +// CHECK:STDOUT: ret ptr %B.call, !dbg !74 // CHECK:STDOUT: // CHECK:STDOUT: if.else.loc25: ; preds = %if.else.loc22 -// CHECK:STDOUT: %C.call = call ptr @_CC.Main.779b9c0f3b54a7f8(ptr %x, i32 %count), !dbg !63 -// CHECK:STDOUT: ret ptr %C.call, !dbg !64 +// CHECK:STDOUT: %C.call = call ptr @_CC.Main.779b9c0f3b54a7f8(ptr %x, i32 %count), !dbg !75 +// CHECK:STDOUT: ret ptr %C.call, !dbg !76 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CB.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count) #0 !dbg !65 { +// CHECK:STDOUT: define linkonce_odr i32 @_CB.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count) #0 !dbg !77 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 1), !dbg !69 -// CHECK:STDOUT: %D.call = call i32 @_CD.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count), !dbg !70 -// CHECK:STDOUT: ret i32 %D.call, !dbg !71 +// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 1), !dbg !81 +// CHECK:STDOUT: %D.call = call i32 @_CD.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count), !dbg !82 +// CHECK:STDOUT: ret i32 %D.call, !dbg !83 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CC.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count) #0 !dbg !72 { +// CHECK:STDOUT: define linkonce_odr i32 @_CC.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count) #0 !dbg !84 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 2), !dbg !76 -// CHECK:STDOUT: %D.call = call i32 @_CD.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count), !dbg !77 -// CHECK:STDOUT: ret i32 %D.call, !dbg !78 +// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 2), !dbg !88 +// CHECK:STDOUT: %D.call = call i32 @_CD.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count), !dbg !89 +// CHECK:STDOUT: ret i32 %D.call, !dbg !90 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CB.Main.de5b400758c39a65(double %x, i32 %count) #0 !dbg !79 { +// CHECK:STDOUT: define linkonce_odr double @_CB.Main.de5b400758c39a65(double %x, i32 %count) #0 !dbg !91 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 1), !dbg !83 -// CHECK:STDOUT: %D.call = call double @_CD.Main.de5b400758c39a65(double %x, i32 %count), !dbg !84 -// CHECK:STDOUT: ret double %D.call, !dbg !85 +// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 1), !dbg !95 +// CHECK:STDOUT: %D.call = call double @_CD.Main.de5b400758c39a65(double %x, i32 %count), !dbg !96 +// CHECK:STDOUT: ret double %D.call, !dbg !97 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CC.Main.de5b400758c39a65(double %x, i32 %count) #0 !dbg !86 { +// CHECK:STDOUT: define linkonce_odr double @_CC.Main.de5b400758c39a65(double %x, i32 %count) #0 !dbg !98 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 2), !dbg !90 -// CHECK:STDOUT: %D.call = call double @_CD.Main.de5b400758c39a65(double %x, i32 %count), !dbg !91 -// CHECK:STDOUT: ret double %D.call, !dbg !92 +// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 2), !dbg !102 +// CHECK:STDOUT: %D.call = call double @_CD.Main.de5b400758c39a65(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 @_CB.Main.779b9c0f3b54a7f8(ptr %x, i32 %count) #0 !dbg !93 { +// CHECK:STDOUT: define linkonce_odr ptr @_CB.Main.779b9c0f3b54a7f8(ptr %x, i32 %count) #0 !dbg !105 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 1), !dbg !97 -// CHECK:STDOUT: %D.call = call ptr @_CD.Main.779b9c0f3b54a7f8(ptr %x, i32 %count), !dbg !98 -// CHECK:STDOUT: ret ptr %D.call, !dbg !99 +// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 1), !dbg !109 +// CHECK:STDOUT: %D.call = call ptr @_CD.Main.779b9c0f3b54a7f8(ptr %x, i32 %count), !dbg !110 +// CHECK:STDOUT: ret ptr %D.call, !dbg !111 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CC.Main.779b9c0f3b54a7f8(ptr %x, i32 %count) #0 !dbg !100 { +// CHECK:STDOUT: define linkonce_odr ptr @_CC.Main.779b9c0f3b54a7f8(ptr %x, i32 %count) #0 !dbg !112 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 2), !dbg !104 -// CHECK:STDOUT: %D.call = call ptr @_CD.Main.779b9c0f3b54a7f8(ptr %x, i32 %count), !dbg !105 -// CHECK:STDOUT: ret ptr %D.call, !dbg !106 +// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 2), !dbg !116 +// CHECK:STDOUT: %D.call = call ptr @_CD.Main.779b9c0f3b54a7f8(ptr %x, i32 %count), !dbg !117 +// CHECK:STDOUT: ret ptr %D.call, !dbg !118 // 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.64ccbb8e5d9a0b8e(i32 %x, i32 %count) #0 !dbg !107 { +// CHECK:STDOUT: define linkonce_odr i32 @_CD.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count) #0 !dbg !119 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !111 -// CHECK:STDOUT: %A.call = call i32 @_CA.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !112 -// CHECK:STDOUT: ret i32 %A.call, !dbg !113 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !123 +// CHECK:STDOUT: %A.call = call i32 @_CA.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !124 +// CHECK:STDOUT: ret i32 %A.call, !dbg !125 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CD.Main.de5b400758c39a65(double %x, i32 %count) #0 !dbg !114 { +// CHECK:STDOUT: define linkonce_odr double @_CD.Main.de5b400758c39a65(double %x, i32 %count) #0 !dbg !126 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !118 -// CHECK:STDOUT: %A.call = call double @_CA.Main.de5b400758c39a65(double %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !119 -// CHECK:STDOUT: ret double %A.call, !dbg !120 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !130 +// CHECK:STDOUT: %A.call = call double @_CA.Main.de5b400758c39a65(double %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !131 +// CHECK:STDOUT: ret double %A.call, !dbg !132 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CD.Main.779b9c0f3b54a7f8(ptr %x, i32 %count) #0 !dbg !121 { +// CHECK:STDOUT: define linkonce_odr ptr @_CD.Main.779b9c0f3b54a7f8(ptr %x, i32 %count) #0 !dbg !133 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !125 -// CHECK:STDOUT: %A.call = call ptr @_CA.Main.779b9c0f3b54a7f8(ptr %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !126 -// CHECK:STDOUT: ret ptr %A.call, !dbg !127 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !137 +// CHECK:STDOUT: %A.call = call ptr @_CA.Main.779b9c0f3b54a7f8(ptr %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !138 +// CHECK:STDOUT: ret ptr %A.call, !dbg !139 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -267,111 +281,123 @@ fn M() { // CHECK:STDOUT: !17 = !DILocation(line: 56, column: 5, scope: !4) // CHECK:STDOUT: !18 = !DILocation(line: 56, column: 3, scope: !4) // CHECK:STDOUT: !19 = !DILocation(line: 47, column: 1, scope: !4) -// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 21, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !24) +// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "Op", linkageName: "_COp.98006a366c2ffd6c:core.Destroy.Core", scope: null, file: !3, line: 49, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !24) // CHECK:STDOUT: !21 = !DISubroutineType(types: !22) -// CHECK:STDOUT: !22 = !{!23, !23, !23} -// CHECK:STDOUT: !23 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !24 = !{!25, !26} +// CHECK:STDOUT: !22 = !{null, !23} +// CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !24 = !{!25} // CHECK:STDOUT: !25 = !DILocalVariable(arg: 1, scope: !20, type: !23) -// CHECK:STDOUT: !26 = !DILocalVariable(arg: 2, scope: !20, type: !23) -// CHECK:STDOUT: !27 = !DILocation(line: 22, column: 7, scope: !20) -// CHECK:STDOUT: !28 = !DILocation(line: 22, column: 6, scope: !20) -// CHECK:STDOUT: !29 = !DILocation(line: 23, column: 5, scope: !20) -// CHECK:STDOUT: !30 = !DILocation(line: 25, column: 7, scope: !20) -// CHECK:STDOUT: !31 = !DILocation(line: 25, column: 6, scope: !20) -// CHECK:STDOUT: !32 = !DILocation(line: 26, column: 12, scope: !20) -// CHECK:STDOUT: !33 = !DILocation(line: 26, column: 5, scope: !20) -// CHECK:STDOUT: !34 = !DILocation(line: 28, column: 12, scope: !20) -// CHECK:STDOUT: !35 = !DILocation(line: 28, column: 5, scope: !20) -// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.de5b400758c39a65", scope: null, file: !3, line: 21, type: !37, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !40) -// CHECK:STDOUT: !37 = !DISubroutineType(types: !38) -// CHECK:STDOUT: !38 = !{!39, !39, !23} -// CHECK:STDOUT: !39 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !40 = !{!41, !42} -// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !36, type: !39) -// CHECK:STDOUT: !42 = !DILocalVariable(arg: 2, scope: !36, type: !23) -// CHECK:STDOUT: !43 = !DILocation(line: 22, column: 7, scope: !36) -// CHECK:STDOUT: !44 = !DILocation(line: 22, column: 6, scope: !36) -// CHECK:STDOUT: !45 = !DILocation(line: 23, column: 5, scope: !36) -// CHECK:STDOUT: !46 = !DILocation(line: 25, column: 7, scope: !36) -// CHECK:STDOUT: !47 = !DILocation(line: 25, column: 6, scope: !36) -// CHECK:STDOUT: !48 = !DILocation(line: 26, column: 12, scope: !36) -// CHECK:STDOUT: !49 = !DILocation(line: 26, column: 5, scope: !36) -// CHECK:STDOUT: !50 = !DILocation(line: 28, column: 12, scope: !36) -// CHECK:STDOUT: !51 = !DILocation(line: 28, column: 5, scope: !36) -// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 21, type: !37, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !53) -// CHECK:STDOUT: !53 = !{!54, !55} -// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !52, type: !39) -// CHECK:STDOUT: !55 = !DILocalVariable(arg: 2, scope: !52, type: !23) -// CHECK:STDOUT: !56 = !DILocation(line: 22, column: 7, scope: !52) -// CHECK:STDOUT: !57 = !DILocation(line: 22, column: 6, scope: !52) -// CHECK:STDOUT: !58 = !DILocation(line: 23, column: 5, scope: !52) -// CHECK:STDOUT: !59 = !DILocation(line: 25, column: 7, scope: !52) -// CHECK:STDOUT: !60 = !DILocation(line: 25, column: 6, scope: !52) -// CHECK:STDOUT: !61 = !DILocation(line: 26, column: 12, scope: !52) -// CHECK:STDOUT: !62 = !DILocation(line: 26, column: 5, scope: !52) -// CHECK:STDOUT: !63 = !DILocation(line: 28, column: 12, scope: !52) -// CHECK:STDOUT: !64 = !DILocation(line: 28, column: 5, scope: !52) -// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 33, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !66) -// CHECK:STDOUT: !66 = !{!67, !68} -// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !65, type: !23) -// CHECK:STDOUT: !68 = !DILocalVariable(arg: 2, scope: !65, type: !23) -// CHECK:STDOUT: !69 = !DILocation(line: 34, column: 3, scope: !65) -// CHECK:STDOUT: !70 = !DILocation(line: 35, column: 10, scope: !65) -// CHECK:STDOUT: !71 = !DILocation(line: 35, column: 3, scope: !65) -// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "C", linkageName: "_CC.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 38, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !73) -// CHECK:STDOUT: !73 = !{!74, !75} -// CHECK:STDOUT: !74 = !DILocalVariable(arg: 1, scope: !72, type: !23) -// CHECK:STDOUT: !75 = !DILocalVariable(arg: 2, scope: !72, type: !23) -// CHECK:STDOUT: !76 = !DILocation(line: 39, column: 3, scope: !72) -// CHECK:STDOUT: !77 = !DILocation(line: 40, column: 10, scope: !72) -// CHECK:STDOUT: !78 = !DILocation(line: 40, column: 3, scope: !72) -// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.de5b400758c39a65", scope: null, file: !3, line: 33, type: !37, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !80) -// CHECK:STDOUT: !80 = !{!81, !82} -// CHECK:STDOUT: !81 = !DILocalVariable(arg: 1, scope: !79, type: !39) -// CHECK:STDOUT: !82 = !DILocalVariable(arg: 2, scope: !79, type: !23) -// CHECK:STDOUT: !83 = !DILocation(line: 34, column: 3, scope: !79) -// CHECK:STDOUT: !84 = !DILocation(line: 35, column: 10, scope: !79) -// CHECK:STDOUT: !85 = !DILocation(line: 35, column: 3, scope: !79) -// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "C", linkageName: "_CC.Main.de5b400758c39a65", scope: null, file: !3, line: 38, type: !37, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !87) -// CHECK:STDOUT: !87 = !{!88, !89} -// CHECK:STDOUT: !88 = !DILocalVariable(arg: 1, scope: !86, type: !39) -// CHECK:STDOUT: !89 = !DILocalVariable(arg: 2, scope: !86, type: !23) -// CHECK:STDOUT: !90 = !DILocation(line: 39, column: 3, scope: !86) -// CHECK:STDOUT: !91 = !DILocation(line: 40, column: 10, scope: !86) -// CHECK:STDOUT: !92 = !DILocation(line: 40, column: 3, scope: !86) -// CHECK:STDOUT: !93 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 33, type: !37, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !94) -// CHECK:STDOUT: !94 = !{!95, !96} -// CHECK:STDOUT: !95 = !DILocalVariable(arg: 1, scope: !93, type: !39) -// CHECK:STDOUT: !96 = !DILocalVariable(arg: 2, scope: !93, type: !23) -// CHECK:STDOUT: !97 = !DILocation(line: 34, column: 3, scope: !93) -// CHECK:STDOUT: !98 = !DILocation(line: 35, column: 10, scope: !93) -// CHECK:STDOUT: !99 = !DILocation(line: 35, column: 3, scope: !93) -// CHECK:STDOUT: !100 = distinct !DISubprogram(name: "C", linkageName: "_CC.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 38, type: !37, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !101) -// CHECK:STDOUT: !101 = !{!102, !103} -// CHECK:STDOUT: !102 = !DILocalVariable(arg: 1, scope: !100, type: !39) -// CHECK:STDOUT: !103 = !DILocalVariable(arg: 2, scope: !100, type: !23) -// CHECK:STDOUT: !104 = !DILocation(line: 39, column: 3, scope: !100) -// CHECK:STDOUT: !105 = !DILocation(line: 40, column: 10, scope: !100) -// CHECK:STDOUT: !106 = !DILocation(line: 40, column: 3, scope: !100) -// CHECK:STDOUT: !107 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 43, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !108) -// CHECK:STDOUT: !108 = !{!109, !110} -// CHECK:STDOUT: !109 = !DILocalVariable(arg: 1, scope: !107, type: !23) -// CHECK:STDOUT: !110 = !DILocalVariable(arg: 2, scope: !107, type: !23) -// CHECK:STDOUT: !111 = !DILocation(line: 44, column: 15, scope: !107) -// CHECK:STDOUT: !112 = !DILocation(line: 44, column: 10, scope: !107) -// CHECK:STDOUT: !113 = !DILocation(line: 44, column: 3, scope: !107) -// CHECK:STDOUT: !114 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.de5b400758c39a65", scope: null, file: !3, line: 43, type: !37, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !115) -// CHECK:STDOUT: !115 = !{!116, !117} -// CHECK:STDOUT: !116 = !DILocalVariable(arg: 1, scope: !114, type: !39) -// CHECK:STDOUT: !117 = !DILocalVariable(arg: 2, scope: !114, type: !23) -// CHECK:STDOUT: !118 = !DILocation(line: 44, column: 15, scope: !114) -// CHECK:STDOUT: !119 = !DILocation(line: 44, column: 10, scope: !114) -// CHECK:STDOUT: !120 = !DILocation(line: 44, column: 3, scope: !114) -// CHECK:STDOUT: !121 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 43, type: !37, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !122) -// CHECK:STDOUT: !122 = !{!123, !124} -// CHECK:STDOUT: !123 = !DILocalVariable(arg: 1, scope: !121, type: !39) -// CHECK:STDOUT: !124 = !DILocalVariable(arg: 2, scope: !121, type: !23) -// CHECK:STDOUT: !125 = !DILocation(line: 44, column: 15, scope: !121) -// CHECK:STDOUT: !126 = !DILocation(line: 44, column: 10, scope: !121) -// CHECK:STDOUT: !127 = !DILocation(line: 44, column: 3, scope: !121) +// CHECK:STDOUT: !26 = !DILocation(line: 49, column: 3, scope: !20) +// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 48, type: !28, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !31) +// CHECK:STDOUT: !28 = !DISubroutineType(types: !29) +// CHECK:STDOUT: !29 = !{null, !30} +// CHECK:STDOUT: !30 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !31 = !{!32} +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !27, type: !30) +// CHECK:STDOUT: !33 = !DILocation(line: 48, column: 3, scope: !27) +// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 21, type: !35, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !37) +// CHECK:STDOUT: !35 = !DISubroutineType(types: !36) +// CHECK:STDOUT: !36 = !{!30, !30, !30} +// CHECK:STDOUT: !37 = !{!38, !39} +// CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !34, type: !30) +// CHECK:STDOUT: !39 = !DILocalVariable(arg: 2, scope: !34, type: !30) +// CHECK:STDOUT: !40 = !DILocation(line: 22, column: 7, scope: !34) +// CHECK:STDOUT: !41 = !DILocation(line: 22, column: 6, scope: !34) +// CHECK:STDOUT: !42 = !DILocation(line: 23, column: 5, scope: !34) +// CHECK:STDOUT: !43 = !DILocation(line: 25, column: 7, scope: !34) +// CHECK:STDOUT: !44 = !DILocation(line: 25, column: 6, scope: !34) +// CHECK:STDOUT: !45 = !DILocation(line: 26, column: 12, scope: !34) +// CHECK:STDOUT: !46 = !DILocation(line: 26, column: 5, scope: !34) +// CHECK:STDOUT: !47 = !DILocation(line: 28, column: 12, scope: !34) +// CHECK:STDOUT: !48 = !DILocation(line: 28, column: 5, scope: !34) +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.de5b400758c39a65", scope: null, file: !3, line: 21, type: !50, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !52) +// CHECK:STDOUT: !50 = !DISubroutineType(types: !51) +// CHECK:STDOUT: !51 = !{!23, !23, !30} +// CHECK:STDOUT: !52 = !{!53, !54} +// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !49, type: !23) +// CHECK:STDOUT: !54 = !DILocalVariable(arg: 2, scope: !49, type: !30) +// CHECK:STDOUT: !55 = !DILocation(line: 22, column: 7, scope: !49) +// CHECK:STDOUT: !56 = !DILocation(line: 22, column: 6, scope: !49) +// CHECK:STDOUT: !57 = !DILocation(line: 23, column: 5, scope: !49) +// CHECK:STDOUT: !58 = !DILocation(line: 25, column: 7, scope: !49) +// CHECK:STDOUT: !59 = !DILocation(line: 25, column: 6, scope: !49) +// CHECK:STDOUT: !60 = !DILocation(line: 26, column: 12, scope: !49) +// CHECK:STDOUT: !61 = !DILocation(line: 26, column: 5, scope: !49) +// CHECK:STDOUT: !62 = !DILocation(line: 28, column: 12, scope: !49) +// CHECK:STDOUT: !63 = !DILocation(line: 28, column: 5, scope: !49) +// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 21, type: !50, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !65) +// CHECK:STDOUT: !65 = !{!66, !67} +// CHECK:STDOUT: !66 = !DILocalVariable(arg: 1, scope: !64, type: !23) +// CHECK:STDOUT: !67 = !DILocalVariable(arg: 2, scope: !64, type: !30) +// CHECK:STDOUT: !68 = !DILocation(line: 22, column: 7, scope: !64) +// CHECK:STDOUT: !69 = !DILocation(line: 22, column: 6, scope: !64) +// CHECK:STDOUT: !70 = !DILocation(line: 23, column: 5, scope: !64) +// CHECK:STDOUT: !71 = !DILocation(line: 25, column: 7, scope: !64) +// CHECK:STDOUT: !72 = !DILocation(line: 25, column: 6, scope: !64) +// CHECK:STDOUT: !73 = !DILocation(line: 26, column: 12, scope: !64) +// CHECK:STDOUT: !74 = !DILocation(line: 26, column: 5, scope: !64) +// CHECK:STDOUT: !75 = !DILocation(line: 28, column: 12, scope: !64) +// CHECK:STDOUT: !76 = !DILocation(line: 28, column: 5, scope: !64) +// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 33, type: !35, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !78) +// CHECK:STDOUT: !78 = !{!79, !80} +// CHECK:STDOUT: !79 = !DILocalVariable(arg: 1, scope: !77, type: !30) +// CHECK:STDOUT: !80 = !DILocalVariable(arg: 2, scope: !77, type: !30) +// CHECK:STDOUT: !81 = !DILocation(line: 34, column: 3, scope: !77) +// CHECK:STDOUT: !82 = !DILocation(line: 35, column: 10, scope: !77) +// CHECK:STDOUT: !83 = !DILocation(line: 35, column: 3, scope: !77) +// CHECK:STDOUT: !84 = distinct !DISubprogram(name: "C", linkageName: "_CC.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 38, type: !35, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !85) +// CHECK:STDOUT: !85 = !{!86, !87} +// CHECK:STDOUT: !86 = !DILocalVariable(arg: 1, scope: !84, type: !30) +// CHECK:STDOUT: !87 = !DILocalVariable(arg: 2, scope: !84, type: !30) +// CHECK:STDOUT: !88 = !DILocation(line: 39, column: 3, scope: !84) +// CHECK:STDOUT: !89 = !DILocation(line: 40, column: 10, scope: !84) +// CHECK:STDOUT: !90 = !DILocation(line: 40, column: 3, scope: !84) +// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.de5b400758c39a65", scope: null, file: !3, line: 33, type: !50, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !92) +// CHECK:STDOUT: !92 = !{!93, !94} +// CHECK:STDOUT: !93 = !DILocalVariable(arg: 1, scope: !91, type: !23) +// CHECK:STDOUT: !94 = !DILocalVariable(arg: 2, scope: !91, type: !30) +// CHECK:STDOUT: !95 = !DILocation(line: 34, column: 3, scope: !91) +// CHECK:STDOUT: !96 = !DILocation(line: 35, column: 10, scope: !91) +// CHECK:STDOUT: !97 = !DILocation(line: 35, column: 3, scope: !91) +// CHECK:STDOUT: !98 = distinct !DISubprogram(name: "C", linkageName: "_CC.Main.de5b400758c39a65", scope: null, file: !3, line: 38, type: !50, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !99) +// CHECK:STDOUT: !99 = !{!100, !101} +// CHECK:STDOUT: !100 = !DILocalVariable(arg: 1, scope: !98, type: !23) +// CHECK:STDOUT: !101 = !DILocalVariable(arg: 2, scope: !98, type: !30) +// CHECK:STDOUT: !102 = !DILocation(line: 39, column: 3, scope: !98) +// CHECK:STDOUT: !103 = !DILocation(line: 40, column: 10, scope: !98) +// CHECK:STDOUT: !104 = !DILocation(line: 40, column: 3, scope: !98) +// CHECK:STDOUT: !105 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 33, type: !50, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !106) +// CHECK:STDOUT: !106 = !{!107, !108} +// CHECK:STDOUT: !107 = !DILocalVariable(arg: 1, scope: !105, type: !23) +// CHECK:STDOUT: !108 = !DILocalVariable(arg: 2, scope: !105, type: !30) +// CHECK:STDOUT: !109 = !DILocation(line: 34, column: 3, scope: !105) +// CHECK:STDOUT: !110 = !DILocation(line: 35, column: 10, scope: !105) +// CHECK:STDOUT: !111 = !DILocation(line: 35, column: 3, scope: !105) +// CHECK:STDOUT: !112 = distinct !DISubprogram(name: "C", linkageName: "_CC.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 38, type: !50, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !113) +// CHECK:STDOUT: !113 = !{!114, !115} +// CHECK:STDOUT: !114 = !DILocalVariable(arg: 1, scope: !112, type: !23) +// CHECK:STDOUT: !115 = !DILocalVariable(arg: 2, scope: !112, type: !30) +// CHECK:STDOUT: !116 = !DILocation(line: 39, column: 3, scope: !112) +// CHECK:STDOUT: !117 = !DILocation(line: 40, column: 10, scope: !112) +// CHECK:STDOUT: !118 = !DILocation(line: 40, column: 3, scope: !112) +// CHECK:STDOUT: !119 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 43, type: !35, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !120) +// CHECK:STDOUT: !120 = !{!121, !122} +// CHECK:STDOUT: !121 = !DILocalVariable(arg: 1, scope: !119, type: !30) +// CHECK:STDOUT: !122 = !DILocalVariable(arg: 2, scope: !119, type: !30) +// CHECK:STDOUT: !123 = !DILocation(line: 44, column: 15, scope: !119) +// CHECK:STDOUT: !124 = !DILocation(line: 44, column: 10, scope: !119) +// CHECK:STDOUT: !125 = !DILocation(line: 44, column: 3, scope: !119) +// CHECK:STDOUT: !126 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.de5b400758c39a65", scope: null, file: !3, line: 43, type: !50, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !127) +// CHECK:STDOUT: !127 = !{!128, !129} +// CHECK:STDOUT: !128 = !DILocalVariable(arg: 1, scope: !126, type: !23) +// CHECK:STDOUT: !129 = !DILocalVariable(arg: 2, scope: !126, type: !30) +// CHECK:STDOUT: !130 = !DILocation(line: 44, column: 15, scope: !126) +// CHECK:STDOUT: !131 = !DILocation(line: 44, column: 10, scope: !126) +// CHECK:STDOUT: !132 = !DILocation(line: 44, column: 3, scope: !126) +// CHECK:STDOUT: !133 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 43, type: !50, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !134) +// CHECK:STDOUT: !134 = !{!135, !136} +// CHECK:STDOUT: !135 = !DILocalVariable(arg: 1, scope: !133, type: !23) +// CHECK:STDOUT: !136 = !DILocalVariable(arg: 2, scope: !133, type: !30) +// CHECK:STDOUT: !137 = !DILocation(line: 44, column: 15, scope: !133) +// CHECK:STDOUT: !138 = !DILocation(line: 44, column: 10, scope: !133) +// CHECK:STDOUT: !139 = !DILocation(line: 44, column: 3, scope: !133) diff --git a/toolchain/lower/testdata/function/generic/call_recursive_mutual.carbon b/toolchain/lower/testdata/function/generic/call_recursive_mutual.carbon index 3c3abcdbbf37..d2c3f29350c9 100644 --- a/toolchain/lower/testdata/function/generic/call_recursive_mutual.carbon +++ b/toolchain/lower/testdata/function/generic/call_recursive_mutual.carbon @@ -67,100 +67,114 @@ fn M() { // CHECK:STDOUT: %F.call.loc40 = call ptr @_CF.Main.779b9c0f3b54a7f8(ptr %.loc40_5, i32 0), !dbg !16 // CHECK:STDOUT: %.loc41_5 = load ptr, ptr %ptr_f64.var, align 8, !dbg !17 // CHECK:STDOUT: %F.call.loc41 = call ptr @_CF.Main.779b9c0f3b54a7f8(ptr %.loc41_5, i32 0), !dbg !18 +// CHECK:STDOUT: call void @"_COp.98006a366c2ffd6c:core.Destroy.Core"(ptr %m.var), !dbg !8 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %n.var), !dbg !7 // CHECK:STDOUT: ret void, !dbg !19 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.98006a366c2ffd6c:core.Destroy.Core"(ptr %self) #0 !dbg !20 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !26 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !27 { +// 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) // 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.64ccbb8e5d9a0b8e(i32 %x, i32 %count) #0 !dbg !20 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 3, !dbg !27 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !28 -// CHECK:STDOUT: -// CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: ret i32 %x, !dbg !29 -// CHECK:STDOUT: -// CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !30 -// CHECK:STDOUT: %G.call = call i32 @_CG.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !31 -// CHECK:STDOUT: ret i32 %G.call, !dbg !32 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CF.Main.de5b400758c39a65(double %x, i32 %count) #0 !dbg !33 { +// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count) #0 !dbg !34 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 3, !dbg !40 // CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !41 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: ret double %x, !dbg !42 +// CHECK:STDOUT: ret i32 %x, !dbg !42 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry // CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !43 -// CHECK:STDOUT: %G.call = call double @_CG.Main.de5b400758c39a65(double %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !44 -// CHECK:STDOUT: ret double %G.call, !dbg !45 +// CHECK:STDOUT: %G.call = call i32 @_CG.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !44 +// CHECK:STDOUT: ret i32 %G.call, !dbg !45 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CF.Main.779b9c0f3b54a7f8(ptr %x, i32 %count) #0 !dbg !46 { +// CHECK:STDOUT: define linkonce_odr double @_CF.Main.de5b400758c39a65(double %x, i32 %count) #0 !dbg !46 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 3, !dbg !50 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !51 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 3, !dbg !52 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !53 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: ret ptr %x, !dbg !52 +// CHECK:STDOUT: ret double %x, !dbg !54 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !53 -// CHECK:STDOUT: %G.call = call ptr @_CG.Main.779b9c0f3b54a7f8(ptr %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !54 -// CHECK:STDOUT: ret ptr %G.call, !dbg !55 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !55 +// CHECK:STDOUT: %G.call = call double @_CG.Main.de5b400758c39a65(double %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !56 +// CHECK:STDOUT: ret double %G.call, !dbg !57 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CG.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count) #0 !dbg !56 { +// CHECK:STDOUT: define linkonce_odr ptr @_CF.Main.779b9c0f3b54a7f8(ptr %x, i32 %count) #0 !dbg !58 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !dbg !60 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !61 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 3, !dbg !62 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !63 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: ret i32 %x, !dbg !62 +// CHECK:STDOUT: ret ptr %x, !dbg !64 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !63 -// CHECK:STDOUT: %F.call = call i32 @_CF.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !64 -// CHECK:STDOUT: ret i32 %F.call, !dbg !65 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !65 +// CHECK:STDOUT: %G.call = call ptr @_CG.Main.779b9c0f3b54a7f8(ptr %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !66 +// CHECK:STDOUT: ret ptr %G.call, !dbg !67 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CG.Main.de5b400758c39a65(double %x, i32 %count) #0 !dbg !66 { +// CHECK:STDOUT: define linkonce_odr i32 @_CG.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count) #0 !dbg !68 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !dbg !70 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !71 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !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 double %x, !dbg !72 +// CHECK:STDOUT: ret i32 %x, !dbg !74 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !73 -// CHECK:STDOUT: %F.call = call double @_CF.Main.de5b400758c39a65(double %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !74 -// CHECK:STDOUT: ret double %F.call, !dbg !75 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !75 +// CHECK:STDOUT: %F.call = call i32 @_CF.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !76 +// CHECK:STDOUT: ret i32 %F.call, !dbg !77 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CG.Main.779b9c0f3b54a7f8(ptr %x, i32 %count) #0 !dbg !76 { +// CHECK:STDOUT: define linkonce_odr double @_CG.Main.de5b400758c39a65(double %x, i32 %count) #0 !dbg !78 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !dbg !80 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !81 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !dbg !82 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !83 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: ret ptr %x, !dbg !82 +// CHECK:STDOUT: ret double %x, !dbg !84 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !83 -// CHECK:STDOUT: %F.call = call ptr @_CF.Main.779b9c0f3b54a7f8(ptr %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !84 -// CHECK:STDOUT: ret ptr %F.call, !dbg !85 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !85 +// CHECK:STDOUT: %F.call = call double @_CF.Main.de5b400758c39a65(double %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !86 +// CHECK:STDOUT: ret double %F.call, !dbg !87 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr ptr @_CG.Main.779b9c0f3b54a7f8(ptr %x, i32 %count) #0 !dbg !88 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !dbg !92 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !93 +// CHECK:STDOUT: +// CHECK:STDOUT: if.then: ; preds = %entry +// CHECK:STDOUT: ret ptr %x, !dbg !94 +// CHECK:STDOUT: +// CHECK:STDOUT: if.else: ; preds = %entry +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !95 +// CHECK:STDOUT: %F.call = call ptr @_CF.Main.779b9c0f3b54a7f8(ptr %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !96 +// CHECK:STDOUT: ret ptr %F.call, !dbg !97 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -193,69 +207,81 @@ fn M() { // CHECK:STDOUT: !17 = !DILocation(line: 41, column: 5, scope: !4) // CHECK:STDOUT: !18 = !DILocation(line: 41, column: 3, scope: !4) // CHECK:STDOUT: !19 = !DILocation(line: 32, column: 1, scope: !4) -// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 18, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !24) +// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "Op", linkageName: "_COp.98006a366c2ffd6c:core.Destroy.Core", scope: null, file: !3, line: 34, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !24) // CHECK:STDOUT: !21 = !DISubroutineType(types: !22) -// CHECK:STDOUT: !22 = !{!23, !23, !23} -// CHECK:STDOUT: !23 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !24 = !{!25, !26} +// CHECK:STDOUT: !22 = !{null, !23} +// CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !24 = !{!25} // CHECK:STDOUT: !25 = !DILocalVariable(arg: 1, scope: !20, type: !23) -// CHECK:STDOUT: !26 = !DILocalVariable(arg: 2, scope: !20, type: !23) -// CHECK:STDOUT: !27 = !DILocation(line: 19, column: 7, scope: !20) -// CHECK:STDOUT: !28 = !DILocation(line: 19, column: 6, scope: !20) -// CHECK:STDOUT: !29 = !DILocation(line: 20, column: 5, scope: !20) -// CHECK:STDOUT: !30 = !DILocation(line: 22, column: 15, scope: !20) -// CHECK:STDOUT: !31 = !DILocation(line: 22, column: 10, scope: !20) -// CHECK:STDOUT: !32 = !DILocation(line: 22, column: 3, scope: !20) -// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.de5b400758c39a65", scope: null, file: !3, line: 18, type: !34, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !37) -// CHECK:STDOUT: !34 = !DISubroutineType(types: !35) -// CHECK:STDOUT: !35 = !{!36, !36, !23} -// CHECK:STDOUT: !36 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !26 = !DILocation(line: 34, column: 3, scope: !20) +// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 33, type: !28, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !31) +// CHECK:STDOUT: !28 = !DISubroutineType(types: !29) +// CHECK:STDOUT: !29 = !{null, !30} +// CHECK:STDOUT: !30 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !31 = !{!32} +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !27, type: !30) +// CHECK:STDOUT: !33 = !DILocation(line: 33, column: 3, scope: !27) +// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 18, type: !35, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !37) +// CHECK:STDOUT: !35 = !DISubroutineType(types: !36) +// CHECK:STDOUT: !36 = !{!30, !30, !30} // CHECK:STDOUT: !37 = !{!38, !39} -// CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !33, type: !36) -// CHECK:STDOUT: !39 = !DILocalVariable(arg: 2, scope: !33, type: !23) -// CHECK:STDOUT: !40 = !DILocation(line: 19, column: 7, scope: !33) -// CHECK:STDOUT: !41 = !DILocation(line: 19, column: 6, scope: !33) -// CHECK:STDOUT: !42 = !DILocation(line: 20, column: 5, scope: !33) -// CHECK:STDOUT: !43 = !DILocation(line: 22, column: 15, scope: !33) -// CHECK:STDOUT: !44 = !DILocation(line: 22, column: 10, scope: !33) -// CHECK:STDOUT: !45 = !DILocation(line: 22, column: 3, scope: !33) -// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 18, type: !34, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !47) -// CHECK:STDOUT: !47 = !{!48, !49} -// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !46, type: !36) -// CHECK:STDOUT: !49 = !DILocalVariable(arg: 2, scope: !46, type: !23) -// CHECK:STDOUT: !50 = !DILocation(line: 19, column: 7, scope: !46) -// CHECK:STDOUT: !51 = !DILocation(line: 19, column: 6, scope: !46) -// CHECK:STDOUT: !52 = !DILocation(line: 20, column: 5, scope: !46) -// CHECK:STDOUT: !53 = !DILocation(line: 22, column: 15, scope: !46) -// CHECK:STDOUT: !54 = !DILocation(line: 22, column: 10, scope: !46) -// CHECK:STDOUT: !55 = !DILocation(line: 22, column: 3, scope: !46) -// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 25, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !57) -// CHECK:STDOUT: !57 = !{!58, !59} -// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !56, type: !23) -// CHECK:STDOUT: !59 = !DILocalVariable(arg: 2, scope: !56, type: !23) -// CHECK:STDOUT: !60 = !DILocation(line: 26, column: 7, scope: !56) -// CHECK:STDOUT: !61 = !DILocation(line: 26, column: 6, scope: !56) -// CHECK:STDOUT: !62 = !DILocation(line: 27, column: 5, scope: !56) -// CHECK:STDOUT: !63 = !DILocation(line: 29, column: 15, scope: !56) -// CHECK:STDOUT: !64 = !DILocation(line: 29, column: 10, scope: !56) -// CHECK:STDOUT: !65 = !DILocation(line: 29, column: 3, scope: !56) -// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.de5b400758c39a65", scope: null, file: !3, line: 25, type: !34, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !67) -// CHECK:STDOUT: !67 = !{!68, !69} -// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !66, type: !36) -// CHECK:STDOUT: !69 = !DILocalVariable(arg: 2, scope: !66, type: !23) -// CHECK:STDOUT: !70 = !DILocation(line: 26, column: 7, scope: !66) -// CHECK:STDOUT: !71 = !DILocation(line: 26, column: 6, scope: !66) -// CHECK:STDOUT: !72 = !DILocation(line: 27, column: 5, scope: !66) -// CHECK:STDOUT: !73 = !DILocation(line: 29, column: 15, scope: !66) -// CHECK:STDOUT: !74 = !DILocation(line: 29, column: 10, scope: !66) -// CHECK:STDOUT: !75 = !DILocation(line: 29, column: 3, scope: !66) -// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 25, type: !34, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !77) -// CHECK:STDOUT: !77 = !{!78, !79} -// CHECK:STDOUT: !78 = !DILocalVariable(arg: 1, scope: !76, type: !36) -// CHECK:STDOUT: !79 = !DILocalVariable(arg: 2, scope: !76, type: !23) -// CHECK:STDOUT: !80 = !DILocation(line: 26, column: 7, scope: !76) -// CHECK:STDOUT: !81 = !DILocation(line: 26, column: 6, scope: !76) -// CHECK:STDOUT: !82 = !DILocation(line: 27, column: 5, scope: !76) -// CHECK:STDOUT: !83 = !DILocation(line: 29, column: 15, scope: !76) -// CHECK:STDOUT: !84 = !DILocation(line: 29, column: 10, scope: !76) -// CHECK:STDOUT: !85 = !DILocation(line: 29, column: 3, scope: !76) +// CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !34, type: !30) +// CHECK:STDOUT: !39 = !DILocalVariable(arg: 2, scope: !34, type: !30) +// CHECK:STDOUT: !40 = !DILocation(line: 19, column: 7, scope: !34) +// CHECK:STDOUT: !41 = !DILocation(line: 19, column: 6, scope: !34) +// CHECK:STDOUT: !42 = !DILocation(line: 20, column: 5, scope: !34) +// CHECK:STDOUT: !43 = !DILocation(line: 22, column: 15, scope: !34) +// CHECK:STDOUT: !44 = !DILocation(line: 22, column: 10, scope: !34) +// CHECK:STDOUT: !45 = !DILocation(line: 22, column: 3, scope: !34) +// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.de5b400758c39a65", scope: null, file: !3, line: 18, type: !47, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !49) +// CHECK:STDOUT: !47 = !DISubroutineType(types: !48) +// CHECK:STDOUT: !48 = !{!23, !23, !30} +// CHECK:STDOUT: !49 = !{!50, !51} +// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !46, type: !23) +// CHECK:STDOUT: !51 = !DILocalVariable(arg: 2, scope: !46, type: !30) +// CHECK:STDOUT: !52 = !DILocation(line: 19, column: 7, scope: !46) +// CHECK:STDOUT: !53 = !DILocation(line: 19, column: 6, scope: !46) +// CHECK:STDOUT: !54 = !DILocation(line: 20, column: 5, scope: !46) +// CHECK:STDOUT: !55 = !DILocation(line: 22, column: 15, scope: !46) +// CHECK:STDOUT: !56 = !DILocation(line: 22, column: 10, scope: !46) +// CHECK:STDOUT: !57 = !DILocation(line: 22, column: 3, scope: !46) +// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 18, type: !47, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !59) +// CHECK:STDOUT: !59 = !{!60, !61} +// CHECK:STDOUT: !60 = !DILocalVariable(arg: 1, scope: !58, type: !23) +// CHECK:STDOUT: !61 = !DILocalVariable(arg: 2, scope: !58, type: !30) +// CHECK:STDOUT: !62 = !DILocation(line: 19, column: 7, scope: !58) +// CHECK:STDOUT: !63 = !DILocation(line: 19, column: 6, scope: !58) +// CHECK:STDOUT: !64 = !DILocation(line: 20, column: 5, scope: !58) +// CHECK:STDOUT: !65 = !DILocation(line: 22, column: 15, scope: !58) +// CHECK:STDOUT: !66 = !DILocation(line: 22, column: 10, scope: !58) +// CHECK:STDOUT: !67 = !DILocation(line: 22, column: 3, scope: !58) +// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 25, type: !35, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !69) +// CHECK:STDOUT: !69 = !{!70, !71} +// CHECK:STDOUT: !70 = !DILocalVariable(arg: 1, scope: !68, type: !30) +// CHECK:STDOUT: !71 = !DILocalVariable(arg: 2, scope: !68, type: !30) +// CHECK:STDOUT: !72 = !DILocation(line: 26, column: 7, scope: !68) +// CHECK:STDOUT: !73 = !DILocation(line: 26, column: 6, scope: !68) +// CHECK:STDOUT: !74 = !DILocation(line: 27, column: 5, scope: !68) +// CHECK:STDOUT: !75 = !DILocation(line: 29, column: 15, scope: !68) +// CHECK:STDOUT: !76 = !DILocation(line: 29, column: 10, scope: !68) +// CHECK:STDOUT: !77 = !DILocation(line: 29, column: 3, scope: !68) +// CHECK:STDOUT: !78 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.de5b400758c39a65", scope: null, file: !3, line: 25, type: !47, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !79) +// CHECK:STDOUT: !79 = !{!80, !81} +// CHECK:STDOUT: !80 = !DILocalVariable(arg: 1, scope: !78, type: !23) +// CHECK:STDOUT: !81 = !DILocalVariable(arg: 2, scope: !78, type: !30) +// CHECK:STDOUT: !82 = !DILocation(line: 26, column: 7, scope: !78) +// CHECK:STDOUT: !83 = !DILocation(line: 26, column: 6, scope: !78) +// CHECK:STDOUT: !84 = !DILocation(line: 27, column: 5, scope: !78) +// CHECK:STDOUT: !85 = !DILocation(line: 29, column: 15, scope: !78) +// CHECK:STDOUT: !86 = !DILocation(line: 29, column: 10, scope: !78) +// CHECK:STDOUT: !87 = !DILocation(line: 29, column: 3, scope: !78) +// CHECK:STDOUT: !88 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 25, type: !47, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !89) +// CHECK:STDOUT: !89 = !{!90, !91} +// CHECK:STDOUT: !90 = !DILocalVariable(arg: 1, scope: !88, type: !23) +// CHECK:STDOUT: !91 = !DILocalVariable(arg: 2, scope: !88, type: !30) +// CHECK:STDOUT: !92 = !DILocation(line: 26, column: 7, scope: !88) +// CHECK:STDOUT: !93 = !DILocation(line: 26, column: 6, scope: !88) +// CHECK:STDOUT: !94 = !DILocation(line: 27, column: 5, scope: !88) +// CHECK:STDOUT: !95 = !DILocation(line: 29, column: 15, scope: !88) +// CHECK:STDOUT: !96 = !DILocation(line: 29, column: 10, scope: !88) +// CHECK:STDOUT: !97 = !DILocation(line: 29, column: 3, scope: !88) diff --git a/toolchain/lower/testdata/function/generic/call_recursive_reorder.carbon b/toolchain/lower/testdata/function/generic/call_recursive_reorder.carbon index 87c4696c3ddd..fffc85ee8c1d 100644 --- a/toolchain/lower/testdata/function/generic/call_recursive_reorder.carbon +++ b/toolchain/lower/testdata/function/generic/call_recursive_reorder.carbon @@ -61,25 +61,39 @@ fn M() { // CHECK:STDOUT: %.loc31_5 = load ptr, ptr %ptr_f64.var, align 8, !dbg !16 // CHECK:STDOUT: %.loc31_14 = load ptr, ptr %ptr_bool.var, align 8, !dbg !17 // CHECK:STDOUT: %F.call.loc31 = call i32 @_CF.Main.2fe87eb83f5a4614(ptr %.loc31_5, ptr %.loc31_14, i32 0), !dbg !18 +// CHECK:STDOUT: call void @"_COp.98006a366c2ffd6c:core.Destroy.Core"(ptr %m.var), !dbg !8 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %n.var), !dbg !7 // CHECK:STDOUT: ret void, !dbg !19 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.98006a366c2ffd6c:core.Destroy.Core"(ptr %self) #0 !dbg !20 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !26 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !27 { +// 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) // 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.2fe87eb83f5a4614(ptr %x, ptr %y, i32 %count) #0 !dbg !20 { +// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.2fe87eb83f5a4614(ptr %x, ptr %y, i32 %count) #0 !dbg !34 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 2, !dbg !29 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !30 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 2, !dbg !41 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !42 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: ret i32 %count, !dbg !31 +// CHECK:STDOUT: ret i32 %count, !dbg !43 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !32 -// CHECK:STDOUT: %F.call = call i32 @_CF.Main.2fe87eb83f5a4614(ptr %y, ptr %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !33 -// CHECK:STDOUT: ret i32 %F.call, !dbg !34 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !44 +// CHECK:STDOUT: %F.call = call i32 @_CF.Main.2fe87eb83f5a4614(ptr %y, ptr %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !45 +// CHECK:STDOUT: ret i32 %F.call, !dbg !46 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -112,18 +126,30 @@ fn M() { // CHECK:STDOUT: !17 = !DILocation(line: 31, column: 14, scope: !4) // CHECK:STDOUT: !18 = !DILocation(line: 31, column: 3, scope: !4) // CHECK:STDOUT: !19 = !DILocation(line: 22, column: 1, scope: !4) -// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.2fe87eb83f5a4614", scope: null, file: !3, line: 15, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !25) +// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "Op", linkageName: "_COp.98006a366c2ffd6c:core.Destroy.Core", scope: null, file: !3, line: 24, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !24) // CHECK:STDOUT: !21 = !DISubroutineType(types: !22) -// CHECK:STDOUT: !22 = !{!23, !24, !24, !23} -// CHECK:STDOUT: !23 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !24 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !25 = !{!26, !27, !28} -// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !20, type: !24) -// CHECK:STDOUT: !27 = !DILocalVariable(arg: 2, scope: !20, type: !24) -// CHECK:STDOUT: !28 = !DILocalVariable(arg: 3, scope: !20, type: !23) -// CHECK:STDOUT: !29 = !DILocation(line: 16, column: 7, scope: !20) -// CHECK:STDOUT: !30 = !DILocation(line: 16, column: 6, scope: !20) -// CHECK:STDOUT: !31 = !DILocation(line: 17, column: 5, scope: !20) -// CHECK:STDOUT: !32 = !DILocation(line: 19, column: 18, scope: !20) -// CHECK:STDOUT: !33 = !DILocation(line: 19, column: 10, scope: !20) -// CHECK:STDOUT: !34 = !DILocation(line: 19, column: 3, scope: !20) +// CHECK:STDOUT: !22 = !{null, !23} +// CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !24 = !{!25} +// CHECK:STDOUT: !25 = !DILocalVariable(arg: 1, scope: !20, type: !23) +// CHECK:STDOUT: !26 = !DILocation(line: 24, column: 3, scope: !20) +// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 23, type: !28, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !31) +// CHECK:STDOUT: !28 = !DISubroutineType(types: !29) +// CHECK:STDOUT: !29 = !{null, !30} +// CHECK:STDOUT: !30 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !31 = !{!32} +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !27, type: !30) +// CHECK:STDOUT: !33 = !DILocation(line: 23, column: 3, scope: !27) +// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.2fe87eb83f5a4614", scope: null, file: !3, line: 15, type: !35, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !37) +// CHECK:STDOUT: !35 = !DISubroutineType(types: !36) +// CHECK:STDOUT: !36 = !{!30, !23, !23, !30} +// CHECK:STDOUT: !37 = !{!38, !39, !40} +// CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !34, type: !23) +// CHECK:STDOUT: !39 = !DILocalVariable(arg: 2, scope: !34, type: !23) +// CHECK:STDOUT: !40 = !DILocalVariable(arg: 3, scope: !34, type: !30) +// CHECK:STDOUT: !41 = !DILocation(line: 16, column: 7, scope: !34) +// CHECK:STDOUT: !42 = !DILocation(line: 16, column: 6, scope: !34) +// CHECK:STDOUT: !43 = !DILocation(line: 17, column: 5, scope: !34) +// CHECK:STDOUT: !44 = !DILocation(line: 19, column: 18, scope: !34) +// CHECK:STDOUT: !45 = !DILocation(line: 19, column: 10, scope: !34) +// CHECK:STDOUT: !46 = !DILocation(line: 19, column: 3, scope: !34) 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 1d918a9e3bc2..52ab5ab1cda1 100644 --- a/toolchain/lower/testdata/function/generic/call_recursive_reorder_more.carbon +++ b/toolchain/lower/testdata/function/generic/call_recursive_reorder_more.carbon @@ -135,89 +135,87 @@ fn M() { // CHECK:STDOUT: %.loc52_15 = load ptr, ptr %ptr_bool.var, align 8, !dbg !61 // CHECK:STDOUT: %.loc52_25 = load ptr, ptr %ptr_bool.var, align 8, !dbg !62 // CHECK:STDOUT: %F.call.loc52 = call i32 @_CF.Main.7776e910959584d9(ptr %.loc52_5, ptr %.loc52_15, ptr %.loc52_25, i32 0), !dbg !63 +// CHECK:STDOUT: call void @"_COp.98006a366c2ffd6c:core.Destroy.Core"(ptr %val_f64.var), !dbg !10 +// CHECK:STDOUT: call void @"_COp.0d6779e60704359e:core.Destroy.Core"(ptr %val_i64.var), !dbg !9 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %val_i32.var), !dbg !8 +// CHECK:STDOUT: call void @"_COp.406738f1b62008ed:core.Destroy.Core"(ptr %val_i16.var), !dbg !7 // CHECK:STDOUT: ret void, !dbg !64 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.98006a366c2ffd6c:core.Destroy.Core"(ptr %self) #0 !dbg !65 { +// 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.0d6779e60704359e:core.Destroy.Core"(ptr %self) #0 !dbg !72 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !78 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !79 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !85 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.406738f1b62008ed:core.Destroy.Core"(ptr %self) #0 !dbg !86 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !92 +// 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.077d2bb2ab5eee86(i16 %x, ptr %y, ptr %z, i32 %count) #0 !dbg !65 { +// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.077d2bb2ab5eee86(i16 %x, ptr %y, ptr %z, i32 %count) #0 !dbg !93 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 2, !dbg !76 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !77 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 2, !dbg !101 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !102 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: ret i32 %count, !dbg !78 +// CHECK:STDOUT: ret i32 %count, !dbg !103 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !79 -// CHECK:STDOUT: %F.call = call i32 @_CF.Main.077d2bb2ab5eee86(i16 %x, ptr %z, ptr %y, i32 %Int.as.AddWith.impl.Op.call), !dbg !80 -// CHECK:STDOUT: ret i32 %F.call, !dbg !81 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !104 +// CHECK:STDOUT: %F.call = call i32 @_CF.Main.077d2bb2ab5eee86(i16 %x, ptr %z, ptr %y, i32 %Int.as.AddWith.impl.Op.call), !dbg !105 +// CHECK:STDOUT: ret i32 %F.call, !dbg !106 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.9a89ac9e10448feb(i32 %x, ptr %y, ptr %z, i32 %count) #0 !dbg !82 { +// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.9a89ac9e10448feb(i32 %x, ptr %y, ptr %z, i32 %count) #0 !dbg !107 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 2, !dbg !90 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !91 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 2, !dbg !115 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !116 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: ret i32 %count, !dbg !92 +// CHECK:STDOUT: ret i32 %count, !dbg !117 // 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 i32 @_CF.Main.9a89ac9e10448feb(i32 %x, ptr %z, ptr %y, i32 %Int.as.AddWith.impl.Op.call), !dbg !94 -// CHECK:STDOUT: ret i32 %F.call, !dbg !95 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !118 +// CHECK:STDOUT: %F.call = call i32 @_CF.Main.9a89ac9e10448feb(i32 %x, ptr %z, ptr %y, i32 %Int.as.AddWith.impl.Op.call), !dbg !119 +// CHECK:STDOUT: ret i32 %F.call, !dbg !120 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.76a945443862cc1f(i1 %x, ptr %y, ptr %z, i32 %count) #0 !dbg !96 { +// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.76a945443862cc1f(i1 %x, ptr %y, ptr %z, i32 %count) #0 !dbg !121 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 2, !dbg !104 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !105 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 2, !dbg !129 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !130 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: ret i32 %count, !dbg !106 +// CHECK:STDOUT: ret i32 %count, !dbg !131 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !107 -// CHECK:STDOUT: %F.call = call i32 @_CF.Main.76a945443862cc1f(i1 %x, ptr %z, ptr %y, i32 %Int.as.AddWith.impl.Op.call), !dbg !108 -// CHECK:STDOUT: ret i32 %F.call, !dbg !109 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !132 +// CHECK:STDOUT: %F.call = call i32 @_CF.Main.76a945443862cc1f(i1 %x, ptr %z, ptr %y, i32 %Int.as.AddWith.impl.Op.call), !dbg !133 +// CHECK:STDOUT: ret i32 %F.call, !dbg !134 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.02da1a7614ea56b6(i64 %x, i1 %y, ptr %z, i32 %count) #0 !dbg !110 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 2, !dbg !119 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !120 -// CHECK:STDOUT: -// CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: ret i32 %count, !dbg !121 -// CHECK:STDOUT: -// CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !122 -// CHECK:STDOUT: %F.call = call i32 @_CF.Main.bea8bae6e14e4034(i64 %x, ptr %z, i1 %y, i32 %Int.as.AddWith.impl.Op.call), !dbg !123 -// CHECK:STDOUT: ret i32 %F.call, !dbg !124 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.4dcab66ec095dfec(double %x, ptr %y, ptr %z, i32 %count) #0 !dbg !125 { -// 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: -// CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: ret i32 %count, !dbg !133 -// CHECK:STDOUT: -// CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !134 -// CHECK:STDOUT: %F.call = call i32 @_CF.Main.4dcab66ec095dfec(double %x, ptr %z, ptr %y, i32 %Int.as.AddWith.impl.Op.call), !dbg !135 -// CHECK:STDOUT: ret i32 %F.call, !dbg !136 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.7776e910959584d9(ptr %x, ptr %y, ptr %z, i32 %count) #0 !dbg !137 { +// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.02da1a7614ea56b6(i64 %x, i1 %y, ptr %z, i32 %count) #0 !dbg !135 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 2, !dbg !143 // CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !144 @@ -227,12 +225,12 @@ fn M() { // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry // CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !146 -// CHECK:STDOUT: %F.call = call i32 @_CF.Main.7776e910959584d9(ptr %x, ptr %z, ptr %y, i32 %Int.as.AddWith.impl.Op.call), !dbg !147 +// CHECK:STDOUT: %F.call = call i32 @_CF.Main.bea8bae6e14e4034(i64 %x, ptr %z, i1 %y, i32 %Int.as.AddWith.impl.Op.call), !dbg !147 // CHECK:STDOUT: ret i32 %F.call, !dbg !148 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.bea8bae6e14e4034(i64 %x, ptr %y, i1 %z, i32 %count) #0 !dbg !149 { +// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.4dcab66ec095dfec(double %x, ptr %y, ptr %z, i32 %count) #0 !dbg !149 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 2, !dbg !155 // CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !156 @@ -242,10 +240,40 @@ fn M() { // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry // CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !158 -// CHECK:STDOUT: %F.call = call i32 @_CF.Main.02da1a7614ea56b6(i64 %x, i1 %z, ptr %y, i32 %Int.as.AddWith.impl.Op.call), !dbg !159 +// CHECK:STDOUT: %F.call = call i32 @_CF.Main.4dcab66ec095dfec(double %x, ptr %z, ptr %y, i32 %Int.as.AddWith.impl.Op.call), !dbg !159 // CHECK:STDOUT: ret i32 %F.call, !dbg !160 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.7776e910959584d9(ptr %x, ptr %y, ptr %z, i32 %count) #0 !dbg !161 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 2, !dbg !167 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !168 +// CHECK:STDOUT: +// CHECK:STDOUT: if.then: ; preds = %entry +// CHECK:STDOUT: ret i32 %count, !dbg !169 +// CHECK:STDOUT: +// CHECK:STDOUT: if.else: ; preds = %entry +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !170 +// CHECK:STDOUT: %F.call = call i32 @_CF.Main.7776e910959584d9(ptr %x, ptr %z, ptr %y, i32 %Int.as.AddWith.impl.Op.call), !dbg !171 +// CHECK:STDOUT: ret i32 %F.call, !dbg !172 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.bea8bae6e14e4034(i64 %x, ptr %y, i1 %z, i32 %count) #0 !dbg !173 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 2, !dbg !179 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !180 +// CHECK:STDOUT: +// CHECK:STDOUT: if.then: ; preds = %entry +// CHECK:STDOUT: ret i32 %count, !dbg !181 +// 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.02da1a7614ea56b6(i64 %x, i1 %z, ptr %y, i32 %Int.as.AddWith.impl.Op.call), !dbg !183 +// CHECK:STDOUT: ret i32 %F.call, !dbg !184 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 8, 7, 6, 5, 4, 3, 2, 1, 0 } // CHECK:STDOUT: uselistorder ptr @_CF.Main.7776e910959584d9, { 5, 7, 6, 4, 0, 1, 2, 3 } @@ -321,99 +349,123 @@ fn M() { // CHECK:STDOUT: !62 = !DILocation(line: 52, column: 25, scope: !4) // CHECK:STDOUT: !63 = !DILocation(line: 52, column: 3, scope: !4) // CHECK:STDOUT: !64 = !DILocation(line: 22, column: 1, scope: !4) -// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.077d2bb2ab5eee86", scope: null, file: !3, line: 15, type: !66, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !71) +// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "Op", linkageName: "_COp.98006a366c2ffd6c:core.Destroy.Core", scope: null, file: !3, line: 26, type: !66, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !69) // CHECK:STDOUT: !66 = !DISubroutineType(types: !67) -// CHECK:STDOUT: !67 = !{!68, !69, !70, !70, !68} -// CHECK:STDOUT: !68 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !69 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed) -// CHECK:STDOUT: !70 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !71 = !{!72, !73, !74, !75} -// CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !65, type: !69) -// CHECK:STDOUT: !73 = !DILocalVariable(arg: 2, scope: !65, type: !70) -// CHECK:STDOUT: !74 = !DILocalVariable(arg: 3, scope: !65, type: !70) -// CHECK:STDOUT: !75 = !DILocalVariable(arg: 4, scope: !65, type: !68) -// CHECK:STDOUT: !76 = !DILocation(line: 16, column: 7, scope: !65) -// CHECK:STDOUT: !77 = !DILocation(line: 16, column: 6, scope: !65) -// CHECK:STDOUT: !78 = !DILocation(line: 17, column: 5, scope: !65) -// CHECK:STDOUT: !79 = !DILocation(line: 19, column: 21, scope: !65) -// CHECK:STDOUT: !80 = !DILocation(line: 19, column: 10, scope: !65) -// CHECK:STDOUT: !81 = !DILocation(line: 19, column: 3, scope: !65) -// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.9a89ac9e10448feb", scope: null, file: !3, line: 15, type: !83, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !85) -// CHECK:STDOUT: !83 = !DISubroutineType(types: !84) -// CHECK:STDOUT: !84 = !{!68, !68, !70, !70, !68} -// CHECK:STDOUT: !85 = !{!86, !87, !88, !89} -// CHECK:STDOUT: !86 = !DILocalVariable(arg: 1, scope: !82, type: !68) -// CHECK:STDOUT: !87 = !DILocalVariable(arg: 2, scope: !82, type: !70) -// CHECK:STDOUT: !88 = !DILocalVariable(arg: 3, scope: !82, type: !70) -// CHECK:STDOUT: !89 = !DILocalVariable(arg: 4, scope: !82, type: !68) -// CHECK:STDOUT: !90 = !DILocation(line: 16, column: 7, scope: !82) -// CHECK:STDOUT: !91 = !DILocation(line: 16, column: 6, scope: !82) -// CHECK:STDOUT: !92 = !DILocation(line: 17, column: 5, scope: !82) -// CHECK:STDOUT: !93 = !DILocation(line: 19, column: 21, scope: !82) -// CHECK:STDOUT: !94 = !DILocation(line: 19, column: 10, scope: !82) -// CHECK:STDOUT: !95 = !DILocation(line: 19, column: 3, scope: !82) -// CHECK:STDOUT: !96 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.76a945443862cc1f", scope: null, file: !3, line: 15, type: !97, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !99) -// CHECK:STDOUT: !97 = !DISubroutineType(types: !98) -// CHECK:STDOUT: !98 = !{!68, !70, !70, !70, !68} -// CHECK:STDOUT: !99 = !{!100, !101, !102, !103} -// CHECK:STDOUT: !100 = !DILocalVariable(arg: 1, scope: !96, type: !70) -// CHECK:STDOUT: !101 = !DILocalVariable(arg: 2, scope: !96, type: !70) -// CHECK:STDOUT: !102 = !DILocalVariable(arg: 3, scope: !96, type: !70) -// CHECK:STDOUT: !103 = !DILocalVariable(arg: 4, scope: !96, type: !68) -// CHECK:STDOUT: !104 = !DILocation(line: 16, column: 7, scope: !96) -// CHECK:STDOUT: !105 = !DILocation(line: 16, column: 6, scope: !96) -// CHECK:STDOUT: !106 = !DILocation(line: 17, column: 5, scope: !96) -// CHECK:STDOUT: !107 = !DILocation(line: 19, column: 21, scope: !96) -// CHECK:STDOUT: !108 = !DILocation(line: 19, column: 10, scope: !96) -// CHECK:STDOUT: !109 = !DILocation(line: 19, column: 3, scope: !96) -// CHECK:STDOUT: !110 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.02da1a7614ea56b6", scope: null, file: !3, line: 15, type: !111, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !114) -// CHECK:STDOUT: !111 = !DISubroutineType(types: !112) -// CHECK:STDOUT: !112 = !{!68, !113, !70, !70, !68} -// CHECK:STDOUT: !113 = !DIBasicType(name: "int", size: 64, encoding: DW_ATE_signed) -// CHECK:STDOUT: !114 = !{!115, !116, !117, !118} -// CHECK:STDOUT: !115 = !DILocalVariable(arg: 1, scope: !110, type: !113) -// CHECK:STDOUT: !116 = !DILocalVariable(arg: 2, scope: !110, type: !70) -// CHECK:STDOUT: !117 = !DILocalVariable(arg: 3, scope: !110, type: !70) -// CHECK:STDOUT: !118 = !DILocalVariable(arg: 4, scope: !110, type: !68) -// CHECK:STDOUT: !119 = !DILocation(line: 16, column: 7, scope: !110) -// CHECK:STDOUT: !120 = !DILocation(line: 16, column: 6, scope: !110) -// CHECK:STDOUT: !121 = !DILocation(line: 17, column: 5, scope: !110) -// CHECK:STDOUT: !122 = !DILocation(line: 19, column: 21, scope: !110) -// CHECK:STDOUT: !123 = !DILocation(line: 19, column: 10, scope: !110) -// CHECK:STDOUT: !124 = !DILocation(line: 19, column: 3, scope: !110) -// CHECK:STDOUT: !125 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.4dcab66ec095dfec", scope: null, file: !3, line: 15, type: !97, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !126) -// CHECK:STDOUT: !126 = !{!127, !128, !129, !130} -// CHECK:STDOUT: !127 = !DILocalVariable(arg: 1, scope: !125, type: !70) -// CHECK:STDOUT: !128 = !DILocalVariable(arg: 2, scope: !125, type: !70) -// CHECK:STDOUT: !129 = !DILocalVariable(arg: 3, scope: !125, type: !70) -// CHECK:STDOUT: !130 = !DILocalVariable(arg: 4, scope: !125, type: !68) -// CHECK:STDOUT: !131 = !DILocation(line: 16, column: 7, scope: !125) -// CHECK:STDOUT: !132 = !DILocation(line: 16, column: 6, scope: !125) -// CHECK:STDOUT: !133 = !DILocation(line: 17, column: 5, scope: !125) -// CHECK:STDOUT: !134 = !DILocation(line: 19, column: 21, scope: !125) -// CHECK:STDOUT: !135 = !DILocation(line: 19, column: 10, scope: !125) -// CHECK:STDOUT: !136 = !DILocation(line: 19, column: 3, scope: !125) -// CHECK:STDOUT: !137 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.7776e910959584d9", scope: null, file: !3, line: 15, type: !97, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !138) +// CHECK:STDOUT: !67 = !{null, !68} +// CHECK:STDOUT: !68 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !69 = !{!70} +// CHECK:STDOUT: !70 = !DILocalVariable(arg: 1, scope: !65, type: !68) +// CHECK:STDOUT: !71 = !DILocation(line: 26, column: 3, scope: !65) +// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0d6779e60704359e:core.Destroy.Core", scope: null, file: !3, line: 25, type: !73, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !76) +// CHECK:STDOUT: !73 = !DISubroutineType(types: !74) +// CHECK:STDOUT: !74 = !{null, !75} +// CHECK:STDOUT: !75 = !DIBasicType(name: "int", size: 64, encoding: DW_ATE_signed) +// CHECK:STDOUT: !76 = !{!77} +// CHECK:STDOUT: !77 = !DILocalVariable(arg: 1, scope: !72, type: !75) +// CHECK:STDOUT: !78 = !DILocation(line: 25, column: 3, scope: !72) +// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 24, type: !80, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !83) +// CHECK:STDOUT: !80 = !DISubroutineType(types: !81) +// CHECK:STDOUT: !81 = !{null, !82} +// CHECK:STDOUT: !82 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !83 = !{!84} +// CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !79, type: !82) +// CHECK:STDOUT: !85 = !DILocation(line: 24, column: 3, scope: !79) +// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "Op", linkageName: "_COp.406738f1b62008ed:core.Destroy.Core", scope: null, file: !3, line: 23, type: !87, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !90) +// CHECK:STDOUT: !87 = !DISubroutineType(types: !88) +// CHECK:STDOUT: !88 = !{null, !89} +// CHECK:STDOUT: !89 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed) +// CHECK:STDOUT: !90 = !{!91} +// CHECK:STDOUT: !91 = !DILocalVariable(arg: 1, scope: !86, type: !89) +// CHECK:STDOUT: !92 = !DILocation(line: 23, column: 3, scope: !86) +// CHECK:STDOUT: !93 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.077d2bb2ab5eee86", scope: null, file: !3, line: 15, type: !94, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !96) +// CHECK:STDOUT: !94 = !DISubroutineType(types: !95) +// CHECK:STDOUT: !95 = !{!82, !89, !68, !68, !82} +// CHECK:STDOUT: !96 = !{!97, !98, !99, !100} +// CHECK:STDOUT: !97 = !DILocalVariable(arg: 1, scope: !93, type: !89) +// CHECK:STDOUT: !98 = !DILocalVariable(arg: 2, scope: !93, type: !68) +// CHECK:STDOUT: !99 = !DILocalVariable(arg: 3, scope: !93, type: !68) +// CHECK:STDOUT: !100 = !DILocalVariable(arg: 4, scope: !93, type: !82) +// CHECK:STDOUT: !101 = !DILocation(line: 16, column: 7, scope: !93) +// CHECK:STDOUT: !102 = !DILocation(line: 16, column: 6, scope: !93) +// CHECK:STDOUT: !103 = !DILocation(line: 17, column: 5, scope: !93) +// CHECK:STDOUT: !104 = !DILocation(line: 19, column: 21, scope: !93) +// CHECK:STDOUT: !105 = !DILocation(line: 19, column: 10, scope: !93) +// CHECK:STDOUT: !106 = !DILocation(line: 19, column: 3, scope: !93) +// CHECK:STDOUT: !107 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.9a89ac9e10448feb", scope: null, file: !3, line: 15, type: !108, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !110) +// CHECK:STDOUT: !108 = !DISubroutineType(types: !109) +// CHECK:STDOUT: !109 = !{!82, !82, !68, !68, !82} +// CHECK:STDOUT: !110 = !{!111, !112, !113, !114} +// CHECK:STDOUT: !111 = !DILocalVariable(arg: 1, scope: !107, type: !82) +// CHECK:STDOUT: !112 = !DILocalVariable(arg: 2, scope: !107, type: !68) +// CHECK:STDOUT: !113 = !DILocalVariable(arg: 3, scope: !107, type: !68) +// CHECK:STDOUT: !114 = !DILocalVariable(arg: 4, scope: !107, type: !82) +// CHECK:STDOUT: !115 = !DILocation(line: 16, column: 7, scope: !107) +// CHECK:STDOUT: !116 = !DILocation(line: 16, column: 6, scope: !107) +// CHECK:STDOUT: !117 = !DILocation(line: 17, column: 5, scope: !107) +// CHECK:STDOUT: !118 = !DILocation(line: 19, column: 21, scope: !107) +// CHECK:STDOUT: !119 = !DILocation(line: 19, column: 10, scope: !107) +// CHECK:STDOUT: !120 = !DILocation(line: 19, column: 3, scope: !107) +// CHECK:STDOUT: !121 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.76a945443862cc1f", scope: null, file: !3, line: 15, type: !122, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !124) +// CHECK:STDOUT: !122 = !DISubroutineType(types: !123) +// CHECK:STDOUT: !123 = !{!82, !68, !68, !68, !82} +// CHECK:STDOUT: !124 = !{!125, !126, !127, !128} +// CHECK:STDOUT: !125 = !DILocalVariable(arg: 1, scope: !121, type: !68) +// CHECK:STDOUT: !126 = !DILocalVariable(arg: 2, scope: !121, type: !68) +// CHECK:STDOUT: !127 = !DILocalVariable(arg: 3, scope: !121, type: !68) +// CHECK:STDOUT: !128 = !DILocalVariable(arg: 4, scope: !121, type: !82) +// CHECK:STDOUT: !129 = !DILocation(line: 16, column: 7, scope: !121) +// CHECK:STDOUT: !130 = !DILocation(line: 16, column: 6, scope: !121) +// CHECK:STDOUT: !131 = !DILocation(line: 17, column: 5, scope: !121) +// CHECK:STDOUT: !132 = !DILocation(line: 19, column: 21, scope: !121) +// CHECK:STDOUT: !133 = !DILocation(line: 19, column: 10, scope: !121) +// CHECK:STDOUT: !134 = !DILocation(line: 19, column: 3, scope: !121) +// CHECK:STDOUT: !135 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.02da1a7614ea56b6", scope: null, file: !3, line: 15, type: !136, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !138) +// CHECK:STDOUT: !136 = !DISubroutineType(types: !137) +// CHECK:STDOUT: !137 = !{!82, !75, !68, !68, !82} // CHECK:STDOUT: !138 = !{!139, !140, !141, !142} -// CHECK:STDOUT: !139 = !DILocalVariable(arg: 1, scope: !137, type: !70) -// CHECK:STDOUT: !140 = !DILocalVariable(arg: 2, scope: !137, type: !70) -// CHECK:STDOUT: !141 = !DILocalVariable(arg: 3, scope: !137, type: !70) -// CHECK:STDOUT: !142 = !DILocalVariable(arg: 4, scope: !137, type: !68) -// CHECK:STDOUT: !143 = !DILocation(line: 16, column: 7, scope: !137) -// CHECK:STDOUT: !144 = !DILocation(line: 16, column: 6, scope: !137) -// CHECK:STDOUT: !145 = !DILocation(line: 17, column: 5, scope: !137) -// CHECK:STDOUT: !146 = !DILocation(line: 19, column: 21, scope: !137) -// CHECK:STDOUT: !147 = !DILocation(line: 19, column: 10, scope: !137) -// CHECK:STDOUT: !148 = !DILocation(line: 19, column: 3, scope: !137) -// CHECK:STDOUT: !149 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.bea8bae6e14e4034", scope: null, file: !3, line: 15, type: !111, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !150) +// CHECK:STDOUT: !139 = !DILocalVariable(arg: 1, scope: !135, type: !75) +// CHECK:STDOUT: !140 = !DILocalVariable(arg: 2, scope: !135, type: !68) +// CHECK:STDOUT: !141 = !DILocalVariable(arg: 3, scope: !135, type: !68) +// CHECK:STDOUT: !142 = !DILocalVariable(arg: 4, scope: !135, type: !82) +// CHECK:STDOUT: !143 = !DILocation(line: 16, column: 7, scope: !135) +// CHECK:STDOUT: !144 = !DILocation(line: 16, column: 6, scope: !135) +// CHECK:STDOUT: !145 = !DILocation(line: 17, column: 5, scope: !135) +// CHECK:STDOUT: !146 = !DILocation(line: 19, column: 21, scope: !135) +// CHECK:STDOUT: !147 = !DILocation(line: 19, column: 10, scope: !135) +// CHECK:STDOUT: !148 = !DILocation(line: 19, column: 3, scope: !135) +// CHECK:STDOUT: !149 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.4dcab66ec095dfec", scope: null, file: !3, line: 15, type: !122, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !150) // CHECK:STDOUT: !150 = !{!151, !152, !153, !154} -// CHECK:STDOUT: !151 = !DILocalVariable(arg: 1, scope: !149, type: !113) -// CHECK:STDOUT: !152 = !DILocalVariable(arg: 2, scope: !149, type: !70) -// CHECK:STDOUT: !153 = !DILocalVariable(arg: 3, scope: !149, type: !70) -// CHECK:STDOUT: !154 = !DILocalVariable(arg: 4, scope: !149, type: !68) +// CHECK:STDOUT: !151 = !DILocalVariable(arg: 1, scope: !149, type: !68) +// CHECK:STDOUT: !152 = !DILocalVariable(arg: 2, scope: !149, type: !68) +// CHECK:STDOUT: !153 = !DILocalVariable(arg: 3, scope: !149, type: !68) +// CHECK:STDOUT: !154 = !DILocalVariable(arg: 4, scope: !149, type: !82) // CHECK:STDOUT: !155 = !DILocation(line: 16, column: 7, scope: !149) // CHECK:STDOUT: !156 = !DILocation(line: 16, column: 6, scope: !149) // CHECK:STDOUT: !157 = !DILocation(line: 17, column: 5, scope: !149) // CHECK:STDOUT: !158 = !DILocation(line: 19, column: 21, scope: !149) // CHECK:STDOUT: !159 = !DILocation(line: 19, column: 10, scope: !149) // CHECK:STDOUT: !160 = !DILocation(line: 19, column: 3, scope: !149) +// CHECK:STDOUT: !161 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.7776e910959584d9", scope: null, file: !3, line: 15, type: !122, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !162) +// CHECK:STDOUT: !162 = !{!163, !164, !165, !166} +// CHECK:STDOUT: !163 = !DILocalVariable(arg: 1, scope: !161, type: !68) +// CHECK:STDOUT: !164 = !DILocalVariable(arg: 2, scope: !161, type: !68) +// CHECK:STDOUT: !165 = !DILocalVariable(arg: 3, scope: !161, type: !68) +// CHECK:STDOUT: !166 = !DILocalVariable(arg: 4, scope: !161, type: !82) +// CHECK:STDOUT: !167 = !DILocation(line: 16, column: 7, scope: !161) +// CHECK:STDOUT: !168 = !DILocation(line: 16, column: 6, scope: !161) +// CHECK:STDOUT: !169 = !DILocation(line: 17, column: 5, scope: !161) +// CHECK:STDOUT: !170 = !DILocation(line: 19, column: 21, scope: !161) +// CHECK:STDOUT: !171 = !DILocation(line: 19, column: 10, scope: !161) +// CHECK:STDOUT: !172 = !DILocation(line: 19, column: 3, scope: !161) +// CHECK:STDOUT: !173 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.bea8bae6e14e4034", scope: null, file: !3, line: 15, type: !136, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !174) +// CHECK:STDOUT: !174 = !{!175, !176, !177, !178} +// CHECK:STDOUT: !175 = !DILocalVariable(arg: 1, scope: !173, type: !75) +// CHECK:STDOUT: !176 = !DILocalVariable(arg: 2, scope: !173, type: !68) +// CHECK:STDOUT: !177 = !DILocalVariable(arg: 3, scope: !173, type: !68) +// CHECK:STDOUT: !178 = !DILocalVariable(arg: 4, scope: !173, type: !82) +// CHECK:STDOUT: !179 = !DILocation(line: 16, column: 7, scope: !173) +// CHECK:STDOUT: !180 = !DILocation(line: 16, column: 6, scope: !173) +// CHECK:STDOUT: !181 = !DILocation(line: 17, column: 5, scope: !173) +// CHECK:STDOUT: !182 = !DILocation(line: 19, column: 21, scope: !173) +// CHECK:STDOUT: !183 = !DILocation(line: 19, column: 10, scope: !173) +// CHECK:STDOUT: !184 = !DILocation(line: 19, column: 3, scope: !173) 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 4eaf4ca83d7c..9f8987aa7b42 100644 --- a/toolchain/lower/testdata/function/generic/call_recursive_sccs_deep.carbon +++ b/toolchain/lower/testdata/function/generic/call_recursive_sccs_deep.carbon @@ -110,240 +110,254 @@ fn M() { // CHECK:STDOUT: %A.call.loc81 = call ptr @_CA.Main.779b9c0f3b54a7f8(ptr %.loc81_5, i32 0), !dbg !16 // CHECK:STDOUT: %.loc82_5 = load ptr, ptr %ptr_f64.var, align 8, !dbg !17 // CHECK:STDOUT: %A.call.loc82 = call ptr @_CA.Main.779b9c0f3b54a7f8(ptr %.loc82_5, i32 0), !dbg !18 +// CHECK:STDOUT: call void @"_COp.98006a366c2ffd6c:core.Destroy.Core"(ptr %m.var), !dbg !8 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %n.var), !dbg !7 // CHECK:STDOUT: ret void, !dbg !19 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.98006a366c2ffd6c:core.Destroy.Core"(ptr %self) #0 !dbg !20 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !26 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !27 { +// 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) // 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.64ccbb8e5d9a0b8e(i32 %x, i32 %count) #0 !dbg !20 { +// CHECK:STDOUT: define linkonce_odr i32 @_CA.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count) #0 !dbg !34 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CB.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count), !dbg !27 -// CHECK:STDOUT: %D.call = call i32 @_CD.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count), !dbg !28 -// CHECK:STDOUT: ret i32 %D.call, !dbg !29 +// CHECK:STDOUT: call void @_CB.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count), !dbg !40 +// CHECK:STDOUT: %D.call = call i32 @_CD.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count), !dbg !41 +// CHECK:STDOUT: ret i32 %D.call, !dbg !42 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CA.Main.de5b400758c39a65(double %x, i32 %count) #0 !dbg !30 { +// CHECK:STDOUT: define linkonce_odr double @_CA.Main.de5b400758c39a65(double %x, i32 %count) #0 !dbg !43 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CB.Main.de5b400758c39a65(double %x, i32 %count), !dbg !37 -// CHECK:STDOUT: %D.call = call double @_CD.Main.de5b400758c39a65(double %x, i32 %count), !dbg !38 -// CHECK:STDOUT: ret double %D.call, !dbg !39 +// CHECK:STDOUT: call void @_CB.Main.de5b400758c39a65(double %x, i32 %count), !dbg !49 +// CHECK:STDOUT: %D.call = call double @_CD.Main.de5b400758c39a65(double %x, i32 %count), !dbg !50 +// CHECK:STDOUT: ret double %D.call, !dbg !51 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CA.Main.779b9c0f3b54a7f8(ptr %x, i32 %count) #0 !dbg !40 { +// CHECK:STDOUT: define linkonce_odr ptr @_CA.Main.779b9c0f3b54a7f8(ptr %x, i32 %count) #0 !dbg !52 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CB.Main.779b9c0f3b54a7f8(ptr %x, i32 %count), !dbg !44 -// CHECK:STDOUT: %D.call = call ptr @_CD.Main.779b9c0f3b54a7f8(ptr %x, i32 %count), !dbg !45 -// CHECK:STDOUT: ret ptr %D.call, !dbg !46 +// CHECK:STDOUT: call void @_CB.Main.779b9c0f3b54a7f8(ptr %x, i32 %count), !dbg !56 +// CHECK:STDOUT: %D.call = call ptr @_CD.Main.779b9c0f3b54a7f8(ptr %x, i32 %count), !dbg !57 +// CHECK:STDOUT: ret ptr %D.call, !dbg !58 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CB.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count) #0 !dbg !47 { +// CHECK:STDOUT: define linkonce_odr void @_CB.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count) #0 !dbg !59 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CC.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count), !dbg !53 -// CHECK:STDOUT: ret void, !dbg !54 +// CHECK:STDOUT: call void @_CC.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count), !dbg !65 +// CHECK:STDOUT: ret void, !dbg !66 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CD.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count) #0 !dbg !55 { +// CHECK:STDOUT: define linkonce_odr i32 @_CD.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count) #0 !dbg !67 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !dbg !59 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then.loc48, label %if.else.loc48, !dbg !60 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !dbg !71 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then.loc48, label %if.else.loc48, !dbg !72 // CHECK:STDOUT: // CHECK:STDOUT: if.then.loc48: ; preds = %entry -// CHECK:STDOUT: ret i32 %x, !dbg !61 +// CHECK:STDOUT: ret i32 %x, !dbg !73 // CHECK:STDOUT: // CHECK:STDOUT: if.else.loc48: ; preds = %entry -// CHECK:STDOUT: %Int.as.ModWith.impl.Op.call = srem i32 %count, 2, !dbg !62 -// CHECK:STDOUT: %Int.as.EqWith.impl.Equal.call = icmp eq i32 %Int.as.ModWith.impl.Op.call, 0, !dbg !62 -// CHECK:STDOUT: br i1 %Int.as.EqWith.impl.Equal.call, label %if.then.loc51, label %if.else.loc51, !dbg !63 +// CHECK:STDOUT: %Int.as.ModWith.impl.Op.call = srem i32 %count, 2, !dbg !74 +// CHECK:STDOUT: %Int.as.EqWith.impl.Equal.call = icmp eq i32 %Int.as.ModWith.impl.Op.call, 0, !dbg !74 +// CHECK:STDOUT: br i1 %Int.as.EqWith.impl.Equal.call, label %if.then.loc51, label %if.else.loc51, !dbg !75 // CHECK:STDOUT: // CHECK:STDOUT: if.then.loc51: ; preds = %if.else.loc48 -// CHECK:STDOUT: %E.call = call i32 @_CE.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count), !dbg !64 -// CHECK:STDOUT: ret i32 %E.call, !dbg !65 +// CHECK:STDOUT: %E.call = call i32 @_CE.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count), !dbg !76 +// CHECK:STDOUT: ret i32 %E.call, !dbg !77 // CHECK:STDOUT: // CHECK:STDOUT: if.else.loc51: ; preds = %if.else.loc48 -// CHECK:STDOUT: %F.call = call i32 @_CF.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count), !dbg !66 -// CHECK:STDOUT: ret i32 %F.call, !dbg !67 +// CHECK:STDOUT: %F.call = call i32 @_CF.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count), !dbg !78 +// CHECK:STDOUT: ret i32 %F.call, !dbg !79 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CB.Main.de5b400758c39a65(double %x, i32 %count) #0 !dbg !68 { +// CHECK:STDOUT: define linkonce_odr void @_CB.Main.de5b400758c39a65(double %x, i32 %count) #0 !dbg !80 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CC.Main.de5b400758c39a65(double %x, i32 %count), !dbg !74 -// CHECK:STDOUT: ret void, !dbg !75 +// CHECK:STDOUT: call void @_CC.Main.de5b400758c39a65(double %x, i32 %count), !dbg !86 +// CHECK:STDOUT: ret void, !dbg !87 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CD.Main.de5b400758c39a65(double %x, i32 %count) #0 !dbg !76 { +// CHECK:STDOUT: define linkonce_odr double @_CD.Main.de5b400758c39a65(double %x, i32 %count) #0 !dbg !88 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !dbg !80 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then.loc48, label %if.else.loc48, !dbg !81 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !dbg !92 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then.loc48, label %if.else.loc48, !dbg !93 // CHECK:STDOUT: // CHECK:STDOUT: if.then.loc48: ; preds = %entry -// CHECK:STDOUT: ret double %x, !dbg !82 +// CHECK:STDOUT: ret double %x, !dbg !94 // CHECK:STDOUT: // CHECK:STDOUT: if.else.loc48: ; preds = %entry -// 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.loc51, label %if.else.loc51, !dbg !84 +// CHECK:STDOUT: %Int.as.ModWith.impl.Op.call = srem i32 %count, 2, !dbg !95 +// CHECK:STDOUT: %Int.as.EqWith.impl.Equal.call = icmp eq i32 %Int.as.ModWith.impl.Op.call, 0, !dbg !95 +// CHECK:STDOUT: br i1 %Int.as.EqWith.impl.Equal.call, label %if.then.loc51, label %if.else.loc51, !dbg !96 // CHECK:STDOUT: // CHECK:STDOUT: if.then.loc51: ; preds = %if.else.loc48 -// CHECK:STDOUT: %E.call = call double @_CE.Main.de5b400758c39a65(double %x, i32 %count), !dbg !85 -// CHECK:STDOUT: ret double %E.call, !dbg !86 +// CHECK:STDOUT: %E.call = call double @_CE.Main.de5b400758c39a65(double %x, i32 %count), !dbg !97 +// CHECK:STDOUT: ret double %E.call, !dbg !98 // CHECK:STDOUT: // CHECK:STDOUT: if.else.loc51: ; preds = %if.else.loc48 -// CHECK:STDOUT: %F.call = call double @_CF.Main.de5b400758c39a65(double %x, i32 %count), !dbg !87 -// CHECK:STDOUT: ret double %F.call, !dbg !88 +// CHECK:STDOUT: %F.call = call double @_CF.Main.de5b400758c39a65(double %x, i32 %count), !dbg !99 +// CHECK:STDOUT: ret double %F.call, !dbg !100 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CB.Main.779b9c0f3b54a7f8(ptr %x, i32 %count) #0 !dbg !89 { +// CHECK:STDOUT: define linkonce_odr void @_CB.Main.779b9c0f3b54a7f8(ptr %x, i32 %count) #0 !dbg !101 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CC.Main.779b9c0f3b54a7f8(ptr %x, i32 %count), !dbg !93 -// CHECK:STDOUT: ret void, !dbg !94 +// CHECK:STDOUT: call void @_CC.Main.779b9c0f3b54a7f8(ptr %x, i32 %count), !dbg !105 +// CHECK:STDOUT: ret void, !dbg !106 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CD.Main.779b9c0f3b54a7f8(ptr %x, i32 %count) #0 !dbg !95 { +// CHECK:STDOUT: define linkonce_odr ptr @_CD.Main.779b9c0f3b54a7f8(ptr %x, i32 %count) #0 !dbg !107 { // 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.loc48, label %if.else.loc48, !dbg !100 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !dbg !111 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then.loc48, label %if.else.loc48, !dbg !112 // CHECK:STDOUT: // CHECK:STDOUT: if.then.loc48: ; preds = %entry -// CHECK:STDOUT: ret ptr %x, !dbg !101 +// CHECK:STDOUT: ret ptr %x, !dbg !113 // CHECK:STDOUT: // CHECK:STDOUT: if.else.loc48: ; preds = %entry -// CHECK:STDOUT: %Int.as.ModWith.impl.Op.call = srem i32 %count, 2, !dbg !102 -// CHECK:STDOUT: %Int.as.EqWith.impl.Equal.call = icmp eq i32 %Int.as.ModWith.impl.Op.call, 0, !dbg !102 -// CHECK:STDOUT: br i1 %Int.as.EqWith.impl.Equal.call, label %if.then.loc51, label %if.else.loc51, !dbg !103 +// CHECK:STDOUT: %Int.as.ModWith.impl.Op.call = srem i32 %count, 2, !dbg !114 +// CHECK:STDOUT: %Int.as.EqWith.impl.Equal.call = icmp eq i32 %Int.as.ModWith.impl.Op.call, 0, !dbg !114 +// CHECK:STDOUT: br i1 %Int.as.EqWith.impl.Equal.call, label %if.then.loc51, label %if.else.loc51, !dbg !115 // CHECK:STDOUT: // CHECK:STDOUT: if.then.loc51: ; preds = %if.else.loc48 -// CHECK:STDOUT: %E.call = call ptr @_CE.Main.779b9c0f3b54a7f8(ptr %x, i32 %count), !dbg !104 -// CHECK:STDOUT: ret ptr %E.call, !dbg !105 +// CHECK:STDOUT: %E.call = call ptr @_CE.Main.779b9c0f3b54a7f8(ptr %x, i32 %count), !dbg !116 +// CHECK:STDOUT: ret ptr %E.call, !dbg !117 // CHECK:STDOUT: // CHECK:STDOUT: if.else.loc51: ; preds = %if.else.loc48 -// CHECK:STDOUT: %F.call = call ptr @_CF.Main.779b9c0f3b54a7f8(ptr %x, i32 %count), !dbg !106 -// CHECK:STDOUT: ret ptr %F.call, !dbg !107 +// CHECK:STDOUT: %F.call = call ptr @_CF.Main.779b9c0f3b54a7f8(ptr %x, i32 %count), !dbg !118 +// CHECK:STDOUT: ret ptr %F.call, !dbg !119 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CC.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count) #0 !dbg !108 { +// CHECK:STDOUT: define linkonce_odr void @_CC.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count) #0 !dbg !120 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.LessOrEquivalent.call = icmp sle i32 %count, 2, !dbg !112 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.LessOrEquivalent.call, label %if.then, label %if.else, !dbg !113 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.LessOrEquivalent.call = icmp sle i32 %count, 2, !dbg !124 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.LessOrEquivalent.call, label %if.then, label %if.else, !dbg !125 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 %count), !dbg !114 -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !115 -// CHECK:STDOUT: call void @_CB.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !116 -// CHECK:STDOUT: br label %if.else, !dbg !117 +// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 %count), !dbg !126 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !127 +// CHECK:STDOUT: call void @_CB.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !128 +// CHECK:STDOUT: br label %if.else, !dbg !129 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %if.then, %entry -// CHECK:STDOUT: ret void, !dbg !118 +// CHECK:STDOUT: ret void, !dbg !130 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CE.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count) #0 !dbg !119 { +// CHECK:STDOUT: define linkonce_odr i32 @_CE.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count) #0 !dbg !131 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %G.call = call i32 @_CG.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count), !dbg !123 -// CHECK:STDOUT: ret i32 %G.call, !dbg !124 +// CHECK:STDOUT: %G.call = call i32 @_CG.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count), !dbg !135 +// CHECK:STDOUT: ret i32 %G.call, !dbg !136 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count) #0 !dbg !125 { +// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count) #0 !dbg !137 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %G.call = call i32 @_CG.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count), !dbg !129 -// CHECK:STDOUT: ret i32 %G.call, !dbg !130 +// CHECK:STDOUT: %G.call = call i32 @_CG.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count), !dbg !141 +// CHECK:STDOUT: ret i32 %G.call, !dbg !142 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CC.Main.de5b400758c39a65(double %x, i32 %count) #0 !dbg !131 { +// CHECK:STDOUT: define linkonce_odr void @_CC.Main.de5b400758c39a65(double %x, i32 %count) #0 !dbg !143 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.LessOrEquivalent.call = icmp sle i32 %count, 2, !dbg !135 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.LessOrEquivalent.call, label %if.then, label %if.else, !dbg !136 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.LessOrEquivalent.call = icmp sle i32 %count, 2, !dbg !147 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.LessOrEquivalent.call, label %if.then, label %if.else, !dbg !148 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 %count), !dbg !137 -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !138 -// CHECK:STDOUT: call void @_CB.Main.de5b400758c39a65(double %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !139 -// CHECK:STDOUT: br label %if.else, !dbg !140 +// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 %count), !dbg !149 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !150 +// CHECK:STDOUT: call void @_CB.Main.de5b400758c39a65(double %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !151 +// CHECK:STDOUT: br label %if.else, !dbg !152 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %if.then, %entry -// CHECK:STDOUT: ret void, !dbg !141 +// CHECK:STDOUT: ret void, !dbg !153 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CE.Main.de5b400758c39a65(double %x, i32 %count) #0 !dbg !142 { +// CHECK:STDOUT: define linkonce_odr double @_CE.Main.de5b400758c39a65(double %x, i32 %count) #0 !dbg !154 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %G.call = call double @_CG.Main.de5b400758c39a65(double %x, i32 %count), !dbg !146 -// CHECK:STDOUT: ret double %G.call, !dbg !147 +// CHECK:STDOUT: %G.call = call double @_CG.Main.de5b400758c39a65(double %x, i32 %count), !dbg !158 +// CHECK:STDOUT: ret double %G.call, !dbg !159 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CF.Main.de5b400758c39a65(double %x, i32 %count) #0 !dbg !148 { +// CHECK:STDOUT: define linkonce_odr double @_CF.Main.de5b400758c39a65(double %x, i32 %count) #0 !dbg !160 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %G.call = call double @_CG.Main.de5b400758c39a65(double %x, i32 %count), !dbg !152 -// CHECK:STDOUT: ret double %G.call, !dbg !153 +// CHECK:STDOUT: %G.call = call double @_CG.Main.de5b400758c39a65(double %x, i32 %count), !dbg !164 +// CHECK:STDOUT: ret double %G.call, !dbg !165 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CC.Main.779b9c0f3b54a7f8(ptr %x, i32 %count) #0 !dbg !154 { +// CHECK:STDOUT: define linkonce_odr void @_CC.Main.779b9c0f3b54a7f8(ptr %x, i32 %count) #0 !dbg !166 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.LessOrEquivalent.call = icmp sle i32 %count, 2, !dbg !158 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.LessOrEquivalent.call, label %if.then, label %if.else, !dbg !159 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.LessOrEquivalent.call = icmp sle i32 %count, 2, !dbg !170 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.LessOrEquivalent.call, label %if.then, label %if.else, !dbg !171 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 %count), !dbg !160 -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !161 -// CHECK:STDOUT: call void @_CB.Main.779b9c0f3b54a7f8(ptr %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !162 -// CHECK:STDOUT: br label %if.else, !dbg !163 +// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 %count), !dbg !172 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !173 +// CHECK:STDOUT: call void @_CB.Main.779b9c0f3b54a7f8(ptr %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !174 +// CHECK:STDOUT: br label %if.else, !dbg !175 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %if.then, %entry -// CHECK:STDOUT: ret void, !dbg !164 +// CHECK:STDOUT: ret void, !dbg !176 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CE.Main.779b9c0f3b54a7f8(ptr %x, i32 %count) #0 !dbg !165 { +// CHECK:STDOUT: define linkonce_odr ptr @_CE.Main.779b9c0f3b54a7f8(ptr %x, i32 %count) #0 !dbg !177 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %G.call = call ptr @_CG.Main.779b9c0f3b54a7f8(ptr %x, i32 %count), !dbg !169 -// CHECK:STDOUT: ret ptr %G.call, !dbg !170 +// CHECK:STDOUT: %G.call = call ptr @_CG.Main.779b9c0f3b54a7f8(ptr %x, i32 %count), !dbg !181 +// CHECK:STDOUT: ret ptr %G.call, !dbg !182 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CF.Main.779b9c0f3b54a7f8(ptr %x, i32 %count) #0 !dbg !171 { +// CHECK:STDOUT: define linkonce_odr ptr @_CF.Main.779b9c0f3b54a7f8(ptr %x, i32 %count) #0 !dbg !183 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %G.call = call ptr @_CG.Main.779b9c0f3b54a7f8(ptr %x, i32 %count), !dbg !175 -// CHECK:STDOUT: ret ptr %G.call, !dbg !176 +// CHECK:STDOUT: %G.call = call ptr @_CG.Main.779b9c0f3b54a7f8(ptr %x, i32 %count), !dbg !187 +// CHECK:STDOUT: ret ptr %G.call, !dbg !188 // 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.64ccbb8e5d9a0b8e(i32 %x, i32 %count) #0 !dbg !177 { +// CHECK:STDOUT: define linkonce_odr i32 @_CG.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %count) #0 !dbg !189 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !181 -// CHECK:STDOUT: %D.call = call i32 @_CD.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !182 -// CHECK:STDOUT: ret i32 %D.call, !dbg !183 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !193 +// CHECK:STDOUT: %D.call = call i32 @_CD.Main.64ccbb8e5d9a0b8e(i32 %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !194 +// CHECK:STDOUT: ret i32 %D.call, !dbg !195 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CG.Main.de5b400758c39a65(double %x, i32 %count) #0 !dbg !184 { +// CHECK:STDOUT: define linkonce_odr double @_CG.Main.de5b400758c39a65(double %x, i32 %count) #0 !dbg !196 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !188 -// CHECK:STDOUT: %D.call = call double @_CD.Main.de5b400758c39a65(double %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !189 -// CHECK:STDOUT: ret double %D.call, !dbg !190 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !200 +// CHECK:STDOUT: %D.call = call double @_CD.Main.de5b400758c39a65(double %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !201 +// CHECK:STDOUT: ret double %D.call, !dbg !202 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CG.Main.779b9c0f3b54a7f8(ptr %x, i32 %count) #0 !dbg !191 { +// CHECK:STDOUT: define linkonce_odr ptr @_CG.Main.779b9c0f3b54a7f8(ptr %x, i32 %count) #0 !dbg !203 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !195 -// CHECK:STDOUT: %D.call = call ptr @_CD.Main.779b9c0f3b54a7f8(ptr %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !196 -// CHECK:STDOUT: ret ptr %D.call, !dbg !197 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !207 +// CHECK:STDOUT: %D.call = call ptr @_CD.Main.779b9c0f3b54a7f8(ptr %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !208 +// CHECK:STDOUT: ret ptr %D.call, !dbg !209 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -380,181 +394,193 @@ fn M() { // CHECK:STDOUT: !17 = !DILocation(line: 82, column: 5, scope: !4) // CHECK:STDOUT: !18 = !DILocation(line: 82, column: 3, scope: !4) // CHECK:STDOUT: !19 = !DILocation(line: 73, column: 1, scope: !4) -// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 31, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !24) +// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "Op", linkageName: "_COp.98006a366c2ffd6c:core.Destroy.Core", scope: null, file: !3, line: 75, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !24) // CHECK:STDOUT: !21 = !DISubroutineType(types: !22) -// CHECK:STDOUT: !22 = !{!23, !23, !23} -// CHECK:STDOUT: !23 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !24 = !{!25, !26} +// CHECK:STDOUT: !22 = !{null, !23} +// CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !24 = !{!25} // CHECK:STDOUT: !25 = !DILocalVariable(arg: 1, scope: !20, type: !23) -// CHECK:STDOUT: !26 = !DILocalVariable(arg: 2, scope: !20, type: !23) -// CHECK:STDOUT: !27 = !DILocation(line: 32, column: 3, scope: !20) -// CHECK:STDOUT: !28 = !DILocation(line: 33, column: 10, scope: !20) -// CHECK:STDOUT: !29 = !DILocation(line: 33, column: 3, scope: !20) -// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.de5b400758c39a65", scope: null, file: !3, line: 31, type: !31, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !34) -// CHECK:STDOUT: !31 = !DISubroutineType(types: !32) -// CHECK:STDOUT: !32 = !{!33, !33, !23} -// CHECK:STDOUT: !33 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !34 = !{!35, !36} -// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !30, type: !33) -// CHECK:STDOUT: !36 = !DILocalVariable(arg: 2, scope: !30, type: !23) -// CHECK:STDOUT: !37 = !DILocation(line: 32, column: 3, scope: !30) -// CHECK:STDOUT: !38 = !DILocation(line: 33, column: 10, scope: !30) -// CHECK:STDOUT: !39 = !DILocation(line: 33, column: 3, scope: !30) -// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 31, type: !31, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !41) -// CHECK:STDOUT: !41 = !{!42, !43} -// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !40, type: !33) -// CHECK:STDOUT: !43 = !DILocalVariable(arg: 2, scope: !40, type: !23) -// CHECK:STDOUT: !44 = !DILocation(line: 32, column: 3, scope: !40) -// CHECK:STDOUT: !45 = !DILocation(line: 33, column: 10, scope: !40) -// CHECK:STDOUT: !46 = !DILocation(line: 33, column: 3, scope: !40) -// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 36, type: !48, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !50) -// CHECK:STDOUT: !48 = !DISubroutineType(types: !49) -// CHECK:STDOUT: !49 = !{null, !23, !23} -// CHECK:STDOUT: !50 = !{!51, !52} -// CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !47, type: !23) -// CHECK:STDOUT: !52 = !DILocalVariable(arg: 2, scope: !47, type: !23) -// CHECK:STDOUT: !53 = !DILocation(line: 37, column: 3, scope: !47) -// CHECK:STDOUT: !54 = !DILocation(line: 36, column: 1, scope: !47) -// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 47, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !56) -// CHECK:STDOUT: !56 = !{!57, !58} -// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !55, type: !23) -// CHECK:STDOUT: !58 = !DILocalVariable(arg: 2, scope: !55, type: !23) -// CHECK:STDOUT: !59 = !DILocation(line: 48, column: 7, scope: !55) -// CHECK:STDOUT: !60 = !DILocation(line: 48, column: 6, scope: !55) -// CHECK:STDOUT: !61 = !DILocation(line: 49, column: 5, scope: !55) -// CHECK:STDOUT: !62 = !DILocation(line: 51, column: 7, scope: !55) -// CHECK:STDOUT: !63 = !DILocation(line: 51, column: 6, scope: !55) -// CHECK:STDOUT: !64 = !DILocation(line: 52, column: 12, scope: !55) -// CHECK:STDOUT: !65 = !DILocation(line: 52, column: 5, scope: !55) -// CHECK:STDOUT: !66 = !DILocation(line: 54, column: 12, scope: !55) -// CHECK:STDOUT: !67 = !DILocation(line: 54, column: 5, scope: !55) -// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.de5b400758c39a65", scope: null, file: !3, line: 36, type: !69, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !71) -// CHECK:STDOUT: !69 = !DISubroutineType(types: !70) -// CHECK:STDOUT: !70 = !{null, !33, !23} -// CHECK:STDOUT: !71 = !{!72, !73} -// CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !68, type: !33) -// CHECK:STDOUT: !73 = !DILocalVariable(arg: 2, scope: !68, type: !23) -// CHECK:STDOUT: !74 = !DILocation(line: 37, column: 3, scope: !68) -// CHECK:STDOUT: !75 = !DILocation(line: 36, column: 1, scope: !68) -// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.de5b400758c39a65", scope: null, file: !3, line: 47, type: !31, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !77) -// CHECK:STDOUT: !77 = !{!78, !79} -// CHECK:STDOUT: !78 = !DILocalVariable(arg: 1, scope: !76, type: !33) -// CHECK:STDOUT: !79 = !DILocalVariable(arg: 2, scope: !76, type: !23) -// CHECK:STDOUT: !80 = !DILocation(line: 48, column: 7, scope: !76) -// CHECK:STDOUT: !81 = !DILocation(line: 48, column: 6, scope: !76) -// CHECK:STDOUT: !82 = !DILocation(line: 49, column: 5, scope: !76) -// CHECK:STDOUT: !83 = !DILocation(line: 51, column: 7, scope: !76) -// CHECK:STDOUT: !84 = !DILocation(line: 51, column: 6, scope: !76) -// CHECK:STDOUT: !85 = !DILocation(line: 52, column: 12, scope: !76) -// CHECK:STDOUT: !86 = !DILocation(line: 52, column: 5, scope: !76) -// CHECK:STDOUT: !87 = !DILocation(line: 54, column: 12, scope: !76) -// CHECK:STDOUT: !88 = !DILocation(line: 54, column: 5, scope: !76) -// CHECK:STDOUT: !89 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 36, type: !69, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !90) -// CHECK:STDOUT: !90 = !{!91, !92} -// CHECK:STDOUT: !91 = !DILocalVariable(arg: 1, scope: !89, type: !33) -// CHECK:STDOUT: !92 = !DILocalVariable(arg: 2, scope: !89, type: !23) -// CHECK:STDOUT: !93 = !DILocation(line: 37, column: 3, scope: !89) -// CHECK:STDOUT: !94 = !DILocation(line: 36, column: 1, scope: !89) -// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 47, type: !31, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !96) -// CHECK:STDOUT: !96 = !{!97, !98} -// CHECK:STDOUT: !97 = !DILocalVariable(arg: 1, scope: !95, type: !33) -// CHECK:STDOUT: !98 = !DILocalVariable(arg: 2, scope: !95, type: !23) -// CHECK:STDOUT: !99 = !DILocation(line: 48, column: 7, scope: !95) -// CHECK:STDOUT: !100 = !DILocation(line: 48, column: 6, scope: !95) -// CHECK:STDOUT: !101 = !DILocation(line: 49, column: 5, scope: !95) -// CHECK:STDOUT: !102 = !DILocation(line: 51, column: 7, scope: !95) -// CHECK:STDOUT: !103 = !DILocation(line: 51, column: 6, scope: !95) -// CHECK:STDOUT: !104 = !DILocation(line: 52, column: 12, scope: !95) -// CHECK:STDOUT: !105 = !DILocation(line: 52, column: 5, scope: !95) -// CHECK:STDOUT: !106 = !DILocation(line: 54, column: 12, scope: !95) -// CHECK:STDOUT: !107 = !DILocation(line: 54, column: 5, scope: !95) -// CHECK:STDOUT: !108 = distinct !DISubprogram(name: "C", linkageName: "_CC.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 40, type: !48, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !109) -// CHECK:STDOUT: !109 = !{!110, !111} -// CHECK:STDOUT: !110 = !DILocalVariable(arg: 1, scope: !108, type: !23) -// CHECK:STDOUT: !111 = !DILocalVariable(arg: 2, scope: !108, type: !23) -// CHECK:STDOUT: !112 = !DILocation(line: 41, column: 7, scope: !108) -// CHECK:STDOUT: !113 = !DILocation(line: 41, column: 6, scope: !108) -// CHECK:STDOUT: !114 = !DILocation(line: 42, column: 5, scope: !108) -// CHECK:STDOUT: !115 = !DILocation(line: 43, column: 10, scope: !108) -// CHECK:STDOUT: !116 = !DILocation(line: 43, column: 5, scope: !108) -// CHECK:STDOUT: !117 = !DILocation(line: 41, column: 3, scope: !108) -// CHECK:STDOUT: !118 = !DILocation(line: 40, column: 1, scope: !108) -// CHECK:STDOUT: !119 = distinct !DISubprogram(name: "E", linkageName: "_CE.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 60, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !120) -// CHECK:STDOUT: !120 = !{!121, !122} -// CHECK:STDOUT: !121 = !DILocalVariable(arg: 1, scope: !119, type: !23) -// CHECK:STDOUT: !122 = !DILocalVariable(arg: 2, scope: !119, type: !23) -// CHECK:STDOUT: !123 = !DILocation(line: 61, column: 10, scope: !119) -// CHECK:STDOUT: !124 = !DILocation(line: 61, column: 3, scope: !119) -// CHECK:STDOUT: !125 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 64, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !126) -// CHECK:STDOUT: !126 = !{!127, !128} -// CHECK:STDOUT: !127 = !DILocalVariable(arg: 1, scope: !125, type: !23) -// CHECK:STDOUT: !128 = !DILocalVariable(arg: 2, scope: !125, type: !23) -// CHECK:STDOUT: !129 = !DILocation(line: 65, column: 10, scope: !125) -// CHECK:STDOUT: !130 = !DILocation(line: 65, column: 3, scope: !125) -// CHECK:STDOUT: !131 = distinct !DISubprogram(name: "C", linkageName: "_CC.Main.de5b400758c39a65", scope: null, file: !3, line: 40, type: !69, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !132) +// CHECK:STDOUT: !26 = !DILocation(line: 75, column: 3, scope: !20) +// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 74, type: !28, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !31) +// CHECK:STDOUT: !28 = !DISubroutineType(types: !29) +// CHECK:STDOUT: !29 = !{null, !30} +// CHECK:STDOUT: !30 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !31 = !{!32} +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !27, type: !30) +// CHECK:STDOUT: !33 = !DILocation(line: 74, column: 3, scope: !27) +// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 31, type: !35, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !37) +// CHECK:STDOUT: !35 = !DISubroutineType(types: !36) +// CHECK:STDOUT: !36 = !{!30, !30, !30} +// CHECK:STDOUT: !37 = !{!38, !39} +// CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !34, type: !30) +// CHECK:STDOUT: !39 = !DILocalVariable(arg: 2, scope: !34, type: !30) +// CHECK:STDOUT: !40 = !DILocation(line: 32, column: 3, scope: !34) +// CHECK:STDOUT: !41 = !DILocation(line: 33, column: 10, scope: !34) +// CHECK:STDOUT: !42 = !DILocation(line: 33, column: 3, scope: !34) +// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.de5b400758c39a65", scope: null, file: !3, line: 31, type: !44, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !46) +// CHECK:STDOUT: !44 = !DISubroutineType(types: !45) +// CHECK:STDOUT: !45 = !{!23, !23, !30} +// CHECK:STDOUT: !46 = !{!47, !48} +// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !43, type: !23) +// CHECK:STDOUT: !48 = !DILocalVariable(arg: 2, scope: !43, type: !30) +// CHECK:STDOUT: !49 = !DILocation(line: 32, column: 3, scope: !43) +// CHECK:STDOUT: !50 = !DILocation(line: 33, column: 10, scope: !43) +// CHECK:STDOUT: !51 = !DILocation(line: 33, column: 3, scope: !43) +// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 31, type: !44, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !53) +// CHECK:STDOUT: !53 = !{!54, !55} +// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !52, type: !23) +// CHECK:STDOUT: !55 = !DILocalVariable(arg: 2, scope: !52, type: !30) +// CHECK:STDOUT: !56 = !DILocation(line: 32, column: 3, scope: !52) +// CHECK:STDOUT: !57 = !DILocation(line: 33, column: 10, scope: !52) +// CHECK:STDOUT: !58 = !DILocation(line: 33, column: 3, scope: !52) +// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 36, type: !60, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !62) +// CHECK:STDOUT: !60 = !DISubroutineType(types: !61) +// CHECK:STDOUT: !61 = !{null, !30, !30} +// CHECK:STDOUT: !62 = !{!63, !64} +// CHECK:STDOUT: !63 = !DILocalVariable(arg: 1, scope: !59, type: !30) +// CHECK:STDOUT: !64 = !DILocalVariable(arg: 2, scope: !59, type: !30) +// CHECK:STDOUT: !65 = !DILocation(line: 37, column: 3, scope: !59) +// CHECK:STDOUT: !66 = !DILocation(line: 36, column: 1, scope: !59) +// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 47, type: !35, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !68) +// CHECK:STDOUT: !68 = !{!69, !70} +// CHECK:STDOUT: !69 = !DILocalVariable(arg: 1, scope: !67, type: !30) +// CHECK:STDOUT: !70 = !DILocalVariable(arg: 2, scope: !67, type: !30) +// CHECK:STDOUT: !71 = !DILocation(line: 48, column: 7, scope: !67) +// CHECK:STDOUT: !72 = !DILocation(line: 48, column: 6, scope: !67) +// CHECK:STDOUT: !73 = !DILocation(line: 49, column: 5, scope: !67) +// CHECK:STDOUT: !74 = !DILocation(line: 51, column: 7, scope: !67) +// CHECK:STDOUT: !75 = !DILocation(line: 51, column: 6, scope: !67) +// CHECK:STDOUT: !76 = !DILocation(line: 52, column: 12, scope: !67) +// CHECK:STDOUT: !77 = !DILocation(line: 52, column: 5, scope: !67) +// CHECK:STDOUT: !78 = !DILocation(line: 54, column: 12, scope: !67) +// CHECK:STDOUT: !79 = !DILocation(line: 54, column: 5, scope: !67) +// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.de5b400758c39a65", scope: null, file: !3, line: 36, type: !81, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !83) +// CHECK:STDOUT: !81 = !DISubroutineType(types: !82) +// CHECK:STDOUT: !82 = !{null, !23, !30} +// CHECK:STDOUT: !83 = !{!84, !85} +// CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !80, type: !23) +// CHECK:STDOUT: !85 = !DILocalVariable(arg: 2, scope: !80, type: !30) +// CHECK:STDOUT: !86 = !DILocation(line: 37, column: 3, scope: !80) +// CHECK:STDOUT: !87 = !DILocation(line: 36, column: 1, scope: !80) +// CHECK:STDOUT: !88 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.de5b400758c39a65", scope: null, file: !3, line: 47, type: !44, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !89) +// CHECK:STDOUT: !89 = !{!90, !91} +// CHECK:STDOUT: !90 = !DILocalVariable(arg: 1, scope: !88, type: !23) +// CHECK:STDOUT: !91 = !DILocalVariable(arg: 2, scope: !88, type: !30) +// CHECK:STDOUT: !92 = !DILocation(line: 48, column: 7, scope: !88) +// CHECK:STDOUT: !93 = !DILocation(line: 48, column: 6, scope: !88) +// CHECK:STDOUT: !94 = !DILocation(line: 49, column: 5, scope: !88) +// CHECK:STDOUT: !95 = !DILocation(line: 51, column: 7, scope: !88) +// CHECK:STDOUT: !96 = !DILocation(line: 51, column: 6, scope: !88) +// CHECK:STDOUT: !97 = !DILocation(line: 52, column: 12, scope: !88) +// CHECK:STDOUT: !98 = !DILocation(line: 52, column: 5, scope: !88) +// CHECK:STDOUT: !99 = !DILocation(line: 54, column: 12, scope: !88) +// CHECK:STDOUT: !100 = !DILocation(line: 54, column: 5, scope: !88) +// CHECK:STDOUT: !101 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 36, type: !81, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !102) +// CHECK:STDOUT: !102 = !{!103, !104} +// CHECK:STDOUT: !103 = !DILocalVariable(arg: 1, scope: !101, type: !23) +// CHECK:STDOUT: !104 = !DILocalVariable(arg: 2, scope: !101, type: !30) +// CHECK:STDOUT: !105 = !DILocation(line: 37, column: 3, scope: !101) +// CHECK:STDOUT: !106 = !DILocation(line: 36, column: 1, scope: !101) +// CHECK:STDOUT: !107 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 47, type: !44, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !108) +// CHECK:STDOUT: !108 = !{!109, !110} +// CHECK:STDOUT: !109 = !DILocalVariable(arg: 1, scope: !107, type: !23) +// CHECK:STDOUT: !110 = !DILocalVariable(arg: 2, scope: !107, type: !30) +// CHECK:STDOUT: !111 = !DILocation(line: 48, column: 7, scope: !107) +// CHECK:STDOUT: !112 = !DILocation(line: 48, column: 6, scope: !107) +// CHECK:STDOUT: !113 = !DILocation(line: 49, column: 5, scope: !107) +// CHECK:STDOUT: !114 = !DILocation(line: 51, column: 7, scope: !107) +// CHECK:STDOUT: !115 = !DILocation(line: 51, column: 6, scope: !107) +// CHECK:STDOUT: !116 = !DILocation(line: 52, column: 12, scope: !107) +// CHECK:STDOUT: !117 = !DILocation(line: 52, column: 5, scope: !107) +// CHECK:STDOUT: !118 = !DILocation(line: 54, column: 12, scope: !107) +// CHECK:STDOUT: !119 = !DILocation(line: 54, column: 5, scope: !107) +// CHECK:STDOUT: !120 = distinct !DISubprogram(name: "C", linkageName: "_CC.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 40, type: !60, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !121) +// CHECK:STDOUT: !121 = !{!122, !123} +// CHECK:STDOUT: !122 = !DILocalVariable(arg: 1, scope: !120, type: !30) +// CHECK:STDOUT: !123 = !DILocalVariable(arg: 2, scope: !120, type: !30) +// CHECK:STDOUT: !124 = !DILocation(line: 41, column: 7, scope: !120) +// CHECK:STDOUT: !125 = !DILocation(line: 41, column: 6, scope: !120) +// CHECK:STDOUT: !126 = !DILocation(line: 42, column: 5, scope: !120) +// CHECK:STDOUT: !127 = !DILocation(line: 43, column: 10, scope: !120) +// CHECK:STDOUT: !128 = !DILocation(line: 43, column: 5, scope: !120) +// CHECK:STDOUT: !129 = !DILocation(line: 41, column: 3, scope: !120) +// CHECK:STDOUT: !130 = !DILocation(line: 40, column: 1, scope: !120) +// CHECK:STDOUT: !131 = distinct !DISubprogram(name: "E", linkageName: "_CE.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 60, type: !35, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !132) // CHECK:STDOUT: !132 = !{!133, !134} -// CHECK:STDOUT: !133 = !DILocalVariable(arg: 1, scope: !131, type: !33) -// CHECK:STDOUT: !134 = !DILocalVariable(arg: 2, scope: !131, type: !23) -// CHECK:STDOUT: !135 = !DILocation(line: 41, column: 7, scope: !131) -// CHECK:STDOUT: !136 = !DILocation(line: 41, column: 6, scope: !131) -// CHECK:STDOUT: !137 = !DILocation(line: 42, column: 5, scope: !131) -// CHECK:STDOUT: !138 = !DILocation(line: 43, column: 10, scope: !131) -// CHECK:STDOUT: !139 = !DILocation(line: 43, column: 5, scope: !131) -// CHECK:STDOUT: !140 = !DILocation(line: 41, column: 3, scope: !131) -// CHECK:STDOUT: !141 = !DILocation(line: 40, column: 1, scope: !131) -// CHECK:STDOUT: !142 = distinct !DISubprogram(name: "E", linkageName: "_CE.Main.de5b400758c39a65", scope: null, file: !3, line: 60, type: !31, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !143) -// CHECK:STDOUT: !143 = !{!144, !145} -// CHECK:STDOUT: !144 = !DILocalVariable(arg: 1, scope: !142, type: !33) -// CHECK:STDOUT: !145 = !DILocalVariable(arg: 2, scope: !142, type: !23) -// CHECK:STDOUT: !146 = !DILocation(line: 61, column: 10, scope: !142) -// CHECK:STDOUT: !147 = !DILocation(line: 61, column: 3, scope: !142) -// CHECK:STDOUT: !148 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.de5b400758c39a65", scope: null, file: !3, line: 64, type: !31, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !149) -// CHECK:STDOUT: !149 = !{!150, !151} -// CHECK:STDOUT: !150 = !DILocalVariable(arg: 1, scope: !148, type: !33) -// CHECK:STDOUT: !151 = !DILocalVariable(arg: 2, scope: !148, type: !23) -// CHECK:STDOUT: !152 = !DILocation(line: 65, column: 10, scope: !148) -// CHECK:STDOUT: !153 = !DILocation(line: 65, column: 3, scope: !148) -// CHECK:STDOUT: !154 = distinct !DISubprogram(name: "C", linkageName: "_CC.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 40, type: !69, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !155) +// CHECK:STDOUT: !133 = !DILocalVariable(arg: 1, scope: !131, type: !30) +// CHECK:STDOUT: !134 = !DILocalVariable(arg: 2, scope: !131, type: !30) +// CHECK:STDOUT: !135 = !DILocation(line: 61, column: 10, scope: !131) +// CHECK:STDOUT: !136 = !DILocation(line: 61, column: 3, scope: !131) +// CHECK:STDOUT: !137 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 64, type: !35, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !138) +// CHECK:STDOUT: !138 = !{!139, !140} +// CHECK:STDOUT: !139 = !DILocalVariable(arg: 1, scope: !137, type: !30) +// CHECK:STDOUT: !140 = !DILocalVariable(arg: 2, scope: !137, type: !30) +// CHECK:STDOUT: !141 = !DILocation(line: 65, column: 10, scope: !137) +// CHECK:STDOUT: !142 = !DILocation(line: 65, column: 3, scope: !137) +// CHECK:STDOUT: !143 = distinct !DISubprogram(name: "C", linkageName: "_CC.Main.de5b400758c39a65", scope: null, file: !3, line: 40, type: !81, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !144) +// CHECK:STDOUT: !144 = !{!145, !146} +// CHECK:STDOUT: !145 = !DILocalVariable(arg: 1, scope: !143, type: !23) +// CHECK:STDOUT: !146 = !DILocalVariable(arg: 2, scope: !143, type: !30) +// CHECK:STDOUT: !147 = !DILocation(line: 41, column: 7, scope: !143) +// CHECK:STDOUT: !148 = !DILocation(line: 41, column: 6, scope: !143) +// CHECK:STDOUT: !149 = !DILocation(line: 42, column: 5, scope: !143) +// CHECK:STDOUT: !150 = !DILocation(line: 43, column: 10, scope: !143) +// CHECK:STDOUT: !151 = !DILocation(line: 43, column: 5, scope: !143) +// CHECK:STDOUT: !152 = !DILocation(line: 41, column: 3, scope: !143) +// CHECK:STDOUT: !153 = !DILocation(line: 40, column: 1, scope: !143) +// CHECK:STDOUT: !154 = distinct !DISubprogram(name: "E", linkageName: "_CE.Main.de5b400758c39a65", scope: null, file: !3, line: 60, type: !44, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !155) // CHECK:STDOUT: !155 = !{!156, !157} -// CHECK:STDOUT: !156 = !DILocalVariable(arg: 1, scope: !154, type: !33) -// CHECK:STDOUT: !157 = !DILocalVariable(arg: 2, scope: !154, type: !23) -// CHECK:STDOUT: !158 = !DILocation(line: 41, column: 7, scope: !154) -// CHECK:STDOUT: !159 = !DILocation(line: 41, column: 6, scope: !154) -// CHECK:STDOUT: !160 = !DILocation(line: 42, column: 5, scope: !154) -// CHECK:STDOUT: !161 = !DILocation(line: 43, column: 10, scope: !154) -// CHECK:STDOUT: !162 = !DILocation(line: 43, column: 5, scope: !154) -// CHECK:STDOUT: !163 = !DILocation(line: 41, column: 3, scope: !154) -// CHECK:STDOUT: !164 = !DILocation(line: 40, column: 1, scope: !154) -// CHECK:STDOUT: !165 = distinct !DISubprogram(name: "E", linkageName: "_CE.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 60, type: !31, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !166) -// CHECK:STDOUT: !166 = !{!167, !168} -// CHECK:STDOUT: !167 = !DILocalVariable(arg: 1, scope: !165, type: !33) -// CHECK:STDOUT: !168 = !DILocalVariable(arg: 2, scope: !165, type: !23) -// CHECK:STDOUT: !169 = !DILocation(line: 61, column: 10, scope: !165) -// CHECK:STDOUT: !170 = !DILocation(line: 61, column: 3, scope: !165) -// CHECK:STDOUT: !171 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 64, type: !31, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !172) -// CHECK:STDOUT: !172 = !{!173, !174} -// CHECK:STDOUT: !173 = !DILocalVariable(arg: 1, scope: !171, type: !33) -// CHECK:STDOUT: !174 = !DILocalVariable(arg: 2, scope: !171, type: !23) -// CHECK:STDOUT: !175 = !DILocation(line: 65, column: 10, scope: !171) -// CHECK:STDOUT: !176 = !DILocation(line: 65, column: 3, scope: !171) -// CHECK:STDOUT: !177 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 68, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !178) +// CHECK:STDOUT: !156 = !DILocalVariable(arg: 1, scope: !154, type: !23) +// CHECK:STDOUT: !157 = !DILocalVariable(arg: 2, scope: !154, type: !30) +// CHECK:STDOUT: !158 = !DILocation(line: 61, column: 10, scope: !154) +// CHECK:STDOUT: !159 = !DILocation(line: 61, column: 3, scope: !154) +// CHECK:STDOUT: !160 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.de5b400758c39a65", scope: null, file: !3, line: 64, type: !44, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !161) +// CHECK:STDOUT: !161 = !{!162, !163} +// CHECK:STDOUT: !162 = !DILocalVariable(arg: 1, scope: !160, type: !23) +// CHECK:STDOUT: !163 = !DILocalVariable(arg: 2, scope: !160, type: !30) +// CHECK:STDOUT: !164 = !DILocation(line: 65, column: 10, scope: !160) +// CHECK:STDOUT: !165 = !DILocation(line: 65, column: 3, scope: !160) +// CHECK:STDOUT: !166 = distinct !DISubprogram(name: "C", linkageName: "_CC.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 40, type: !81, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !167) +// CHECK:STDOUT: !167 = !{!168, !169} +// CHECK:STDOUT: !168 = !DILocalVariable(arg: 1, scope: !166, type: !23) +// CHECK:STDOUT: !169 = !DILocalVariable(arg: 2, scope: !166, type: !30) +// CHECK:STDOUT: !170 = !DILocation(line: 41, column: 7, scope: !166) +// CHECK:STDOUT: !171 = !DILocation(line: 41, column: 6, scope: !166) +// CHECK:STDOUT: !172 = !DILocation(line: 42, column: 5, scope: !166) +// CHECK:STDOUT: !173 = !DILocation(line: 43, column: 10, scope: !166) +// CHECK:STDOUT: !174 = !DILocation(line: 43, column: 5, scope: !166) +// CHECK:STDOUT: !175 = !DILocation(line: 41, column: 3, scope: !166) +// CHECK:STDOUT: !176 = !DILocation(line: 40, column: 1, scope: !166) +// CHECK:STDOUT: !177 = distinct !DISubprogram(name: "E", linkageName: "_CE.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 60, type: !44, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !178) // CHECK:STDOUT: !178 = !{!179, !180} // CHECK:STDOUT: !179 = !DILocalVariable(arg: 1, scope: !177, type: !23) -// CHECK:STDOUT: !180 = !DILocalVariable(arg: 2, scope: !177, type: !23) -// CHECK:STDOUT: !181 = !DILocation(line: 69, column: 15, scope: !177) -// CHECK:STDOUT: !182 = !DILocation(line: 69, column: 10, scope: !177) -// CHECK:STDOUT: !183 = !DILocation(line: 69, column: 3, scope: !177) -// CHECK:STDOUT: !184 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.de5b400758c39a65", scope: null, file: !3, line: 68, type: !31, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !185) -// CHECK:STDOUT: !185 = !{!186, !187} -// CHECK:STDOUT: !186 = !DILocalVariable(arg: 1, scope: !184, type: !33) -// CHECK:STDOUT: !187 = !DILocalVariable(arg: 2, scope: !184, type: !23) -// CHECK:STDOUT: !188 = !DILocation(line: 69, column: 15, scope: !184) -// CHECK:STDOUT: !189 = !DILocation(line: 69, column: 10, scope: !184) -// CHECK:STDOUT: !190 = !DILocation(line: 69, column: 3, scope: !184) -// CHECK:STDOUT: !191 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 68, type: !31, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !192) -// CHECK:STDOUT: !192 = !{!193, !194} -// CHECK:STDOUT: !193 = !DILocalVariable(arg: 1, scope: !191, type: !33) -// CHECK:STDOUT: !194 = !DILocalVariable(arg: 2, scope: !191, type: !23) -// CHECK:STDOUT: !195 = !DILocation(line: 69, column: 15, scope: !191) -// CHECK:STDOUT: !196 = !DILocation(line: 69, column: 10, scope: !191) -// CHECK:STDOUT: !197 = !DILocation(line: 69, column: 3, scope: !191) +// CHECK:STDOUT: !180 = !DILocalVariable(arg: 2, scope: !177, type: !30) +// CHECK:STDOUT: !181 = !DILocation(line: 61, column: 10, scope: !177) +// CHECK:STDOUT: !182 = !DILocation(line: 61, column: 3, scope: !177) +// CHECK:STDOUT: !183 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 64, type: !44, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !184) +// CHECK:STDOUT: !184 = !{!185, !186} +// CHECK:STDOUT: !185 = !DILocalVariable(arg: 1, scope: !183, type: !23) +// CHECK:STDOUT: !186 = !DILocalVariable(arg: 2, scope: !183, type: !30) +// CHECK:STDOUT: !187 = !DILocation(line: 65, column: 10, scope: !183) +// CHECK:STDOUT: !188 = !DILocation(line: 65, column: 3, scope: !183) +// CHECK:STDOUT: !189 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 68, type: !35, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !190) +// CHECK:STDOUT: !190 = !{!191, !192} +// CHECK:STDOUT: !191 = !DILocalVariable(arg: 1, scope: !189, type: !30) +// CHECK:STDOUT: !192 = !DILocalVariable(arg: 2, scope: !189, type: !30) +// CHECK:STDOUT: !193 = !DILocation(line: 69, column: 15, scope: !189) +// CHECK:STDOUT: !194 = !DILocation(line: 69, column: 10, scope: !189) +// CHECK:STDOUT: !195 = !DILocation(line: 69, column: 3, scope: !189) +// CHECK:STDOUT: !196 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.de5b400758c39a65", scope: null, file: !3, line: 68, type: !44, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !197) +// CHECK:STDOUT: !197 = !{!198, !199} +// CHECK:STDOUT: !198 = !DILocalVariable(arg: 1, scope: !196, type: !23) +// CHECK:STDOUT: !199 = !DILocalVariable(arg: 2, scope: !196, type: !30) +// CHECK:STDOUT: !200 = !DILocation(line: 69, column: 15, scope: !196) +// CHECK:STDOUT: !201 = !DILocation(line: 69, column: 10, scope: !196) +// CHECK:STDOUT: !202 = !DILocation(line: 69, column: 3, scope: !196) +// CHECK:STDOUT: !203 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 68, type: !44, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !204) +// CHECK:STDOUT: !204 = !{!205, !206} +// CHECK:STDOUT: !205 = !DILocalVariable(arg: 1, scope: !203, type: !23) +// CHECK:STDOUT: !206 = !DILocalVariable(arg: 2, scope: !203, type: !30) +// CHECK:STDOUT: !207 = !DILocation(line: 69, column: 15, scope: !203) +// CHECK:STDOUT: !208 = !DILocation(line: 69, column: 10, scope: !203) +// CHECK:STDOUT: !209 = !DILocation(line: 69, column: 3, scope: !203) 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 f1929bcdb04d..531fbc832bea 100644 --- a/toolchain/lower/testdata/function/generic/call_specific_in_class.carbon +++ b/toolchain/lower/testdata/function/generic/call_specific_in_class.carbon @@ -50,128 +50,153 @@ fn M() { // CHECK:STDOUT: %type = type {} // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CM.Main() #0 !dbg !4 { +// CHECK:STDOUT: define weak_odr void @"_COp.71e25083d63c4d6c:core.Destroy.Core"(ptr %self) #0 !dbg !4 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %ptr_i32.var = alloca ptr, align 8, !dbg !7 -// CHECK:STDOUT: %ptr_f64.var = alloca ptr, align 8, !dbg !8 -// CHECK:STDOUT: %ptr_i8.var = alloca ptr, align 8, !dbg !9 -// CHECK:STDOUT: %var_i32.var = alloca i32, align 4, !dbg !10 -// CHECK:STDOUT: %var_f64.var = alloca double, align 8, !dbg !11 -// CHECK:STDOUT: %_.var = alloca {}, align 8, !dbg !12 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_i32.var), !dbg !7 -// CHECK:STDOUT: store ptr poison, ptr %ptr_i32.var, align 8, !dbg !7 -// CHECK:STDOUT: %.loc34_5 = load ptr, ptr %ptr_i32.var, align 8, !dbg !13 -// CHECK:STDOUT: %F.call.loc34 = call ptr @_CF.Main.779b9c0f3b54a7f8(ptr %.loc34_5), !dbg !14 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_f64.var), !dbg !8 -// CHECK:STDOUT: store ptr poison, ptr %ptr_f64.var, align 8, !dbg !8 -// CHECK:STDOUT: %.loc36_5 = load ptr, ptr %ptr_f64.var, align 8, !dbg !15 -// CHECK:STDOUT: %F.call.loc36 = call ptr @_CF.Main.779b9c0f3b54a7f8(ptr %.loc36_5), !dbg !16 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_i8.var), !dbg !9 -// CHECK:STDOUT: store ptr poison, ptr %ptr_i8.var, align 8, !dbg !9 -// CHECK:STDOUT: %.loc38_5 = load ptr, ptr %ptr_i8.var, align 8, !dbg !17 -// CHECK:STDOUT: %F.call.loc38 = call ptr @_CF.Main.779b9c0f3b54a7f8(ptr %.loc38_5), !dbg !18 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %var_i32.var), !dbg !10 -// CHECK:STDOUT: store i32 0, ptr %var_i32.var, align 4, !dbg !10 -// CHECK:STDOUT: %.loc40_5 = load i32, ptr %var_i32.var, align 4, !dbg !19 -// CHECK:STDOUT: %F.call.loc40 = call i32 @_CF.Main.64ccbb8e5d9a0b8e(i32 %.loc40_5), !dbg !20 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %var_f64.var), !dbg !11 -// CHECK:STDOUT: store double 0.000000e+00, ptr %var_f64.var, align 8, !dbg !11 -// CHECK:STDOUT: %.loc42_5 = load double, ptr %var_f64.var, align 8, !dbg !21 -// CHECK:STDOUT: %F.call.loc42 = call double @_CF.Main.de5b400758c39a65(double %.loc42_5), !dbg !22 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !12 -// CHECK:STDOUT: %F.call.loc44 = call %type @_CF.Main.582d60b54baf6b63(%type zeroinitializer), !dbg !23 -// CHECK:STDOUT: ret void, !dbg !24 +// CHECK:STDOUT: ret void, !dbg !10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CM.Main() #0 !dbg !11 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %ptr_i32.var = alloca ptr, align 8, !dbg !14 +// CHECK:STDOUT: %ptr_f64.var = alloca ptr, align 8, !dbg !15 +// CHECK:STDOUT: %ptr_i8.var = alloca ptr, align 8, !dbg !16 +// CHECK:STDOUT: %var_i32.var = alloca i32, align 4, !dbg !17 +// CHECK:STDOUT: %var_f64.var = alloca double, align 8, !dbg !18 +// CHECK:STDOUT: %_.var = alloca {}, align 8, !dbg !19 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_i32.var), !dbg !14 +// CHECK:STDOUT: store ptr poison, ptr %ptr_i32.var, align 8, !dbg !14 +// CHECK:STDOUT: %.loc34_5 = load ptr, ptr %ptr_i32.var, align 8, !dbg !20 +// CHECK:STDOUT: %F.call.loc34 = call ptr @_CF.Main.779b9c0f3b54a7f8(ptr %.loc34_5), !dbg !21 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_f64.var), !dbg !15 +// CHECK:STDOUT: store ptr poison, ptr %ptr_f64.var, align 8, !dbg !15 +// CHECK:STDOUT: %.loc36_5 = load ptr, ptr %ptr_f64.var, align 8, !dbg !22 +// CHECK:STDOUT: %F.call.loc36 = call ptr @_CF.Main.779b9c0f3b54a7f8(ptr %.loc36_5), !dbg !23 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_i8.var), !dbg !16 +// CHECK:STDOUT: store ptr poison, ptr %ptr_i8.var, align 8, !dbg !16 +// CHECK:STDOUT: %.loc38_5 = load ptr, ptr %ptr_i8.var, align 8, !dbg !24 +// CHECK:STDOUT: %F.call.loc38 = call ptr @_CF.Main.779b9c0f3b54a7f8(ptr %.loc38_5), !dbg !25 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %var_i32.var), !dbg !17 +// CHECK:STDOUT: store i32 0, ptr %var_i32.var, align 4, !dbg !17 +// CHECK:STDOUT: %.loc40_5 = load i32, ptr %var_i32.var, align 4, !dbg !26 +// CHECK:STDOUT: %F.call.loc40 = call i32 @_CF.Main.64ccbb8e5d9a0b8e(i32 %.loc40_5), !dbg !27 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %var_f64.var), !dbg !18 +// CHECK:STDOUT: store double 0.000000e+00, ptr %var_f64.var, align 8, !dbg !18 +// CHECK:STDOUT: %.loc42_5 = load double, ptr %var_f64.var, align 8, !dbg !28 +// CHECK:STDOUT: %F.call.loc42 = call double @_CF.Main.de5b400758c39a65(double %.loc42_5), !dbg !29 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !19 +// CHECK:STDOUT: %F.call.loc44 = call %type @_CF.Main.582d60b54baf6b63(%type zeroinitializer), !dbg !30 +// CHECK:STDOUT: call void @"_COp.71e25083d63c4d6c:core.Destroy.Core"(ptr %_.var), !dbg !19 +// CHECK:STDOUT: call void @"_COp.98006a366c2ffd6c:core.Destroy.Core"(ptr %var_f64.var), !dbg !18 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %var_i32.var), !dbg !17 +// CHECK:STDOUT: ret void, !dbg !31 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.98006a366c2ffd6c:core.Destroy.Core"(ptr %self) #0 !dbg !32 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !35 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !36 { +// CHECK:STDOUT: entry: +// 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: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CF.Main.779b9c0f3b54a7f8(ptr %x) #0 !dbg !25 { +// CHECK:STDOUT: define linkonce_odr ptr @_CF.Main.779b9c0f3b54a7f8(ptr %x) #0 !dbg !43 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %G.call = call ptr @_CG.Main.779b9c0f3b54a7f8(ptr %x), !dbg !31 -// CHECK:STDOUT: ret ptr %G.call, !dbg !32 +// CHECK:STDOUT: %G.call = call ptr @_CG.Main.779b9c0f3b54a7f8(ptr %x), !dbg !48 +// CHECK:STDOUT: ret ptr %G.call, !dbg !49 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.64ccbb8e5d9a0b8e(i32 %x) #0 !dbg !33 { +// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.64ccbb8e5d9a0b8e(i32 %x) #0 !dbg !50 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %G.call = call i32 @_CG.Main.64ccbb8e5d9a0b8e(i32 %x), !dbg !39 -// CHECK:STDOUT: ret i32 %G.call, !dbg !40 +// CHECK:STDOUT: %G.call = call i32 @_CG.Main.64ccbb8e5d9a0b8e(i32 %x), !dbg !55 +// CHECK:STDOUT: ret i32 %G.call, !dbg !56 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CF.Main.de5b400758c39a65(double %x) #0 !dbg !41 { +// CHECK:STDOUT: define linkonce_odr double @_CF.Main.de5b400758c39a65(double %x) #0 !dbg !57 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %G.call = call double @_CG.Main.de5b400758c39a65(double %x), !dbg !44 -// CHECK:STDOUT: ret double %G.call, !dbg !45 +// CHECK:STDOUT: %G.call = call double @_CG.Main.de5b400758c39a65(double %x), !dbg !60 +// CHECK:STDOUT: ret double %G.call, !dbg !61 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr %type @_CF.Main.582d60b54baf6b63(%type %x) #0 !dbg !46 { +// CHECK:STDOUT: define linkonce_odr %type @_CF.Main.582d60b54baf6b63(%type %x) #0 !dbg !62 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %G.call = call %type @_CG.Main.582d60b54baf6b63(%type %x), !dbg !49 -// CHECK:STDOUT: ret %type %G.call, !dbg !50 +// CHECK:STDOUT: %G.call = call %type @_CG.Main.582d60b54baf6b63(%type %x), !dbg !65 +// CHECK:STDOUT: ret %type %G.call, !dbg !66 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CG.Main.779b9c0f3b54a7f8(ptr %x) #0 !dbg !51 { +// CHECK:STDOUT: define linkonce_odr ptr @_CG.Main.779b9c0f3b54a7f8(ptr %x) #0 !dbg !67 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %c.var = alloca {}, align 8, !dbg !54 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !54 -// CHECK:STDOUT: %C.Cfn.call = call ptr @_CCfn.C.Main.779b9c0f3b54a7f8(ptr %c.var, ptr %x), !dbg !55 -// CHECK:STDOUT: ret ptr %C.Cfn.call, !dbg !56 +// CHECK:STDOUT: %c.var = alloca {}, align 8, !dbg !70 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !70 +// CHECK:STDOUT: %C.Cfn.call = call ptr @_CCfn.C.Main.779b9c0f3b54a7f8(ptr %c.var, ptr %x), !dbg !71 +// CHECK:STDOUT: call void @"_COp.71e25083d63c4d6c:core.Destroy.Core"(ptr %c.var), !dbg !70 +// CHECK:STDOUT: ret ptr %C.Cfn.call, !dbg !72 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CG.Main.64ccbb8e5d9a0b8e(i32 %x) #0 !dbg !57 { +// CHECK:STDOUT: define linkonce_odr i32 @_CG.Main.64ccbb8e5d9a0b8e(i32 %x) #0 !dbg !73 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %c.var = alloca {}, align 8, !dbg !60 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !60 -// CHECK:STDOUT: %C.Cfn.call = call i32 @_CCfn.C.Main.64ccbb8e5d9a0b8e(ptr %c.var, i32 %x), !dbg !61 -// CHECK:STDOUT: ret i32 %C.Cfn.call, !dbg !62 +// CHECK:STDOUT: %c.var = alloca {}, align 8, !dbg !76 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !76 +// CHECK:STDOUT: %C.Cfn.call = call i32 @_CCfn.C.Main.64ccbb8e5d9a0b8e(ptr %c.var, i32 %x), !dbg !77 +// CHECK:STDOUT: call void @"_COp.71e25083d63c4d6c:core.Destroy.Core"(ptr %c.var), !dbg !76 +// CHECK:STDOUT: ret i32 %C.Cfn.call, !dbg !78 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CG.Main.de5b400758c39a65(double %x) #0 !dbg !63 { +// CHECK:STDOUT: define linkonce_odr double @_CG.Main.de5b400758c39a65(double %x) #0 !dbg !79 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %c.var = alloca {}, align 8, !dbg !66 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !66 -// CHECK:STDOUT: %C.Cfn.call = call double @_CCfn.C.Main.de5b400758c39a65(ptr %c.var, double %x), !dbg !67 -// CHECK:STDOUT: ret double %C.Cfn.call, !dbg !68 +// CHECK:STDOUT: %c.var = alloca {}, align 8, !dbg !82 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !82 +// CHECK:STDOUT: %C.Cfn.call = call double @_CCfn.C.Main.de5b400758c39a65(ptr %c.var, double %x), !dbg !83 +// CHECK:STDOUT: call void @"_COp.71e25083d63c4d6c:core.Destroy.Core"(ptr %c.var), !dbg !82 +// CHECK:STDOUT: ret double %C.Cfn.call, !dbg !84 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr %type @_CG.Main.582d60b54baf6b63(%type %x) #0 !dbg !69 { +// CHECK:STDOUT: define linkonce_odr %type @_CG.Main.582d60b54baf6b63(%type %x) #0 !dbg !85 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %c.var = alloca {}, align 8, !dbg !72 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !72 -// CHECK:STDOUT: %C.Cfn.call = call %type @_CCfn.C.Main.582d60b54baf6b63(ptr %c.var, %type %x), !dbg !73 -// CHECK:STDOUT: ret %type %C.Cfn.call, !dbg !74 +// CHECK:STDOUT: %c.var = alloca {}, align 8, !dbg !88 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !88 +// CHECK:STDOUT: %C.Cfn.call = call %type @_CCfn.C.Main.582d60b54baf6b63(ptr %c.var, %type %x), !dbg !89 +// CHECK:STDOUT: call void @"_COp.71e25083d63c4d6c:core.Destroy.Core"(ptr %c.var), !dbg !88 +// CHECK:STDOUT: ret %type %C.Cfn.call, !dbg !90 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CCfn.C.Main.779b9c0f3b54a7f8(ptr %self, ptr %x) #0 !dbg !75 { +// CHECK:STDOUT: define linkonce_odr ptr @_CCfn.C.Main.779b9c0f3b54a7f8(ptr %self, ptr %x) #0 !dbg !91 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret ptr %x, !dbg !81 +// CHECK:STDOUT: ret ptr %x, !dbg !97 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CCfn.C.Main.64ccbb8e5d9a0b8e(ptr %self, i32 %x) #0 !dbg !82 { +// CHECK:STDOUT: define linkonce_odr i32 @_CCfn.C.Main.64ccbb8e5d9a0b8e(ptr %self, i32 %x) #0 !dbg !98 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret i32 %x, !dbg !88 +// CHECK:STDOUT: ret i32 %x, !dbg !104 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CCfn.C.Main.de5b400758c39a65(ptr %self, double %x) #0 !dbg !89 { +// CHECK:STDOUT: define linkonce_odr double @_CCfn.C.Main.de5b400758c39a65(ptr %self, double %x) #0 !dbg !105 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret double %x, !dbg !93 +// CHECK:STDOUT: ret double %x, !dbg !109 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr %type @_CCfn.C.Main.582d60b54baf6b63(ptr %self, %type %x) #0 !dbg !94 { +// CHECK:STDOUT: define linkonce_odr %type @_CCfn.C.Main.582d60b54baf6b63(ptr %self, %type %x) #0 !dbg !110 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret %type %x, !dbg !98 +// CHECK:STDOUT: ret %type %x, !dbg !114 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -188,98 +213,114 @@ fn M() { // CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) // CHECK:STDOUT: !3 = !DIFile(filename: "call_specific_in_class.carbon", directory: "") -// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "M", linkageName: "_CM.Main", scope: null, file: !3, line: 32, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Op", linkageName: "_COp.71e25083d63c4d6c:core.Destroy.Core", scope: null, file: !3, line: 24, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !8) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) -// CHECK:STDOUT: !6 = !{null} -// CHECK:STDOUT: !7 = !DILocation(line: 33, column: 3, scope: !4) -// CHECK:STDOUT: !8 = !DILocation(line: 35, column: 3, scope: !4) -// CHECK:STDOUT: !9 = !DILocation(line: 37, column: 3, scope: !4) -// CHECK:STDOUT: !10 = !DILocation(line: 39, column: 3, scope: !4) -// CHECK:STDOUT: !11 = !DILocation(line: 41, column: 3, scope: !4) -// CHECK:STDOUT: !12 = !DILocation(line: 43, column: 3, scope: !4) -// CHECK:STDOUT: !13 = !DILocation(line: 34, column: 5, scope: !4) -// CHECK:STDOUT: !14 = !DILocation(line: 34, column: 3, scope: !4) -// CHECK:STDOUT: !15 = !DILocation(line: 36, column: 5, scope: !4) -// CHECK:STDOUT: !16 = !DILocation(line: 36, column: 3, scope: !4) -// CHECK:STDOUT: !17 = !DILocation(line: 38, column: 5, scope: !4) -// CHECK:STDOUT: !18 = !DILocation(line: 38, column: 3, scope: !4) -// CHECK:STDOUT: !19 = !DILocation(line: 40, column: 5, scope: !4) -// CHECK:STDOUT: !20 = !DILocation(line: 40, column: 3, scope: !4) -// CHECK:STDOUT: !21 = !DILocation(line: 42, column: 5, scope: !4) -// CHECK:STDOUT: !22 = !DILocation(line: 42, column: 3, scope: !4) -// CHECK:STDOUT: !23 = !DILocation(line: 44, column: 3, scope: !4) -// CHECK:STDOUT: !24 = !DILocation(line: 32, column: 1, scope: !4) -// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 28, type: !26, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !29) -// CHECK:STDOUT: !26 = !DISubroutineType(types: !27) -// CHECK:STDOUT: !27 = !{!28, !28} -// CHECK:STDOUT: !28 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !29 = !{!30} -// CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !25, type: !28) -// CHECK:STDOUT: !31 = !DILocation(line: 29, column: 10, scope: !25) -// CHECK:STDOUT: !32 = !DILocation(line: 29, column: 3, scope: !25) -// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 28, type: !34, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !37) -// CHECK:STDOUT: !34 = !DISubroutineType(types: !35) -// CHECK:STDOUT: !35 = !{!36, !36} -// CHECK:STDOUT: !36 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !37 = !{!38} -// CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !33, type: !36) -// CHECK:STDOUT: !39 = !DILocation(line: 29, column: 10, scope: !33) -// CHECK:STDOUT: !40 = !DILocation(line: 29, column: 3, scope: !33) -// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.de5b400758c39a65", scope: null, file: !3, line: 28, type: !26, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !42) -// CHECK:STDOUT: !42 = !{!43} -// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !41, type: !28) -// CHECK:STDOUT: !44 = !DILocation(line: 29, column: 10, scope: !41) -// CHECK:STDOUT: !45 = !DILocation(line: 29, column: 3, scope: !41) -// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.582d60b54baf6b63", scope: null, file: !3, line: 28, type: !26, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !47) -// CHECK:STDOUT: !47 = !{!48} -// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !46, type: !28) -// CHECK:STDOUT: !49 = !DILocation(line: 29, column: 10, scope: !46) -// CHECK:STDOUT: !50 = !DILocation(line: 29, column: 3, scope: !46) -// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 23, type: !26, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !52) -// CHECK:STDOUT: !52 = !{!53} -// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !51, type: !28) -// CHECK:STDOUT: !54 = !DILocation(line: 24, column: 3, scope: !51) -// CHECK:STDOUT: !55 = !DILocation(line: 25, column: 10, scope: !51) -// CHECK:STDOUT: !56 = !DILocation(line: 25, column: 3, scope: !51) -// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 23, type: !34, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !58) +// CHECK:STDOUT: !6 = !{null, !7} +// CHECK:STDOUT: !7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !8 = !{!9} +// CHECK:STDOUT: !9 = !DILocalVariable(arg: 1, scope: !4, type: !7) +// CHECK:STDOUT: !10 = !DILocation(line: 24, column: 3, scope: !4) +// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "M", linkageName: "_CM.Main", scope: null, file: !3, line: 32, type: !12, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) +// CHECK:STDOUT: !13 = !{null} +// CHECK:STDOUT: !14 = !DILocation(line: 33, column: 3, scope: !11) +// CHECK:STDOUT: !15 = !DILocation(line: 35, column: 3, scope: !11) +// CHECK:STDOUT: !16 = !DILocation(line: 37, column: 3, scope: !11) +// CHECK:STDOUT: !17 = !DILocation(line: 39, column: 3, scope: !11) +// CHECK:STDOUT: !18 = !DILocation(line: 41, column: 3, scope: !11) +// CHECK:STDOUT: !19 = !DILocation(line: 43, column: 3, scope: !11) +// CHECK:STDOUT: !20 = !DILocation(line: 34, column: 5, scope: !11) +// CHECK:STDOUT: !21 = !DILocation(line: 34, column: 3, scope: !11) +// CHECK:STDOUT: !22 = !DILocation(line: 36, column: 5, scope: !11) +// CHECK:STDOUT: !23 = !DILocation(line: 36, column: 3, scope: !11) +// CHECK:STDOUT: !24 = !DILocation(line: 38, column: 5, scope: !11) +// CHECK:STDOUT: !25 = !DILocation(line: 38, column: 3, scope: !11) +// CHECK:STDOUT: !26 = !DILocation(line: 40, column: 5, scope: !11) +// CHECK:STDOUT: !27 = !DILocation(line: 40, column: 3, scope: !11) +// CHECK:STDOUT: !28 = !DILocation(line: 42, column: 5, scope: !11) +// CHECK:STDOUT: !29 = !DILocation(line: 42, column: 3, scope: !11) +// CHECK:STDOUT: !30 = !DILocation(line: 44, column: 3, scope: !11) +// CHECK:STDOUT: !31 = !DILocation(line: 32, column: 1, scope: !11) +// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "Op", linkageName: "_COp.98006a366c2ffd6c:core.Destroy.Core", scope: null, file: !3, line: 41, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !33) +// CHECK:STDOUT: !33 = !{!34} +// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !32, type: !7) +// CHECK:STDOUT: !35 = !DILocation(line: 41, column: 3, scope: !32) +// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 39, type: !37, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !40) +// CHECK:STDOUT: !37 = !DISubroutineType(types: !38) +// CHECK:STDOUT: !38 = !{null, !39} +// CHECK:STDOUT: !39 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !40 = !{!41} +// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !36, type: !39) +// CHECK:STDOUT: !42 = !DILocation(line: 39, column: 3, scope: !36) +// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 28, type: !44, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !46) +// CHECK:STDOUT: !44 = !DISubroutineType(types: !45) +// CHECK:STDOUT: !45 = !{!7, !7} +// CHECK:STDOUT: !46 = !{!47} +// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !43, type: !7) +// CHECK:STDOUT: !48 = !DILocation(line: 29, column: 10, scope: !43) +// CHECK:STDOUT: !49 = !DILocation(line: 29, column: 3, scope: !43) +// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 28, type: !51, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !53) +// CHECK:STDOUT: !51 = !DISubroutineType(types: !52) +// CHECK:STDOUT: !52 = !{!39, !39} +// CHECK:STDOUT: !53 = !{!54} +// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !50, type: !39) +// CHECK:STDOUT: !55 = !DILocation(line: 29, column: 10, scope: !50) +// CHECK:STDOUT: !56 = !DILocation(line: 29, column: 3, scope: !50) +// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.de5b400758c39a65", scope: null, file: !3, line: 28, type: !44, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !58) // CHECK:STDOUT: !58 = !{!59} -// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !57, type: !36) -// CHECK:STDOUT: !60 = !DILocation(line: 24, column: 3, scope: !57) -// CHECK:STDOUT: !61 = !DILocation(line: 25, column: 10, scope: !57) -// CHECK:STDOUT: !62 = !DILocation(line: 25, column: 3, scope: !57) -// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.de5b400758c39a65", scope: null, file: !3, line: 23, type: !26, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !64) -// CHECK:STDOUT: !64 = !{!65} -// CHECK:STDOUT: !65 = !DILocalVariable(arg: 1, scope: !63, type: !28) -// CHECK:STDOUT: !66 = !DILocation(line: 24, column: 3, scope: !63) -// CHECK:STDOUT: !67 = !DILocation(line: 25, column: 10, scope: !63) -// CHECK:STDOUT: !68 = !DILocation(line: 25, column: 3, scope: !63) -// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.582d60b54baf6b63", scope: null, file: !3, line: 23, type: !26, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !70) -// CHECK:STDOUT: !70 = !{!71} -// CHECK:STDOUT: !71 = !DILocalVariable(arg: 1, scope: !69, type: !28) -// CHECK:STDOUT: !72 = !DILocation(line: 24, column: 3, scope: !69) -// CHECK:STDOUT: !73 = !DILocation(line: 25, column: 10, scope: !69) -// CHECK:STDOUT: !74 = !DILocation(line: 25, column: 3, scope: !69) -// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "Cfn", linkageName: "_CCfn.C.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 18, type: !76, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !78) -// CHECK:STDOUT: !76 = !DISubroutineType(types: !77) -// CHECK:STDOUT: !77 = !{!28, !28, !28} -// CHECK:STDOUT: !78 = !{!79, !80} -// CHECK:STDOUT: !79 = !DILocalVariable(arg: 1, scope: !75, type: !28) -// CHECK:STDOUT: !80 = !DILocalVariable(arg: 2, scope: !75, type: !28) -// CHECK:STDOUT: !81 = !DILocation(line: 19, column: 5, scope: !75) -// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "Cfn", linkageName: "_CCfn.C.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 18, type: !83, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !85) -// CHECK:STDOUT: !83 = !DISubroutineType(types: !84) -// CHECK:STDOUT: !84 = !{!36, !28, !36} -// CHECK:STDOUT: !85 = !{!86, !87} -// CHECK:STDOUT: !86 = !DILocalVariable(arg: 1, scope: !82, type: !28) -// CHECK:STDOUT: !87 = !DILocalVariable(arg: 2, scope: !82, type: !36) -// CHECK:STDOUT: !88 = !DILocation(line: 19, column: 5, scope: !82) -// CHECK:STDOUT: !89 = distinct !DISubprogram(name: "Cfn", linkageName: "_CCfn.C.Main.de5b400758c39a65", scope: null, file: !3, line: 18, type: !76, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !90) -// CHECK:STDOUT: !90 = !{!91, !92} -// CHECK:STDOUT: !91 = !DILocalVariable(arg: 1, scope: !89, type: !28) -// CHECK:STDOUT: !92 = !DILocalVariable(arg: 2, scope: !89, type: !28) -// CHECK:STDOUT: !93 = !DILocation(line: 19, column: 5, scope: !89) -// CHECK:STDOUT: !94 = distinct !DISubprogram(name: "Cfn", linkageName: "_CCfn.C.Main.582d60b54baf6b63", scope: null, file: !3, line: 18, type: !76, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !95) -// CHECK:STDOUT: !95 = !{!96, !97} -// CHECK:STDOUT: !96 = !DILocalVariable(arg: 1, scope: !94, type: !28) -// CHECK:STDOUT: !97 = !DILocalVariable(arg: 2, scope: !94, type: !28) -// CHECK:STDOUT: !98 = !DILocation(line: 19, column: 5, scope: !94) +// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !57, type: !7) +// CHECK:STDOUT: !60 = !DILocation(line: 29, column: 10, scope: !57) +// CHECK:STDOUT: !61 = !DILocation(line: 29, column: 3, scope: !57) +// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.582d60b54baf6b63", scope: null, file: !3, line: 28, type: !44, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !63) +// CHECK:STDOUT: !63 = !{!64} +// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !62, type: !7) +// CHECK:STDOUT: !65 = !DILocation(line: 29, column: 10, scope: !62) +// CHECK:STDOUT: !66 = !DILocation(line: 29, column: 3, scope: !62) +// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 23, type: !44, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !68) +// CHECK:STDOUT: !68 = !{!69} +// CHECK:STDOUT: !69 = !DILocalVariable(arg: 1, scope: !67, type: !7) +// CHECK:STDOUT: !70 = !DILocation(line: 24, column: 3, scope: !67) +// CHECK:STDOUT: !71 = !DILocation(line: 25, column: 10, scope: !67) +// CHECK:STDOUT: !72 = !DILocation(line: 25, column: 3, scope: !67) +// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 23, type: !51, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !74) +// CHECK:STDOUT: !74 = !{!75} +// CHECK:STDOUT: !75 = !DILocalVariable(arg: 1, scope: !73, type: !39) +// CHECK:STDOUT: !76 = !DILocation(line: 24, column: 3, scope: !73) +// CHECK:STDOUT: !77 = !DILocation(line: 25, column: 10, scope: !73) +// CHECK:STDOUT: !78 = !DILocation(line: 25, column: 3, scope: !73) +// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.de5b400758c39a65", scope: null, file: !3, line: 23, type: !44, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !80) +// CHECK:STDOUT: !80 = !{!81} +// CHECK:STDOUT: !81 = !DILocalVariable(arg: 1, scope: !79, type: !7) +// CHECK:STDOUT: !82 = !DILocation(line: 24, column: 3, scope: !79) +// CHECK:STDOUT: !83 = !DILocation(line: 25, column: 10, scope: !79) +// CHECK:STDOUT: !84 = !DILocation(line: 25, column: 3, scope: !79) +// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.582d60b54baf6b63", scope: null, file: !3, line: 23, type: !44, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !86) +// CHECK:STDOUT: !86 = !{!87} +// CHECK:STDOUT: !87 = !DILocalVariable(arg: 1, scope: !85, type: !7) +// CHECK:STDOUT: !88 = !DILocation(line: 24, column: 3, scope: !85) +// CHECK:STDOUT: !89 = !DILocation(line: 25, column: 10, scope: !85) +// CHECK:STDOUT: !90 = !DILocation(line: 25, column: 3, scope: !85) +// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "Cfn", linkageName: "_CCfn.C.Main.779b9c0f3b54a7f8", scope: null, file: !3, line: 18, type: !92, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !94) +// CHECK:STDOUT: !92 = !DISubroutineType(types: !93) +// CHECK:STDOUT: !93 = !{!7, !7, !7} +// CHECK:STDOUT: !94 = !{!95, !96} +// CHECK:STDOUT: !95 = !DILocalVariable(arg: 1, scope: !91, type: !7) +// CHECK:STDOUT: !96 = !DILocalVariable(arg: 2, scope: !91, type: !7) +// CHECK:STDOUT: !97 = !DILocation(line: 19, column: 5, scope: !91) +// CHECK:STDOUT: !98 = distinct !DISubprogram(name: "Cfn", linkageName: "_CCfn.C.Main.64ccbb8e5d9a0b8e", scope: null, file: !3, line: 18, type: !99, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !101) +// CHECK:STDOUT: !99 = !DISubroutineType(types: !100) +// CHECK:STDOUT: !100 = !{!39, !7, !39} +// CHECK:STDOUT: !101 = !{!102, !103} +// CHECK:STDOUT: !102 = !DILocalVariable(arg: 1, scope: !98, type: !7) +// CHECK:STDOUT: !103 = !DILocalVariable(arg: 2, scope: !98, type: !39) +// CHECK:STDOUT: !104 = !DILocation(line: 19, column: 5, scope: !98) +// CHECK:STDOUT: !105 = distinct !DISubprogram(name: "Cfn", linkageName: "_CCfn.C.Main.de5b400758c39a65", scope: null, file: !3, line: 18, type: !92, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !106) +// CHECK:STDOUT: !106 = !{!107, !108} +// CHECK:STDOUT: !107 = !DILocalVariable(arg: 1, scope: !105, type: !7) +// CHECK:STDOUT: !108 = !DILocalVariable(arg: 2, scope: !105, type: !7) +// CHECK:STDOUT: !109 = !DILocation(line: 19, column: 5, scope: !105) +// CHECK:STDOUT: !110 = distinct !DISubprogram(name: "Cfn", linkageName: "_CCfn.C.Main.582d60b54baf6b63", scope: null, file: !3, line: 18, type: !92, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !111) +// CHECK:STDOUT: !111 = !{!112, !113} +// CHECK:STDOUT: !112 = !DILocalVariable(arg: 1, scope: !110, type: !7) +// CHECK:STDOUT: !113 = !DILocalVariable(arg: 2, scope: !110, type: !7) +// CHECK:STDOUT: !114 = !DILocation(line: 19, column: 5, scope: !110) diff --git a/toolchain/lower/testdata/function/generic/import.carbon b/toolchain/lower/testdata/function/generic/import.carbon index c2adb4ab7e50..fe26c492b33c 100644 --- a/toolchain/lower/testdata/function/generic/import.carbon +++ b/toolchain/lower/testdata/function/generic/import.carbon @@ -119,18 +119,25 @@ fn Call() -> i32 { // CHECK:STDOUT: store ptr %DirectGeneric.call, ptr %p.var, align 8, !dbg !9 // CHECK:STDOUT: %.loc9_11 = load ptr, ptr %p.var, align 8, !dbg !11 // CHECK:STDOUT: %.loc9_10.2 = load i32, ptr %.loc9_11, align 4, !dbg !12 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %n.var), !dbg !8 // CHECK:STDOUT: ret i32 %.loc9_10.2, !dbg !13 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !14 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !19 +// 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.b88d1103f417c6d4(ptr %y) #0 !dbg !14 { -// CHECK:STDOUT: call void @_CDirectDeclared.Main(), !dbg !21 -// CHECK:STDOUT: call void @_CDirectDefined.Main(), !dbg !22 -// CHECK:STDOUT: %1 = call ptr @_CIndirectGeneric.Main.b88d1103f417c6d4(ptr %y), !dbg !23 -// CHECK:STDOUT: ret ptr %1, !dbg !24 +// CHECK:STDOUT: define linkonce_odr ptr @_CDirectGeneric.Main.b88d1103f417c6d4(ptr %y) #0 !dbg !20 { +// CHECK:STDOUT: call void @_CDirectDeclared.Main(), !dbg !27 +// CHECK:STDOUT: call void @_CDirectDefined.Main(), !dbg !28 +// CHECK:STDOUT: %1 = call ptr @_CIndirectGeneric.Main.b88d1103f417c6d4(ptr %y), !dbg !29 +// CHECK:STDOUT: ret ptr %1, !dbg !30 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CDirectDeclared.Main() @@ -138,10 +145,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.b88d1103f417c6d4(ptr %x) #0 !dbg !25 { -// CHECK:STDOUT: call void @_CIndirectDeclared.Main(), !dbg !29 -// CHECK:STDOUT: call void @_CIndirectDefined.Main(), !dbg !30 -// CHECK:STDOUT: ret ptr %x, !dbg !31 +// CHECK:STDOUT: define linkonce_odr ptr @_CIndirectGeneric.Main.b88d1103f417c6d4(ptr %x) #0 !dbg !31 { +// CHECK:STDOUT: call void @_CIndirectDeclared.Main(), !dbg !35 +// CHECK:STDOUT: call void @_CIndirectDefined.Main(), !dbg !36 +// CHECK:STDOUT: ret ptr %x, !dbg !37 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CIndirectDeclared.Main() @@ -171,21 +178,27 @@ fn Call() -> i32 { // CHECK:STDOUT: !11 = !DILocation(line: 9, column: 11, scope: !4) // CHECK:STDOUT: !12 = !DILocation(line: 9, column: 10, scope: !4) // CHECK:STDOUT: !13 = !DILocation(line: 9, column: 3, scope: !4) -// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "DirectGeneric", linkageName: "_CDirectGeneric.Main.b88d1103f417c6d4", scope: null, file: !15, line: 10, type: !16, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !19) -// CHECK:STDOUT: !15 = !DIFile(filename: "directly_imported.carbon", directory: "") -// CHECK:STDOUT: !16 = !DISubroutineType(types: !17) -// CHECK:STDOUT: !17 = !{!18, !18} -// CHECK:STDOUT: !18 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !19 = !{!20} -// CHECK:STDOUT: !20 = !DILocalVariable(arg: 1, scope: !14, type: !18) -// CHECK:STDOUT: !21 = !DILocation(line: 11, column: 3, scope: !14) -// CHECK:STDOUT: !22 = !DILocation(line: 12, column: 3, scope: !14) -// CHECK:STDOUT: !23 = !DILocation(line: 13, column: 10, scope: !14) -// CHECK:STDOUT: !24 = !DILocation(line: 13, column: 3, scope: !14) -// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "IndirectGeneric", linkageName: "_CIndirectGeneric.Main.b88d1103f417c6d4", scope: null, file: !26, line: 8, type: !16, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !27) -// CHECK:STDOUT: !26 = !DIFile(filename: "indirectly_imported.carbon", directory: "") -// CHECK:STDOUT: !27 = !{!28} -// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !25, type: !18) -// CHECK:STDOUT: !29 = !DILocation(line: 9, column: 3, scope: !25) -// CHECK:STDOUT: !30 = !DILocation(line: 10, column: 3, scope: !25) -// CHECK:STDOUT: !31 = !DILocation(line: 11, column: 3, scope: !25) +// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 7, type: !15, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !17) +// CHECK:STDOUT: !15 = !DISubroutineType(types: !16) +// CHECK:STDOUT: !16 = !{null, !7} +// CHECK:STDOUT: !17 = !{!18} +// CHECK:STDOUT: !18 = !DILocalVariable(arg: 1, scope: !14, type: !7) +// CHECK:STDOUT: !19 = !DILocation(line: 7, column: 3, scope: !14) +// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "DirectGeneric", linkageName: "_CDirectGeneric.Main.b88d1103f417c6d4", scope: null, file: !21, line: 10, type: !22, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !25) +// CHECK:STDOUT: !21 = !DIFile(filename: "directly_imported.carbon", directory: "") +// CHECK:STDOUT: !22 = !DISubroutineType(types: !23) +// CHECK:STDOUT: !23 = !{!24, !24} +// CHECK:STDOUT: !24 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !25 = !{!26} +// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !20, type: !24) +// CHECK:STDOUT: !27 = !DILocation(line: 11, column: 3, scope: !20) +// CHECK:STDOUT: !28 = !DILocation(line: 12, column: 3, scope: !20) +// CHECK:STDOUT: !29 = !DILocation(line: 13, column: 10, scope: !20) +// CHECK:STDOUT: !30 = !DILocation(line: 13, column: 3, scope: !20) +// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "IndirectGeneric", linkageName: "_CIndirectGeneric.Main.b88d1103f417c6d4", scope: null, file: !32, line: 8, type: !22, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !33) +// CHECK:STDOUT: !32 = !DIFile(filename: "indirectly_imported.carbon", directory: "") +// CHECK:STDOUT: !33 = !{!34} +// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !31, type: !24) +// CHECK:STDOUT: !35 = !DILocation(line: 9, column: 3, scope: !31) +// CHECK:STDOUT: !36 = !DILocation(line: 10, column: 3, scope: !31) +// CHECK:STDOUT: !37 = !DILocation(line: 11, column: 3, scope: !31) diff --git a/toolchain/lower/testdata/function/generic/import_core_witness.carbon b/toolchain/lower/testdata/function/generic/import_core_witness.carbon new file mode 100644 index 000000000000..662107ff2b28 --- /dev/null +++ b/toolchain/lower/testdata/function/generic/import_core_witness.carbon @@ -0,0 +1,98 @@ +// 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/function/generic/import_core_witness.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/function/generic/import_core_witness.carbon + +// --- lib.carbon + +library "[[@TEST_NAME]]"; + +fn F(x:! i32) { + // This generates a witness for the destructor of `y` which is reused by the + // instantiation for the call in `main.carbon`. + var unused y: i32 = x; +} + +// --- main.carbon + +import library "lib"; + +fn Run() { + F(0); +} + +// CHECK:STDOUT: ; ModuleID = 'lib.carbon' +// CHECK:STDOUT: source_filename = "lib.carbon" +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !4 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nounwind } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "lib.carbon", directory: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 7, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !8) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{null, !7} +// CHECK:STDOUT: !7 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !8 = !{!9} +// CHECK:STDOUT: !9 = !DILocalVariable(arg: 1, scope: !4, type: !7) +// CHECK:STDOUT: !10 = !DILocation(line: 7, column: 3, scope: !4) +// CHECK:STDOUT: ; ModuleID = 'main.carbon' +// CHECK:STDOUT: source_filename = "main.carbon" +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @main() #0 !dbg !4 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_CF.Main.ea4dcbbefe9f139a(), !dbg !7 +// CHECK:STDOUT: ret void, !dbg !8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.ea4dcbbefe9f139a() #0 !dbg !9 { +// CHECK:STDOUT: %1 = alloca i32, align 4, !dbg !11 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !11 +// CHECK:STDOUT: store i32 0, ptr %1, align 4, !dbg !11 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %1), !dbg !11 +// CHECK:STDOUT: ret void, !dbg !12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: declare void @"_COp.7e389eab4a7e5487: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 +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nounwind } +// CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "main.carbon", directory: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !3, line: 4, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{null} +// CHECK:STDOUT: !7 = !DILocation(line: 5, column: 3, scope: !4) +// CHECK:STDOUT: !8 = !DILocation(line: 4, column: 1, scope: !4) +// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.ea4dcbbefe9f139a", scope: null, file: !10, line: 4, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !10 = !DIFile(filename: "lib.carbon", directory: "") +// CHECK:STDOUT: !11 = !DILocation(line: 7, column: 3, scope: !9) +// CHECK:STDOUT: !12 = !DILocation(line: 4, column: 1, scope: !9) diff --git a/toolchain/lower/testdata/function/generic/import_unused_def.carbon b/toolchain/lower/testdata/function/generic/import_unused_def.carbon new file mode 100644 index 000000000000..01565e5cfd60 --- /dev/null +++ b/toolchain/lower/testdata/function/generic/import_unused_def.carbon @@ -0,0 +1,138 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/int.carbon +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/function/generic/import_unused_def.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/function/generic/import_unused_def.carbon + +// --- a.carbon +library "a"; + +class Foo { + adapt i32; +} + +// This will be instantiated in "a", but unused here. Meanwhile the +// instantiation of "F" in "b" can create a use, without emitting a definition. +// This test verifies how the emitted definition is marked. Right now it is: +// `_COp.a9f4dd835fff2161:core.Destroy.Core` +impl Foo as Core.Copy { + fn Op[self: Self]() -> Self { + return (self as i32).(Core.Copy.Op)() as Foo; + } +} + +fn GenericF[T:! type](unused x: T) -> Foo { + var f: Foo = (0 as i32) as Foo; + return f; +} + +// --- b.carbon +library "b"; +import library "a"; + +fn Main() { + GenericF(0); +} + +// CHECK:STDOUT: ; ModuleID = 'a.carbon' +// CHECK:STDOUT: source_filename = "a.carbon" +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define i32 @"_COp.Foo.Main:Copy.Core"(i32 %self) #0 !dbg !4 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret i32 %self, !dbg !10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.a9f4dd835fff2161:core.Destroy.Core"(ptr %self) #0 !dbg !11 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !16 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nounwind } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "a.carbon", directory: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Foo.Main:Copy.Core", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !8) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{!7, !7} +// CHECK:STDOUT: !7 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !8 = !{!9} +// CHECK:STDOUT: !9 = !DILocalVariable(arg: 1, scope: !4, type: !7) +// CHECK:STDOUT: !10 = !DILocation(line: 13, column: 5, scope: !4) +// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a9f4dd835fff2161:core.Destroy.Core", scope: null, file: !3, line: 18, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !14) +// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) +// CHECK:STDOUT: !13 = !{null, !7} +// CHECK:STDOUT: !14 = !{!15} +// CHECK:STDOUT: !15 = !DILocalVariable(arg: 1, scope: !11, type: !7) +// CHECK:STDOUT: !16 = !DILocation(line: 18, column: 3, scope: !11) +// 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 !4 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %GenericF.call = call i32 @_CGenericF.Main.084a2801e0f5d754({} zeroinitializer), !dbg !7 +// CHECK:STDOUT: ret void, !dbg !8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr i32 @_CGenericF.Main.084a2801e0f5d754({} %x) #0 !dbg !9 { +// CHECK:STDOUT: %1 = alloca i32, align 4, !dbg !17 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !17 +// CHECK:STDOUT: %2 = call i32 @"_COp.Foo.Main:Copy.Core"(i32 0), !dbg !18 +// CHECK:STDOUT: store i32 %2, ptr %1, align 4, !dbg !17 +// CHECK:STDOUT: %3 = load i32, ptr %1, align 4, !dbg !19 +// CHECK:STDOUT: %4 = call i32 @"_COp.Foo.Main:Copy.Core"(i32 %3), !dbg !19 +// CHECK:STDOUT: call void @"_COp.a9f4dd835fff2161:core.Destroy.Core"(ptr %1), !dbg !17 +// CHECK:STDOUT: ret i32 %4, !dbg !20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: declare i32 @"_COp.Foo.Main:Copy.Core"(i32) +// CHECK:STDOUT: +// CHECK:STDOUT: declare void @"_COp.a9f4dd835fff2161: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 +// CHECK:STDOUT: +// CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @"_COp.Foo.Main:Copy.Core", { 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.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "b.carbon", directory: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !3, line: 4, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{null} +// CHECK:STDOUT: !7 = !DILocation(line: 5, column: 3, scope: !4) +// CHECK:STDOUT: !8 = !DILocation(line: 4, column: 1, scope: !4) +// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "GenericF", linkageName: "_CGenericF.Main.084a2801e0f5d754", scope: null, file: !10, line: 17, type: !11, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !15) +// CHECK:STDOUT: !10 = !DIFile(filename: "a.carbon", directory: "") +// CHECK:STDOUT: !11 = !DISubroutineType(types: !12) +// CHECK:STDOUT: !12 = !{!13, !14} +// CHECK:STDOUT: !13 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !15 = !{!16} +// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !9, type: !14) +// CHECK:STDOUT: !17 = !DILocation(line: 18, column: 3, scope: !9) +// CHECK:STDOUT: !18 = !DILocation(line: 18, column: 16, scope: !9) +// CHECK:STDOUT: !19 = !DILocation(line: 19, column: 10, scope: !9) +// CHECK:STDOUT: !20 = !DILocation(line: 19, column: 3, scope: !9) diff --git a/toolchain/lower/testdata/function/generic/type_representation.carbon b/toolchain/lower/testdata/function/generic/type_representation.carbon index 082ac068e2b6..70883a7e5368 100644 --- a/toolchain/lower/testdata/function/generic/type_representation.carbon +++ b/toolchain/lower/testdata/function/generic/type_representation.carbon @@ -91,130 +91,164 @@ fn F_nested_tuple(a: ((i32, i32), X)) -> ((i32, i32), X) { // 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 !16 { +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !16 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc38_24.1.a = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 0, !dbg !22 -// CHECK:STDOUT: %.loc38_24.2 = load i32, ptr %.loc38_24.1.a, align 4, !dbg !22 -// CHECK:STDOUT: %.loc38_37.1.b = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !23 -// CHECK:STDOUT: %.loc38_37.2 = load i32, ptr %.loc38_37.1.b, align 4, !dbg !23 -// CHECK:STDOUT: %.loc38_39.2.a = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0, !dbg !24 -// CHECK:STDOUT: store i32 %.loc38_24.2, ptr %.loc38_39.2.a, align 4, !dbg !24 -// CHECK:STDOUT: %.loc38_39.4.b = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !24 -// CHECK:STDOUT: store i32 %.loc38_37.2, ptr %.loc38_39.4.b, align 4, !dbg !24 -// CHECK:STDOUT: ret void, !dbg !25 +// CHECK:STDOUT: ret void, !dbg !21 // 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 !26 { +// CHECK:STDOUT: define void @"_COp.X.Main:Copy.Main"(ptr sret({ i32, i32 }) %return, ptr %self) #0 !dbg !22 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.Main.f2c09195b9db5815(ptr %return, ptr %a), !dbg !29 -// CHECK:STDOUT: ret void, !dbg !30 +// CHECK:STDOUT: %.loc38_24.1.a = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 0, !dbg !28 +// CHECK:STDOUT: %.loc38_24.2 = load i32, ptr %.loc38_24.1.a, align 4, !dbg !28 +// CHECK:STDOUT: %.loc38_37.1.b = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !29 +// CHECK:STDOUT: %.loc38_37.2 = load i32, ptr %.loc38_37.1.b, align 4, !dbg !29 +// CHECK:STDOUT: %.loc38_39.2.a = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0, !dbg !30 +// CHECK:STDOUT: store i32 %.loc38_24.2, ptr %.loc38_39.2.a, align 4, !dbg !30 +// CHECK:STDOUT: %.loc38_39.4.b = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !30 +// CHECK:STDOUT: store i32 %.loc38_37.2, ptr %.loc38_39.4.b, align 4, !dbg !30 +// CHECK:STDOUT: ret void, !dbg !31 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @"_COp.61ea2aba74ab3bf1:Copy.Main"() #0 !dbg !31 { +// CHECK:STDOUT: define void @_CF_X.Main(ptr sret({ i32, i32 }) %return, ptr %a) #0 !dbg !32 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !34 +// CHECK:STDOUT: call void @_CF.Main.f2c09195b9db5815(ptr %return, ptr %a), !dbg !35 +// CHECK:STDOUT: ret void, !dbg !36 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF_empty_tuple.Main() #0 !dbg !35 { +// CHECK:STDOUT: define weak_odr void @"_COp.fb32c4dfca65e378:core.Destroy.Core"(ptr %self) #0 !dbg !37 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.Main.94af6b585cb77bfd(), !dbg !36 -// CHECK:STDOUT: ret void, !dbg !37 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @"_COp.d07e2731f1087d49:Copy.Main"(ptr sret({ i32, i32 }) %return, ptr %self) #0 !dbg !38 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %tuple.elem0.loc59_12.1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 0, !dbg !41 -// CHECK:STDOUT: %tuple.elem0.loc59_12.1.tuple.elem.load = load i32, ptr %tuple.elem0.loc59_12.1.tuple.elem, align 4, !dbg !41 -// CHECK:STDOUT: %tuple.elem0.loc59_12.2.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0, !dbg !41 -// CHECK:STDOUT: store i32 %tuple.elem0.loc59_12.1.tuple.elem.load, ptr %tuple.elem0.loc59_12.2.tuple.elem, align 4, !dbg !41 -// CHECK:STDOUT: %tuple.elem1.loc59_12.1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !41 -// CHECK:STDOUT: %tuple.elem1.loc59_12.1.tuple.elem.load = load i32, ptr %tuple.elem1.loc59_12.1.tuple.elem, align 4, !dbg !41 -// CHECK:STDOUT: %tuple.elem1.loc59_12.2.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !41 -// CHECK:STDOUT: store i32 %tuple.elem1.loc59_12.1.tuple.elem.load, ptr %tuple.elem1.loc59_12.2.tuple.elem, align 4, !dbg !41 // CHECK:STDOUT: ret void, !dbg !42 // 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 !43 { +// CHECK:STDOUT: define weak_odr void @"_COp.607f187990247af9:core.Destroy.Core"(ptr %self) #0 !dbg !43 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.Main.4381e7f8def4ed9d(ptr %return, ptr %a), !dbg !46 -// CHECK:STDOUT: ret void, !dbg !47 +// CHECK:STDOUT: ret void, !dbg !46 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @"_COp.a6c7c55658a5a74c:Copy.Main"(ptr sret({ { i32, i32 }, { i32, i32 } }) %return, ptr %self) #0 !dbg !48 { +// CHECK:STDOUT: define void @"_COp.61ea2aba74ab3bf1:Copy.Main"() #0 !dbg !47 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %tuple.elem0.loc69_17.tuple.elem = getelementptr inbounds nuw { ptr, ptr }, ptr %self, i32 0, i32 0, !dbg !51 -// CHECK:STDOUT: %tuple.elem0.loc69_17.tuple.elem.load = load ptr, ptr %tuple.elem0.loc69_17.tuple.elem, align 8, !dbg !51 -// CHECK:STDOUT: %tuple.elem0.loc69_51.tuple.elem = getelementptr inbounds nuw { { i32, i32 }, { i32, i32 } }, ptr %return, i32 0, i32 0, !dbg !52 -// CHECK:STDOUT: call void @"_COp.d07e2731f1087d49:Copy.Main"(ptr %tuple.elem0.loc69_51.tuple.elem, ptr %tuple.elem0.loc69_17.tuple.elem.load), !dbg !51 -// CHECK:STDOUT: %tuple.elem1.loc69_37.tuple.elem = getelementptr inbounds nuw { ptr, ptr }, ptr %self, i32 0, i32 1, !dbg !53 -// CHECK:STDOUT: %tuple.elem1.loc69_37.tuple.elem.load = load ptr, ptr %tuple.elem1.loc69_37.tuple.elem, align 8, !dbg !53 -// CHECK:STDOUT: %tuple.elem1.loc69_51.tuple.elem = getelementptr inbounds nuw { { i32, i32 }, { i32, i32 } }, ptr %return, i32 0, i32 1, !dbg !52 -// 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 !53 -// CHECK:STDOUT: ret void, !dbg !54 +// CHECK:STDOUT: ret void, !dbg !50 // 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 !55 { +// CHECK:STDOUT: define void @_CF_empty_tuple.Main() #0 !dbg !51 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.Main.389b355d0ba7c2d7(ptr %return, ptr %a), !dbg !58 -// CHECK:STDOUT: ret void, !dbg !59 +// CHECK:STDOUT: call void @_CF.Main.94af6b585cb77bfd(), !dbg !52 +// CHECK:STDOUT: ret void, !dbg !53 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.07d7f3268607f0bc(i32 %a) #0 !dbg !60 { +// CHECK:STDOUT: define void @"_COp.d07e2731f1087d49:Copy.Main"(ptr sret({ i32, i32 }) %return, ptr %self) #0 !dbg !54 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca i32, align 4, !dbg !63 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !63 -// CHECK:STDOUT: %Copy.WithSelf.Op.call.loc18 = call i32 @"_COp.Int.be1e879c1ad406d8.Core:Copy.Main"(i32 %a), !dbg !64 -// CHECK:STDOUT: store i32 %Copy.WithSelf.Op.call.loc18, ptr %_.var, align 4, !dbg !63 -// CHECK:STDOUT: %Copy.WithSelf.Op.call.loc19 = call i32 @"_COp.Int.be1e879c1ad406d8.Core:Copy.Main"(i32 %a), !dbg !65 -// CHECK:STDOUT: ret i32 %Copy.WithSelf.Op.call.loc19, !dbg !66 +// CHECK:STDOUT: %tuple.elem0.loc59_12.1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 0, !dbg !57 +// CHECK:STDOUT: %tuple.elem0.loc59_12.1.tuple.elem.load = load i32, ptr %tuple.elem0.loc59_12.1.tuple.elem, align 4, !dbg !57 +// CHECK:STDOUT: %tuple.elem0.loc59_12.2.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0, !dbg !57 +// CHECK:STDOUT: store i32 %tuple.elem0.loc59_12.1.tuple.elem.load, ptr %tuple.elem0.loc59_12.2.tuple.elem, align 4, !dbg !57 +// CHECK:STDOUT: %tuple.elem1.loc59_12.1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !57 +// CHECK:STDOUT: %tuple.elem1.loc59_12.1.tuple.elem.load = load i32, ptr %tuple.elem1.loc59_12.1.tuple.elem, align 4, !dbg !57 +// CHECK:STDOUT: %tuple.elem1.loc59_12.2.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !57 +// CHECK:STDOUT: store i32 %tuple.elem1.loc59_12.1.tuple.elem.load, ptr %tuple.elem1.loc59_12.2.tuple.elem, align 4, !dbg !57 +// CHECK:STDOUT: ret void, !dbg !58 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Main.f2c09195b9db5815(ptr sret({ i32, i32 }) %return, ptr %a) #0 !dbg !67 { +// CHECK:STDOUT: define void @_CF_two_tuple.Main(ptr sret({ i32, i32 }) %return, ptr %a) #0 !dbg !59 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca { i32, i32 }, align 8, !dbg !70 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !70 -// CHECK:STDOUT: call void @"_COp.X.Main:Copy.Main"(ptr %_.var, ptr %a), !dbg !71 -// CHECK:STDOUT: call void @"_COp.X.Main:Copy.Main"(ptr %return, ptr %a), !dbg !72 -// CHECK:STDOUT: ret void, !dbg !73 +// CHECK:STDOUT: call void @_CF.Main.4381e7f8def4ed9d(ptr %return, ptr %a), !dbg !62 +// CHECK:STDOUT: ret void, !dbg !63 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Main.94af6b585cb77bfd() #0 !dbg !74 { +// CHECK:STDOUT: define weak_odr void @"_COp.8e354c83fe88ab86:core.Destroy.Core"(ptr %self) #0 !dbg !64 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca {}, align 8, !dbg !75 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !75 -// CHECK:STDOUT: call void @"_COp.61ea2aba74ab3bf1:Copy.Main"(), !dbg !76 -// CHECK:STDOUT: call void @"_COp.61ea2aba74ab3bf1:Copy.Main"(), !dbg !77 -// CHECK:STDOUT: ret void, !dbg !78 +// CHECK:STDOUT: ret void, !dbg !67 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Main.4381e7f8def4ed9d(ptr sret({ i32, i32 }) %return, ptr %a) #0 !dbg !79 { +// CHECK:STDOUT: define void @"_COp.a6c7c55658a5a74c:Copy.Main"(ptr sret({ { i32, i32 }, { i32, i32 } }) %return, ptr %self) #0 !dbg !68 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca { i32, i32 }, align 8, !dbg !82 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !82 -// CHECK:STDOUT: call void @"_COp.d07e2731f1087d49:Copy.Main"(ptr %_.var, ptr %a), !dbg !83 -// CHECK:STDOUT: call void @"_COp.d07e2731f1087d49:Copy.Main"(ptr %return, ptr %a), !dbg !84 -// CHECK:STDOUT: ret void, !dbg !85 +// CHECK:STDOUT: %tuple.elem0.loc69_17.tuple.elem = getelementptr inbounds nuw { ptr, ptr }, ptr %self, i32 0, i32 0, !dbg !71 +// CHECK:STDOUT: %tuple.elem0.loc69_17.tuple.elem.load = load ptr, ptr %tuple.elem0.loc69_17.tuple.elem, align 8, !dbg !71 +// CHECK:STDOUT: %tuple.elem0.loc69_51.tuple.elem = getelementptr inbounds nuw { { i32, i32 }, { i32, i32 } }, ptr %return, i32 0, i32 0, !dbg !72 +// CHECK:STDOUT: call void @"_COp.d07e2731f1087d49:Copy.Main"(ptr %tuple.elem0.loc69_51.tuple.elem, ptr %tuple.elem0.loc69_17.tuple.elem.load), !dbg !71 +// CHECK:STDOUT: %tuple.elem1.loc69_37.tuple.elem = getelementptr inbounds nuw { ptr, ptr }, ptr %self, i32 0, i32 1, !dbg !73 +// CHECK:STDOUT: %tuple.elem1.loc69_37.tuple.elem.load = load ptr, ptr %tuple.elem1.loc69_37.tuple.elem, align 8, !dbg !73 +// CHECK:STDOUT: %tuple.elem1.loc69_51.tuple.elem = getelementptr inbounds nuw { { i32, i32 }, { i32, i32 } }, ptr %return, i32 0, i32 1, !dbg !72 +// 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 !73 +// CHECK:STDOUT: ret void, !dbg !74 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Main.389b355d0ba7c2d7(ptr sret({ { i32, i32 }, { i32, i32 } }) %return, ptr %a) #0 !dbg !86 { +// CHECK:STDOUT: define void @_CF_nested_tuple.Main(ptr sret({ { i32, i32 }, { i32, i32 } }) %return, ptr %a) #0 !dbg !75 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca { { i32, i32 }, { i32, i32 } }, align 8, !dbg !89 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !89 -// CHECK:STDOUT: call void @"_COp.a6c7c55658a5a74c:Copy.Main"(ptr %_.var, ptr %a), !dbg !90 -// CHECK:STDOUT: call void @"_COp.a6c7c55658a5a74c:Copy.Main"(ptr %return, ptr %a), !dbg !91 -// CHECK:STDOUT: ret void, !dbg !92 +// CHECK:STDOUT: call void @_CF.Main.389b355d0ba7c2d7(ptr %return, ptr %a), !dbg !78 +// CHECK:STDOUT: ret void, !dbg !79 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.fe297bc49d82e879:core.Destroy.Core"(ptr %self) #0 !dbg !80 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !83 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.07d7f3268607f0bc(i32 %a) #0 !dbg !84 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %_.var = alloca i32, align 4, !dbg !87 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !87 +// CHECK:STDOUT: %Copy.WithSelf.Op.call.loc18 = call i32 @"_COp.Int.be1e879c1ad406d8.Core:Copy.Main"(i32 %a), !dbg !88 +// CHECK:STDOUT: store i32 %Copy.WithSelf.Op.call.loc18, ptr %_.var, align 4, !dbg !87 +// CHECK:STDOUT: %Copy.WithSelf.Op.call.loc19 = call i32 @"_COp.Int.be1e879c1ad406d8.Core:Copy.Main"(i32 %a), !dbg !89 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %_.var), !dbg !87 +// CHECK:STDOUT: ret i32 %Copy.WithSelf.Op.call.loc19, !dbg !90 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.f2c09195b9db5815(ptr sret({ i32, i32 }) %return, ptr %a) #0 !dbg !91 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %_.var = alloca { i32, i32 }, align 8, !dbg !94 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !94 +// CHECK:STDOUT: call void @"_COp.X.Main:Copy.Main"(ptr %_.var, ptr %a), !dbg !95 +// CHECK:STDOUT: call void @"_COp.X.Main:Copy.Main"(ptr %return, ptr %a), !dbg !96 +// CHECK:STDOUT: call void @"_COp.607f187990247af9:core.Destroy.Core"(ptr %_.var), !dbg !94 +// CHECK:STDOUT: ret void, !dbg !97 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.94af6b585cb77bfd() #0 !dbg !98 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %_.var = alloca {}, align 8, !dbg !99 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !99 +// CHECK:STDOUT: call void @"_COp.61ea2aba74ab3bf1:Copy.Main"(), !dbg !100 +// CHECK:STDOUT: call void @"_COp.61ea2aba74ab3bf1:Copy.Main"(), !dbg !101 +// CHECK:STDOUT: ret void, !dbg !102 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.4381e7f8def4ed9d(ptr sret({ i32, i32 }) %return, ptr %a) #0 !dbg !103 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %_.var = alloca { i32, i32 }, align 8, !dbg !106 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !106 +// CHECK:STDOUT: call void @"_COp.d07e2731f1087d49:Copy.Main"(ptr %_.var, ptr %a), !dbg !107 +// CHECK:STDOUT: call void @"_COp.d07e2731f1087d49:Copy.Main"(ptr %return, ptr %a), !dbg !108 +// CHECK:STDOUT: call void @"_COp.8e354c83fe88ab86:core.Destroy.Core"(ptr %_.var), !dbg !106 +// CHECK:STDOUT: ret void, !dbg !109 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.389b355d0ba7c2d7(ptr sret({ { i32, i32 }, { i32, i32 } }) %return, ptr %a) #0 !dbg !110 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %_.var = alloca { { i32, i32 }, { i32, i32 } }, align 8, !dbg !113 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !113 +// CHECK:STDOUT: call void @"_COp.a6c7c55658a5a74c:Copy.Main"(ptr %_.var, ptr %a), !dbg !114 +// CHECK:STDOUT: call void @"_COp.a6c7c55658a5a74c:Copy.Main"(ptr %return, ptr %a), !dbg !115 +// CHECK:STDOUT: call void @"_COp.fe297bc49d82e879:core.Destroy.Core"(ptr %_.var), !dbg !113 +// CHECK:STDOUT: ret void, !dbg !116 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -245,80 +279,104 @@ fn F_nested_tuple(a: ((i32, i32), X)) -> ((i32, i32), X) { // CHECK:STDOUT: !13 = !DILocalVariable(arg: 1, scope: !11, type: !7) // CHECK:STDOUT: !14 = !DILocation(line: 29, column: 10, scope: !11) // CHECK:STDOUT: !15 = !DILocation(line: 29, column: 3, scope: !11) -// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "Op", linkageName: "_COp.X.Main:Copy.Main", scope: null, file: !3, line: 37, type: !17, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !20) +// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 29, type: !17, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !19) // CHECK:STDOUT: !17 = !DISubroutineType(types: !18) -// CHECK:STDOUT: !18 = !{!19, !19} -// CHECK:STDOUT: !19 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !20 = !{!21} -// CHECK:STDOUT: !21 = !DILocalVariable(arg: 1, scope: !16, type: !19) -// CHECK:STDOUT: !22 = !DILocation(line: 38, column: 20, scope: !16) -// CHECK:STDOUT: !23 = !DILocation(line: 38, column: 33, scope: !16) -// CHECK:STDOUT: !24 = !DILocation(line: 38, column: 14, scope: !16) -// CHECK:STDOUT: !25 = !DILocation(line: 38, column: 7, scope: !16) -// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "F_X", linkageName: "_CF_X.Main", scope: null, file: !3, line: 43, type: !17, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !27) -// CHECK:STDOUT: !27 = !{!28} -// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !26, type: !19) -// CHECK:STDOUT: !29 = !DILocation(line: 44, column: 10, scope: !26) -// CHECK:STDOUT: !30 = !DILocation(line: 44, column: 3, scope: !26) -// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "Op", linkageName: "_COp.61ea2aba74ab3bf1:Copy.Main", scope: null, file: !3, line: 48, type: !32, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !32 = !DISubroutineType(types: !33) -// CHECK:STDOUT: !33 = !{null} -// CHECK:STDOUT: !34 = !DILocation(line: 49, column: 5, scope: !31) -// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "F_empty_tuple", linkageName: "_CF_empty_tuple.Main", scope: null, file: !3, line: 53, type: !32, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !36 = !DILocation(line: 54, column: 10, scope: !35) -// CHECK:STDOUT: !37 = !DILocation(line: 54, column: 3, scope: !35) -// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d07e2731f1087d49:Copy.Main", scope: null, file: !3, line: 58, type: !17, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !39) -// CHECK:STDOUT: !39 = !{!40} -// CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !38, type: !19) -// CHECK:STDOUT: !41 = !DILocation(line: 59, column: 12, scope: !38) -// CHECK:STDOUT: !42 = !DILocation(line: 59, column: 5, scope: !38) -// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "F_two_tuple", linkageName: "_CF_two_tuple.Main", scope: null, file: !3, line: 63, type: !17, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !44) +// CHECK:STDOUT: !18 = !{null, !7} +// CHECK:STDOUT: !19 = !{!20} +// CHECK:STDOUT: !20 = !DILocalVariable(arg: 1, scope: !16, type: !7) +// CHECK:STDOUT: !21 = !DILocation(line: 29, column: 10, scope: !16) +// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Op", linkageName: "_COp.X.Main:Copy.Main", scope: null, file: !3, line: 37, type: !23, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !26) +// CHECK:STDOUT: !23 = !DISubroutineType(types: !24) +// CHECK:STDOUT: !24 = !{!25, !25} +// CHECK:STDOUT: !25 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !26 = !{!27} +// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !22, type: !25) +// CHECK:STDOUT: !28 = !DILocation(line: 38, column: 20, scope: !22) +// CHECK:STDOUT: !29 = !DILocation(line: 38, column: 33, scope: !22) +// CHECK:STDOUT: !30 = !DILocation(line: 38, column: 14, scope: !22) +// CHECK:STDOUT: !31 = !DILocation(line: 38, column: 7, scope: !22) +// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "F_X", linkageName: "_CF_X.Main", scope: null, file: !3, line: 43, type: !23, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !33) +// CHECK:STDOUT: !33 = !{!34} +// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !32, type: !25) +// CHECK:STDOUT: !35 = !DILocation(line: 44, column: 10, scope: !32) +// CHECK:STDOUT: !36 = !DILocation(line: 44, column: 3, scope: !32) +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fb32c4dfca65e378:core.Destroy.Core", scope: null, file: !3, line: 44, type: !38, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !40) +// CHECK:STDOUT: !38 = !DISubroutineType(types: !39) +// CHECK:STDOUT: !39 = !{null, !25} +// CHECK:STDOUT: !40 = !{!41} +// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !37, type: !25) +// CHECK:STDOUT: !42 = !DILocation(line: 44, column: 10, scope: !37) +// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "Op", linkageName: "_COp.607f187990247af9:core.Destroy.Core", scope: null, file: !3, line: 44, type: !38, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !44) // CHECK:STDOUT: !44 = !{!45} -// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !43, type: !19) -// CHECK:STDOUT: !46 = !DILocation(line: 64, column: 10, scope: !43) -// CHECK:STDOUT: !47 = !DILocation(line: 64, column: 3, scope: !43) -// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a6c7c55658a5a74c:Copy.Main", scope: null, file: !3, line: 68, type: !17, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !49) -// CHECK:STDOUT: !49 = !{!50} -// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !48, type: !19) -// CHECK:STDOUT: !51 = !DILocation(line: 69, column: 13, scope: !48) -// CHECK:STDOUT: !52 = !DILocation(line: 69, column: 12, scope: !48) -// CHECK:STDOUT: !53 = !DILocation(line: 69, column: 33, scope: !48) -// CHECK:STDOUT: !54 = !DILocation(line: 69, column: 5, scope: !48) -// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "F_nested_tuple", linkageName: "_CF_nested_tuple.Main", scope: null, file: !3, line: 73, type: !17, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !56) -// CHECK:STDOUT: !56 = !{!57} -// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !55, type: !19) -// CHECK:STDOUT: !58 = !DILocation(line: 74, column: 10, scope: !55) -// CHECK:STDOUT: !59 = !DILocation(line: 74, column: 3, scope: !55) -// CHECK:STDOUT: !60 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.07d7f3268607f0bc", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !61) -// CHECK:STDOUT: !61 = !{!62} -// CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !60, type: !7) -// CHECK:STDOUT: !63 = !DILocation(line: 18, column: 3, scope: !60) -// CHECK:STDOUT: !64 = !DILocation(line: 18, column: 14, scope: !60) -// CHECK:STDOUT: !65 = !DILocation(line: 19, column: 10, scope: !60) -// CHECK:STDOUT: !66 = !DILocation(line: 19, column: 3, scope: !60) -// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.f2c09195b9db5815", scope: null, file: !3, line: 17, type: !17, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !68) -// CHECK:STDOUT: !68 = !{!69} -// CHECK:STDOUT: !69 = !DILocalVariable(arg: 1, scope: !67, type: !19) -// CHECK:STDOUT: !70 = !DILocation(line: 18, column: 3, scope: !67) -// CHECK:STDOUT: !71 = !DILocation(line: 18, column: 14, scope: !67) -// CHECK:STDOUT: !72 = !DILocation(line: 19, column: 10, scope: !67) -// CHECK:STDOUT: !73 = !DILocation(line: 19, column: 3, scope: !67) -// CHECK:STDOUT: !74 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.94af6b585cb77bfd", scope: null, file: !3, line: 17, type: !32, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !75 = !DILocation(line: 18, column: 3, scope: !74) -// CHECK:STDOUT: !76 = !DILocation(line: 18, column: 14, scope: !74) -// CHECK:STDOUT: !77 = !DILocation(line: 19, column: 10, scope: !74) -// CHECK:STDOUT: !78 = !DILocation(line: 19, column: 3, scope: !74) -// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.4381e7f8def4ed9d", scope: null, file: !3, line: 17, type: !17, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !80) -// CHECK:STDOUT: !80 = !{!81} -// CHECK:STDOUT: !81 = !DILocalVariable(arg: 1, scope: !79, type: !19) -// CHECK:STDOUT: !82 = !DILocation(line: 18, column: 3, scope: !79) -// CHECK:STDOUT: !83 = !DILocation(line: 18, column: 14, scope: !79) -// CHECK:STDOUT: !84 = !DILocation(line: 19, column: 10, scope: !79) -// CHECK:STDOUT: !85 = !DILocation(line: 19, column: 3, scope: !79) -// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.389b355d0ba7c2d7", scope: null, file: !3, line: 17, type: !17, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !87) -// CHECK:STDOUT: !87 = !{!88} -// CHECK:STDOUT: !88 = !DILocalVariable(arg: 1, scope: !86, type: !19) -// CHECK:STDOUT: !89 = !DILocation(line: 18, column: 3, scope: !86) -// CHECK:STDOUT: !90 = !DILocation(line: 18, column: 14, scope: !86) -// CHECK:STDOUT: !91 = !DILocation(line: 19, column: 10, scope: !86) -// CHECK:STDOUT: !92 = !DILocation(line: 19, column: 3, scope: !86) +// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !43, type: !25) +// CHECK:STDOUT: !46 = !DILocation(line: 44, column: 10, scope: !43) +// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "Op", linkageName: "_COp.61ea2aba74ab3bf1:Copy.Main", scope: null, file: !3, line: 48, type: !48, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !48 = !DISubroutineType(types: !49) +// CHECK:STDOUT: !49 = !{null} +// CHECK:STDOUT: !50 = !DILocation(line: 49, column: 5, scope: !47) +// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "F_empty_tuple", linkageName: "_CF_empty_tuple.Main", scope: null, file: !3, line: 53, type: !48, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !52 = !DILocation(line: 54, column: 10, scope: !51) +// CHECK:STDOUT: !53 = !DILocation(line: 54, column: 3, scope: !51) +// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d07e2731f1087d49:Copy.Main", scope: null, file: !3, line: 58, type: !23, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !55) +// CHECK:STDOUT: !55 = !{!56} +// CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !54, type: !25) +// CHECK:STDOUT: !57 = !DILocation(line: 59, column: 12, scope: !54) +// CHECK:STDOUT: !58 = !DILocation(line: 59, column: 5, scope: !54) +// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "F_two_tuple", linkageName: "_CF_two_tuple.Main", scope: null, file: !3, line: 63, type: !23, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !60) +// CHECK:STDOUT: !60 = !{!61} +// CHECK:STDOUT: !61 = !DILocalVariable(arg: 1, scope: !59, type: !25) +// CHECK:STDOUT: !62 = !DILocation(line: 64, column: 10, scope: !59) +// CHECK:STDOUT: !63 = !DILocation(line: 64, column: 3, scope: !59) +// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8e354c83fe88ab86:core.Destroy.Core", scope: null, file: !3, line: 64, type: !38, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !65) +// CHECK:STDOUT: !65 = !{!66} +// CHECK:STDOUT: !66 = !DILocalVariable(arg: 1, scope: !64, type: !25) +// CHECK:STDOUT: !67 = !DILocation(line: 64, column: 10, scope: !64) +// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a6c7c55658a5a74c:Copy.Main", scope: null, file: !3, line: 68, type: !23, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !69) +// CHECK:STDOUT: !69 = !{!70} +// CHECK:STDOUT: !70 = !DILocalVariable(arg: 1, scope: !68, type: !25) +// CHECK:STDOUT: !71 = !DILocation(line: 69, column: 13, scope: !68) +// CHECK:STDOUT: !72 = !DILocation(line: 69, column: 12, scope: !68) +// CHECK:STDOUT: !73 = !DILocation(line: 69, column: 33, scope: !68) +// CHECK:STDOUT: !74 = !DILocation(line: 69, column: 5, scope: !68) +// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "F_nested_tuple", linkageName: "_CF_nested_tuple.Main", scope: null, file: !3, line: 73, type: !23, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !76) +// CHECK:STDOUT: !76 = !{!77} +// CHECK:STDOUT: !77 = !DILocalVariable(arg: 1, scope: !75, type: !25) +// CHECK:STDOUT: !78 = !DILocation(line: 74, column: 10, scope: !75) +// CHECK:STDOUT: !79 = !DILocation(line: 74, column: 3, scope: !75) +// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fe297bc49d82e879:core.Destroy.Core", scope: null, file: !3, line: 74, type: !38, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !81) +// CHECK:STDOUT: !81 = !{!82} +// CHECK:STDOUT: !82 = !DILocalVariable(arg: 1, scope: !80, type: !25) +// CHECK:STDOUT: !83 = !DILocation(line: 74, column: 10, scope: !80) +// CHECK:STDOUT: !84 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.07d7f3268607f0bc", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !85) +// CHECK:STDOUT: !85 = !{!86} +// CHECK:STDOUT: !86 = !DILocalVariable(arg: 1, scope: !84, type: !7) +// CHECK:STDOUT: !87 = !DILocation(line: 18, column: 3, scope: !84) +// CHECK:STDOUT: !88 = !DILocation(line: 18, column: 14, scope: !84) +// CHECK:STDOUT: !89 = !DILocation(line: 19, column: 10, scope: !84) +// CHECK:STDOUT: !90 = !DILocation(line: 19, column: 3, scope: !84) +// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.f2c09195b9db5815", scope: null, file: !3, line: 17, type: !23, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !92) +// CHECK:STDOUT: !92 = !{!93} +// CHECK:STDOUT: !93 = !DILocalVariable(arg: 1, scope: !91, type: !25) +// CHECK:STDOUT: !94 = !DILocation(line: 18, column: 3, scope: !91) +// CHECK:STDOUT: !95 = !DILocation(line: 18, column: 14, scope: !91) +// CHECK:STDOUT: !96 = !DILocation(line: 19, column: 10, scope: !91) +// CHECK:STDOUT: !97 = !DILocation(line: 19, column: 3, scope: !91) +// CHECK:STDOUT: !98 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.94af6b585cb77bfd", scope: null, file: !3, line: 17, type: !48, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !99 = !DILocation(line: 18, column: 3, scope: !98) +// CHECK:STDOUT: !100 = !DILocation(line: 18, column: 14, scope: !98) +// CHECK:STDOUT: !101 = !DILocation(line: 19, column: 10, scope: !98) +// CHECK:STDOUT: !102 = !DILocation(line: 19, column: 3, scope: !98) +// CHECK:STDOUT: !103 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.4381e7f8def4ed9d", scope: null, file: !3, line: 17, type: !23, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !104) +// CHECK:STDOUT: !104 = !{!105} +// CHECK:STDOUT: !105 = !DILocalVariable(arg: 1, scope: !103, type: !25) +// CHECK:STDOUT: !106 = !DILocation(line: 18, column: 3, scope: !103) +// CHECK:STDOUT: !107 = !DILocation(line: 18, column: 14, scope: !103) +// CHECK:STDOUT: !108 = !DILocation(line: 19, column: 10, scope: !103) +// CHECK:STDOUT: !109 = !DILocation(line: 19, column: 3, scope: !103) +// CHECK:STDOUT: !110 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.389b355d0ba7c2d7", scope: null, file: !3, line: 17, type: !23, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !111) +// CHECK:STDOUT: !111 = !{!112} +// CHECK:STDOUT: !112 = !DILocalVariable(arg: 1, scope: !110, type: !25) +// CHECK:STDOUT: !113 = !DILocation(line: 18, column: 3, scope: !110) +// CHECK:STDOUT: !114 = !DILocation(line: 18, column: 14, scope: !110) +// CHECK:STDOUT: !115 = !DILocation(line: 19, column: 10, scope: !110) +// CHECK:STDOUT: !116 = !DILocation(line: 19, column: 3, scope: !110) diff --git a/toolchain/lower/testdata/impl/impl.carbon b/toolchain/lower/testdata/impl/impl.carbon index 788eb7815a3b..0d51feb88a84 100644 --- a/toolchain/lower/testdata/impl/impl.carbon +++ b/toolchain/lower/testdata/impl/impl.carbon @@ -153,9 +153,23 @@ impl C(B) as I { // CHECK:STDOUT: call void @"_CF.C.Main:I.96947bccc1c5e61b.Main"(ptr %a.var, ptr %x), !dbg !23 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b.var), !dbg !22 // CHECK:STDOUT: call void @"_CF.C.Main:I.707dbe5ae2414d29.Main"(ptr %b.var, ptr %y), !dbg !24 +// CHECK:STDOUT: call void @"_COp.301c2cde953858ec:core.Destroy.Core"(ptr %b.var), !dbg !22 +// CHECK:STDOUT: call void @"_COp.1afa5e4ee26f3f8f:core.Destroy.Core"(ptr %a.var), !dbg !21 // CHECK:STDOUT: ret void, !dbg !25 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.301c2cde953858ec:core.Destroy.Core"(ptr %self) #0 !dbg !26 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !31 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.1afa5e4ee26f3f8f:core.Destroy.Core"(ptr %self) #0 !dbg !32 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !35 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree 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: @@ -199,6 +213,16 @@ impl C(B) as I { // CHECK:STDOUT: !23 = !DILocation(line: 21, column: 21, scope: !15) // CHECK:STDOUT: !24 = !DILocation(line: 22, column: 21, scope: !15) // CHECK:STDOUT: !25 = !DILocation(line: 20, column: 1, scope: !15) +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.301c2cde953858ec:core.Destroy.Core", scope: null, file: !3, line: 22, type: !27, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !29) +// CHECK:STDOUT: !27 = !DISubroutineType(types: !28) +// CHECK:STDOUT: !28 = !{null, !7} +// CHECK:STDOUT: !29 = !{!30} +// CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !26, type: !7) +// CHECK:STDOUT: !31 = !DILocation(line: 22, column: 3, scope: !26) +// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "Op", linkageName: "_COp.1afa5e4ee26f3f8f:core.Destroy.Core", scope: null, file: !3, line: 21, type: !27, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !33) +// CHECK:STDOUT: !33 = !{!34} +// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !32, type: !7) +// CHECK:STDOUT: !35 = !DILocation(line: 21, column: 3, scope: !32) // CHECK:STDOUT: ; ModuleID = 'generic_class_impls.carbon' // CHECK:STDOUT: source_filename = "generic_class_impls.carbon" // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/impl/import_facet.carbon b/toolchain/lower/testdata/impl/import_facet.carbon index 50252cde058a..e2e72f430ecb 100644 --- a/toolchain/lower/testdata/impl/import_facet.carbon +++ b/toolchain/lower/testdata/impl/import_facet.carbon @@ -94,25 +94,32 @@ fn F(d: D(i32)) -> i32* { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc5_21.1.temp), !dbg !10 // CHECK:STDOUT: call void @"_CGetI.D.eb057aa32837c84e.Main:I.Main.b88d1103f417c6d4"(ptr %.loc5_21.1.temp, ptr %d), !dbg !10 // CHECK:STDOUT: %C.GetC.call = call ptr @_CGetC.C.Main.541f3e0ecf5901d3(ptr %.loc5_21.1.temp), !dbg !10 +// CHECK:STDOUT: call void @"_COp.82ecdab79d079066:core.Destroy.Core"(ptr %.loc5_21.1.temp), !dbg !10 // CHECK:STDOUT: ret ptr %C.GetC.call, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.82ecdab79d079066:core.Destroy.Core"(ptr %self) #0 !dbg !12 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !17 +// 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.b88d1103f417c6d4"(ptr sret({}) %return, ptr %self) #0 !dbg !12 { -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @C.val.23a.anon, i64 0, i1 false), !dbg !16 -// CHECK:STDOUT: ret void, !dbg !16 +// CHECK:STDOUT: define linkonce_odr void @"_CGetI.D.eb057aa32837c84e.Main:I.Main.b88d1103f417c6d4"(ptr sret({}) %return, ptr %self) #0 !dbg !18 { +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @C.val.23a.anon, i64 0, i1 false), !dbg !22 +// CHECK:STDOUT: ret void, !dbg !22 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CGetC.C.Main.541f3e0ecf5901d3(ptr %self) #0 !dbg !17 { -// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !21 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !21 -// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !21 -// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !22 -// CHECK:STDOUT: ret ptr %2, !dbg !23 +// CHECK:STDOUT: define linkonce_odr ptr @_CGetC.C.Main.541f3e0ecf5901d3(ptr %self) #0 !dbg !23 { +// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !27 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !27 +// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !27 +// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !28 +// CHECK:STDOUT: ret ptr %2, !dbg !29 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) @@ -137,15 +144,21 @@ fn F(d: D(i32)) -> i32* { // CHECK:STDOUT: !9 = !DILocalVariable(arg: 1, scope: !4, type: !7) // CHECK:STDOUT: !10 = !DILocation(line: 5, column: 10, scope: !4) // CHECK:STDOUT: !11 = !DILocation(line: 5, column: 3, scope: !4) -// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "GetI", linkageName: "_CGetI.D.eb057aa32837c84e.Main:I.Main.b88d1103f417c6d4", scope: null, file: !13, line: 6, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !14) -// CHECK:STDOUT: !13 = !DIFile(filename: "c.carbon", directory: "") -// CHECK:STDOUT: !14 = !{!15} -// CHECK:STDOUT: !15 = !DILocalVariable(arg: 1, scope: !12, type: !7) -// CHECK:STDOUT: !16 = !DILocation(line: 7, column: 7, scope: !12) -// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "GetC", linkageName: "_CGetC.C.Main.541f3e0ecf5901d3", scope: null, file: !18, line: 4, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !19) -// CHECK:STDOUT: !18 = !DIFile(filename: "a.carbon", directory: "") -// CHECK:STDOUT: !19 = !{!20} -// CHECK:STDOUT: !20 = !DILocalVariable(arg: 1, scope: !17, type: !7) -// CHECK:STDOUT: !21 = !DILocation(line: 5, column: 5, scope: !17) -// CHECK:STDOUT: !22 = !DILocation(line: 6, column: 12, scope: !17) -// CHECK:STDOUT: !23 = !DILocation(line: 6, column: 5, scope: !17) +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Op", linkageName: "_COp.82ecdab79d079066:core.Destroy.Core", scope: null, file: !3, line: 5, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !15) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null, !7} +// CHECK:STDOUT: !15 = !{!16} +// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !12, type: !7) +// CHECK:STDOUT: !17 = !DILocation(line: 5, column: 10, scope: !12) +// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "GetI", linkageName: "_CGetI.D.eb057aa32837c84e.Main:I.Main.b88d1103f417c6d4", scope: null, file: !19, line: 6, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !20) +// CHECK:STDOUT: !19 = !DIFile(filename: "c.carbon", directory: "") +// CHECK:STDOUT: !20 = !{!21} +// CHECK:STDOUT: !21 = !DILocalVariable(arg: 1, scope: !18, type: !7) +// CHECK:STDOUT: !22 = !DILocation(line: 7, column: 7, scope: !18) +// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "GetC", linkageName: "_CGetC.C.Main.541f3e0ecf5901d3", scope: null, file: !24, line: 4, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !25) +// CHECK:STDOUT: !24 = !DIFile(filename: "a.carbon", directory: "") +// CHECK:STDOUT: !25 = !{!26} +// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !23, type: !7) +// CHECK:STDOUT: !27 = !DILocation(line: 5, column: 5, scope: !23) +// CHECK:STDOUT: !28 = !DILocation(line: 6, column: 12, scope: !23) +// CHECK:STDOUT: !29 = !DILocation(line: 6, column: 5, scope: !23) diff --git a/toolchain/lower/testdata/impl/import_thunk.carbon b/toolchain/lower/testdata/impl/import_thunk.carbon index 9b88bed33adf..4469e120cea2 100644 --- a/toolchain/lower/testdata/impl/import_thunk.carbon +++ b/toolchain/lower/testdata/impl/import_thunk.carbon @@ -109,13 +109,34 @@ fn Test(a: A) -> C { // CHECK:STDOUT: call void @"_CConvert.A.Main:ImplicitAs.707dbe5ae2414d29.Core"(ptr %.loc16_9.1.temp, ptr %a), !dbg !29 // CHECK:STDOUT: call void @"_CF.61ea2aba74ab3bf1:I.Main"(ptr %.loc20_19.1.temp, ptr %.loc16_9.1.temp), !dbg !28 // CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.0c4ab795cec6cb27.Core"(ptr %return, ptr %.loc20_19.1.temp), !dbg !28 +// CHECK:STDOUT: call void @"_COp.301c2cde953858ec:core.Destroy.Core"(ptr %.loc20_19.1.temp), !dbg !28 +// CHECK:STDOUT: call void @"_COp.301c2cde953858ec:core.Destroy.Core"(ptr %.loc16_9.1.temp), !dbg !29 // CHECK:STDOUT: ret void, !dbg !28 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !30 { +// 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.3d608d0372c8fc08:core.Destroy.Core"(ptr %self) #0 !dbg !37 { +// 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.301c2cde953858ec:core.Destroy.Core"(ptr %self) #0 !dbg !43 { +// CHECK:STDOUT: entry: +// 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)) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @"_COp.301c2cde953858ec:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -155,6 +176,23 @@ fn Test(a: A) -> C { // CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !25, type: !7) // CHECK:STDOUT: !28 = !DILocation(line: 20, column: 3, scope: !25) // CHECK:STDOUT: !29 = !DILocation(line: 16, column: 8, scope: !25) +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 20, type: !31, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !34) +// CHECK:STDOUT: !31 = !DISubroutineType(types: !32) +// CHECK:STDOUT: !32 = !{null, !33} +// CHECK:STDOUT: !33 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !34 = !{!35} +// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !30, type: !33) +// CHECK:STDOUT: !36 = !DILocation(line: 20, column: 3, scope: !30) +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.3d608d0372c8fc08:core.Destroy.Core", scope: null, file: !3, line: 20, type: !38, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !40) +// CHECK:STDOUT: !38 = !DISubroutineType(types: !39) +// CHECK:STDOUT: !39 = !{null, !7} +// CHECK:STDOUT: !40 = !{!41} +// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !37, type: !7) +// CHECK:STDOUT: !42 = !DILocation(line: 20, column: 3, scope: !37) +// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "Op", linkageName: "_COp.301c2cde953858ec:core.Destroy.Core", scope: null, file: !3, line: 20, type: !38, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !44) +// CHECK:STDOUT: !44 = !{!45} +// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !43, type: !7) +// CHECK:STDOUT: !46 = !DILocation(line: 20, column: 3, scope: !43) // CHECK:STDOUT: ; ModuleID = 'call_thunk.carbon' // CHECK:STDOUT: source_filename = "call_thunk.carbon" // CHECK:STDOUT: @@ -170,6 +208,8 @@ fn Test(a: A) -> C { // CHECK:STDOUT: call void @"_CConvert.A.Main:ImplicitAs.707dbe5ae2414d29.Core"(ptr %.loc7_19.1.temp, ptr %a), !dbg !11 // CHECK:STDOUT: call void @"_CF.61ea2aba74ab3bf1:I.Main"(ptr %.loc7_20.2.temp, ptr %.loc7_19.1.temp), !dbg !10 // CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.0c4ab795cec6cb27.Core"(ptr %return, ptr %.loc7_20.2.temp), !dbg !12 +// CHECK:STDOUT: call void @"_COp.301c2cde953858ec:core.Destroy.Core"(ptr %.loc7_20.2.temp), !dbg !10 +// CHECK:STDOUT: call void @"_COp.301c2cde953858ec:core.Destroy.Core"(ptr %.loc7_19.1.temp), !dbg !11 // CHECK:STDOUT: ret void, !dbg !12 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -181,10 +221,29 @@ fn Test(a: A) -> C { // CHECK:STDOUT: // CHECK:STDOUT: declare void @"_CConvert.B.Main:ImplicitAs.0c4ab795cec6cb27.Core"(ptr sret({ i32 }), ptr) // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.69f7902aa585f246:core.Destroy.Core"(ptr %self) #0 !dbg !13 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.1d5de97c772422d7:core.Destroy.Core"(ptr %self) #0 !dbg !20 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !25 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.301c2cde953858ec:core.Destroy.Core"(ptr %self) #0 !dbg !26 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !29 +// 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.301c2cde953858ec:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 2, 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -206,6 +265,23 @@ fn Test(a: A) -> C { // CHECK:STDOUT: !10 = !DILocation(line: 7, column: 10, scope: !4) // CHECK:STDOUT: !11 = !DILocation(line: 7, column: 19, scope: !4) // CHECK:STDOUT: !12 = !DILocation(line: 7, column: 3, scope: !4) +// CHECK:STDOUT: !13 = distinct !DISubprogram(name: "Op", linkageName: "_COp.69f7902aa585f246:core.Destroy.Core", scope: null, file: !3, line: 7, type: !14, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !17) +// CHECK:STDOUT: !14 = !DISubroutineType(types: !15) +// CHECK:STDOUT: !15 = !{null, !16} +// CHECK:STDOUT: !16 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !17 = !{!18} +// CHECK:STDOUT: !18 = !DILocalVariable(arg: 1, scope: !13, type: !16) +// CHECK:STDOUT: !19 = !DILocation(line: 7, column: 10, scope: !13) +// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "Op", linkageName: "_COp.1d5de97c772422d7:core.Destroy.Core", scope: null, file: !3, line: 7, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !23) +// CHECK:STDOUT: !21 = !DISubroutineType(types: !22) +// CHECK:STDOUT: !22 = !{null, !7} +// CHECK:STDOUT: !23 = !{!24} +// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !20, type: !7) +// CHECK:STDOUT: !25 = !DILocation(line: 7, column: 10, scope: !20) +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.301c2cde953858ec:core.Destroy.Core", scope: null, file: !3, line: 7, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !27) +// CHECK:STDOUT: !27 = !{!28} +// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !26, type: !7) +// CHECK:STDOUT: !29 = !DILocation(line: 7, column: 10, scope: !26) // CHECK:STDOUT: ; ModuleID = 'thunk_for_imported_interface.carbon' // CHECK:STDOUT: source_filename = "thunk_for_imported_interface.carbon" // CHECK:STDOUT: @@ -229,6 +305,8 @@ fn Test(a: A) -> C { // CHECK:STDOUT: call void @"_CConvert.A.Main:ImplicitAs.707dbe5ae2414d29.Core"(ptr %.2.temp, ptr %a), !dbg !17 // CHECK:STDOUT: call void @"_CF.X.Main:I.Main"(ptr %.loc9_19.1.temp, ptr %.2.temp), !dbg !16 // CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.0c4ab795cec6cb27.Core"(ptr %return, ptr %.loc9_19.1.temp), !dbg !16 +// CHECK:STDOUT: call void @"_COp.301c2cde953858ec:core.Destroy.Core"(ptr %.loc9_19.1.temp), !dbg !16 +// CHECK:STDOUT: call void @"_COp.301c2cde953858ec:core.Destroy.Core"(ptr %.2.temp), !dbg !17 // CHECK:STDOUT: ret void, !dbg !16 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -236,10 +314,29 @@ fn Test(a: A) -> C { // CHECK:STDOUT: // CHECK:STDOUT: declare void @"_CConvert.B.Main:ImplicitAs.0c4ab795cec6cb27.Core"(ptr sret({ i32 }), ptr) // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.69f7902aa585f246:core.Destroy.Core"(ptr %self) #0 !dbg !18 { +// 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.1d5de97c772422d7:core.Destroy.Core"(ptr %self) #0 !dbg !25 { +// 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.301c2cde953858ec:core.Destroy.Core"(ptr %self) #0 !dbg !31 { +// 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) // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @"_COp.301c2cde953858ec:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -267,6 +364,23 @@ fn Test(a: A) -> C { // CHECK:STDOUT: !15 = !DILocalVariable(arg: 1, scope: !13, type: !7) // CHECK:STDOUT: !16 = !DILocation(line: 9, column: 3, scope: !13) // CHECK:STDOUT: !17 = !DILocation(line: 4294967295, scope: !13) +// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "Op", linkageName: "_COp.69f7902aa585f246:core.Destroy.Core", scope: null, file: !3, line: 9, type: !19, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !22) +// CHECK:STDOUT: !19 = !DISubroutineType(types: !20) +// CHECK:STDOUT: !20 = !{null, !21} +// CHECK:STDOUT: !21 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !22 = !{!23} +// CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !18, type: !21) +// CHECK:STDOUT: !24 = !DILocation(line: 9, column: 3, scope: !18) +// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "Op", linkageName: "_COp.1d5de97c772422d7:core.Destroy.Core", scope: null, file: !3, line: 9, type: !26, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !28) +// CHECK:STDOUT: !26 = !DISubroutineType(types: !27) +// CHECK:STDOUT: !27 = !{null, !7} +// CHECK:STDOUT: !28 = !{!29} +// CHECK:STDOUT: !29 = !DILocalVariable(arg: 1, scope: !25, type: !7) +// CHECK:STDOUT: !30 = !DILocation(line: 9, column: 3, scope: !25) +// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "Op", linkageName: "_COp.301c2cde953858ec:core.Destroy.Core", scope: null, file: !3, line: 9, type: !26, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !32) +// CHECK:STDOUT: !32 = !{!33} +// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !31, type: !7) +// CHECK:STDOUT: !34 = !DILocation(line: 9, column: 3, scope: !31) // CHECK:STDOUT: ; ModuleID = 'call_thunk_for_imported_interface.carbon' // CHECK:STDOUT: source_filename = "call_thunk_for_imported_interface.carbon" // CHECK:STDOUT: @@ -282,6 +396,8 @@ fn Test(a: A) -> C { // CHECK:STDOUT: call void @"_CConvert.A.Main:ImplicitAs.707dbe5ae2414d29.Core"(ptr %.loc8_18.1.temp, ptr %a), !dbg !11 // CHECK:STDOUT: call void @"_CF.X.Main:I.Main"(ptr %.loc8_19.2.temp, ptr %.loc8_18.1.temp), !dbg !10 // CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.0c4ab795cec6cb27.Core"(ptr %return, ptr %.loc8_19.2.temp), !dbg !12 +// CHECK:STDOUT: call void @"_COp.301c2cde953858ec:core.Destroy.Core"(ptr %.loc8_19.2.temp), !dbg !10 +// CHECK:STDOUT: call void @"_COp.301c2cde953858ec:core.Destroy.Core"(ptr %.loc8_18.1.temp), !dbg !11 // CHECK:STDOUT: ret void, !dbg !12 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -293,10 +409,29 @@ fn Test(a: A) -> C { // CHECK:STDOUT: // CHECK:STDOUT: declare void @"_CConvert.B.Main:ImplicitAs.0c4ab795cec6cb27.Core"(ptr sret({ i32 }), ptr) // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.69f7902aa585f246:core.Destroy.Core"(ptr %self) #0 !dbg !13 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.1d5de97c772422d7:core.Destroy.Core"(ptr %self) #0 !dbg !20 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !25 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.301c2cde953858ec:core.Destroy.Core"(ptr %self) #0 !dbg !26 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !29 +// 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.301c2cde953858ec:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 2, 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -318,3 +453,20 @@ fn Test(a: A) -> C { // CHECK:STDOUT: !10 = !DILocation(line: 8, column: 10, scope: !4) // CHECK:STDOUT: !11 = !DILocation(line: 8, column: 18, scope: !4) // CHECK:STDOUT: !12 = !DILocation(line: 8, column: 3, scope: !4) +// CHECK:STDOUT: !13 = distinct !DISubprogram(name: "Op", linkageName: "_COp.69f7902aa585f246:core.Destroy.Core", scope: null, file: !3, line: 8, type: !14, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !17) +// CHECK:STDOUT: !14 = !DISubroutineType(types: !15) +// CHECK:STDOUT: !15 = !{null, !16} +// CHECK:STDOUT: !16 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !17 = !{!18} +// CHECK:STDOUT: !18 = !DILocalVariable(arg: 1, scope: !13, type: !16) +// CHECK:STDOUT: !19 = !DILocation(line: 8, column: 10, scope: !13) +// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "Op", linkageName: "_COp.1d5de97c772422d7:core.Destroy.Core", scope: null, file: !3, line: 8, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !23) +// CHECK:STDOUT: !21 = !DISubroutineType(types: !22) +// CHECK:STDOUT: !22 = !{null, !7} +// CHECK:STDOUT: !23 = !{!24} +// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !20, type: !7) +// CHECK:STDOUT: !25 = !DILocation(line: 8, column: 10, scope: !20) +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.301c2cde953858ec:core.Destroy.Core", scope: null, file: !3, line: 8, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !27) +// CHECK:STDOUT: !27 = !{!28} +// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !26, type: !7) +// CHECK:STDOUT: !29 = !DILocation(line: 8, column: 10, scope: !26) diff --git a/toolchain/lower/testdata/impl/thunk.carbon b/toolchain/lower/testdata/impl/thunk.carbon index 0325f59466b2..63eada751a61 100644 --- a/toolchain/lower/testdata/impl/thunk.carbon +++ b/toolchain/lower/testdata/impl/thunk.carbon @@ -113,28 +113,51 @@ fn CallCallGeneric(c: C(()), b: B) -> A { // CHECK:STDOUT: call void @"_CConvert.A.Main:ImplicitAs.707dbe5ae2414d29.Core"(ptr %.loc16_9.1.temp, ptr %a), !dbg !29 // CHECK:STDOUT: call void @"_CF.61ea2aba74ab3bf1:I.Main"(ptr %.loc20_19.1.temp, ptr %.loc16_9.1.temp), !dbg !28 // CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.0c4ab795cec6cb27.Core"(ptr %return, ptr %.loc20_19.1.temp), !dbg !28 +// CHECK:STDOUT: call void @"_COp.301c2cde953858ec:core.Destroy.Core"(ptr %.loc20_19.1.temp), !dbg !28 +// CHECK:STDOUT: call void @"_COp.301c2cde953858ec:core.Destroy.Core"(ptr %.loc16_9.1.temp), !dbg !29 // CHECK:STDOUT: ret void, !dbg !28 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CTest.Main(ptr sret({ i32 }) %return, ptr %a) #0 !dbg !30 { +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !30 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc24_20.1.temp = alloca { i32 }, align 8, !dbg !33 -// CHECK:STDOUT: %.loc24_20.2.temp = alloca { i32 }, align 8, !dbg !33 -// CHECK:STDOUT: %.loc24_19.1.temp = alloca { i32 }, align 8, !dbg !34 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_20.1.temp), !dbg !33 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_20.2.temp), !dbg !33 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_19.1.temp), !dbg !34 -// CHECK:STDOUT: call void @"_CConvert.A.Main:ImplicitAs.707dbe5ae2414d29.Core"(ptr %.loc24_19.1.temp, ptr %a), !dbg !34 -// CHECK:STDOUT: call void @"_CF.61ea2aba74ab3bf1:I.Main"(ptr %.loc24_20.2.temp, ptr %.loc24_19.1.temp), !dbg !33 -// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.0c4ab795cec6cb27.Core"(ptr %return, ptr %.loc24_20.2.temp), !dbg !35 -// CHECK:STDOUT: ret void, !dbg !35 +// CHECK:STDOUT: ret void, !dbg !36 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.3d608d0372c8fc08:core.Destroy.Core"(ptr %self) #0 !dbg !37 { +// 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.301c2cde953858ec:core.Destroy.Core"(ptr %self) #0 !dbg !43 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !46 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CTest.Main(ptr sret({ i32 }) %return, ptr %a) #0 !dbg !47 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc24_20.1.temp = alloca { i32 }, align 8, !dbg !50 +// CHECK:STDOUT: %.loc24_20.2.temp = alloca { i32 }, align 8, !dbg !50 +// CHECK:STDOUT: %.loc24_19.1.temp = alloca { i32 }, align 8, !dbg !51 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_20.1.temp), !dbg !50 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_20.2.temp), !dbg !50 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_19.1.temp), !dbg !51 +// CHECK:STDOUT: call void @"_CConvert.A.Main:ImplicitAs.707dbe5ae2414d29.Core"(ptr %.loc24_19.1.temp, ptr %a), !dbg !51 +// CHECK:STDOUT: call void @"_CF.61ea2aba74ab3bf1:I.Main"(ptr %.loc24_20.2.temp, ptr %.loc24_19.1.temp), !dbg !50 +// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.0c4ab795cec6cb27.Core"(ptr %return, ptr %.loc24_20.2.temp), !dbg !52 +// CHECK:STDOUT: call void @"_COp.301c2cde953858ec:core.Destroy.Core"(ptr %.loc24_20.2.temp), !dbg !50 +// CHECK:STDOUT: call void @"_COp.301c2cde953858ec:core.Destroy.Core"(ptr %.loc24_19.1.temp), !dbg !51 +// CHECK:STDOUT: ret void, !dbg !52 // 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.301c2cde953858ec: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 } @@ -174,12 +197,29 @@ fn CallCallGeneric(c: C(()), b: B) -> A { // CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !25, type: !7) // CHECK:STDOUT: !28 = !DILocation(line: 20, column: 3, scope: !25) // CHECK:STDOUT: !29 = !DILocation(line: 16, column: 8, scope: !25) -// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !3, line: 23, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !31) -// CHECK:STDOUT: !31 = !{!32} -// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !30, type: !7) -// CHECK:STDOUT: !33 = !DILocation(line: 24, column: 10, scope: !30) -// CHECK:STDOUT: !34 = !DILocation(line: 24, column: 19, scope: !30) -// CHECK:STDOUT: !35 = !DILocation(line: 24, column: 3, scope: !30) +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 20, type: !31, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !34) +// CHECK:STDOUT: !31 = !DISubroutineType(types: !32) +// CHECK:STDOUT: !32 = !{null, !33} +// CHECK:STDOUT: !33 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !34 = !{!35} +// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !30, type: !33) +// CHECK:STDOUT: !36 = !DILocation(line: 20, column: 3, scope: !30) +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.3d608d0372c8fc08:core.Destroy.Core", scope: null, file: !3, line: 20, type: !38, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !40) +// CHECK:STDOUT: !38 = !DISubroutineType(types: !39) +// CHECK:STDOUT: !39 = !{null, !7} +// CHECK:STDOUT: !40 = !{!41} +// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !37, type: !7) +// CHECK:STDOUT: !42 = !DILocation(line: 20, column: 3, scope: !37) +// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "Op", linkageName: "_COp.301c2cde953858ec:core.Destroy.Core", scope: null, file: !3, line: 20, type: !38, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !44) +// CHECK:STDOUT: !44 = !{!45} +// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !43, type: !7) +// CHECK:STDOUT: !46 = !DILocation(line: 20, column: 3, scope: !43) +// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !3, line: 23, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !48) +// CHECK:STDOUT: !48 = !{!49} +// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !47, type: !7) +// CHECK:STDOUT: !50 = !DILocation(line: 24, column: 10, scope: !47) +// CHECK:STDOUT: !51 = !DILocation(line: 24, column: 19, scope: !47) +// CHECK:STDOUT: !52 = !DILocation(line: 24, column: 3, scope: !47) // CHECK:STDOUT: ; ModuleID = 'generic_thunk.carbon' // CHECK:STDOUT: source_filename = "generic_thunk.carbon" // CHECK:STDOUT: @@ -194,28 +234,43 @@ fn CallCallGeneric(c: C(()), b: B) -> A { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCall.Main(ptr sret({}) %return, ptr %c, ptr %b) #0 !dbg !11 { +// CHECK:STDOUT: define weak_odr void @"_COp.301c2cde953858ec:core.Destroy.Core"(ptr %self) #0 !dbg !11 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc22_23.1.temp = alloca {}, align 8, !dbg !17 -// CHECK:STDOUT: %.loc22_23.3.temp = alloca {}, align 8, !dbg !17 -// CHECK:STDOUT: %.loc22_23.7.temp = alloca {}, align 8, !dbg !17 -// CHECK:STDOUT: %.loc22_22.1.temp = alloca {}, align 8, !dbg !18 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc22_23.1.temp), !dbg !17 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc22_23.3.temp), !dbg !17 -// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.96947bccc1c5e61b.Core"(ptr %.loc22_23.3.temp, ptr %b), !dbg !17 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc22_23.7.temp), !dbg !17 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc22_22.1.temp), !dbg !18 -// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.96947bccc1c5e61b.Core"(ptr %.loc22_22.1.temp, ptr %b), !dbg !18 -// CHECK:STDOUT: call void @"_CF.C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f"(ptr %.loc22_23.7.temp, ptr %c, ptr %.loc22_22.1.temp), !dbg !17 -// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.96947bccc1c5e61b.Core"(ptr %return, ptr %.loc22_23.7.temp), !dbg !19 -// CHECK:STDOUT: ret void, !dbg !19 +// CHECK:STDOUT: ret void, !dbg !16 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCallCallGeneric.Main(ptr sret({}) %return, ptr %c, ptr %b) #0 !dbg !20 { +// CHECK:STDOUT: define weak_odr void @"_COp.1afa5e4ee26f3f8f:core.Destroy.Core"(ptr %self) #0 !dbg !17 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CCallGeneric.Main.0bac38e8a17f7a1f(ptr %return, ptr %c, ptr %b), !dbg !24 -// CHECK:STDOUT: ret void, !dbg !25 +// CHECK:STDOUT: ret void, !dbg !20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CCall.Main(ptr sret({}) %return, ptr %c, ptr %b) #0 !dbg !21 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc22_23.1.temp = alloca {}, align 8, !dbg !27 +// CHECK:STDOUT: %.loc22_23.3.temp = alloca {}, align 8, !dbg !27 +// CHECK:STDOUT: %.loc22_23.7.temp = alloca {}, align 8, !dbg !27 +// CHECK:STDOUT: %.loc22_22.1.temp = alloca {}, align 8, !dbg !28 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc22_23.1.temp), !dbg !27 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc22_23.3.temp), !dbg !27 +// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.96947bccc1c5e61b.Core"(ptr %.loc22_23.3.temp, ptr %b), !dbg !27 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc22_23.7.temp), !dbg !27 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc22_22.1.temp), !dbg !28 +// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.96947bccc1c5e61b.Core"(ptr %.loc22_22.1.temp, ptr %b), !dbg !28 +// CHECK:STDOUT: call void @"_CF.C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f"(ptr %.loc22_23.7.temp, ptr %c, ptr %.loc22_22.1.temp), !dbg !27 +// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.96947bccc1c5e61b.Core"(ptr %return, ptr %.loc22_23.7.temp), !dbg !29 +// CHECK:STDOUT: call void @"_COp.301c2cde953858ec:core.Destroy.Core"(ptr %.loc22_23.7.temp), !dbg !27 +// CHECK:STDOUT: call void @"_COp.1afa5e4ee26f3f8f:core.Destroy.Core"(ptr %.loc22_22.1.temp), !dbg !28 +// CHECK:STDOUT: call void @"_COp.1afa5e4ee26f3f8f:core.Destroy.Core"(ptr %.loc22_23.3.temp), !dbg !27 +// CHECK:STDOUT: ret void, !dbg !29 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CCallCallGeneric.Main(ptr sret({}) %return, ptr %c, ptr %b) #0 !dbg !30 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_CCallGeneric.Main.0bac38e8a17f7a1f(ptr %return, ptr %c, ptr %b), !dbg !34 +// CHECK:STDOUT: ret void, !dbg !35 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) @@ -225,33 +280,36 @@ fn CallCallGeneric(c: C(()), b: B) -> A { // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2 // 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 !26 { +// CHECK:STDOUT: define linkonce_odr void @"_CF.C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f"(ptr sret({}) %return, ptr %self, ptr %_) #0 !dbg !36 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @B.val.loc18_49, i64 0, i1 false), !dbg !30 -// CHECK:STDOUT: ret void, !dbg !30 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @B.val.loc18_49, i64 0, i1 false), !dbg !40 +// CHECK:STDOUT: ret void, !dbg !40 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CCallGeneric.Main.0bac38e8a17f7a1f(ptr sret({}) %return, ptr %c, ptr %b) #0 !dbg !31 { +// CHECK:STDOUT: define linkonce_odr void @_CCallGeneric.Main.0bac38e8a17f7a1f(ptr sret({}) %return, ptr %c, ptr %b) #0 !dbg !41 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_CF:thunk.C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f"(ptr %return, ptr %c, ptr %b), !dbg !35 -// CHECK:STDOUT: ret void, !dbg !36 +// CHECK:STDOUT: call void @"_CF:thunk.C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f"(ptr %return, ptr %c, ptr %b), !dbg !45 +// CHECK:STDOUT: ret void, !dbg !46 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CF:thunk.C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f"(ptr sret({}) %return, ptr %self, ptr %x) #3 !dbg !37 { +// CHECK:STDOUT: define linkonce_odr void @"_CF:thunk.C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f"(ptr sret({}) %return, ptr %self, ptr %x) #3 !dbg !47 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc18_38.2.temp = alloca {}, align 8, !dbg !41 -// CHECK:STDOUT: %.loc18_38.6.temp = alloca {}, align 8, !dbg !41 -// CHECK:STDOUT: %.loc12_21.1.temp = alloca {}, align 8, !dbg !42 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_38.2.temp), !dbg !41 -// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.96947bccc1c5e61b.Core"(ptr %.loc18_38.2.temp, ptr %x), !dbg !41 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_38.6.temp), !dbg !41 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_21.1.temp), !dbg !42 -// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.96947bccc1c5e61b.Core"(ptr %.loc12_21.1.temp, ptr %x), !dbg !42 -// CHECK:STDOUT: call void @"_CF.C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f"(ptr %.loc18_38.6.temp, ptr %self, ptr %.loc12_21.1.temp), !dbg !41 -// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.96947bccc1c5e61b.Core"(ptr %return, ptr %.loc18_38.6.temp), !dbg !41 -// CHECK:STDOUT: ret void, !dbg !41 +// CHECK:STDOUT: %.loc18_38.2.temp = alloca {}, align 8, !dbg !51 +// CHECK:STDOUT: %.loc18_38.6.temp = alloca {}, align 8, !dbg !51 +// CHECK:STDOUT: %.loc12_21.1.temp = alloca {}, align 8, !dbg !52 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_38.2.temp), !dbg !51 +// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.96947bccc1c5e61b.Core"(ptr %.loc18_38.2.temp, ptr %x), !dbg !51 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_38.6.temp), !dbg !51 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_21.1.temp), !dbg !52 +// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.96947bccc1c5e61b.Core"(ptr %.loc12_21.1.temp, ptr %x), !dbg !52 +// CHECK:STDOUT: call void @"_CF.C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f"(ptr %.loc18_38.6.temp, ptr %self, ptr %.loc12_21.1.temp), !dbg !51 +// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.96947bccc1c5e61b.Core"(ptr %return, ptr %.loc18_38.6.temp), !dbg !51 +// CHECK:STDOUT: call void @"_COp.301c2cde953858ec:core.Destroy.Core"(ptr %.loc18_38.6.temp), !dbg !51 +// CHECK:STDOUT: call void @"_COp.1afa5e4ee26f3f8f:core.Destroy.Core"(ptr %.loc12_21.1.temp), !dbg !52 +// CHECK:STDOUT: call void @"_COp.1afa5e4ee26f3f8f:core.Destroy.Core"(ptr %.loc18_38.2.temp), !dbg !51 +// CHECK:STDOUT: ret void, !dbg !51 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -276,35 +334,45 @@ fn CallCallGeneric(c: C(()), b: B) -> A { // CHECK:STDOUT: !8 = !{!9} // CHECK:STDOUT: !9 = !DILocalVariable(arg: 1, scope: !4, type: !7) // CHECK:STDOUT: !10 = !DILocation(line: 7, column: 44, scope: !4) -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !3, line: 21, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !14) +// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Op", linkageName: "_COp.301c2cde953858ec:core.Destroy.Core", scope: null, file: !3, line: 18, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !14) // CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{!7, !7, !7} -// CHECK:STDOUT: !14 = !{!15, !16} +// CHECK:STDOUT: !13 = !{null, !7} +// CHECK:STDOUT: !14 = !{!15} // CHECK:STDOUT: !15 = !DILocalVariable(arg: 1, scope: !11, type: !7) -// CHECK:STDOUT: !16 = !DILocalVariable(arg: 2, scope: !11, type: !7) -// CHECK:STDOUT: !17 = !DILocation(line: 22, column: 10, scope: !11) -// CHECK:STDOUT: !18 = !DILocation(line: 22, column: 22, scope: !11) -// CHECK:STDOUT: !19 = !DILocation(line: 22, column: 3, scope: !11) -// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "CallCallGeneric", linkageName: "_CCallCallGeneric.Main", scope: null, file: !3, line: 29, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !21) -// CHECK:STDOUT: !21 = !{!22, !23} -// CHECK:STDOUT: !22 = !DILocalVariable(arg: 1, scope: !20, type: !7) -// CHECK:STDOUT: !23 = !DILocalVariable(arg: 2, scope: !20, type: !7) -// CHECK:STDOUT: !24 = !DILocation(line: 30, column: 10, scope: !20) -// CHECK:STDOUT: !25 = !DILocation(line: 30, column: 3, scope: !20) -// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "F", linkageName: "_CF.C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f", scope: null, file: !3, line: 18, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !27) -// CHECK:STDOUT: !27 = !{!28, !29} -// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !26, type: !7) -// CHECK:STDOUT: !29 = !DILocalVariable(arg: 2, scope: !26, type: !7) -// CHECK:STDOUT: !30 = !DILocation(line: 18, column: 40, scope: !26) -// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "CallGeneric", linkageName: "_CCallGeneric.Main.0bac38e8a17f7a1f", scope: null, file: !3, line: 25, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !32) -// CHECK:STDOUT: !32 = !{!33, !34} -// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !31, type: !7) -// CHECK:STDOUT: !34 = !DILocalVariable(arg: 2, scope: !31, type: !7) -// CHECK:STDOUT: !35 = !DILocation(line: 26, column: 10, scope: !31) -// CHECK:STDOUT: !36 = !DILocation(line: 26, column: 3, scope: !31) -// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "F", linkageName: "_CF:thunk.C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f", scope: null, file: !3, line: 18, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !38) -// CHECK:STDOUT: !38 = !{!39, !40} -// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !37, type: !7) -// CHECK:STDOUT: !40 = !DILocalVariable(arg: 2, scope: !37, type: !7) -// CHECK:STDOUT: !41 = !DILocation(line: 18, column: 3, scope: !37) -// CHECK:STDOUT: !42 = !DILocation(line: 12, column: 20, scope: !37) +// CHECK:STDOUT: !16 = !DILocation(line: 18, column: 3, scope: !11) +// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "Op", linkageName: "_COp.1afa5e4ee26f3f8f:core.Destroy.Core", scope: null, file: !3, line: 12, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !18) +// CHECK:STDOUT: !18 = !{!19} +// CHECK:STDOUT: !19 = !DILocalVariable(arg: 1, scope: !17, type: !7) +// CHECK:STDOUT: !20 = !DILocation(line: 12, column: 20, scope: !17) +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !3, line: 21, type: !22, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !24) +// CHECK:STDOUT: !22 = !DISubroutineType(types: !23) +// CHECK:STDOUT: !23 = !{!7, !7, !7} +// CHECK:STDOUT: !24 = !{!25, !26} +// CHECK:STDOUT: !25 = !DILocalVariable(arg: 1, scope: !21, type: !7) +// CHECK:STDOUT: !26 = !DILocalVariable(arg: 2, scope: !21, type: !7) +// CHECK:STDOUT: !27 = !DILocation(line: 22, column: 10, scope: !21) +// CHECK:STDOUT: !28 = !DILocation(line: 22, column: 22, scope: !21) +// CHECK:STDOUT: !29 = !DILocation(line: 22, column: 3, scope: !21) +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "CallCallGeneric", linkageName: "_CCallCallGeneric.Main", scope: null, file: !3, line: 29, type: !22, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !31) +// CHECK:STDOUT: !31 = !{!32, !33} +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !30, type: !7) +// CHECK:STDOUT: !33 = !DILocalVariable(arg: 2, scope: !30, type: !7) +// CHECK:STDOUT: !34 = !DILocation(line: 30, column: 10, scope: !30) +// CHECK:STDOUT: !35 = !DILocation(line: 30, column: 3, scope: !30) +// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "F", linkageName: "_CF.C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f", scope: null, file: !3, line: 18, type: !22, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !37) +// CHECK:STDOUT: !37 = !{!38, !39} +// CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !36, type: !7) +// CHECK:STDOUT: !39 = !DILocalVariable(arg: 2, scope: !36, type: !7) +// CHECK:STDOUT: !40 = !DILocation(line: 18, column: 40, scope: !36) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "CallGeneric", linkageName: "_CCallGeneric.Main.0bac38e8a17f7a1f", scope: null, file: !3, line: 25, type: !22, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !42) +// CHECK:STDOUT: !42 = !{!43, !44} +// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !41, type: !7) +// CHECK:STDOUT: !44 = !DILocalVariable(arg: 2, scope: !41, type: !7) +// CHECK:STDOUT: !45 = !DILocation(line: 26, column: 10, scope: !41) +// CHECK:STDOUT: !46 = !DILocation(line: 26, column: 3, scope: !41) +// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "F", linkageName: "_CF:thunk.C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f", scope: null, file: !3, line: 18, type: !22, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !48) +// CHECK:STDOUT: !48 = !{!49, !50} +// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !47, type: !7) +// CHECK:STDOUT: !50 = !DILocalVariable(arg: 2, scope: !47, type: !7) +// CHECK:STDOUT: !51 = !DILocation(line: 18, column: 3, scope: !47) +// CHECK:STDOUT: !52 = !DILocation(line: 12, column: 20, scope: !47) diff --git a/toolchain/lower/testdata/index/array_element_access.carbon b/toolchain/lower/testdata/index/array_element_access.carbon index 5c8cb21d158b..8441ef97cedb 100644 --- a/toolchain/lower/testdata/index/array_element_access.carbon +++ b/toolchain/lower/testdata/index/array_element_access.carbon @@ -77,9 +77,33 @@ fn Run() { // CHECK:STDOUT: %.loc20_21.1.array.index = getelementptr inbounds [2 x i32], ptr %.loc20_18.1.temp, i32 0, i32 1, !dbg !21 // CHECK:STDOUT: %.loc20_21.2 = load i32, ptr %.loc20_21.1.array.index, align 4, !dbg !21 // CHECK:STDOUT: store i32 %.loc20_21.2, ptr %_.var.loc20, align 4, !dbg !20 +// CHECK:STDOUT: call void @"_COp.f53f00a5f9e218d2:core.Destroy.Core"(ptr %.loc20_18.1.temp), !dbg !21 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %_.var.loc20), !dbg !20 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %_.var.loc19), !dbg !19 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %b.var), !dbg !18 +// CHECK:STDOUT: call void @"_COp.8e354c83fe88ab86:core.Destroy.Core"(ptr %.loc17_28.1.temp), !dbg !17 +// CHECK:STDOUT: call void @"_COp.f53f00a5f9e218d2:core.Destroy.Core"(ptr %a.var), !dbg !16 // CHECK:STDOUT: ret void, !dbg !24 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !25 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !31 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.f53f00a5f9e218d2:core.Destroy.Core"(ptr %self) #0 !dbg !32 { +// 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.8e354c83fe88ab86:core.Destroy.Core"(ptr %self) #0 !dbg !38 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !41 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree 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: @@ -87,6 +111,8 @@ fn Run() { // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @"_COp.7e389eab4a7e5487:core.Destroy.Core", { 2, 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_COp.f53f00a5f9e218d2: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: @@ -122,3 +148,20 @@ fn Run() { // CHECK:STDOUT: !22 = !DILocation(line: 19, column: 18, scope: !13) // CHECK:STDOUT: !23 = !DILocation(line: 19, column: 16, scope: !13) // CHECK:STDOUT: !24 = !DILocation(line: 16, column: 1, scope: !13) +// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 20, type: !26, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !29) +// CHECK:STDOUT: !26 = !DISubroutineType(types: !27) +// CHECK:STDOUT: !27 = !{null, !28} +// CHECK:STDOUT: !28 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !29 = !{!30} +// CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !25, type: !28) +// CHECK:STDOUT: !31 = !DILocation(line: 20, column: 16, scope: !25) +// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f53f00a5f9e218d2:core.Destroy.Core", scope: null, file: !3, line: 20, type: !33, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !35) +// CHECK:STDOUT: !33 = !DISubroutineType(types: !34) +// CHECK:STDOUT: !34 = !{null, !7} +// CHECK:STDOUT: !35 = !{!36} +// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !32, type: !7) +// CHECK:STDOUT: !37 = !DILocation(line: 20, column: 16, scope: !32) +// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8e354c83fe88ab86:core.Destroy.Core", scope: null, file: !3, line: 17, type: !33, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !39) +// CHECK:STDOUT: !39 = !{!40} +// CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !38, type: !7) +// CHECK:STDOUT: !41 = !DILocation(line: 17, column: 26, scope: !38) diff --git a/toolchain/lower/testdata/interop/cpp/function_decl.carbon b/toolchain/lower/testdata/interop/cpp/function_decl.carbon index e64fc1afa0bd..289e647a8581 100644 --- a/toolchain/lower/testdata/interop/cpp/function_decl.carbon +++ b/toolchain/lower/testdata/interop/cpp/function_decl.carbon @@ -434,9 +434,16 @@ fn MyF() -> i32 { // CHECK:STDOUT: %SimpleReturnValue.call = call i32 @_Z17SimpleReturnValueii(i32 3, i32 4), !dbg !22 // CHECK:STDOUT: store i32 %SimpleReturnValue.call, ptr %value.var, align 4, !dbg !23 // CHECK:STDOUT: %.loc14 = load i32, ptr %value.var, align 4, !dbg !24 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %value.var), !dbg !15 // CHECK:STDOUT: ret i32 %.loc14, !dbg !25 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #2 !dbg !26 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !31 +// 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: @@ -475,3 +482,9 @@ fn MyF() -> i32 { // CHECK:STDOUT: !23 = !DILocation(line: 13, column: 3, scope: !11) // CHECK:STDOUT: !24 = !DILocation(line: 14, column: 10, scope: !11) // CHECK:STDOUT: !25 = !DILocation(line: 14, column: 3, scope: !11) +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !6, line: 11, type: !27, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !29) +// CHECK:STDOUT: !27 = !DISubroutineType(types: !28) +// CHECK:STDOUT: !28 = !{null, !14} +// CHECK:STDOUT: !29 = !{!30} +// CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !26, type: !14) +// CHECK:STDOUT: !31 = !DILocation(line: 11, column: 3, scope: !26) diff --git a/toolchain/lower/testdata/interop/cpp/import_inline.carbon b/toolchain/lower/testdata/interop/cpp/import_inline.carbon index 87532596f4cd..e834f872009e 100644 --- a/toolchain/lower/testdata/interop/cpp/import_inline.carbon +++ b/toolchain/lower/testdata/interop/cpp/import_inline.carbon @@ -47,9 +47,16 @@ fn Call() -> i32 { // CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !18 // CHECK:STDOUT: call void @_Z1FPi(ptr %n.var), !dbg !19 // CHECK:STDOUT: %.loc24 = load i32, ptr %n.var, align 4, !dbg !20 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %n.var), !dbg !18 // CHECK:STDOUT: ret i32 %.loc24, !dbg !21 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #1 !dbg !22 { +// CHECK:STDOUT: entry: +// 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)) #2 // CHECK:STDOUT: @@ -83,3 +90,9 @@ fn Call() -> i32 { // CHECK:STDOUT: !19 = !DILocation(line: 23, column: 3, scope: !14) // CHECK:STDOUT: !20 = !DILocation(line: 24, column: 10, scope: !14) // CHECK:STDOUT: !21 = !DILocation(line: 24, column: 3, scope: !14) +// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !6, line: 22, type: !23, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !25) +// CHECK:STDOUT: !23 = !DISubroutineType(types: !24) +// CHECK:STDOUT: !24 = !{null, !17} +// CHECK:STDOUT: !25 = !{!26} +// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !22, type: !17) +// CHECK:STDOUT: !27 = !DILocation(line: 22, column: 3, scope: !22) diff --git a/toolchain/lower/testdata/interop/cpp/method.carbon b/toolchain/lower/testdata/interop/cpp/method.carbon index 67f46aaefd7f..d91ee27b3107 100644 --- a/toolchain/lower/testdata/interop/cpp/method.carbon +++ b/toolchain/lower/testdata/interop/cpp/method.carbon @@ -310,13 +310,22 @@ fn Call(n: Cpp.NeedThunk) { // CHECK:STDOUT: call void @_ZNK9NeedThunk8ImplicitEa.carbon_thunk(ptr %n, ptr @int_1.30e), !dbg !26 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_14.3.temp), !dbg !25 // CHECK:STDOUT: call void @_ZNH9NeedThunk8ExplicitES_a.carbon_thunk(ptr %n, ptr @int_1.30e), !dbg !27 +// CHECK:STDOUT: call void @"_COp.43bece552030817c:core.Destroy.Core"(ptr @int_1.30e), !dbg !25 +// CHECK:STDOUT: call void @"_COp.43bece552030817c:core.Destroy.Core"(ptr @int_1.30e), !dbg !24 // CHECK:STDOUT: ret void, !dbg !28 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.43bece552030817c:core.Destroy.Core"(ptr %self) #2 !dbg !29 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !35 +// 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: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @"_COp.43bece552030817c:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } // 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" } @@ -357,3 +366,10 @@ fn Call(n: Cpp.NeedThunk) { // CHECK:STDOUT: !26 = !DILocation(line: 7, column: 3, scope: !18) // CHECK:STDOUT: !27 = !DILocation(line: 8, column: 3, scope: !18) // CHECK:STDOUT: !28 = !DILocation(line: 6, column: 1, scope: !18) +// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "Op", linkageName: "_COp.43bece552030817c:core.Destroy.Core", scope: null, file: !6, line: 8, type: !30, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !33) +// CHECK:STDOUT: !30 = !DISubroutineType(types: !31) +// CHECK:STDOUT: !31 = !{null, !32} +// CHECK:STDOUT: !32 = !DIBasicType(name: "int", size: 8, encoding: DW_ATE_signed) +// CHECK:STDOUT: !33 = !{!34} +// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !29, type: !32) +// CHECK:STDOUT: !35 = !DILocation(line: 8, column: 14, scope: !29) diff --git a/toolchain/lower/testdata/interop/cpp/nullptr.carbon b/toolchain/lower/testdata/interop/cpp/nullptr.carbon index e3137442d151..98602c087ceb 100644 --- a/toolchain/lower/testdata/interop/cpp/nullptr.carbon +++ b/toolchain/lower/testdata/interop/cpp/nullptr.carbon @@ -93,67 +93,88 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) { // CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr poison), !dbg !20 // CHECK:STDOUT: store ptr %Cpp.nullptr_t.as.Copy.impl.Op.call, ptr %.loc14_22.1.temp, align 8, !dbg !20 // CHECK:STDOUT: call void @_Z11TakeNullptrDn.carbon_thunk(ptr %.loc14_22.1.temp), !dbg !22 +// CHECK:STDOUT: call void @"_COp.705e422c84320121:core.Destroy.Core"(ptr %.loc14_22.1.temp), !dbg !20 +// CHECK:STDOUT: call void @"_COp.dc33c1983710215f:core.Destroy.Core"(ptr %.loc12_18.2.temp), !dbg !19 // CHECK:STDOUT: ret void, !dbg !23 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: declare void @"_COp.1608e268d71809e4:core.Destroy.Core"(ptr) -// CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z7TakePtrPi(ptr noundef) #1 // CHECK:STDOUT: // CHECK:STDOUT: declare ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CReturnNullptr.Main() #2 !dbg !24 { +// CHECK:STDOUT: define weak_odr void @"_COp.705e422c84320121:core.Destroy.Core"(ptr %self) #2 !dbg !24 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr poison), !dbg !28 -// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.Copy.impl.Op.call, !dbg !29 +// CHECK:STDOUT: ret void, !dbg !30 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CReturnNullptrCopy.Main() #2 !dbg !30 { +// CHECK:STDOUT: define weak_odr void @"_COp.ca2ce9262234b385:core.Destroy.Core"(ptr %self) #2 !dbg !31 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a.var = alloca ptr, align 8, !dbg !31 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !31 -// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call.loc22 = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr poison), !dbg !32 -// CHECK:STDOUT: store ptr %Cpp.nullptr_t.as.Copy.impl.Op.call.loc22, ptr %a.var, align 8, !dbg !31 -// CHECK:STDOUT: %.loc23 = load ptr, ptr %a.var, align 8, !dbg !33 -// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call.loc23 = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr %.loc23), !dbg !33 -// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.Copy.impl.Op.call.loc23, !dbg !34 +// CHECK:STDOUT: ret void, !dbg !34 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CReturnConvertedNullptrIndirectly.Main() #2 !dbg !35 { +// CHECK:STDOUT: define weak_odr void @"_COp.dc33c1983710215f:core.Destroy.Core"(ptr %self) #2 !dbg !35 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a.var = alloca ptr, align 8, !dbg !36 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !36 -// CHECK:STDOUT: call void @_Z13ReturnNullptrv.carbon_thunk(ptr %a.var), !dbg !37 -// CHECK:STDOUT: %.loc28_10 = load ptr, ptr %a.var, align 8, !dbg !38 -// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.83dbfcd16e56a769.Core.b88d1103f417c6d4"(ptr %.loc28_10), !dbg !39 -// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !39 +// CHECK:STDOUT: ret void, !dbg !38 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CReturnConvertedNullptrDirectly.Main() #2 !dbg !40 { +// CHECK:STDOUT: define ptr @_CReturnNullptr.Main() #2 !dbg !39 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc32_28.1.temp = alloca ptr, align 8, !dbg !41 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc32_28.1.temp), !dbg !41 -// CHECK:STDOUT: call void @_Z13ReturnNullptrv.carbon_thunk(ptr %.loc32_28.1.temp), !dbg !41 -// CHECK:STDOUT: %.loc32_28.4 = load ptr, ptr %.loc32_28.1.temp, align 8, !dbg !41 -// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.83dbfcd16e56a769.Core.b88d1103f417c6d4"(ptr %.loc32_28.4), !dbg !42 -// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !42 +// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr poison), !dbg !42 +// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.Copy.impl.Op.call, !dbg !43 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CConvertNullptrConstant.Main() #2 !dbg !43 { +// CHECK:STDOUT: define ptr @_CReturnNullptrCopy.Main() #2 !dbg !44 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.83dbfcd16e56a769.Core.b88d1103f417c6d4"(ptr poison), !dbg !44 -// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !44 +// CHECK:STDOUT: %a.var = alloca ptr, align 8, !dbg !45 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !45 +// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call.loc22 = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr poison), !dbg !46 +// CHECK:STDOUT: store ptr %Cpp.nullptr_t.as.Copy.impl.Op.call.loc22, ptr %a.var, align 8, !dbg !45 +// CHECK:STDOUT: %.loc23 = load ptr, ptr %a.var, align 8, !dbg !47 +// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call.loc23 = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr %.loc23), !dbg !47 +// CHECK:STDOUT: call void @"_COp.705e422c84320121:core.Destroy.Core"(ptr %a.var), !dbg !45 +// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.Copy.impl.Op.call.loc23, !dbg !48 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.83dbfcd16e56a769.Core.b88d1103f417c6d4"(ptr %self) #2 !dbg !45 { -// CHECK:STDOUT: %1 = call ptr @_CNone.Optional.Core.95809cda2a4fffc7(), !dbg !51 -// CHECK:STDOUT: ret ptr %1, !dbg !52 +// CHECK:STDOUT: define ptr @_CReturnConvertedNullptrIndirectly.Main() #2 !dbg !49 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %a.var = alloca ptr, align 8, !dbg !50 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !50 +// CHECK:STDOUT: call void @_Z13ReturnNullptrv.carbon_thunk(ptr %a.var), !dbg !51 +// CHECK:STDOUT: %.loc28_10 = load ptr, ptr %a.var, align 8, !dbg !52 +// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.83dbfcd16e56a769.Core.b88d1103f417c6d4"(ptr %.loc28_10), !dbg !53 +// CHECK:STDOUT: call void @"_COp.705e422c84320121:core.Destroy.Core"(ptr %a.var), !dbg !50 +// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !53 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define ptr @_CReturnConvertedNullptrDirectly.Main() #2 !dbg !54 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc32_28.1.temp = alloca ptr, align 8, !dbg !55 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc32_28.1.temp), !dbg !55 +// CHECK:STDOUT: call void @_Z13ReturnNullptrv.carbon_thunk(ptr %.loc32_28.1.temp), !dbg !55 +// CHECK:STDOUT: %.loc32_28.4 = load ptr, ptr %.loc32_28.1.temp, align 8, !dbg !55 +// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.83dbfcd16e56a769.Core.b88d1103f417c6d4"(ptr %.loc32_28.4), !dbg !56 +// CHECK:STDOUT: call void @"_COp.705e422c84320121:core.Destroy.Core"(ptr %.loc32_28.1.temp), !dbg !55 +// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !56 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define ptr @_CConvertNullptrConstant.Main() #2 !dbg !57 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.83dbfcd16e56a769.Core.b88d1103f417c6d4"(ptr poison), !dbg !58 +// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !58 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.83dbfcd16e56a769.Core.b88d1103f417c6d4"(ptr %self) #2 !dbg !59 { +// CHECK:STDOUT: %1 = call ptr @_CNone.Optional.Core.95809cda2a4fffc7(), !dbg !65 +// CHECK:STDOUT: ret ptr %1, !dbg !66 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -162,8 +183,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.95809cda2a4fffc7() #2 !dbg !53 { -// CHECK:STDOUT: ret ptr null, !dbg !55 +// CHECK:STDOUT: define linkonce_odr ptr @_CNone.Optional.Core.95809cda2a4fffc7() #2 !dbg !67 { +// CHECK:STDOUT: ret ptr null, !dbg !69 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -203,35 +224,49 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) { // CHECK:STDOUT: !21 = !DILocation(line: 12, column: 3, scope: !16) // CHECK:STDOUT: !22 = !DILocation(line: 14, column: 3, scope: !16) // CHECK:STDOUT: !23 = !DILocation(line: 11, column: 1, scope: !16) -// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "ReturnNullptr", linkageName: "_CReturnNullptr.Main", scope: null, file: !6, line: 17, type: !25, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "Op", linkageName: "_COp.705e422c84320121:core.Destroy.Core", scope: null, file: !6, line: 14, type: !25, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !28) // CHECK:STDOUT: !25 = !DISubroutineType(types: !26) -// CHECK:STDOUT: !26 = !{!27} +// CHECK:STDOUT: !26 = !{null, !27} // CHECK:STDOUT: !27 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !28 = !DILocation(line: 18, column: 10, scope: !24) -// CHECK:STDOUT: !29 = !DILocation(line: 18, column: 3, scope: !24) -// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "ReturnNullptrCopy", linkageName: "_CReturnNullptrCopy.Main", scope: null, file: !6, line: 21, type: !25, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !31 = !DILocation(line: 22, column: 3, scope: !30) -// CHECK:STDOUT: !32 = !DILocation(line: 22, column: 26, scope: !30) -// CHECK:STDOUT: !33 = !DILocation(line: 23, column: 10, scope: !30) -// CHECK:STDOUT: !34 = !DILocation(line: 23, column: 3, scope: !30) -// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "ReturnConvertedNullptrIndirectly", linkageName: "_CReturnConvertedNullptrIndirectly.Main", scope: null, file: !6, line: 26, type: !25, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !36 = !DILocation(line: 27, column: 3, scope: !35) -// CHECK:STDOUT: !37 = !DILocation(line: 27, column: 26, scope: !35) -// CHECK:STDOUT: !38 = !DILocation(line: 28, column: 10, scope: !35) -// CHECK:STDOUT: !39 = !DILocation(line: 28, column: 3, scope: !35) -// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "ReturnConvertedNullptrDirectly", linkageName: "_CReturnConvertedNullptrDirectly.Main", scope: null, file: !6, line: 31, type: !25, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !41 = !DILocation(line: 32, column: 10, scope: !40) -// CHECK:STDOUT: !42 = !DILocation(line: 32, column: 3, scope: !40) -// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "ConvertNullptrConstant", linkageName: "_CConvertNullptrConstant.Main", scope: null, file: !6, line: 35, type: !25, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !44 = !DILocation(line: 36, column: 3, scope: !43) -// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.NullptrT.CppCompat.Core:ImplicitAs.83dbfcd16e56a769.Core.b88d1103f417c6d4", scope: null, file: !46, line: 51, type: !47, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !49) -// CHECK:STDOUT: !46 = !DIFile(filename: "{{.*}}/prelude/types/cpp/nullptr.carbon", directory: "") -// CHECK:STDOUT: !47 = !DISubroutineType(types: !48) -// CHECK:STDOUT: !48 = !{!27, !27} -// CHECK:STDOUT: !49 = !{!50} -// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !45, type: !27) -// CHECK:STDOUT: !51 = !DILocation(line: 52, column: 14, scope: !45) -// CHECK:STDOUT: !52 = !DILocation(line: 52, column: 7, scope: !45) -// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.95809cda2a4fffc7", scope: null, file: !54, line: 27, type: !25, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !54 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !55 = !DILocation(line: 28, column: 5, scope: !53) +// CHECK:STDOUT: !28 = !{!29} +// CHECK:STDOUT: !29 = !DILocalVariable(arg: 1, scope: !24, type: !27) +// CHECK:STDOUT: !30 = !DILocation(line: 14, column: 19, scope: !24) +// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "Op", linkageName: "_COp.ca2ce9262234b385:core.Destroy.Core", scope: null, file: !6, line: 12, type: !25, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !32) +// CHECK:STDOUT: !32 = !{!33} +// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !31, type: !27) +// CHECK:STDOUT: !34 = !DILocation(line: 12, column: 15, scope: !31) +// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "Op", linkageName: "_COp.dc33c1983710215f:core.Destroy.Core", scope: null, file: !6, line: 12, type: !25, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !36) +// CHECK:STDOUT: !36 = !{!37} +// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !35, type: !27) +// CHECK:STDOUT: !38 = !DILocation(line: 12, column: 15, scope: !35) +// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "ReturnNullptr", linkageName: "_CReturnNullptr.Main", scope: null, file: !6, line: 17, type: !40, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !40 = !DISubroutineType(types: !41) +// CHECK:STDOUT: !41 = !{!27} +// CHECK:STDOUT: !42 = !DILocation(line: 18, column: 10, scope: !39) +// CHECK:STDOUT: !43 = !DILocation(line: 18, column: 3, scope: !39) +// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "ReturnNullptrCopy", linkageName: "_CReturnNullptrCopy.Main", scope: null, file: !6, line: 21, type: !40, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !45 = !DILocation(line: 22, column: 3, scope: !44) +// CHECK:STDOUT: !46 = !DILocation(line: 22, column: 26, scope: !44) +// CHECK:STDOUT: !47 = !DILocation(line: 23, column: 10, scope: !44) +// CHECK:STDOUT: !48 = !DILocation(line: 23, column: 3, scope: !44) +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "ReturnConvertedNullptrIndirectly", linkageName: "_CReturnConvertedNullptrIndirectly.Main", scope: null, file: !6, line: 26, type: !40, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !50 = !DILocation(line: 27, column: 3, scope: !49) +// CHECK:STDOUT: !51 = !DILocation(line: 27, column: 26, scope: !49) +// CHECK:STDOUT: !52 = !DILocation(line: 28, column: 10, scope: !49) +// CHECK:STDOUT: !53 = !DILocation(line: 28, column: 3, scope: !49) +// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "ReturnConvertedNullptrDirectly", linkageName: "_CReturnConvertedNullptrDirectly.Main", scope: null, file: !6, line: 31, type: !40, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !55 = !DILocation(line: 32, column: 10, scope: !54) +// CHECK:STDOUT: !56 = !DILocation(line: 32, column: 3, scope: !54) +// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "ConvertNullptrConstant", linkageName: "_CConvertNullptrConstant.Main", scope: null, file: !6, line: 35, type: !40, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !58 = !DILocation(line: 36, column: 3, scope: !57) +// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.NullptrT.CppCompat.Core:ImplicitAs.83dbfcd16e56a769.Core.b88d1103f417c6d4", scope: null, file: !60, line: 51, type: !61, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !63) +// CHECK:STDOUT: !60 = !DIFile(filename: "{{.*}}/prelude/types/cpp/nullptr.carbon", directory: "") +// CHECK:STDOUT: !61 = !DISubroutineType(types: !62) +// CHECK:STDOUT: !62 = !{!27, !27} +// CHECK:STDOUT: !63 = !{!64} +// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !59, type: !27) +// CHECK:STDOUT: !65 = !DILocation(line: 52, column: 14, scope: !59) +// CHECK:STDOUT: !66 = !DILocation(line: 52, column: 7, scope: !59) +// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.95809cda2a4fffc7", scope: null, file: !68, line: 27, type: !40, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !68 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !69 = !DILocation(line: 28, column: 5, scope: !67) diff --git a/toolchain/lower/testdata/interop/cpp/parameters.carbon b/toolchain/lower/testdata/interop/cpp/parameters.carbon index a36f06517327..2694ea67dd1a 100644 --- a/toolchain/lower/testdata/interop/cpp/parameters.carbon +++ b/toolchain/lower/testdata/interop/cpp/parameters.carbon @@ -192,44 +192,76 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_21.3.temp), !dbg !26 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_24.3.temp), !dbg !27 // CHECK:STDOUT: call void @_Z13pass_unsignedhtjm.carbon_thunk(ptr @int_1.e80, ptr @int_2.fb2, i32 3, i64 4), !dbg !29 +// CHECK:STDOUT: call void @"_COp.ecaf8c3e76291eee:core.Destroy.Core"(ptr @int_2.fb2), !dbg !27 +// CHECK:STDOUT: call void @"_COp.3de38e83520d6bec:core.Destroy.Core"(ptr @int_1.e80), !dbg !26 +// CHECK:STDOUT: call void @"_COp.406738f1b62008ed:core.Destroy.Core"(ptr @int_2.305), !dbg !25 +// CHECK:STDOUT: call void @"_COp.43bece552030817c:core.Destroy.Core"(ptr @int_1.30e), !dbg !24 // CHECK:STDOUT: ret void, !dbg !30 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.ecaf8c3e76291eee:core.Destroy.Core"(ptr %self) #2 !dbg !31 { +// 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.3de38e83520d6bec:core.Destroy.Core"(ptr %self) #2 !dbg !38 { +// 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.406738f1b62008ed:core.Destroy.Core"(ptr %self) #2 !dbg !45 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !51 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.43bece552030817c:core.Destroy.Core"(ptr %self) #2 !dbg !52 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !58 +// 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) #2 !dbg !31 { +// CHECK:STDOUT: define void @_CPassShort.Main(i16 %a, ptr %b) #2 !dbg !59 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc17_18.1.temp = alloca i16, align 2, !dbg !39 -// CHECK:STDOUT: %.loc18_18.3.temp = alloca i16, align 2, !dbg !40 -// CHECK:STDOUT: %.loc19_18.2.temp = alloca i16, align 2, !dbg !41 -// CHECK:STDOUT: %.loc20_28.3.temp = alloca i16, align 2, !dbg !42 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_18.1.temp), !dbg !39 -// CHECK:STDOUT: store i16 %a, ptr %.loc17_18.1.temp, align 2, !dbg !39 -// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk(ptr %.loc17_18.1.temp), !dbg !43 -// CHECK:STDOUT: %.loc18_18.2 = load i16, ptr %b, align 2, !dbg !40 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_18.3.temp), !dbg !40 -// CHECK:STDOUT: store i16 %.loc18_18.2, ptr %.loc18_18.3.temp, align 2, !dbg !40 -// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk(ptr %.loc18_18.3.temp), !dbg !44 -// CHECK:STDOUT: %.loc19_18.1 = load i16, ptr @_Cc.Main, align 2, !dbg !41 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_18.2.temp), !dbg !41 -// CHECK:STDOUT: store i16 %.loc19_18.1, ptr %.loc19_18.2.temp, align 2, !dbg !41 -// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk(ptr %.loc19_18.2.temp), !dbg !45 -// CHECK:STDOUT: %MakeShort.call = call i16 @_CMakeShort.Main(), !dbg !42 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_28.3.temp), !dbg !42 -// CHECK:STDOUT: store i16 %MakeShort.call, ptr %.loc20_28.3.temp, align 2, !dbg !42 -// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk(ptr %.loc20_28.3.temp), !dbg !46 -// CHECK:STDOUT: ret void, !dbg !47 +// CHECK:STDOUT: %.loc17_18.1.temp = alloca i16, align 2, !dbg !66 +// CHECK:STDOUT: %.loc18_18.3.temp = alloca i16, align 2, !dbg !67 +// CHECK:STDOUT: %.loc19_18.2.temp = alloca i16, align 2, !dbg !68 +// CHECK:STDOUT: %.loc20_28.3.temp = alloca i16, align 2, !dbg !69 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_18.1.temp), !dbg !66 +// CHECK:STDOUT: store i16 %a, ptr %.loc17_18.1.temp, align 2, !dbg !66 +// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk(ptr %.loc17_18.1.temp), !dbg !70 +// CHECK:STDOUT: %.loc18_18.2 = load i16, ptr %b, align 2, !dbg !67 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_18.3.temp), !dbg !67 +// CHECK:STDOUT: store i16 %.loc18_18.2, ptr %.loc18_18.3.temp, align 2, !dbg !67 +// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk(ptr %.loc18_18.3.temp), !dbg !71 +// CHECK:STDOUT: %.loc19_18.1 = load i16, ptr @_Cc.Main, align 2, !dbg !68 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_18.2.temp), !dbg !68 +// CHECK:STDOUT: store i16 %.loc19_18.1, ptr %.loc19_18.2.temp, align 2, !dbg !68 +// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk(ptr %.loc19_18.2.temp), !dbg !72 +// CHECK:STDOUT: %MakeShort.call = call i16 @_CMakeShort.Main(), !dbg !69 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_28.3.temp), !dbg !69 +// CHECK:STDOUT: store i16 %MakeShort.call, ptr %.loc20_28.3.temp, align 2, !dbg !69 +// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk(ptr %.loc20_28.3.temp), !dbg !73 +// CHECK:STDOUT: call void @"_COp.406738f1b62008ed:core.Destroy.Core"(ptr %.loc20_28.3.temp), !dbg !69 +// CHECK:STDOUT: call void @"_COp.406738f1b62008ed:core.Destroy.Core"(ptr %.loc19_18.2.temp), !dbg !68 +// CHECK:STDOUT: call void @"_COp.406738f1b62008ed:core.Destroy.Core"(ptr %.loc18_18.3.temp), !dbg !67 +// CHECK:STDOUT: call void @"_COp.406738f1b62008ed:core.Destroy.Core"(ptr %.loc17_18.1.temp), !dbg !66 +// CHECK:STDOUT: ret void, !dbg !74 // 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() #2 !dbg !48 { +// CHECK:STDOUT: define internal void @_C__global_init.Main() #2 !dbg !75 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: store i16 poison, ptr @_Cc.Main, align 2, !dbg !49 -// CHECK:STDOUT: ret void, !dbg !50 +// CHECK:STDOUT: store i16 poison, ptr @_Cc.Main, align 2, !dbg !76 +// CHECK:STDOUT: ret void, !dbg !77 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -275,26 +307,53 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: !28 = !DILocation(line: 7, column: 3, scope: !21) // CHECK:STDOUT: !29 = !DILocation(line: 9, column: 3, scope: !21) // CHECK:STDOUT: !30 = !DILocation(line: 6, column: 1, scope: !21) -// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "PassShort", linkageName: "_CPassShort.Main", scope: null, file: !6, line: 16, type: !32, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !36) +// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "Op", linkageName: "_COp.ecaf8c3e76291eee:core.Destroy.Core", scope: null, file: !6, line: 9, type: !32, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !35) // CHECK:STDOUT: !32 = !DISubroutineType(types: !33) -// CHECK:STDOUT: !33 = !{null, !34, !35} -// CHECK:STDOUT: !34 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed) -// CHECK:STDOUT: !35 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !36 = !{!37, !38} -// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !31, type: !34) -// CHECK:STDOUT: !38 = !DILocalVariable(arg: 2, scope: !31, type: !35) -// CHECK:STDOUT: !39 = !DILocation(line: 17, column: 18, scope: !31) -// CHECK:STDOUT: !40 = !DILocation(line: 18, column: 18, scope: !31) -// CHECK:STDOUT: !41 = !DILocation(line: 19, column: 18, scope: !31) -// CHECK:STDOUT: !42 = !DILocation(line: 20, column: 18, scope: !31) -// CHECK:STDOUT: !43 = !DILocation(line: 17, column: 3, scope: !31) -// CHECK:STDOUT: !44 = !DILocation(line: 18, column: 3, scope: !31) -// CHECK:STDOUT: !45 = !DILocation(line: 19, column: 3, scope: !31) -// CHECK:STDOUT: !46 = !DILocation(line: 20, column: 3, scope: !31) -// CHECK:STDOUT: !47 = !DILocation(line: 16, column: 1, scope: !31) -// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !6, type: !22, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !49 = !DILocation(line: 14, column: 1, scope: !48) -// CHECK:STDOUT: !50 = !DILocation(line: 0, scope: !48) +// CHECK:STDOUT: !33 = !{null, !34} +// CHECK:STDOUT: !34 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_unsigned) +// CHECK:STDOUT: !35 = !{!36} +// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !31, type: !34) +// CHECK:STDOUT: !37 = !DILocation(line: 9, column: 24, scope: !31) +// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Op", linkageName: "_COp.3de38e83520d6bec:core.Destroy.Core", scope: null, file: !6, line: 9, type: !39, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !42) +// CHECK:STDOUT: !39 = !DISubroutineType(types: !40) +// CHECK:STDOUT: !40 = !{null, !41} +// CHECK:STDOUT: !41 = !DIBasicType(name: "int", size: 8, encoding: DW_ATE_unsigned) +// CHECK:STDOUT: !42 = !{!43} +// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !38, type: !41) +// CHECK:STDOUT: !44 = !DILocation(line: 9, column: 21, scope: !38) +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Op", linkageName: "_COp.406738f1b62008ed:core.Destroy.Core", scope: null, file: !6, line: 7, type: !46, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !49) +// CHECK:STDOUT: !46 = !DISubroutineType(types: !47) +// CHECK:STDOUT: !47 = !{null, !48} +// CHECK:STDOUT: !48 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed) +// CHECK:STDOUT: !49 = !{!50} +// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !45, type: !48) +// CHECK:STDOUT: !51 = !DILocation(line: 7, column: 22, scope: !45) +// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "Op", linkageName: "_COp.43bece552030817c:core.Destroy.Core", scope: null, file: !6, line: 7, type: !53, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !56) +// CHECK:STDOUT: !53 = !DISubroutineType(types: !54) +// CHECK:STDOUT: !54 = !{null, !55} +// CHECK:STDOUT: !55 = !DIBasicType(name: "int", size: 8, encoding: DW_ATE_signed) +// CHECK:STDOUT: !56 = !{!57} +// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !52, type: !55) +// CHECK:STDOUT: !58 = !DILocation(line: 7, column: 19, scope: !52) +// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "PassShort", linkageName: "_CPassShort.Main", scope: null, file: !6, line: 16, type: !60, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !63) +// CHECK:STDOUT: !60 = !DISubroutineType(types: !61) +// CHECK:STDOUT: !61 = !{null, !48, !62} +// CHECK:STDOUT: !62 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !63 = !{!64, !65} +// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !59, type: !48) +// CHECK:STDOUT: !65 = !DILocalVariable(arg: 2, scope: !59, type: !62) +// CHECK:STDOUT: !66 = !DILocation(line: 17, column: 18, scope: !59) +// CHECK:STDOUT: !67 = !DILocation(line: 18, column: 18, scope: !59) +// CHECK:STDOUT: !68 = !DILocation(line: 19, column: 18, scope: !59) +// CHECK:STDOUT: !69 = !DILocation(line: 20, column: 18, scope: !59) +// CHECK:STDOUT: !70 = !DILocation(line: 17, column: 3, scope: !59) +// CHECK:STDOUT: !71 = !DILocation(line: 18, column: 3, scope: !59) +// CHECK:STDOUT: !72 = !DILocation(line: 19, column: 3, scope: !59) +// CHECK:STDOUT: !73 = !DILocation(line: 20, column: 3, scope: !59) +// CHECK:STDOUT: !74 = !DILocation(line: 16, column: 1, scope: !59) +// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !6, type: !22, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !76 = !DILocation(line: 14, column: 1, scope: !75) +// CHECK:STDOUT: !77 = !DILocation(line: 0, scope: !75) // CHECK:STDOUT: ; ModuleID = 'import_struct.carbon' // CHECK:STDOUT: source_filename = "import_struct.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" diff --git a/toolchain/lower/testdata/interop/cpp/pointer.carbon b/toolchain/lower/testdata/interop/cpp/pointer.carbon index 21b9d1f22a07..4ed85fc8a170 100644 --- a/toolchain/lower/testdata/interop/cpp/pointer.carbon +++ b/toolchain/lower/testdata/interop/cpp/pointer.carbon @@ -232,74 +232,89 @@ fn ReturnPtrWithThunk() -> Core.Optional(Cpp.C*) { // CHECK:STDOUT: store ptr %U.binding.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc22_15.2.temp, align 8, !dbg !24 // CHECK:STDOUT: %.loc22_15.4 = load ptr, ptr %.loc22_15.2.temp, align 8, !dbg !24 // CHECK:STDOUT: call void @_Z7TakePtrP1C(ptr %.loc22_15.4), !dbg !25 +// CHECK:STDOUT: call void @"_COp.b17d31fafee11ec0:core.Destroy.Core"(ptr %.loc22_15.2.temp), !dbg !24 // CHECK:STDOUT: ret void, !dbg !26 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z7TakePtrP1C(ptr noundef) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CReturnPtr.Main() #2 !dbg !27 { +// CHECK:STDOUT: define weak_odr void @"_COp.52ae03024b07a1ce:core.Destroy.Core"(ptr %self) #2 !dbg !27 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %ReturnPtr.call = call ptr @_Z9ReturnPtrv(), !dbg !30 -// CHECK:STDOUT: ret ptr %ReturnPtr.call, !dbg !31 +// CHECK:STDOUT: ret void, !dbg !30 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.b17d31fafee11ec0:core.Destroy.Core"(ptr %self) #2 !dbg !31 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !34 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define ptr @_CReturnPtr.Main() #2 !dbg !35 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %ReturnPtr.call = call ptr @_Z9ReturnPtrv(), !dbg !38 +// CHECK:STDOUT: ret ptr %ReturnPtr.call, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare noundef ptr @_Z9ReturnPtrv() #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassPtrWithThunk.Main(ptr %_) #2 !dbg !32 { +// CHECK:STDOUT: define void @_CPassPtrWithThunk.Main(ptr %_) #2 !dbg !40 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !35 +// CHECK:STDOUT: ret void, !dbg !43 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassNonnullPtrWithThunk.Main(ptr %p) #2 !dbg !36 { +// CHECK:STDOUT: define void @_CPassNonnullPtrWithThunk.Main(ptr %p) #2 !dbg !44 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc35_24.2.temp = alloca ptr, align 8, !dbg !39 -// CHECK:STDOUT: %U.binding.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.e76fd6d2be138e4a"(ptr %p), !dbg !39 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc35_24.2.temp), !dbg !39 -// CHECK:STDOUT: store ptr %U.binding.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc35_24.2.temp, align 8, !dbg !39 -// CHECK:STDOUT: %.loc35_24.4 = load ptr, ptr %.loc35_24.2.temp, align 8, !dbg !39 -// CHECK:STDOUT: call void @_Z16TakePtrWithThunkP1Ci.carbon_thunk1(ptr %.loc35_24.4), !dbg !40 -// CHECK:STDOUT: ret void, !dbg !41 +// CHECK:STDOUT: %.loc35_24.2.temp = alloca ptr, align 8, !dbg !47 +// CHECK:STDOUT: %U.binding.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.e76fd6d2be138e4a"(ptr %p), !dbg !47 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc35_24.2.temp), !dbg !47 +// CHECK:STDOUT: store ptr %U.binding.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc35_24.2.temp, align 8, !dbg !47 +// CHECK:STDOUT: %.loc35_24.4 = load ptr, ptr %.loc35_24.2.temp, align 8, !dbg !47 +// CHECK:STDOUT: call void @_Z16TakePtrWithThunkP1Ci.carbon_thunk1(ptr %.loc35_24.4), !dbg !48 +// CHECK:STDOUT: call void @"_COp.b17d31fafee11ec0:core.Destroy.Core"(ptr %.loc35_24.2.temp), !dbg !47 +// CHECK:STDOUT: ret void, !dbg !49 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CReturnPtrWithThunk.Main() #2 !dbg !42 { +// CHECK:STDOUT: define ptr @_CReturnPtrWithThunk.Main() #2 !dbg !50 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %ReturnPtrWithThunk__carbon_thunk.call = call ptr @_Z18ReturnPtrWithThunki.carbon_thunk0(), !dbg !43 -// CHECK:STDOUT: ret ptr %ReturnPtrWithThunk__carbon_thunk.call, !dbg !44 +// CHECK:STDOUT: %ReturnPtrWithThunk__carbon_thunk.call = call ptr @_Z18ReturnPtrWithThunki.carbon_thunk0(), !dbg !51 +// CHECK:STDOUT: ret ptr %ReturnPtrWithThunk__carbon_thunk.call, !dbg !52 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.e76fd6d2be138e4a"(ptr %self) #2 !dbg !45 { -// CHECK:STDOUT: %1 = call ptr @"_CConvert.90961d7b1ce4f089:OptionalAs.0e326e799dad0c64.Core.8f431b36581f9e63"(ptr %self), !dbg !51 -// CHECK:STDOUT: ret ptr %1, !dbg !52 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.e76fd6d2be138e4a"(ptr %self) #2 !dbg !53 { +// CHECK:STDOUT: %1 = call ptr @"_CConvert.90961d7b1ce4f089:OptionalAs.0e326e799dad0c64.Core.8f431b36581f9e63"(ptr %self), !dbg !59 +// CHECK:STDOUT: ret ptr %1, !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: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.90961d7b1ce4f089:OptionalAs.0e326e799dad0c64.Core.8f431b36581f9e63"(ptr %self) #2 !dbg !53 { -// CHECK:STDOUT: %1 = call ptr @_CSome.Optional.Core.8f431b36581f9e63(ptr %self), !dbg !56 -// CHECK:STDOUT: ret ptr %1, !dbg !57 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.90961d7b1ce4f089:OptionalAs.0e326e799dad0c64.Core.8f431b36581f9e63"(ptr %self) #2 !dbg !61 { +// CHECK:STDOUT: %1 = call ptr @_CSome.Optional.Core.8f431b36581f9e63(ptr %self), !dbg !64 +// CHECK:STDOUT: ret ptr %1, !dbg !65 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.8f431b36581f9e63(ptr %value) #2 !dbg !58 { -// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.f53db17714b9f655"(ptr %value), !dbg !61 -// CHECK:STDOUT: ret ptr %1, !dbg !62 +// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.8f431b36581f9e63(ptr %value) #2 !dbg !66 { +// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.f53db17714b9f655"(ptr %value), !dbg !69 +// CHECK:STDOUT: ret ptr %1, !dbg !70 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.f53db17714b9f655"(ptr %self) #2 !dbg !63 { -// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !66 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !66 -// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !66 -// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !67 -// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !68 -// CHECK:STDOUT: ret ptr %2, !dbg !69 +// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.f53db17714b9f655"(ptr %self) #2 !dbg !71 { +// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !74 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !74 +// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !74 +// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !75 +// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !76 +// CHECK:STDOUT: call void @"_COp.52ae03024b07a1ce:core.Destroy.Core"(ptr %1), !dbg !74 +// CHECK:STDOUT: ret ptr %2, !dbg !77 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -342,46 +357,54 @@ fn ReturnPtrWithThunk() -> Core.Optional(Cpp.C*) { // CHECK:STDOUT: !24 = !DILocation(line: 22, column: 15, scope: !21) // CHECK:STDOUT: !25 = !DILocation(line: 22, column: 3, scope: !21) // CHECK:STDOUT: !26 = !DILocation(line: 19, column: 1, scope: !21) -// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "ReturnPtr", linkageName: "_CReturnPtr.Main", scope: null, file: !6, line: 25, type: !28, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !28 = !DISubroutineType(types: !29) -// CHECK:STDOUT: !29 = !{!17} -// CHECK:STDOUT: !30 = !DILocation(line: 26, column: 10, scope: !27) -// CHECK:STDOUT: !31 = !DILocation(line: 26, column: 3, scope: !27) -// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "PassPtrWithThunk", linkageName: "_CPassPtrWithThunk.Main", scope: null, file: !6, line: 29, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !33) -// CHECK:STDOUT: !33 = !{!34} -// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !32, type: !17) -// CHECK:STDOUT: !35 = !DILocation(line: 29, column: 1, scope: !32) -// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "PassNonnullPtrWithThunk", linkageName: "_CPassNonnullPtrWithThunk.Main", scope: null, file: !6, line: 34, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !37) -// CHECK:STDOUT: !37 = !{!38} -// CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !36, type: !17) -// CHECK:STDOUT: !39 = !DILocation(line: 35, column: 24, scope: !36) -// CHECK:STDOUT: !40 = !DILocation(line: 35, column: 3, scope: !36) -// CHECK:STDOUT: !41 = !DILocation(line: 34, column: 1, scope: !36) -// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "ReturnPtrWithThunk", linkageName: "_CReturnPtrWithThunk.Main", scope: null, file: !6, line: 38, type: !28, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !43 = !DILocation(line: 39, column: 10, scope: !42) -// CHECK:STDOUT: !44 = !DILocation(line: 39, column: 3, scope: !42) -// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.e76fd6d2be138e4a", scope: null, file: !46, line: 96, type: !47, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !49) -// CHECK:STDOUT: !46 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !47 = !DISubroutineType(types: !48) -// CHECK:STDOUT: !48 = !{!17, !17} -// CHECK:STDOUT: !49 = !{!50} -// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !45, type: !17) -// CHECK:STDOUT: !51 = !DILocation(line: 97, column: 12, scope: !45) -// CHECK:STDOUT: !52 = !DILocation(line: 97, column: 5, scope: !45) -// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.90961d7b1ce4f089:OptionalAs.0e326e799dad0c64.Core.8f431b36581f9e63", scope: null, file: !46, line: 71, type: !47, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !54) -// CHECK:STDOUT: !54 = !{!55} -// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !53, type: !17) -// CHECK:STDOUT: !56 = !DILocation(line: 72, column: 12, scope: !53) -// CHECK:STDOUT: !57 = !DILocation(line: 72, column: 5, scope: !53) -// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.8f431b36581f9e63", scope: null, file: !46, line: 30, type: !47, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !59) -// CHECK:STDOUT: !59 = !{!60} -// CHECK:STDOUT: !60 = !DILocalVariable(arg: 1, scope: !58, type: !17) -// CHECK:STDOUT: !61 = !DILocation(line: 31, column: 12, scope: !58) -// CHECK:STDOUT: !62 = !DILocation(line: 31, column: 5, scope: !58) -// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.f53db17714b9f655", scope: null, file: !46, line: 150, type: !47, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !64) -// CHECK:STDOUT: !64 = !{!65} -// CHECK:STDOUT: !65 = !DILocalVariable(arg: 1, scope: !63, type: !17) -// CHECK:STDOUT: !66 = !DILocation(line: 151, column: 14, scope: !63) -// CHECK:STDOUT: !67 = !DILocation(line: 153, column: 5, scope: !63) -// CHECK:STDOUT: !68 = !DILocation(line: 151, column: 18, scope: !63) -// CHECK:STDOUT: !69 = !DILocation(line: 154, column: 5, scope: !63) +// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "Op", linkageName: "_COp.52ae03024b07a1ce:core.Destroy.Core", scope: null, file: !6, line: 22, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !28) +// CHECK:STDOUT: !28 = !{!29} +// CHECK:STDOUT: !29 = !DILocalVariable(arg: 1, scope: !27, type: !17) +// CHECK:STDOUT: !30 = !DILocation(line: 22, column: 15, scope: !27) +// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b17d31fafee11ec0:core.Destroy.Core", scope: null, file: !6, line: 22, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !32) +// CHECK:STDOUT: !32 = !{!33} +// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !31, type: !17) +// CHECK:STDOUT: !34 = !DILocation(line: 22, column: 15, scope: !31) +// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "ReturnPtr", linkageName: "_CReturnPtr.Main", scope: null, file: !6, line: 25, type: !36, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !36 = !DISubroutineType(types: !37) +// CHECK:STDOUT: !37 = !{!17} +// CHECK:STDOUT: !38 = !DILocation(line: 26, column: 10, scope: !35) +// CHECK:STDOUT: !39 = !DILocation(line: 26, column: 3, scope: !35) +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "PassPtrWithThunk", linkageName: "_CPassPtrWithThunk.Main", scope: null, file: !6, line: 29, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !41) +// CHECK:STDOUT: !41 = !{!42} +// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !40, type: !17) +// CHECK:STDOUT: !43 = !DILocation(line: 29, column: 1, scope: !40) +// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "PassNonnullPtrWithThunk", linkageName: "_CPassNonnullPtrWithThunk.Main", scope: null, file: !6, line: 34, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !45) +// CHECK:STDOUT: !45 = !{!46} +// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !44, type: !17) +// CHECK:STDOUT: !47 = !DILocation(line: 35, column: 24, scope: !44) +// CHECK:STDOUT: !48 = !DILocation(line: 35, column: 3, scope: !44) +// CHECK:STDOUT: !49 = !DILocation(line: 34, column: 1, scope: !44) +// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "ReturnPtrWithThunk", linkageName: "_CReturnPtrWithThunk.Main", scope: null, file: !6, line: 38, type: !36, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !51 = !DILocation(line: 39, column: 10, scope: !50) +// CHECK:STDOUT: !52 = !DILocation(line: 39, column: 3, scope: !50) +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.e76fd6d2be138e4a", scope: null, file: !54, line: 96, type: !55, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !57) +// CHECK:STDOUT: !54 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !55 = !DISubroutineType(types: !56) +// CHECK:STDOUT: !56 = !{!17, !17} +// CHECK:STDOUT: !57 = !{!58} +// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !53, type: !17) +// CHECK:STDOUT: !59 = !DILocation(line: 97, column: 12, scope: !53) +// CHECK:STDOUT: !60 = !DILocation(line: 97, column: 5, scope: !53) +// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.90961d7b1ce4f089:OptionalAs.0e326e799dad0c64.Core.8f431b36581f9e63", scope: null, file: !54, line: 71, type: !55, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !62) +// CHECK:STDOUT: !62 = !{!63} +// CHECK:STDOUT: !63 = !DILocalVariable(arg: 1, scope: !61, type: !17) +// CHECK:STDOUT: !64 = !DILocation(line: 72, column: 12, scope: !61) +// CHECK:STDOUT: !65 = !DILocation(line: 72, column: 5, scope: !61) +// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.8f431b36581f9e63", scope: null, file: !54, line: 30, type: !55, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !67) +// CHECK:STDOUT: !67 = !{!68} +// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !66, type: !17) +// CHECK:STDOUT: !69 = !DILocation(line: 31, column: 12, scope: !66) +// CHECK:STDOUT: !70 = !DILocation(line: 31, column: 5, scope: !66) +// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.f53db17714b9f655", scope: null, file: !54, line: 150, type: !55, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !72) +// CHECK:STDOUT: !72 = !{!73} +// CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !71, type: !17) +// CHECK:STDOUT: !74 = !DILocation(line: 151, column: 14, scope: !71) +// CHECK:STDOUT: !75 = !DILocation(line: 153, column: 5, scope: !71) +// CHECK:STDOUT: !76 = !DILocation(line: 151, column: 18, scope: !71) +// CHECK:STDOUT: !77 = !DILocation(line: 154, column: 5, scope: !71) diff --git a/toolchain/lower/testdata/interop/cpp/reference.carbon b/toolchain/lower/testdata/interop/cpp/reference.carbon index 1324e490fe8b..0293df59b2c0 100644 --- a/toolchain/lower/testdata/interop/cpp/reference.carbon +++ b/toolchain/lower/testdata/interop/cpp/reference.carbon @@ -217,6 +217,9 @@ fn GetRefs() { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_23.2.temp), !dbg !23 // CHECK:STDOUT: store i32 %.loc25_23.1, ptr %.loc25_23.2.temp, align 4, !dbg !23 // CHECK:STDOUT: call void @_Z15TakeConstIntRefRKi.carbon_thunk(ptr %.loc25_23.2.temp), !dbg !29 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %.loc25_23.2.temp), !dbg !23 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr @int_42.c68), !dbg !22 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %n.var), !dbg !21 // CHECK:STDOUT: ret void, !dbg !30 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -231,16 +234,23 @@ fn GetRefs() { // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z10TakeIntRefRi(ptr noundef nonnull align 4 dereferenceable(4)) #2 // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #3 !dbg !36 { +// CHECK:STDOUT: entry: +// 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)) #5 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp.9b0a46309e124f8a:DefaultOrUnformed.Core.93349b0fe912a29b"(ptr sret({}) %return) #3 !dbg !36 { -// CHECK:STDOUT: call void @"_COp:thunk.C.Cpp"(ptr %return), !dbg !38 -// CHECK:STDOUT: ret void, !dbg !39 +// CHECK:STDOUT: define linkonce_odr void @"_COp.9b0a46309e124f8a:DefaultOrUnformed.Core.93349b0fe912a29b"(ptr sret({}) %return) #3 !dbg !43 { +// CHECK:STDOUT: call void @"_COp:thunk.C.Cpp"(ptr %return), !dbg !45 +// CHECK:STDOUT: ret void, !dbg !46 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @"_COp.7e389eab4a7e5487: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 = { 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" } @@ -290,10 +300,17 @@ fn GetRefs() { // CHECK:STDOUT: !33 = !{!34} // CHECK:STDOUT: !34 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !35 = !DILocation(line: 5, column: 7, scope: !31) -// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "Op", linkageName: "_COp.9b0a46309e124f8a:DefaultOrUnformed.Core.93349b0fe912a29b", scope: null, file: !37, line: 9, type: !32, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !37 = !DIFile(filename: "min_prelude/parts/default.carbon", directory: "") -// CHECK:STDOUT: !38 = !DILocation(line: 9, column: 28, scope: !36) -// CHECK:STDOUT: !39 = !DILocation(line: 9, column: 21, scope: !36) +// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !6, line: 25, type: !37, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !40) +// CHECK:STDOUT: !37 = !DISubroutineType(types: !38) +// CHECK:STDOUT: !38 = !{null, !39} +// CHECK:STDOUT: !39 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !40 = !{!41} +// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !36, type: !39) +// CHECK:STDOUT: !42 = !DILocation(line: 25, column: 23, scope: !36) +// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "Op", linkageName: "_COp.9b0a46309e124f8a:DefaultOrUnformed.Core.93349b0fe912a29b", scope: null, file: !44, line: 9, type: !32, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !44 = !DIFile(filename: "min_prelude/parts/default.carbon", directory: "") +// CHECK:STDOUT: !45 = !DILocation(line: 9, column: 28, scope: !43) +// CHECK:STDOUT: !46 = !DILocation(line: 9, column: 21, scope: !43) // CHECK:STDOUT: ; ModuleID = 'pass_references_via_thunk.carbon' // CHECK:STDOUT: source_filename = "pass_references_via_thunk.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" @@ -415,6 +432,9 @@ fn GetRefs() { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc26_23.2.temp), !dbg !25 // CHECK:STDOUT: store i32 %.loc26_23.1, ptr %.loc26_23.2.temp, align 4, !dbg !25 // CHECK:STDOUT: call void @_Z15TakeConstIntRefRKi10ForceThunk.carbon_thunk1(ptr %.loc26_23.2.temp), !dbg !31 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %.loc26_23.2.temp), !dbg !25 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr @int_42.c68), !dbg !24 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %n.var), !dbg !23 // CHECK:STDOUT: ret void, !dbg !32 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -425,16 +445,23 @@ fn GetRefs() { // CHECK:STDOUT: ret void, !dbg !37 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #3 !dbg !38 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !44 +// 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)) #5 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp.9b0a46309e124f8a:DefaultOrUnformed.Core.93349b0fe912a29b"(ptr sret({}) %return) #3 !dbg !38 { -// CHECK:STDOUT: call void @"_COp:thunk.C.Cpp"(ptr %return), !dbg !40 -// CHECK:STDOUT: ret void, !dbg !41 +// CHECK:STDOUT: define linkonce_odr void @"_COp.9b0a46309e124f8a:DefaultOrUnformed.Core.93349b0fe912a29b"(ptr sret({}) %return) #3 !dbg !45 { +// CHECK:STDOUT: call void @"_COp:thunk.C.Cpp"(ptr %return), !dbg !47 +// CHECK:STDOUT: ret void, !dbg !48 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @"_COp.7e389eab4a7e5487: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 = { 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" } @@ -486,10 +513,17 @@ fn GetRefs() { // CHECK:STDOUT: !35 = !{!36} // CHECK:STDOUT: !36 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !37 = !DILocation(line: 5, column: 7, scope: !33) -// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Op", linkageName: "_COp.9b0a46309e124f8a:DefaultOrUnformed.Core.93349b0fe912a29b", scope: null, file: !39, line: 9, type: !34, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !39 = !DIFile(filename: "min_prelude/parts/default.carbon", directory: "") -// CHECK:STDOUT: !40 = !DILocation(line: 9, column: 28, scope: !38) -// CHECK:STDOUT: !41 = !DILocation(line: 9, column: 21, scope: !38) +// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !6, line: 26, type: !39, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !42) +// CHECK:STDOUT: !39 = !DISubroutineType(types: !40) +// CHECK:STDOUT: !40 = !{null, !41} +// CHECK:STDOUT: !41 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !42 = !{!43} +// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !38, type: !41) +// CHECK:STDOUT: !44 = !DILocation(line: 26, column: 23, scope: !38) +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Op", linkageName: "_COp.9b0a46309e124f8a:DefaultOrUnformed.Core.93349b0fe912a29b", scope: null, file: !46, line: 9, type: !34, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !46 = !DIFile(filename: "min_prelude/parts/default.carbon", directory: "") +// CHECK:STDOUT: !47 = !DILocation(line: 9, column: 28, scope: !45) +// CHECK:STDOUT: !48 = !DILocation(line: 9, column: 21, scope: !45) // CHECK:STDOUT: ; ModuleID = 'return_references.carbon' // CHECK:STDOUT: source_filename = "return_references.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" diff --git a/toolchain/lower/testdata/interop/cpp/return.carbon b/toolchain/lower/testdata/interop/cpp/return.carbon index da07ac48f115..086333bdf4b9 100644 --- a/toolchain/lower/testdata/interop/cpp/return.carbon +++ b/toolchain/lower/testdata/interop/cpp/return.carbon @@ -271,50 +271,110 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: %ReturnI32.call = call i32 @_Z9ReturnI32v(), !dbg !76 // CHECK:STDOUT: %ReturnI64.call = call i64 @_Z9ReturnI64v(), !dbg !77 // 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 !78 +// CHECK:STDOUT: call void @"_COp.406738f1b62008ed:core.Destroy.Core"(ptr %.loc25_35.1.temp), !dbg !73 +// CHECK:STDOUT: call void @"_COp.43bece552030817c:core.Destroy.Core"(ptr %.loc24_32.1.temp), !dbg !72 +// CHECK:STDOUT: call void @"_COp.ecaf8c3e76291eee:core.Destroy.Core"(ptr %.loc20_35.1.temp), !dbg !71 +// CHECK:STDOUT: call void @"_COp.3de38e83520d6bec:core.Destroy.Core"(ptr %.loc19_32.1.temp), !dbg !70 // CHECK:STDOUT: ret void, !dbg !79 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CVars.Main() #2 !dbg !80 { +// CHECK:STDOUT: define weak_odr void @"_COp.406738f1b62008ed:core.Destroy.Core"(ptr %self) #2 !dbg !80 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %my_u8.var = alloca i8, align 1, !dbg !81 -// CHECK:STDOUT: %my_u16.var = alloca i16, align 2, !dbg !82 -// CHECK:STDOUT: %my_u32.var = alloca i32, align 4, !dbg !83 -// CHECK:STDOUT: %my_u64.var = alloca i64, align 8, !dbg !84 -// CHECK:STDOUT: %my_i8.var = alloca i8, align 1, !dbg !85 -// CHECK:STDOUT: %my_i16.var = alloca i16, align 2, !dbg !86 -// CHECK:STDOUT: %my_i32.var = alloca i32, align 4, !dbg !87 -// CHECK:STDOUT: %my_i64.var = alloca i64, align 8, !dbg !88 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u8.var), !dbg !81 -// CHECK:STDOUT: call void @_Z8ReturnU8v.carbon_thunk(ptr %my_u8.var), !dbg !89 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u16.var), !dbg !82 -// CHECK:STDOUT: call void @_Z9ReturnU16v.carbon_thunk(ptr %my_u16.var), !dbg !90 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u32.var), !dbg !83 -// CHECK:STDOUT: %ReturnU32.call = call i32 @_Z9ReturnU32v(), !dbg !91 -// CHECK:STDOUT: store i32 %ReturnU32.call, ptr %my_u32.var, align 4, !dbg !83 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u64.var), !dbg !84 -// CHECK:STDOUT: %ReturnU64.call = call i64 @_Z9ReturnU64v(), !dbg !92 -// CHECK:STDOUT: store i64 %ReturnU64.call, ptr %my_u64.var, align 8, !dbg !84 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i8.var), !dbg !85 -// CHECK:STDOUT: call void @_Z8ReturnI8v.carbon_thunk(ptr %my_i8.var), !dbg !93 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i16.var), !dbg !86 -// CHECK:STDOUT: call void @_Z9ReturnI16v.carbon_thunk(ptr %my_i16.var), !dbg !94 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i32.var), !dbg !87 -// CHECK:STDOUT: %ReturnI32.call = call i32 @_Z9ReturnI32v(), !dbg !95 -// CHECK:STDOUT: store i32 %ReturnI32.call, ptr %my_i32.var, align 4, !dbg !87 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i64.var), !dbg !88 -// CHECK:STDOUT: %ReturnI64.call = call i64 @_Z9ReturnI64v(), !dbg !96 -// CHECK:STDOUT: store i64 %ReturnI64.call, ptr %my_i64.var, align 8, !dbg !88 -// CHECK:STDOUT: %.loc43_7 = load i8, ptr %my_u8.var, align 1, !dbg !97 -// CHECK:STDOUT: %.loc43_14 = load i16, ptr %my_u16.var, align 2, !dbg !98 -// CHECK:STDOUT: %.loc43_22 = load i32, ptr %my_u32.var, align 4, !dbg !99 -// CHECK:STDOUT: %.loc43_30 = load i64, ptr %my_u64.var, align 8, !dbg !100 -// CHECK:STDOUT: %.loc43_38 = load i8, ptr %my_i8.var, align 1, !dbg !101 -// CHECK:STDOUT: %.loc43_45 = load i16, ptr %my_i16.var, align 2, !dbg !102 -// CHECK:STDOUT: %.loc43_53 = load i32, ptr %my_i32.var, align 4, !dbg !103 -// CHECK:STDOUT: %.loc43_61 = load i64, ptr %my_i64.var, align 8, !dbg !104 -// 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 !105 -// CHECK:STDOUT: ret void, !dbg !106 +// CHECK:STDOUT: ret void, !dbg !85 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.43bece552030817c:core.Destroy.Core"(ptr %self) #2 !dbg !86 { +// 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.ecaf8c3e76291eee:core.Destroy.Core"(ptr %self) #2 !dbg !92 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !97 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.3de38e83520d6bec:core.Destroy.Core"(ptr %self) #2 !dbg !98 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !103 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CVars.Main() #2 !dbg !104 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %my_u8.var = alloca i8, align 1, !dbg !105 +// CHECK:STDOUT: %my_u16.var = alloca i16, align 2, !dbg !106 +// CHECK:STDOUT: %my_u32.var = alloca i32, align 4, !dbg !107 +// CHECK:STDOUT: %my_u64.var = alloca i64, align 8, !dbg !108 +// CHECK:STDOUT: %my_i8.var = alloca i8, align 1, !dbg !109 +// CHECK:STDOUT: %my_i16.var = alloca i16, align 2, !dbg !110 +// CHECK:STDOUT: %my_i32.var = alloca i32, align 4, !dbg !111 +// CHECK:STDOUT: %my_i64.var = alloca i64, align 8, !dbg !112 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u8.var), !dbg !105 +// CHECK:STDOUT: call void @_Z8ReturnU8v.carbon_thunk(ptr %my_u8.var), !dbg !113 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u16.var), !dbg !106 +// CHECK:STDOUT: call void @_Z9ReturnU16v.carbon_thunk(ptr %my_u16.var), !dbg !114 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u32.var), !dbg !107 +// CHECK:STDOUT: %ReturnU32.call = call i32 @_Z9ReturnU32v(), !dbg !115 +// CHECK:STDOUT: store i32 %ReturnU32.call, ptr %my_u32.var, align 4, !dbg !107 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u64.var), !dbg !108 +// CHECK:STDOUT: %ReturnU64.call = call i64 @_Z9ReturnU64v(), !dbg !116 +// CHECK:STDOUT: store i64 %ReturnU64.call, ptr %my_u64.var, align 8, !dbg !108 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i8.var), !dbg !109 +// CHECK:STDOUT: call void @_Z8ReturnI8v.carbon_thunk(ptr %my_i8.var), !dbg !117 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i16.var), !dbg !110 +// CHECK:STDOUT: call void @_Z9ReturnI16v.carbon_thunk(ptr %my_i16.var), !dbg !118 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i32.var), !dbg !111 +// CHECK:STDOUT: %ReturnI32.call = call i32 @_Z9ReturnI32v(), !dbg !119 +// CHECK:STDOUT: store i32 %ReturnI32.call, ptr %my_i32.var, align 4, !dbg !111 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i64.var), !dbg !112 +// CHECK:STDOUT: %ReturnI64.call = call i64 @_Z9ReturnI64v(), !dbg !120 +// CHECK:STDOUT: store i64 %ReturnI64.call, ptr %my_i64.var, align 8, !dbg !112 +// CHECK:STDOUT: %.loc43_7 = load i8, ptr %my_u8.var, align 1, !dbg !121 +// CHECK:STDOUT: %.loc43_14 = load i16, ptr %my_u16.var, align 2, !dbg !122 +// CHECK:STDOUT: %.loc43_22 = load i32, ptr %my_u32.var, align 4, !dbg !123 +// CHECK:STDOUT: %.loc43_30 = load i64, ptr %my_u64.var, align 8, !dbg !124 +// CHECK:STDOUT: %.loc43_38 = load i8, ptr %my_i8.var, align 1, !dbg !125 +// CHECK:STDOUT: %.loc43_45 = load i16, ptr %my_i16.var, align 2, !dbg !126 +// CHECK:STDOUT: %.loc43_53 = load i32, ptr %my_i32.var, align 4, !dbg !127 +// CHECK:STDOUT: %.loc43_61 = load i64, ptr %my_i64.var, align 8, !dbg !128 +// 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 !129 +// CHECK:STDOUT: call void @"_COp.0d6779e60704359e:core.Destroy.Core"(ptr %my_i64.var), !dbg !112 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %my_i32.var), !dbg !111 +// CHECK:STDOUT: call void @"_COp.406738f1b62008ed:core.Destroy.Core"(ptr %my_i16.var), !dbg !110 +// CHECK:STDOUT: call void @"_COp.43bece552030817c:core.Destroy.Core"(ptr %my_i8.var), !dbg !109 +// CHECK:STDOUT: call void @"_COp.798ffd80cf2992c3:core.Destroy.Core"(ptr %my_u64.var), !dbg !108 +// CHECK:STDOUT: call void @"_COp.dab1523ded6661cc:core.Destroy.Core"(ptr %my_u32.var), !dbg !107 +// CHECK:STDOUT: call void @"_COp.ecaf8c3e76291eee:core.Destroy.Core"(ptr %my_u16.var), !dbg !106 +// CHECK:STDOUT: call void @"_COp.3de38e83520d6bec:core.Destroy.Core"(ptr %my_u8.var), !dbg !105 +// CHECK:STDOUT: ret void, !dbg !130 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.0d6779e60704359e:core.Destroy.Core"(ptr %self) #2 !dbg !131 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !136 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #2 !dbg !137 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !142 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.798ffd80cf2992c3:core.Destroy.Core"(ptr %self) #2 !dbg !143 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !148 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.dab1523ded6661cc:core.Destroy.Core"(ptr %self) #2 !dbg !149 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !154 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -412,33 +472,81 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: !77 = !DILocation(line: 27, column: 21, scope: !67) // CHECK:STDOUT: !78 = !DILocation(line: 29, column: 3, scope: !67) // CHECK:STDOUT: !79 = !DILocation(line: 18, column: 1, scope: !67) -// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "Vars", linkageName: "_CVars.Main", scope: null, file: !6, line: 32, type: !68, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !81 = !DILocation(line: 33, column: 3, scope: !80) -// CHECK:STDOUT: !82 = !DILocation(line: 34, column: 3, scope: !80) -// CHECK:STDOUT: !83 = !DILocation(line: 35, column: 3, scope: !80) -// CHECK:STDOUT: !84 = !DILocation(line: 36, column: 3, scope: !80) -// CHECK:STDOUT: !85 = !DILocation(line: 38, column: 3, scope: !80) -// CHECK:STDOUT: !86 = !DILocation(line: 39, column: 3, scope: !80) -// CHECK:STDOUT: !87 = !DILocation(line: 40, column: 3, scope: !80) -// CHECK:STDOUT: !88 = !DILocation(line: 41, column: 3, scope: !80) -// CHECK:STDOUT: !89 = !DILocation(line: 33, column: 19, scope: !80) -// CHECK:STDOUT: !90 = !DILocation(line: 34, column: 21, scope: !80) -// CHECK:STDOUT: !91 = !DILocation(line: 35, column: 21, scope: !80) -// CHECK:STDOUT: !92 = !DILocation(line: 36, column: 21, scope: !80) -// CHECK:STDOUT: !93 = !DILocation(line: 38, column: 19, scope: !80) -// CHECK:STDOUT: !94 = !DILocation(line: 39, column: 21, scope: !80) -// CHECK:STDOUT: !95 = !DILocation(line: 40, column: 21, scope: !80) -// CHECK:STDOUT: !96 = !DILocation(line: 41, column: 21, scope: !80) -// CHECK:STDOUT: !97 = !DILocation(line: 43, column: 7, scope: !80) -// CHECK:STDOUT: !98 = !DILocation(line: 43, column: 14, scope: !80) -// CHECK:STDOUT: !99 = !DILocation(line: 43, column: 22, scope: !80) -// CHECK:STDOUT: !100 = !DILocation(line: 43, column: 30, scope: !80) -// CHECK:STDOUT: !101 = !DILocation(line: 43, column: 38, scope: !80) -// CHECK:STDOUT: !102 = !DILocation(line: 43, column: 45, scope: !80) -// CHECK:STDOUT: !103 = !DILocation(line: 43, column: 53, scope: !80) -// CHECK:STDOUT: !104 = !DILocation(line: 43, column: 61, scope: !80) -// CHECK:STDOUT: !105 = !DILocation(line: 43, column: 3, scope: !80) -// CHECK:STDOUT: !106 = !DILocation(line: 32, column: 1, scope: !80) +// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "Op", linkageName: "_COp.406738f1b62008ed:core.Destroy.Core", scope: null, file: !6, line: 25, type: !81, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !83) +// CHECK:STDOUT: !81 = !DISubroutineType(types: !82) +// CHECK:STDOUT: !82 = !{null, !52} +// CHECK:STDOUT: !83 = !{!84} +// CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !80, type: !52) +// CHECK:STDOUT: !85 = !DILocation(line: 25, column: 21, scope: !80) +// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "Op", linkageName: "_COp.43bece552030817c:core.Destroy.Core", scope: null, file: !6, line: 24, type: !87, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !89) +// CHECK:STDOUT: !87 = !DISubroutineType(types: !88) +// CHECK:STDOUT: !88 = !{null, !46} +// CHECK:STDOUT: !89 = !{!90} +// CHECK:STDOUT: !90 = !DILocalVariable(arg: 1, scope: !86, type: !46) +// CHECK:STDOUT: !91 = !DILocation(line: 24, column: 19, scope: !86) +// CHECK:STDOUT: !92 = distinct !DISubprogram(name: "Op", linkageName: "_COp.ecaf8c3e76291eee:core.Destroy.Core", scope: null, file: !6, line: 20, type: !93, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !95) +// CHECK:STDOUT: !93 = !DISubroutineType(types: !94) +// CHECK:STDOUT: !94 = !{null, !28} +// CHECK:STDOUT: !95 = !{!96} +// CHECK:STDOUT: !96 = !DILocalVariable(arg: 1, scope: !92, type: !28) +// CHECK:STDOUT: !97 = !DILocation(line: 20, column: 21, scope: !92) +// CHECK:STDOUT: !98 = distinct !DISubprogram(name: "Op", linkageName: "_COp.3de38e83520d6bec:core.Destroy.Core", scope: null, file: !6, line: 19, type: !99, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !101) +// CHECK:STDOUT: !99 = !DISubroutineType(types: !100) +// CHECK:STDOUT: !100 = !{null, !22} +// CHECK:STDOUT: !101 = !{!102} +// CHECK:STDOUT: !102 = !DILocalVariable(arg: 1, scope: !98, type: !22) +// CHECK:STDOUT: !103 = !DILocation(line: 19, column: 19, scope: !98) +// CHECK:STDOUT: !104 = distinct !DISubprogram(name: "Vars", linkageName: "_CVars.Main", scope: null, file: !6, line: 32, type: !68, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !105 = !DILocation(line: 33, column: 3, scope: !104) +// CHECK:STDOUT: !106 = !DILocation(line: 34, column: 3, scope: !104) +// CHECK:STDOUT: !107 = !DILocation(line: 35, column: 3, scope: !104) +// CHECK:STDOUT: !108 = !DILocation(line: 36, column: 3, scope: !104) +// CHECK:STDOUT: !109 = !DILocation(line: 38, column: 3, scope: !104) +// CHECK:STDOUT: !110 = !DILocation(line: 39, column: 3, scope: !104) +// CHECK:STDOUT: !111 = !DILocation(line: 40, column: 3, scope: !104) +// CHECK:STDOUT: !112 = !DILocation(line: 41, column: 3, scope: !104) +// CHECK:STDOUT: !113 = !DILocation(line: 33, column: 19, scope: !104) +// CHECK:STDOUT: !114 = !DILocation(line: 34, column: 21, scope: !104) +// CHECK:STDOUT: !115 = !DILocation(line: 35, column: 21, scope: !104) +// CHECK:STDOUT: !116 = !DILocation(line: 36, column: 21, scope: !104) +// CHECK:STDOUT: !117 = !DILocation(line: 38, column: 19, scope: !104) +// CHECK:STDOUT: !118 = !DILocation(line: 39, column: 21, scope: !104) +// CHECK:STDOUT: !119 = !DILocation(line: 40, column: 21, scope: !104) +// CHECK:STDOUT: !120 = !DILocation(line: 41, column: 21, scope: !104) +// CHECK:STDOUT: !121 = !DILocation(line: 43, column: 7, scope: !104) +// CHECK:STDOUT: !122 = !DILocation(line: 43, column: 14, scope: !104) +// CHECK:STDOUT: !123 = !DILocation(line: 43, column: 22, scope: !104) +// CHECK:STDOUT: !124 = !DILocation(line: 43, column: 30, scope: !104) +// CHECK:STDOUT: !125 = !DILocation(line: 43, column: 38, scope: !104) +// CHECK:STDOUT: !126 = !DILocation(line: 43, column: 45, scope: !104) +// CHECK:STDOUT: !127 = !DILocation(line: 43, column: 53, scope: !104) +// CHECK:STDOUT: !128 = !DILocation(line: 43, column: 61, scope: !104) +// CHECK:STDOUT: !129 = !DILocation(line: 43, column: 3, scope: !104) +// CHECK:STDOUT: !130 = !DILocation(line: 32, column: 1, scope: !104) +// CHECK:STDOUT: !131 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0d6779e60704359e:core.Destroy.Core", scope: null, file: !6, line: 41, type: !132, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !134) +// CHECK:STDOUT: !132 = !DISubroutineType(types: !133) +// CHECK:STDOUT: !133 = !{null, !64} +// CHECK:STDOUT: !134 = !{!135} +// CHECK:STDOUT: !135 = !DILocalVariable(arg: 1, scope: !131, type: !64) +// CHECK:STDOUT: !136 = !DILocation(line: 41, column: 3, scope: !131) +// CHECK:STDOUT: !137 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !6, line: 40, type: !138, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !140) +// CHECK:STDOUT: !138 = !DISubroutineType(types: !139) +// CHECK:STDOUT: !139 = !{null, !58} +// CHECK:STDOUT: !140 = !{!141} +// CHECK:STDOUT: !141 = !DILocalVariable(arg: 1, scope: !137, type: !58) +// CHECK:STDOUT: !142 = !DILocation(line: 40, column: 3, scope: !137) +// CHECK:STDOUT: !143 = distinct !DISubprogram(name: "Op", linkageName: "_COp.798ffd80cf2992c3:core.Destroy.Core", scope: null, file: !6, line: 36, type: !144, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !146) +// CHECK:STDOUT: !144 = !DISubroutineType(types: !145) +// CHECK:STDOUT: !145 = !{null, !40} +// CHECK:STDOUT: !146 = !{!147} +// CHECK:STDOUT: !147 = !DILocalVariable(arg: 1, scope: !143, type: !40) +// CHECK:STDOUT: !148 = !DILocation(line: 36, column: 3, scope: !143) +// CHECK:STDOUT: !149 = distinct !DISubprogram(name: "Op", linkageName: "_COp.dab1523ded6661cc:core.Destroy.Core", scope: null, file: !6, line: 35, type: !150, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !152) +// CHECK:STDOUT: !150 = !DISubroutineType(types: !151) +// CHECK:STDOUT: !151 = !{null, !34} +// CHECK:STDOUT: !152 = !{!153} +// CHECK:STDOUT: !153 = !DILocalVariable(arg: 1, scope: !149, type: !34) +// CHECK:STDOUT: !154 = !DILocation(line: 35, column: 3, scope: !149) // CHECK:STDOUT: ; ModuleID = 'import_class.carbon' // CHECK:STDOUT: source_filename = "import_class.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" diff --git a/toolchain/lower/testdata/interop/cpp/std_initializer_list.carbon b/toolchain/lower/testdata/interop/cpp/std_initializer_list.carbon index 23500517ed2c..08ab88942dee 100644 --- a/toolchain/lower/testdata/interop/cpp/std_initializer_list.carbon +++ b/toolchain/lower/testdata/interop/cpp/std_initializer_list.carbon @@ -124,6 +124,8 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: // CHECK:STDOUT: $_ZN11vector_likeD2Ev = comdat any // CHECK:STDOUT: +// CHECK:STDOUT: $_ZN15nontrivial_dtorD2Ev = comdat any +// CHECK:STDOUT: // CHECK:STDOUT: @array = internal constant [3 x i32] [i32 1, i32 2, i32 3] // CHECK:STDOUT: @array.loc13_50.15 = internal constant [3 x i32] [i32 1, i32 2, i32 3] // CHECK:STDOUT: @@ -199,29 +201,43 @@ 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 !24 // 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 !24 // CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !26 +// CHECK:STDOUT: call void @"_COp.bfd302cd235977c4: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 void @_CInitVectorLike.Main() #3 !dbg !28 { +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #3 !dbg !28 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !29 -// CHECK:STDOUT: %.loc18_36.2.temp = alloca [16 x i8], align 1, !dbg !30 -// CHECK:STDOUT: %.loc18_36.4.temp = alloca [3 x i32], align 4, !dbg !30 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !29 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.2.temp), !dbg !30 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.4.temp), !dbg !30 -// CHECK:STDOUT: %.loc18_36.5.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.temp, i32 0, i64 0, !dbg !30 -// CHECK:STDOUT: %.loc18_36.8.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.temp, i32 0, i64 1, !dbg !30 -// CHECK:STDOUT: %.loc18_36.11.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.temp, i32 0, i64 2, !dbg !30 -// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.2.temp, i32 0, i32 0, !dbg !30 -// CHECK:STDOUT: store ptr @array.loc13_50.15, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !30 -// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.end = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.2.temp, i32 0, i32 8, !dbg !30 -// 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 !30 -// CHECK:STDOUT: call void @_ZN11vector_likeC1ESt16initializer_listIiE.carbon_thunk(ptr %.loc18_36.2.temp, ptr %_.var), !dbg !29 -// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !31 -// CHECK:STDOUT: call void @_ZN11vector_likeD2Ev(ptr %_.var), !dbg !29 -// CHECK:STDOUT: ret void, !dbg !32 +// CHECK:STDOUT: ret void, !dbg !34 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.bfd302cd235977c4:core.Destroy.Core"(ptr %self) #3 !dbg !35 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !41 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CInitVectorLike.Main() #3 !dbg !42 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !43 +// CHECK:STDOUT: %.loc18_36.2.temp = alloca [16 x i8], align 1, !dbg !44 +// CHECK:STDOUT: %.loc18_36.4.temp = alloca [3 x i32], align 4, !dbg !44 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !43 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.2.temp), !dbg !44 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.4.temp), !dbg !44 +// CHECK:STDOUT: %.loc18_36.5.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.temp, i32 0, i64 0, !dbg !44 +// CHECK:STDOUT: %.loc18_36.8.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.temp, i32 0, i64 1, !dbg !44 +// CHECK:STDOUT: %.loc18_36.11.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.temp, i32 0, i64 2, !dbg !44 +// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.2.temp, i32 0, i32 0, !dbg !44 +// CHECK:STDOUT: store ptr @array.loc13_50.15, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !44 +// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.end = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.2.temp, i32 0, i32 8, !dbg !44 +// 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 !44 +// CHECK:STDOUT: call void @_ZN11vector_likeC1ESt16initializer_listIiE.carbon_thunk(ptr %.loc18_36.2.temp, ptr %_.var), !dbg !43 +// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !45 +// CHECK:STDOUT: call void @"_COp.bfd302cd235977c4:core.Destroy.Core"(ptr @array), !dbg !44 +// CHECK:STDOUT: call void @_ZN11vector_likeD2Ev(ptr %_.var), !dbg !43 +// CHECK:STDOUT: ret void, !dbg !46 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable @@ -234,25 +250,41 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CInitNontrivialDtor.Main() #3 !dbg !33 { +// CHECK:STDOUT: define void @_CInitNontrivialDtor.Main() #3 !dbg !47 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca [16 x i8], align 1, !dbg !34 -// CHECK:STDOUT: %.loc23_69.17.temp = alloca [3 x [1 x i8]], align 1, !dbg !35 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !34 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc23_69.17.temp), !dbg !35 -// CHECK:STDOUT: %.loc23_69.18.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 0, !dbg !35 -// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple(ptr %.loc23_69.18.array.index), !dbg !35 -// CHECK:STDOUT: %.loc23_69.16.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 1, !dbg !35 -// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple(ptr %.loc23_69.16.array.index), !dbg !35 -// CHECK:STDOUT: %.loc23_69.15.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 2, !dbg !35 -// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple(ptr %.loc23_69.15.array.index), !dbg !35 -// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 0, !dbg !34 -// CHECK:STDOUT: store ptr %.loc23_69.17.temp, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !34 -// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.end = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 8, !dbg !34 -// CHECK:STDOUT: %initializer_list.initializer_list.call.array.end = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 1, !dbg !34 -// CHECK:STDOUT: store ptr %initializer_list.initializer_list.call.array.end, ptr %initializer_list.initializer_list.call.init_list.end, align 8, !dbg !34 -// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !36 -// CHECK:STDOUT: ret void, !dbg !37 +// CHECK:STDOUT: %_.var = alloca [16 x i8], align 1, !dbg !48 +// CHECK:STDOUT: %.loc23_69.17.temp = alloca [3 x [1 x i8]], align 1, !dbg !49 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !48 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc23_69.17.temp), !dbg !49 +// CHECK:STDOUT: %.loc23_69.18.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 0, !dbg !49 +// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple(ptr %.loc23_69.18.array.index), !dbg !49 +// CHECK:STDOUT: %.loc23_69.16.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 1, !dbg !49 +// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple(ptr %.loc23_69.16.array.index), !dbg !49 +// CHECK:STDOUT: %.loc23_69.15.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 2, !dbg !49 +// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple(ptr %.loc23_69.15.array.index), !dbg !49 +// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 0, !dbg !48 +// CHECK:STDOUT: store ptr %.loc23_69.17.temp, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !48 +// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.end = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 8, !dbg !48 +// CHECK:STDOUT: %initializer_list.initializer_list.call.array.end = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 1, !dbg !48 +// CHECK:STDOUT: store ptr %initializer_list.initializer_list.call.array.end, ptr %initializer_list.initializer_list.call.init_list.end, align 8, !dbg !48 +// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !50 +// CHECK:STDOUT: call void @"_COp.3c5ceecfa63e1bfb:core.Destroy.Core"(ptr %.loc23_69.17.temp), !dbg !49 +// CHECK:STDOUT: ret void, !dbg !51 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable +// 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 !19 +// 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.3c5ceecfa63e1bfb:core.Destroy.Core"(ptr %self) #3 !dbg !52 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !55 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -299,16 +331,34 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: !25 = !DILocation(line: 13, column: 42, scope: !21) // CHECK:STDOUT: !26 = !DILocation(line: 14, column: 3, scope: !21) // CHECK:STDOUT: !27 = !DILocation(line: 12, column: 1, scope: !21) -// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "InitVectorLike", linkageName: "_CInitVectorLike.Main", scope: null, file: !6, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !29 = !DILocation(line: 18, column: 3, scope: !28) -// CHECK:STDOUT: !30 = !DILocation(line: 18, column: 28, scope: !28) -// CHECK:STDOUT: !31 = !DILocation(line: 19, column: 3, scope: !28) -// CHECK:STDOUT: !32 = !DILocation(line: 17, column: 1, scope: !28) -// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "InitNontrivialDtor", linkageName: "_CInitNontrivialDtor.Main", scope: null, file: !6, line: 22, type: !22, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !34 = !DILocation(line: 23, column: 3, scope: !33) -// CHECK:STDOUT: !35 = !DILocation(line: 23, column: 58, scope: !33) -// CHECK:STDOUT: !36 = !DILocation(line: 24, column: 3, scope: !33) -// CHECK:STDOUT: !37 = !DILocation(line: 22, column: 1, scope: !33) +// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !6, line: 13, type: !29, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !32) +// CHECK:STDOUT: !29 = !DISubroutineType(types: !30) +// CHECK:STDOUT: !30 = !{null, !31} +// CHECK:STDOUT: !31 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !32 = !{!33} +// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !28, type: !31) +// CHECK:STDOUT: !34 = !DILocation(line: 13, column: 42, scope: !28) +// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "Op", linkageName: "_COp.bfd302cd235977c4:core.Destroy.Core", scope: null, file: !6, line: 13, type: !36, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !39) +// CHECK:STDOUT: !36 = !DISubroutineType(types: !37) +// CHECK:STDOUT: !37 = !{null, !38} +// CHECK:STDOUT: !38 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !39 = !{!40} +// CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !35, type: !38) +// CHECK:STDOUT: !41 = !DILocation(line: 13, column: 42, scope: !35) +// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "InitVectorLike", linkageName: "_CInitVectorLike.Main", scope: null, file: !6, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !43 = !DILocation(line: 18, column: 3, scope: !42) +// CHECK:STDOUT: !44 = !DILocation(line: 18, column: 28, scope: !42) +// CHECK:STDOUT: !45 = !DILocation(line: 19, column: 3, scope: !42) +// CHECK:STDOUT: !46 = !DILocation(line: 17, column: 1, scope: !42) +// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "InitNontrivialDtor", linkageName: "_CInitNontrivialDtor.Main", scope: null, file: !6, line: 22, type: !22, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !48 = !DILocation(line: 23, column: 3, scope: !47) +// CHECK:STDOUT: !49 = !DILocation(line: 23, column: 58, scope: !47) +// CHECK:STDOUT: !50 = !DILocation(line: 24, column: 3, scope: !47) +// CHECK:STDOUT: !51 = !DILocation(line: 22, column: 1, scope: !47) +// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "Op", linkageName: "_COp.3c5ceecfa63e1bfb:core.Destroy.Core", scope: null, file: !6, line: 23, type: !36, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !53) +// CHECK:STDOUT: !53 = !{!54} +// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !52, type: !38) +// CHECK:STDOUT: !55 = !DILocation(line: 23, column: 58, scope: !52) // CHECK:STDOUT: ; ModuleID = 'use_pointer_size.carbon' // CHECK:STDOUT: source_filename = "use_pointer_size.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" @@ -322,6 +372,8 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: // CHECK:STDOUT: $_ZN11vector_likeD2Ev = comdat any // CHECK:STDOUT: +// CHECK:STDOUT: $_ZN15nontrivial_dtorD2Ev = comdat any +// CHECK:STDOUT: // CHECK:STDOUT: @array = internal constant [3 x i32] [i32 1, i32 2, i32 3] // CHECK:STDOUT: @array.loc13_50.15 = internal constant [3 x i32] [i32 1, i32 2, i32 3] // CHECK:STDOUT: @@ -397,29 +449,43 @@ 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 !26 // CHECK:STDOUT: store i64 3, ptr %initializer_list.initializer_list.call.init_list.size, align 8, !dbg !26 // CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !28 +// CHECK:STDOUT: call void @"_COp.bfd302cd235977c4:core.Destroy.Core"(ptr @array), !dbg !27 // CHECK:STDOUT: ret void, !dbg !29 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CInitVectorLike.Main() #3 !dbg !30 { +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #3 !dbg !30 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !31 -// CHECK:STDOUT: %.loc18_36.2.temp = alloca [16 x i8], align 1, !dbg !32 -// CHECK:STDOUT: %.loc18_36.4.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.2.temp), !dbg !32 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.4.temp), !dbg !32 -// CHECK:STDOUT: %.loc18_36.5.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.temp, i32 0, i64 0, !dbg !32 -// CHECK:STDOUT: %.loc18_36.8.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.temp, i32 0, i64 1, !dbg !32 -// CHECK:STDOUT: %.loc18_36.11.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.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.2.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.size = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.2.temp, i32 0, i32 8, !dbg !32 -// CHECK:STDOUT: store i64 3, ptr %initializer_list.initializer_list.call.init_list.size, align 8, !dbg !32 -// CHECK:STDOUT: call void @_ZN11vector_likeC1ESt16initializer_listIiE.carbon_thunk(ptr %.loc18_36.2.temp, ptr %_.var), !dbg !31 -// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !33 -// CHECK:STDOUT: call void @_ZN11vector_likeD2Ev(ptr %_.var), !dbg !31 -// CHECK:STDOUT: ret void, !dbg !34 +// CHECK:STDOUT: ret void, !dbg !36 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.bfd302cd235977c4:core.Destroy.Core"(ptr %self) #3 !dbg !37 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CInitVectorLike.Main() #3 !dbg !44 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !45 +// CHECK:STDOUT: %.loc18_36.2.temp = alloca [16 x i8], align 1, !dbg !46 +// CHECK:STDOUT: %.loc18_36.4.temp = alloca [3 x i32], align 4, !dbg !46 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !45 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.2.temp), !dbg !46 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.4.temp), !dbg !46 +// CHECK:STDOUT: %.loc18_36.5.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.temp, i32 0, i64 0, !dbg !46 +// CHECK:STDOUT: %.loc18_36.8.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.temp, i32 0, i64 1, !dbg !46 +// CHECK:STDOUT: %.loc18_36.11.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.temp, i32 0, i64 2, !dbg !46 +// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.2.temp, i32 0, i32 0, !dbg !46 +// CHECK:STDOUT: store ptr @array.loc13_50.15, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !46 +// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.2.temp, i32 0, i32 8, !dbg !46 +// CHECK:STDOUT: store i64 3, ptr %initializer_list.initializer_list.call.init_list.size, align 8, !dbg !46 +// CHECK:STDOUT: call void @_ZN11vector_likeC1ESt16initializer_listIiE.carbon_thunk(ptr %.loc18_36.2.temp, ptr %_.var), !dbg !45 +// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !47 +// CHECK:STDOUT: call void @"_COp.bfd302cd235977c4:core.Destroy.Core"(ptr @array), !dbg !46 +// CHECK:STDOUT: call void @_ZN11vector_likeD2Ev(ptr %_.var), !dbg !45 +// CHECK:STDOUT: ret void, !dbg !48 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable @@ -432,24 +498,40 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CInitNontrivialDtor.Main() #3 !dbg !35 { +// CHECK:STDOUT: define void @_CInitNontrivialDtor.Main() #3 !dbg !49 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca [16 x i8], align 1, !dbg !36 -// CHECK:STDOUT: %.loc23_69.17.temp = alloca [3 x [1 x i8]], align 1, !dbg !37 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !36 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc23_69.17.temp), !dbg !37 -// CHECK:STDOUT: %.loc23_69.18.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 0, !dbg !37 -// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple(ptr %.loc23_69.18.array.index), !dbg !37 -// CHECK:STDOUT: %.loc23_69.16.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 1, !dbg !37 -// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple(ptr %.loc23_69.16.array.index), !dbg !37 -// CHECK:STDOUT: %.loc23_69.15.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 2, !dbg !37 -// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple(ptr %.loc23_69.15.array.index), !dbg !37 -// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 0, !dbg !36 -// CHECK:STDOUT: store ptr %.loc23_69.17.temp, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !36 -// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 8, !dbg !36 -// CHECK:STDOUT: store i64 3, ptr %initializer_list.initializer_list.call.init_list.size, align 8, !dbg !36 -// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !38 -// CHECK:STDOUT: ret void, !dbg !39 +// CHECK:STDOUT: %_.var = alloca [16 x i8], align 1, !dbg !50 +// CHECK:STDOUT: %.loc23_69.17.temp = alloca [3 x [1 x i8]], align 1, !dbg !51 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !50 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc23_69.17.temp), !dbg !51 +// CHECK:STDOUT: %.loc23_69.18.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 0, !dbg !51 +// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple(ptr %.loc23_69.18.array.index), !dbg !51 +// CHECK:STDOUT: %.loc23_69.16.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 1, !dbg !51 +// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple(ptr %.loc23_69.16.array.index), !dbg !51 +// CHECK:STDOUT: %.loc23_69.15.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 2, !dbg !51 +// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple(ptr %.loc23_69.15.array.index), !dbg !51 +// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 0, !dbg !50 +// CHECK:STDOUT: store ptr %.loc23_69.17.temp, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !50 +// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 8, !dbg !50 +// CHECK:STDOUT: store i64 3, ptr %initializer_list.initializer_list.call.init_list.size, align 8, !dbg !50 +// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !52 +// CHECK:STDOUT: call void @"_COp.3c5ceecfa63e1bfb:core.Destroy.Core"(ptr %.loc23_69.17.temp), !dbg !51 +// CHECK:STDOUT: ret void, !dbg !53 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable +// 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 !21 +// 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.3c5ceecfa63e1bfb:core.Destroy.Core"(ptr %self) #3 !dbg !54 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !57 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -498,13 +580,31 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: !27 = !DILocation(line: 13, column: 42, scope: !23) // CHECK:STDOUT: !28 = !DILocation(line: 14, column: 3, scope: !23) // CHECK:STDOUT: !29 = !DILocation(line: 12, column: 1, scope: !23) -// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "InitVectorLike", linkageName: "_CInitVectorLike.Main", scope: null, file: !6, line: 17, type: !24, 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: !33 = !DILocation(line: 19, column: 3, scope: !30) -// CHECK:STDOUT: !34 = !DILocation(line: 17, column: 1, scope: !30) -// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "InitNontrivialDtor", linkageName: "_CInitNontrivialDtor.Main", scope: null, file: !6, line: 22, type: !24, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !36 = !DILocation(line: 23, column: 3, scope: !35) -// CHECK:STDOUT: !37 = !DILocation(line: 23, column: 58, scope: !35) -// CHECK:STDOUT: !38 = !DILocation(line: 24, column: 3, scope: !35) -// CHECK:STDOUT: !39 = !DILocation(line: 22, column: 1, scope: !35) +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !6, line: 13, type: !31, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !34) +// CHECK:STDOUT: !31 = !DISubroutineType(types: !32) +// CHECK:STDOUT: !32 = !{null, !33} +// CHECK:STDOUT: !33 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !34 = !{!35} +// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !30, type: !33) +// CHECK:STDOUT: !36 = !DILocation(line: 13, column: 42, scope: !30) +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.bfd302cd235977c4:core.Destroy.Core", scope: null, file: !6, line: 13, type: !38, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !41) +// CHECK:STDOUT: !38 = !DISubroutineType(types: !39) +// CHECK:STDOUT: !39 = !{null, !40} +// CHECK:STDOUT: !40 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !41 = !{!42} +// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !37, type: !40) +// CHECK:STDOUT: !43 = !DILocation(line: 13, column: 42, scope: !37) +// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "InitVectorLike", linkageName: "_CInitVectorLike.Main", scope: null, file: !6, line: 17, type: !24, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !45 = !DILocation(line: 18, column: 3, scope: !44) +// CHECK:STDOUT: !46 = !DILocation(line: 18, column: 28, scope: !44) +// CHECK:STDOUT: !47 = !DILocation(line: 19, column: 3, scope: !44) +// CHECK:STDOUT: !48 = !DILocation(line: 17, column: 1, scope: !44) +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "InitNontrivialDtor", linkageName: "_CInitNontrivialDtor.Main", scope: null, file: !6, line: 22, type: !24, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !50 = !DILocation(line: 23, column: 3, scope: !49) +// CHECK:STDOUT: !51 = !DILocation(line: 23, column: 58, scope: !49) +// CHECK:STDOUT: !52 = !DILocation(line: 24, column: 3, scope: !49) +// CHECK:STDOUT: !53 = !DILocation(line: 22, column: 1, scope: !49) +// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "Op", linkageName: "_COp.3c5ceecfa63e1bfb:core.Destroy.Core", scope: null, file: !6, line: 23, type: !38, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !55) +// CHECK:STDOUT: !55 = !{!56} +// CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !54, type: !40) +// CHECK:STDOUT: !57 = !DILocation(line: 23, column: 58, scope: !54) diff --git a/toolchain/lower/testdata/interop/cpp/void.carbon b/toolchain/lower/testdata/interop/cpp/void.carbon index b9dddeecdb13..94ce1cf82a0b 100644 --- a/toolchain/lower/testdata/interop/cpp/void.carbon +++ b/toolchain/lower/testdata/interop/cpp/void.carbon @@ -70,132 +70,162 @@ fn ConvertFromConstVoidPtr(p: const Cpp.void*) -> const i32* { // CHECK:STDOUT: store ptr %U.binding.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc7_21.2.temp, align 8, !dbg !17 // CHECK:STDOUT: %.loc7_21.4 = load ptr, ptr %.loc7_21.2.temp, align 8, !dbg !17 // CHECK:STDOUT: call void @_Z13take_void_ptrPv(ptr %.loc7_21.4), !dbg !18 +// CHECK:STDOUT: call void @"_COp.ee91ab4ecda32839:core.Destroy.Core"(ptr %.loc7_21.2.temp), !dbg !17 // CHECK:STDOUT: ret void, !dbg !19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z13take_void_ptrPv(ptr noundef) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassIntPtr.Main(ptr %a) #0 !dbg !20 { +// CHECK:STDOUT: define weak_odr void @"_COp.39ca70f0f5ff2105:core.Destroy.Core"(ptr %self) #0 !dbg !20 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc11_21.2.temp = alloca ptr, align 8, !dbg !23 -// CHECK:STDOUT: %U.binding.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.295aa3526801a9d4"(ptr %a), !dbg !23 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_21.2.temp), !dbg !23 -// CHECK:STDOUT: store ptr %U.binding.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc11_21.2.temp, align 8, !dbg !23 -// CHECK:STDOUT: %.loc11_21.4 = load ptr, ptr %.loc11_21.2.temp, align 8, !dbg !23 -// CHECK:STDOUT: call void @_Z13take_void_ptrPv(ptr %.loc11_21.4), !dbg !24 -// CHECK:STDOUT: ret void, !dbg !25 +// CHECK:STDOUT: ret void, !dbg !23 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassIntPtrToConstVoidPtr.Main(ptr %a) #0 !dbg !26 { +// CHECK:STDOUT: define weak_odr void @"_COp.ee91ab4ecda32839:core.Destroy.Core"(ptr %self) #0 !dbg !24 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc15_27.2.temp = alloca ptr, align 8, !dbg !29 -// CHECK:STDOUT: %U.binding.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.e995c7ea1c3d1cc3"(ptr %a), !dbg !29 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc15_27.2.temp), !dbg !29 -// CHECK:STDOUT: store ptr %U.binding.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc15_27.2.temp, align 8, !dbg !29 -// CHECK:STDOUT: %.loc15_27.4 = load ptr, ptr %.loc15_27.2.temp, align 8, !dbg !29 -// CHECK:STDOUT: call void @_Z19take_const_void_ptrPKv(ptr %.loc15_27.4), !dbg !30 -// CHECK:STDOUT: ret void, !dbg !31 +// CHECK:STDOUT: ret void, !dbg !27 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CPassIntPtr.Main(ptr %a) #0 !dbg !28 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc11_21.2.temp = alloca ptr, align 8, !dbg !31 +// CHECK:STDOUT: %U.binding.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.295aa3526801a9d4"(ptr %a), !dbg !31 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_21.2.temp), !dbg !31 +// CHECK:STDOUT: store ptr %U.binding.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc11_21.2.temp, align 8, !dbg !31 +// CHECK:STDOUT: %.loc11_21.4 = load ptr, ptr %.loc11_21.2.temp, align 8, !dbg !31 +// CHECK:STDOUT: call void @_Z13take_void_ptrPv(ptr %.loc11_21.4), !dbg !32 +// CHECK:STDOUT: call void @"_COp.ee91ab4ecda32839:core.Destroy.Core"(ptr %.loc11_21.2.temp), !dbg !31 +// CHECK:STDOUT: ret void, !dbg !33 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CPassIntPtrToConstVoidPtr.Main(ptr %a) #0 !dbg !34 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc15_27.2.temp = alloca ptr, align 8, !dbg !37 +// CHECK:STDOUT: %U.binding.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.e995c7ea1c3d1cc3"(ptr %a), !dbg !37 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc15_27.2.temp), !dbg !37 +// CHECK:STDOUT: store ptr %U.binding.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc15_27.2.temp, align 8, !dbg !37 +// CHECK:STDOUT: %.loc15_27.4 = load ptr, ptr %.loc15_27.2.temp, align 8, !dbg !37 +// CHECK:STDOUT: call void @_Z19take_const_void_ptrPKv(ptr %.loc15_27.4), !dbg !38 +// CHECK:STDOUT: call void @"_COp.0d7a529f95147939:core.Destroy.Core"(ptr %.loc15_27.2.temp), !dbg !37 +// CHECK:STDOUT: ret void, !dbg !39 // 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 void @_CPassConstIntPtrToConstVoidPtr.Main(ptr %a) #0 !dbg !32 { +// CHECK:STDOUT: define weak_odr void @"_COp.02b26c7ebd9c0872:core.Destroy.Core"(ptr %self) #0 !dbg !40 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc19_27.2.temp = alloca ptr, align 8, !dbg !35 -// CHECK:STDOUT: %U.binding.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.e995c7ea1c3d1cc3"(ptr %a), !dbg !35 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_27.2.temp), !dbg !35 -// CHECK:STDOUT: store ptr %U.binding.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc19_27.2.temp, align 8, !dbg !35 -// CHECK:STDOUT: %.loc19_27.4 = load ptr, ptr %.loc19_27.2.temp, align 8, !dbg !35 -// CHECK:STDOUT: call void @_Z19take_const_void_ptrPKv(ptr %.loc19_27.4), !dbg !36 -// CHECK:STDOUT: ret void, !dbg !37 +// CHECK:STDOUT: ret void, !dbg !43 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.66983884551336cb"(ptr %self) #0 !dbg !38 { -// CHECK:STDOUT: %1 = call ptr @"_CConvert.90961d7b1ce4f089:OptionalAs.0e326e799dad0c64.Core.7bed839a0b822504"(ptr %self), !dbg !44 -// CHECK:STDOUT: ret ptr %1, !dbg !45 +// CHECK:STDOUT: define weak_odr void @"_COp.0d7a529f95147939:core.Destroy.Core"(ptr %self) #0 !dbg !44 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !47 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CPassConstIntPtrToConstVoidPtr.Main(ptr %a) #0 !dbg !48 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc19_27.2.temp = alloca ptr, align 8, !dbg !51 +// CHECK:STDOUT: %U.binding.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.e995c7ea1c3d1cc3"(ptr %a), !dbg !51 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_27.2.temp), !dbg !51 +// CHECK:STDOUT: store ptr %U.binding.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc19_27.2.temp, align 8, !dbg !51 +// CHECK:STDOUT: %.loc19_27.4 = load ptr, ptr %.loc19_27.2.temp, align 8, !dbg !51 +// CHECK:STDOUT: call void @_Z19take_const_void_ptrPKv(ptr %.loc19_27.4), !dbg !52 +// CHECK:STDOUT: call void @"_COp.0d7a529f95147939:core.Destroy.Core"(ptr %.loc19_27.2.temp), !dbg !51 +// CHECK:STDOUT: ret void, !dbg !53 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.66983884551336cb"(ptr %self) #0 !dbg !54 { +// CHECK:STDOUT: %1 = call ptr @"_CConvert.90961d7b1ce4f089:OptionalAs.0e326e799dad0c64.Core.7bed839a0b822504"(ptr %self), !dbg !60 +// CHECK:STDOUT: ret ptr %1, !dbg !61 // 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.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.295aa3526801a9d4"(ptr %self) #0 !dbg !46 { -// CHECK:STDOUT: %1 = call ptr @"_CConvert.3667eb502d1ddfa9:OptionalAs.c7a50af9bdd61b43.Core.57bd8d0c2213b1aa"(ptr %self), !dbg !49 -// CHECK:STDOUT: ret ptr %1, !dbg !50 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.295aa3526801a9d4"(ptr %self) #0 !dbg !62 { +// CHECK:STDOUT: %1 = call ptr @"_CConvert.3667eb502d1ddfa9:OptionalAs.c7a50af9bdd61b43.Core.57bd8d0c2213b1aa"(ptr %self), !dbg !65 +// CHECK:STDOUT: ret ptr %1, !dbg !66 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.e995c7ea1c3d1cc3"(ptr %self) #0 !dbg !51 { -// CHECK:STDOUT: %1 = call ptr @"_CConvert.3667eb502d1ddfa9:OptionalAs.c7a50af9bdd61b43.Core.02dd0be934e1c38a"(ptr %self), !dbg !54 -// CHECK:STDOUT: ret ptr %1, !dbg !55 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.e995c7ea1c3d1cc3"(ptr %self) #0 !dbg !67 { +// CHECK:STDOUT: %1 = call ptr @"_CConvert.3667eb502d1ddfa9:OptionalAs.c7a50af9bdd61b43.Core.02dd0be934e1c38a"(ptr %self), !dbg !70 +// CHECK:STDOUT: ret ptr %1, !dbg !71 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.90961d7b1ce4f089:OptionalAs.0e326e799dad0c64.Core.7bed839a0b822504"(ptr %self) #0 !dbg !56 { -// CHECK:STDOUT: %1 = call ptr @_CSome.Optional.Core.7bed839a0b822504(ptr %self), !dbg !59 -// CHECK:STDOUT: ret ptr %1, !dbg !60 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.90961d7b1ce4f089:OptionalAs.0e326e799dad0c64.Core.7bed839a0b822504"(ptr %self) #0 !dbg !72 { +// CHECK:STDOUT: %1 = call ptr @_CSome.Optional.Core.7bed839a0b822504(ptr %self), !dbg !75 +// CHECK:STDOUT: ret ptr %1, !dbg !76 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.3667eb502d1ddfa9:OptionalAs.c7a50af9bdd61b43.Core.57bd8d0c2213b1aa"(ptr %self) #0 !dbg !61 { -// CHECK:STDOUT: %temp = alloca ptr, align 8, !dbg !64 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !64 -// CHECK:STDOUT: store ptr %self, ptr %temp, align 8, !dbg !64 -// CHECK:STDOUT: %1 = load ptr, ptr %temp, align 8, !dbg !64 -// CHECK:STDOUT: %2 = call ptr @_CSome.Optional.Core.7bed839a0b822504(ptr %1), !dbg !65 -// CHECK:STDOUT: ret ptr %2, !dbg !66 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.3667eb502d1ddfa9:OptionalAs.c7a50af9bdd61b43.Core.57bd8d0c2213b1aa"(ptr %self) #0 !dbg !77 { +// CHECK:STDOUT: %temp = alloca ptr, align 8, !dbg !80 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !80 +// CHECK:STDOUT: store ptr %self, ptr %temp, align 8, !dbg !80 +// CHECK:STDOUT: %1 = load ptr, ptr %temp, align 8, !dbg !80 +// CHECK:STDOUT: %2 = call ptr @_CSome.Optional.Core.7bed839a0b822504(ptr %1), !dbg !81 +// CHECK:STDOUT: ret ptr %2, !dbg !82 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.3667eb502d1ddfa9:OptionalAs.c7a50af9bdd61b43.Core.02dd0be934e1c38a"(ptr %self) #0 !dbg !67 { -// CHECK:STDOUT: %temp = alloca ptr, align 8, !dbg !70 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !70 -// CHECK:STDOUT: %1 = call ptr @"_CConvert:thunk.e8f8f92d3d08d149:ImplicitAs.ffd58aeb29886b72.Core.b88d1103f417c6d4"(ptr %self), !dbg !70 -// CHECK:STDOUT: store ptr %1, ptr %temp, align 8, !dbg !70 -// CHECK:STDOUT: %2 = load ptr, ptr %temp, align 8, !dbg !70 -// CHECK:STDOUT: %3 = call ptr @_CSome.Optional.Core.9544e72a46e24ed6(ptr %2), !dbg !71 -// CHECK:STDOUT: ret ptr %3, !dbg !72 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.3667eb502d1ddfa9:OptionalAs.c7a50af9bdd61b43.Core.02dd0be934e1c38a"(ptr %self) #0 !dbg !83 { +// CHECK:STDOUT: %temp = alloca ptr, align 8, !dbg !86 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !86 +// CHECK:STDOUT: %1 = call ptr @"_CConvert:thunk.e8f8f92d3d08d149:ImplicitAs.ffd58aeb29886b72.Core.b88d1103f417c6d4"(ptr %self), !dbg !86 +// CHECK:STDOUT: store ptr %1, ptr %temp, align 8, !dbg !86 +// CHECK:STDOUT: %2 = load ptr, ptr %temp, align 8, !dbg !86 +// CHECK:STDOUT: %3 = call ptr @_CSome.Optional.Core.9544e72a46e24ed6(ptr %2), !dbg !87 +// CHECK:STDOUT: ret ptr %3, !dbg !88 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.7bed839a0b822504(ptr %value) #0 !dbg !73 { -// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.a3238f3d1f6ba299"(ptr %value), !dbg !76 -// CHECK:STDOUT: ret ptr %1, !dbg !77 +// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.7bed839a0b822504(ptr %value) #0 !dbg !89 { +// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.a3238f3d1f6ba299"(ptr %value), !dbg !92 +// CHECK:STDOUT: ret ptr %1, !dbg !93 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert:thunk.e8f8f92d3d08d149:ImplicitAs.ffd58aeb29886b72.Core.b88d1103f417c6d4"(ptr %self) #3 !dbg !78 { -// CHECK:STDOUT: ret ptr %self, !dbg !82 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert:thunk.e8f8f92d3d08d149:ImplicitAs.ffd58aeb29886b72.Core.b88d1103f417c6d4"(ptr %self) #3 !dbg !94 { +// CHECK:STDOUT: ret ptr %self, !dbg !98 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.9544e72a46e24ed6(ptr %value) #0 !dbg !83 { -// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.2e8a3baa837dcd9f"(ptr %value), !dbg !86 -// CHECK:STDOUT: ret ptr %1, !dbg !87 +// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.9544e72a46e24ed6(ptr %value) #0 !dbg !99 { +// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.2e8a3baa837dcd9f"(ptr %value), !dbg !102 +// CHECK:STDOUT: ret ptr %1, !dbg !103 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.a3238f3d1f6ba299"(ptr %self) #0 !dbg !88 { -// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !91 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !91 -// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !91 -// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !92 -// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !93 -// CHECK:STDOUT: ret ptr %2, !dbg !94 +// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.a3238f3d1f6ba299"(ptr %self) #0 !dbg !104 { +// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !107 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !107 +// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !107 +// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !108 +// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !109 +// CHECK:STDOUT: call void @"_COp.39ca70f0f5ff2105:core.Destroy.Core"(ptr %1), !dbg !107 +// CHECK:STDOUT: ret ptr %2, !dbg !110 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.2e8a3baa837dcd9f"(ptr %self) #0 !dbg !95 { -// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !98 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !98 -// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !98 -// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !99 -// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !100 -// CHECK:STDOUT: ret ptr %2, !dbg !101 +// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.2e8a3baa837dcd9f"(ptr %self) #0 !dbg !111 { +// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !114 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !114 +// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !114 +// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !115 +// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !116 +// CHECK:STDOUT: call void @"_COp.02b26c7ebd9c0872:core.Destroy.Core"(ptr %1), !dbg !114 +// CHECK:STDOUT: ret ptr %2, !dbg !117 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -232,88 +262,104 @@ fn ConvertFromConstVoidPtr(p: const Cpp.void*) -> const i32* { // CHECK:STDOUT: !17 = !DILocation(line: 7, column: 21, scope: !11) // CHECK:STDOUT: !18 = !DILocation(line: 7, column: 3, scope: !11) // CHECK:STDOUT: !19 = !DILocation(line: 6, column: 1, scope: !11) -// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "PassIntPtr", linkageName: "_CPassIntPtr.Main", scope: null, file: !6, line: 10, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !21) +// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "Op", linkageName: "_COp.39ca70f0f5ff2105:core.Destroy.Core", scope: null, file: !6, line: 7, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !21) // CHECK:STDOUT: !21 = !{!22} // CHECK:STDOUT: !22 = !DILocalVariable(arg: 1, scope: !20, type: !14) -// CHECK:STDOUT: !23 = !DILocation(line: 11, column: 21, scope: !20) -// CHECK:STDOUT: !24 = !DILocation(line: 11, column: 3, scope: !20) -// CHECK:STDOUT: !25 = !DILocation(line: 10, column: 1, scope: !20) -// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "PassIntPtrToConstVoidPtr", linkageName: "_CPassIntPtrToConstVoidPtr.Main", scope: null, file: !6, line: 14, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !27) -// CHECK:STDOUT: !27 = !{!28} -// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !26, type: !14) -// CHECK:STDOUT: !29 = !DILocation(line: 15, column: 27, scope: !26) -// CHECK:STDOUT: !30 = !DILocation(line: 15, column: 3, scope: !26) -// CHECK:STDOUT: !31 = !DILocation(line: 14, column: 1, scope: !26) -// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "PassConstIntPtrToConstVoidPtr", linkageName: "_CPassConstIntPtrToConstVoidPtr.Main", scope: null, file: !6, line: 18, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !33) -// CHECK:STDOUT: !33 = !{!34} -// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !32, type: !14) -// CHECK:STDOUT: !35 = !DILocation(line: 19, column: 27, scope: !32) -// CHECK:STDOUT: !36 = !DILocation(line: 19, column: 3, scope: !32) -// CHECK:STDOUT: !37 = !DILocation(line: 18, column: 1, scope: !32) -// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.66983884551336cb", scope: null, file: !39, line: 96, type: !40, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !42) -// CHECK:STDOUT: !39 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !40 = !DISubroutineType(types: !41) -// CHECK:STDOUT: !41 = !{!14, !14} -// CHECK:STDOUT: !42 = !{!43} -// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !38, type: !14) -// CHECK:STDOUT: !44 = !DILocation(line: 97, column: 12, scope: !38) -// CHECK:STDOUT: !45 = !DILocation(line: 97, column: 5, scope: !38) -// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.295aa3526801a9d4", scope: null, file: !39, line: 96, type: !40, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !47) -// CHECK:STDOUT: !47 = !{!48} -// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !46, type: !14) -// CHECK:STDOUT: !49 = !DILocation(line: 97, column: 12, scope: !46) -// CHECK:STDOUT: !50 = !DILocation(line: 97, column: 5, scope: !46) -// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.e995c7ea1c3d1cc3", scope: null, file: !39, line: 96, type: !40, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !52) -// CHECK:STDOUT: !52 = !{!53} -// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !51, type: !14) -// CHECK:STDOUT: !54 = !DILocation(line: 97, column: 12, scope: !51) -// CHECK:STDOUT: !55 = !DILocation(line: 97, column: 5, scope: !51) -// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.90961d7b1ce4f089:OptionalAs.0e326e799dad0c64.Core.7bed839a0b822504", scope: null, file: !39, line: 71, type: !40, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !57) -// CHECK:STDOUT: !57 = !{!58} -// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !56, type: !14) -// CHECK:STDOUT: !59 = !DILocation(line: 72, column: 12, scope: !56) -// CHECK:STDOUT: !60 = !DILocation(line: 72, column: 5, scope: !56) -// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.3667eb502d1ddfa9:OptionalAs.c7a50af9bdd61b43.Core.57bd8d0c2213b1aa", scope: null, file: !39, line: 78, type: !40, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !62) -// CHECK:STDOUT: !62 = !{!63} -// CHECK:STDOUT: !63 = !DILocalVariable(arg: 1, scope: !61, type: !14) -// CHECK:STDOUT: !64 = !DILocation(line: 79, column: 29, scope: !61) -// CHECK:STDOUT: !65 = !DILocation(line: 79, column: 12, scope: !61) -// CHECK:STDOUT: !66 = !DILocation(line: 79, column: 5, scope: !61) -// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.3667eb502d1ddfa9:OptionalAs.c7a50af9bdd61b43.Core.02dd0be934e1c38a", scope: null, file: !39, line: 78, type: !40, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !68) +// CHECK:STDOUT: !23 = !DILocation(line: 7, column: 21, scope: !20) +// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "Op", linkageName: "_COp.ee91ab4ecda32839:core.Destroy.Core", scope: null, file: !6, line: 7, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !25) +// CHECK:STDOUT: !25 = !{!26} +// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !24, type: !14) +// CHECK:STDOUT: !27 = !DILocation(line: 7, column: 21, scope: !24) +// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "PassIntPtr", linkageName: "_CPassIntPtr.Main", scope: null, file: !6, line: 10, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !29) +// CHECK:STDOUT: !29 = !{!30} +// CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !28, type: !14) +// CHECK:STDOUT: !31 = !DILocation(line: 11, column: 21, scope: !28) +// CHECK:STDOUT: !32 = !DILocation(line: 11, column: 3, scope: !28) +// CHECK:STDOUT: !33 = !DILocation(line: 10, column: 1, scope: !28) +// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "PassIntPtrToConstVoidPtr", linkageName: "_CPassIntPtrToConstVoidPtr.Main", scope: null, file: !6, line: 14, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !35) +// CHECK:STDOUT: !35 = !{!36} +// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !34, type: !14) +// CHECK:STDOUT: !37 = !DILocation(line: 15, column: 27, scope: !34) +// CHECK:STDOUT: !38 = !DILocation(line: 15, column: 3, scope: !34) +// CHECK:STDOUT: !39 = !DILocation(line: 14, column: 1, scope: !34) +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "Op", linkageName: "_COp.02b26c7ebd9c0872:core.Destroy.Core", scope: null, file: !6, line: 15, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !41) +// CHECK:STDOUT: !41 = !{!42} +// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !40, type: !14) +// CHECK:STDOUT: !43 = !DILocation(line: 15, column: 27, scope: !40) +// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0d7a529f95147939:core.Destroy.Core", scope: null, file: !6, line: 15, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !45) +// CHECK:STDOUT: !45 = !{!46} +// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !44, type: !14) +// CHECK:STDOUT: !47 = !DILocation(line: 15, column: 27, scope: !44) +// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "PassConstIntPtrToConstVoidPtr", linkageName: "_CPassConstIntPtrToConstVoidPtr.Main", scope: null, file: !6, line: 18, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !49) +// CHECK:STDOUT: !49 = !{!50} +// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !48, type: !14) +// CHECK:STDOUT: !51 = !DILocation(line: 19, column: 27, scope: !48) +// CHECK:STDOUT: !52 = !DILocation(line: 19, column: 3, scope: !48) +// CHECK:STDOUT: !53 = !DILocation(line: 18, column: 1, scope: !48) +// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.66983884551336cb", scope: null, file: !55, line: 96, type: !56, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !58) +// CHECK:STDOUT: !55 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !56 = !DISubroutineType(types: !57) +// CHECK:STDOUT: !57 = !{!14, !14} +// CHECK:STDOUT: !58 = !{!59} +// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !54, type: !14) +// CHECK:STDOUT: !60 = !DILocation(line: 97, column: 12, scope: !54) +// CHECK:STDOUT: !61 = !DILocation(line: 97, column: 5, scope: !54) +// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.295aa3526801a9d4", scope: null, file: !55, line: 96, type: !56, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !63) +// CHECK:STDOUT: !63 = !{!64} +// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !62, type: !14) +// CHECK:STDOUT: !65 = !DILocation(line: 97, column: 12, scope: !62) +// CHECK:STDOUT: !66 = !DILocation(line: 97, column: 5, scope: !62) +// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.e995c7ea1c3d1cc3", scope: null, file: !55, line: 96, type: !56, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !68) // CHECK:STDOUT: !68 = !{!69} // CHECK:STDOUT: !69 = !DILocalVariable(arg: 1, scope: !67, type: !14) -// CHECK:STDOUT: !70 = !DILocation(line: 79, column: 29, scope: !67) -// CHECK:STDOUT: !71 = !DILocation(line: 79, column: 12, scope: !67) -// CHECK:STDOUT: !72 = !DILocation(line: 79, column: 5, scope: !67) -// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.7bed839a0b822504", scope: null, file: !39, line: 30, type: !40, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !74) -// CHECK:STDOUT: !74 = !{!75} -// CHECK:STDOUT: !75 = !DILocalVariable(arg: 1, scope: !73, type: !14) -// CHECK:STDOUT: !76 = !DILocation(line: 31, column: 12, scope: !73) -// CHECK:STDOUT: !77 = !DILocation(line: 31, column: 5, scope: !73) -// CHECK:STDOUT: !78 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert:thunk.e8f8f92d3d08d149:ImplicitAs.ffd58aeb29886b72.Core.b88d1103f417c6d4", scope: null, file: !79, line: 40, type: !40, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !80) -// CHECK:STDOUT: !79 = !DIFile(filename: "{{.*}}/prelude/types/cpp/void.carbon", directory: "") -// CHECK:STDOUT: !80 = !{!81} -// CHECK:STDOUT: !81 = !DILocalVariable(arg: 1, scope: !78, type: !14) -// CHECK:STDOUT: !82 = !DILocation(line: 40, column: 3, scope: !78) -// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.9544e72a46e24ed6", scope: null, file: !39, line: 30, type: !40, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !84) +// CHECK:STDOUT: !70 = !DILocation(line: 97, column: 12, scope: !67) +// CHECK:STDOUT: !71 = !DILocation(line: 97, column: 5, scope: !67) +// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.90961d7b1ce4f089:OptionalAs.0e326e799dad0c64.Core.7bed839a0b822504", scope: null, file: !55, line: 71, type: !56, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !73) +// CHECK:STDOUT: !73 = !{!74} +// CHECK:STDOUT: !74 = !DILocalVariable(arg: 1, scope: !72, type: !14) +// CHECK:STDOUT: !75 = !DILocation(line: 72, column: 12, scope: !72) +// CHECK:STDOUT: !76 = !DILocation(line: 72, column: 5, scope: !72) +// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.3667eb502d1ddfa9:OptionalAs.c7a50af9bdd61b43.Core.57bd8d0c2213b1aa", scope: null, file: !55, line: 78, type: !56, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !78) +// CHECK:STDOUT: !78 = !{!79} +// CHECK:STDOUT: !79 = !DILocalVariable(arg: 1, scope: !77, type: !14) +// CHECK:STDOUT: !80 = !DILocation(line: 79, column: 29, scope: !77) +// CHECK:STDOUT: !81 = !DILocation(line: 79, column: 12, scope: !77) +// CHECK:STDOUT: !82 = !DILocation(line: 79, column: 5, scope: !77) +// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.3667eb502d1ddfa9:OptionalAs.c7a50af9bdd61b43.Core.02dd0be934e1c38a", scope: null, file: !55, line: 78, type: !56, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !84) // CHECK:STDOUT: !84 = !{!85} // CHECK:STDOUT: !85 = !DILocalVariable(arg: 1, scope: !83, type: !14) -// CHECK:STDOUT: !86 = !DILocation(line: 31, column: 12, scope: !83) -// CHECK:STDOUT: !87 = !DILocation(line: 31, column: 5, scope: !83) -// CHECK:STDOUT: !88 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.a3238f3d1f6ba299", scope: null, file: !39, line: 150, type: !40, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !89) -// CHECK:STDOUT: !89 = !{!90} -// CHECK:STDOUT: !90 = !DILocalVariable(arg: 1, scope: !88, type: !14) -// CHECK:STDOUT: !91 = !DILocation(line: 151, column: 14, scope: !88) -// CHECK:STDOUT: !92 = !DILocation(line: 153, column: 5, scope: !88) -// CHECK:STDOUT: !93 = !DILocation(line: 151, column: 18, scope: !88) -// CHECK:STDOUT: !94 = !DILocation(line: 154, column: 5, scope: !88) -// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.2e8a3baa837dcd9f", scope: null, file: !39, line: 150, type: !40, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !96) +// CHECK:STDOUT: !86 = !DILocation(line: 79, column: 29, scope: !83) +// CHECK:STDOUT: !87 = !DILocation(line: 79, column: 12, scope: !83) +// CHECK:STDOUT: !88 = !DILocation(line: 79, column: 5, scope: !83) +// CHECK:STDOUT: !89 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.7bed839a0b822504", scope: null, file: !55, line: 30, type: !56, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !90) +// CHECK:STDOUT: !90 = !{!91} +// CHECK:STDOUT: !91 = !DILocalVariable(arg: 1, scope: !89, type: !14) +// CHECK:STDOUT: !92 = !DILocation(line: 31, column: 12, scope: !89) +// CHECK:STDOUT: !93 = !DILocation(line: 31, column: 5, scope: !89) +// CHECK:STDOUT: !94 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert:thunk.e8f8f92d3d08d149:ImplicitAs.ffd58aeb29886b72.Core.b88d1103f417c6d4", scope: null, file: !95, line: 40, type: !56, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !96) +// CHECK:STDOUT: !95 = !DIFile(filename: "{{.*}}/prelude/types/cpp/void.carbon", directory: "") // CHECK:STDOUT: !96 = !{!97} -// CHECK:STDOUT: !97 = !DILocalVariable(arg: 1, scope: !95, type: !14) -// CHECK:STDOUT: !98 = !DILocation(line: 151, column: 14, scope: !95) -// CHECK:STDOUT: !99 = !DILocation(line: 153, column: 5, scope: !95) -// CHECK:STDOUT: !100 = !DILocation(line: 151, column: 18, scope: !95) -// CHECK:STDOUT: !101 = !DILocation(line: 154, column: 5, scope: !95) +// CHECK:STDOUT: !97 = !DILocalVariable(arg: 1, scope: !94, type: !14) +// CHECK:STDOUT: !98 = !DILocation(line: 40, column: 3, scope: !94) +// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.9544e72a46e24ed6", scope: null, file: !55, line: 30, type: !56, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !100) +// CHECK:STDOUT: !100 = !{!101} +// CHECK:STDOUT: !101 = !DILocalVariable(arg: 1, scope: !99, type: !14) +// CHECK:STDOUT: !102 = !DILocation(line: 31, column: 12, scope: !99) +// CHECK:STDOUT: !103 = !DILocation(line: 31, column: 5, scope: !99) +// CHECK:STDOUT: !104 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.a3238f3d1f6ba299", scope: null, file: !55, line: 150, type: !56, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !105) +// CHECK:STDOUT: !105 = !{!106} +// CHECK:STDOUT: !106 = !DILocalVariable(arg: 1, scope: !104, type: !14) +// CHECK:STDOUT: !107 = !DILocation(line: 151, column: 14, scope: !104) +// CHECK:STDOUT: !108 = !DILocation(line: 153, column: 5, scope: !104) +// CHECK:STDOUT: !109 = !DILocation(line: 151, column: 18, scope: !104) +// CHECK:STDOUT: !110 = !DILocation(line: 154, column: 5, scope: !104) +// CHECK:STDOUT: !111 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.2e8a3baa837dcd9f", scope: null, file: !55, line: 150, type: !56, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !112) +// CHECK:STDOUT: !112 = !{!113} +// CHECK:STDOUT: !113 = !DILocalVariable(arg: 1, scope: !111, type: !14) +// CHECK:STDOUT: !114 = !DILocation(line: 151, column: 14, scope: !111) +// CHECK:STDOUT: !115 = !DILocation(line: 153, column: 5, scope: !111) +// CHECK:STDOUT: !116 = !DILocation(line: 151, column: 18, scope: !111) +// CHECK:STDOUT: !117 = !DILocation(line: 154, column: 5, scope: !111) // CHECK:STDOUT: ; ModuleID = 'receive.carbon' // CHECK:STDOUT: source_filename = "receive.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" diff --git a/toolchain/lower/testdata/let/copy_value_rep.carbon b/toolchain/lower/testdata/let/copy_value_rep.carbon index 58ab752246ee..db4e6ac7c5c1 100644 --- a/toolchain/lower/testdata/let/copy_value_rep.carbon +++ b/toolchain/lower/testdata/let/copy_value_rep.carbon @@ -38,9 +38,28 @@ fn Run() -> i32 { // CHECK:STDOUT: %.loc19_17.2 = load i32, ptr %.loc19_17.1.a, align 4, !dbg !10 // CHECK:STDOUT: %.loc20_4.a = getelementptr inbounds nuw { i32 }, ptr %x.var, i32 0, i32 0, !dbg !11 // CHECK:STDOUT: store i32 2, ptr %.loc20_4.a, align 4, !dbg !11 +// CHECK:STDOUT: call void @"_COp.607f187990247af9:core.Destroy.Core"(ptr %x.var), !dbg !8 // CHECK:STDOUT: ret i32 %.loc19_17.2, !dbg !12 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !13 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.2595c2fa6d16d130:core.Destroy.Core"(ptr %self) #0 !dbg !19 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !25 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.607f187990247af9:core.Destroy.Core"(ptr %self) #0 !dbg !26 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !29 +// 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,3 +86,20 @@ fn Run() -> i32 { // CHECK:STDOUT: !10 = !DILocation(line: 19, column: 16, scope: !4) // CHECK:STDOUT: !11 = !DILocation(line: 20, column: 3, scope: !4) // CHECK:STDOUT: !12 = !DILocation(line: 22, column: 3, scope: !4) +// CHECK:STDOUT: !13 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 18, type: !14, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !16) +// CHECK:STDOUT: !14 = !DISubroutineType(types: !15) +// CHECK:STDOUT: !15 = !{null, !7} +// CHECK:STDOUT: !16 = !{!17} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !13, type: !7) +// CHECK:STDOUT: !18 = !DILocation(line: 18, column: 3, scope: !13) +// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "Op", linkageName: "_COp.2595c2fa6d16d130:core.Destroy.Core", scope: null, file: !3, line: 18, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !23) +// CHECK:STDOUT: !20 = !DISubroutineType(types: !21) +// CHECK:STDOUT: !21 = !{null, !22} +// CHECK:STDOUT: !22 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !23 = !{!24} +// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !19, type: !22) +// CHECK:STDOUT: !25 = !DILocation(line: 18, column: 3, scope: !19) +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.607f187990247af9:core.Destroy.Core", scope: null, file: !3, line: 18, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !27) +// CHECK:STDOUT: !27 = !{!28} +// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !26, type: !22) +// CHECK:STDOUT: !29 = !DILocation(line: 18, column: 3, scope: !26) diff --git a/toolchain/lower/testdata/let/tuple.carbon b/toolchain/lower/testdata/let/tuple.carbon index 44f3ce176d2e..f0f52ed1b200 100644 --- a/toolchain/lower/testdata/let/tuple.carbon +++ b/toolchain/lower/testdata/let/tuple.carbon @@ -68,9 +68,29 @@ fn F() -> i32 { // CHECK:STDOUT: %tuple.elem1.loc17_11.tuple.elem.load = load ptr, ptr %tuple.elem1.loc17_11.tuple.elem, align 8, !dbg !15 // 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 !15 // CHECK:STDOUT: %tuple.elem1.loc17_13.tuple.elem.load = load i32, ptr %tuple.elem1.loc17_13.tuple.elem, align 4, !dbg !15 +// CHECK:STDOUT: call void @"_COp.8e354c83fe88ab86:core.Destroy.Core"(ptr %b.var), !dbg !9 +// CHECK:STDOUT: call void @"_COp.819e9e1e390140e8:core.Destroy.Core"(ptr %a.var), !dbg !8 // CHECK:STDOUT: ret i32 %tuple.elem1.loc17_13.tuple.elem.load, !dbg !16 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !17 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !22 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.8e354c83fe88ab86:core.Destroy.Core"(ptr %self) #0 !dbg !23 { +// 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.819e9e1e390140e8:core.Destroy.Core"(ptr %self) #0 !dbg !30 { +// 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) // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #1 // CHECK:STDOUT: @@ -105,3 +125,20 @@ fn F() -> i32 { // CHECK:STDOUT: !14 = !DILocation(line: 16, column: 42, scope: !4) // CHECK:STDOUT: !15 = !DILocation(line: 17, column: 10, scope: !4) // CHECK:STDOUT: !16 = !DILocation(line: 17, column: 3, scope: !4) +// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 15, type: !18, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !20) +// CHECK:STDOUT: !18 = !DISubroutineType(types: !19) +// CHECK:STDOUT: !19 = !{null, !7} +// CHECK:STDOUT: !20 = !{!21} +// CHECK:STDOUT: !21 = !DILocalVariable(arg: 1, scope: !17, type: !7) +// CHECK:STDOUT: !22 = !DILocation(line: 15, column: 3, scope: !17) +// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8e354c83fe88ab86:core.Destroy.Core", scope: null, file: !3, line: 15, type: !24, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !27) +// CHECK:STDOUT: !24 = !DISubroutineType(types: !25) +// CHECK:STDOUT: !25 = !{null, !26} +// CHECK:STDOUT: !26 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !27 = !{!28} +// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !23, type: !26) +// CHECK:STDOUT: !29 = !DILocation(line: 15, column: 3, scope: !23) +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Op", linkageName: "_COp.819e9e1e390140e8:core.Destroy.Core", scope: null, file: !3, line: 14, type: !24, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !31) +// CHECK:STDOUT: !31 = !{!32} +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !30, type: !26) +// CHECK:STDOUT: !33 = !DILocation(line: 14, column: 3, scope: !30) diff --git a/toolchain/lower/testdata/operators/assignment.carbon b/toolchain/lower/testdata/operators/assignment.carbon index 09a988f4bf72..56f52f5894f8 100644 --- a/toolchain/lower/testdata/operators/assignment.carbon +++ b/toolchain/lower/testdata/operators/assignment.carbon @@ -35,26 +35,40 @@ fn G() -> (i32, i32) { // CHECK:STDOUT: store i32 12, ptr %a.var, align 4, !dbg !8 // CHECK:STDOUT: store i32 9, ptr %a.var, align 4, !dbg !9 // CHECK:STDOUT: %.loc16 = load i32, ptr %a.var, align 4, !dbg !10 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %a.var), !dbg !8 // CHECK:STDOUT: ret i32 %.loc16, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CG.Main(ptr sret({ i32, i32 }) %return) #0 !dbg !12 { +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %b.var = alloca { i32, i32 }, align 8, !dbg !16 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b.var), !dbg !16 -// CHECK:STDOUT: %tuple.elem0.loc21.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 0, !dbg !17 -// CHECK:STDOUT: %tuple.elem1.loc21.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 1, !dbg !17 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %b.var, ptr align 4 @tuple.21c.loc21_5, i64 8, i1 false), !dbg !18 -// CHECK:STDOUT: %tuple.elem0.loc22_10.1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 0, !dbg !19 -// CHECK:STDOUT: %.loc22_10.1 = load i32, ptr %tuple.elem0.loc22_10.1.tuple.elem, align 4, !dbg !19 -// CHECK:STDOUT: %tuple.elem0.loc22_10.2.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0, !dbg !19 -// CHECK:STDOUT: store i32 %.loc22_10.1, ptr %tuple.elem0.loc22_10.2.tuple.elem, align 4, !dbg !19 -// CHECK:STDOUT: %tuple.elem1.loc22_10.1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 1, !dbg !19 -// CHECK:STDOUT: %.loc22_10.3 = load i32, ptr %tuple.elem1.loc22_10.1.tuple.elem, align 4, !dbg !19 -// CHECK:STDOUT: %tuple.elem1.loc22_10.2.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !19 -// CHECK:STDOUT: store i32 %.loc22_10.3, ptr %tuple.elem1.loc22_10.2.tuple.elem, align 4, !dbg !19 -// CHECK:STDOUT: ret void, !dbg !20 +// CHECK:STDOUT: ret void, !dbg !17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CG.Main(ptr sret({ i32, i32 }) %return) #0 !dbg !18 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %b.var = alloca { i32, i32 }, align 8, !dbg !22 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b.var), !dbg !22 +// CHECK:STDOUT: %tuple.elem0.loc21.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 0, !dbg !23 +// CHECK:STDOUT: %tuple.elem1.loc21.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 1, !dbg !23 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %b.var, ptr align 4 @tuple.21c.loc21_5, i64 8, i1 false), !dbg !24 +// CHECK:STDOUT: %tuple.elem0.loc22_10.1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 0, !dbg !25 +// CHECK:STDOUT: %.loc22_10.1 = load i32, ptr %tuple.elem0.loc22_10.1.tuple.elem, align 4, !dbg !25 +// CHECK:STDOUT: %tuple.elem0.loc22_10.2.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0, !dbg !25 +// CHECK:STDOUT: store i32 %.loc22_10.1, ptr %tuple.elem0.loc22_10.2.tuple.elem, align 4, !dbg !25 +// CHECK:STDOUT: %tuple.elem1.loc22_10.1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 1, !dbg !25 +// CHECK:STDOUT: %.loc22_10.3 = load i32, ptr %tuple.elem1.loc22_10.1.tuple.elem, align 4, !dbg !25 +// CHECK:STDOUT: %tuple.elem1.loc22_10.2.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !25 +// CHECK:STDOUT: store i32 %.loc22_10.3, ptr %tuple.elem1.loc22_10.2.tuple.elem, align 4, !dbg !25 +// CHECK:STDOUT: call void @"_COp.8e354c83fe88ab86:core.Destroy.Core"(ptr %b.var), !dbg !22 +// CHECK:STDOUT: ret void, !dbg !26 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.8e354c83fe88ab86:core.Destroy.Core"(ptr %self) #0 !dbg !27 { +// 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) @@ -85,12 +99,24 @@ fn G() -> (i32, i32) { // CHECK:STDOUT: !9 = !DILocation(line: 15, column: 3, scope: !4) // CHECK:STDOUT: !10 = !DILocation(line: 16, column: 10, scope: !4) // CHECK:STDOUT: !11 = !DILocation(line: 16, column: 3, scope: !4) -// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !3, line: 19, type: !13, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 14, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !15) // CHECK:STDOUT: !13 = !DISubroutineType(types: !14) -// CHECK:STDOUT: !14 = !{!15} -// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !16 = !DILocation(line: 20, column: 3, scope: !12) -// CHECK:STDOUT: !17 = !DILocation(line: 21, column: 7, scope: !12) -// CHECK:STDOUT: !18 = !DILocation(line: 21, column: 3, scope: !12) -// CHECK:STDOUT: !19 = !DILocation(line: 22, column: 10, scope: !12) -// CHECK:STDOUT: !20 = !DILocation(line: 22, column: 3, scope: !12) +// CHECK:STDOUT: !14 = !{null, !7} +// CHECK:STDOUT: !15 = !{!16} +// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !12, type: !7) +// CHECK:STDOUT: !17 = !DILocation(line: 14, column: 3, scope: !12) +// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !3, line: 19, type: !19, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !19 = !DISubroutineType(types: !20) +// CHECK:STDOUT: !20 = !{!21} +// CHECK:STDOUT: !21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !22 = !DILocation(line: 20, column: 3, scope: !18) +// CHECK:STDOUT: !23 = !DILocation(line: 21, column: 7, scope: !18) +// CHECK:STDOUT: !24 = !DILocation(line: 21, column: 3, scope: !18) +// CHECK:STDOUT: !25 = !DILocation(line: 22, column: 10, scope: !18) +// CHECK:STDOUT: !26 = !DILocation(line: 22, column: 3, scope: !18) +// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8e354c83fe88ab86:core.Destroy.Core", scope: null, file: !3, line: 20, type: !28, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !30) +// CHECK:STDOUT: !28 = !DISubroutineType(types: !29) +// CHECK:STDOUT: !29 = !{null, !21} +// CHECK:STDOUT: !30 = !{!31} +// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !27, type: !21) +// CHECK:STDOUT: !32 = !DILocation(line: 20, column: 3, scope: !27) diff --git a/toolchain/lower/testdata/operators/increment.carbon b/toolchain/lower/testdata/operators/increment.carbon index fb5bee168527..63f46ed32c94 100644 --- a/toolchain/lower/testdata/operators/increment.carbon +++ b/toolchain/lower/testdata/operators/increment.carbon @@ -29,36 +29,43 @@ fn IncrSigned() { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %from.var), !dbg !7 // CHECK:STDOUT: store i32 0, ptr %from.var, align 4, !dbg !7 // CHECK:STDOUT: call void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %from.var), !dbg !8 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %from.var), !dbg !7 // CHECK:STDOUT: ret void, !dbg !9 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !10 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !16 +// 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 !10 { -// CHECK:STDOUT: call void @"_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.5375cfcbca6d9e35.Core.57ee91777b6354a8"(ptr %self, i32 1), !dbg !17 -// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: define linkonce_odr void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !17 { +// CHECK:STDOUT: call void @"_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.5375cfcbca6d9e35.Core.57ee91777b6354a8"(ptr %self, i32 1), !dbg !21 +// CHECK:STDOUT: ret void, !dbg !22 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.5375cfcbca6d9e35.Core.57ee91777b6354a8"(ptr %self, i32 %other) #2 !dbg !19 { -// CHECK:STDOUT: %1 = call i32 @"_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d"(i32 %other), !dbg !25 -// CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !26 -// CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !26 -// CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !26 -// CHECK:STDOUT: ret void, !dbg !26 +// CHECK:STDOUT: define linkonce_odr void @"_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.5375cfcbca6d9e35.Core.57ee91777b6354a8"(ptr %self, i32 %other) #2 !dbg !23 { +// CHECK:STDOUT: %1 = call i32 @"_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d"(i32 %other), !dbg !29 +// CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !30 +// CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !30 +// CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !30 +// CHECK:STDOUT: ret void, !dbg !30 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d"(i32 %self) #0 !dbg !27 { -// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !32 -// CHECK:STDOUT: ret i32 %1, !dbg !33 +// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d"(i32 %self) #0 !dbg !31 { +// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !36 +// CHECK:STDOUT: ret i32 %1, !dbg !37 // 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 !34 { -// CHECK:STDOUT: ret i32 %self, !dbg !37 +// CHECK:STDOUT: define linkonce_odr i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self) #0 !dbg !38 { +// CHECK:STDOUT: ret i32 %self, !dbg !41 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -78,31 +85,35 @@ fn IncrSigned() { // CHECK:STDOUT: !7 = !DILocation(line: 5, column: 3, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 6, column: 3, scope: !4) // CHECK:STDOUT: !9 = !DILocation(line: 4, column: 1, scope: !4) -// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !11, line: 363, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !15) -// CHECK:STDOUT: !11 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null, !14} -// CHECK:STDOUT: !14 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !15 = !{!16} -// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !10, type: !14) -// CHECK:STDOUT: !17 = !DILocation(line: 365, column: 5, scope: !10) -// CHECK:STDOUT: !18 = !DILocation(line: 363, column: 3, scope: !10) -// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.5375cfcbca6d9e35.Core.57ee91777b6354a8", scope: null, file: !11, line: 299, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !22) -// CHECK:STDOUT: !20 = !DISubroutineType(types: !21) -// CHECK:STDOUT: !21 = !{null, !14, !14} -// CHECK:STDOUT: !22 = !{!23, !24} -// CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !19, type: !14) -// CHECK:STDOUT: !24 = !DILocalVariable(arg: 2, scope: !19, type: !14) -// CHECK:STDOUT: !25 = !DILocation(line: 4294967295, scope: !19) -// CHECK:STDOUT: !26 = !DILocation(line: 299, column: 3, scope: !19) -// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d", scope: null, file: !11, line: 62, type: !28, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !30) -// CHECK:STDOUT: !28 = !DISubroutineType(types: !29) -// CHECK:STDOUT: !29 = !{!14, !14} -// CHECK:STDOUT: !30 = !{!31} -// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !27, type: !14) -// CHECK:STDOUT: !32 = !DILocation(line: 64, column: 17, scope: !27) -// CHECK:STDOUT: !33 = !DILocation(line: 64, column: 5, scope: !27) -// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !11, line: 57, type: !28, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !35) -// CHECK:STDOUT: !35 = !{!36} -// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !34, type: !14) -// CHECK:STDOUT: !37 = !DILocation(line: 57, column: 36, scope: !34) +// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 5, type: !11, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !14) +// CHECK:STDOUT: !11 = !DISubroutineType(types: !12) +// CHECK:STDOUT: !12 = !{null, !13} +// CHECK:STDOUT: !13 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !14 = !{!15} +// CHECK:STDOUT: !15 = !DILocalVariable(arg: 1, scope: !10, type: !13) +// CHECK:STDOUT: !16 = !DILocation(line: 5, column: 3, scope: !10) +// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !18, line: 363, type: !11, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !19) +// CHECK:STDOUT: !18 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") +// CHECK:STDOUT: !19 = !{!20} +// CHECK:STDOUT: !20 = !DILocalVariable(arg: 1, scope: !17, type: !13) +// CHECK:STDOUT: !21 = !DILocation(line: 365, column: 5, scope: !17) +// CHECK:STDOUT: !22 = !DILocation(line: 363, column: 3, scope: !17) +// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk.Int.9452f4c51951679b.Core:AddAssignWith.5375cfcbca6d9e35.Core.57ee91777b6354a8", scope: null, file: !18, line: 299, type: !24, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !26) +// CHECK:STDOUT: !24 = !DISubroutineType(types: !25) +// CHECK:STDOUT: !25 = !{null, !13, !13} +// CHECK:STDOUT: !26 = !{!27, !28} +// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !23, type: !13) +// CHECK:STDOUT: !28 = !DILocalVariable(arg: 2, scope: !23, type: !13) +// CHECK:STDOUT: !29 = !DILocation(line: 4294967295, scope: !23) +// CHECK:STDOUT: !30 = !DILocation(line: 299, column: 3, scope: !23) +// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d", scope: null, file: !18, line: 62, type: !32, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !34) +// CHECK:STDOUT: !32 = !DISubroutineType(types: !33) +// CHECK:STDOUT: !33 = !{!13, !13} +// CHECK:STDOUT: !34 = !{!35} +// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !31, type: !13) +// CHECK:STDOUT: !36 = !DILocation(line: 64, column: 17, scope: !31) +// CHECK:STDOUT: !37 = !DILocation(line: 64, column: 5, scope: !31) +// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !18, line: 57, type: !32, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !39) +// CHECK:STDOUT: !39 = !{!40} +// CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !38, type: !13) +// CHECK:STDOUT: !41 = !DILocation(line: 57, column: 36, scope: !38) diff --git a/toolchain/lower/testdata/operators/overloaded.carbon b/toolchain/lower/testdata/operators/overloaded.carbon index 35cb4d97b73f..c8c35ca5b85b 100644 --- a/toolchain/lower/testdata/operators/overloaded.carbon +++ b/toolchain/lower/testdata/operators/overloaded.carbon @@ -98,9 +98,22 @@ fn Calculate(a: Number, b: Number) -> Number { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc30_10.1.temp), !dbg !33 // CHECK:STDOUT: call void @"_COp.Number.Main:Negate.Core"(ptr %.loc30_10.1.temp, ptr %a), !dbg !33 // CHECK:STDOUT: call void @"_COp.Number.Main:MulWith.44027391c5135f93.Core"(ptr %return, ptr %.loc30_10.1.temp, ptr %b), !dbg !33 +// CHECK:STDOUT: call void @"_COp.9960bfe90b4ad2b6:core.Destroy.Core"(ptr %.loc30_10.1.temp), !dbg !33 // CHECK:STDOUT: ret void, !dbg !34 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.86fb9acde14db001:core.Destroy.Core"(ptr %self) #0 !dbg !35 { +// 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.9960bfe90b4ad2b6:core.Destroy.Core"(ptr %self) #0 !dbg !41 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !44 +// 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: @@ -145,3 +158,13 @@ fn Calculate(a: Number, b: Number) -> Number { // CHECK:STDOUT: !32 = !DILocalVariable(arg: 2, scope: !29, type: !7) // CHECK:STDOUT: !33 = !DILocation(line: 30, column: 10, scope: !29) // CHECK:STDOUT: !34 = !DILocation(line: 30, column: 3, scope: !29) +// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "Op", linkageName: "_COp.86fb9acde14db001:core.Destroy.Core", scope: null, file: !3, line: 30, type: !36, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !38) +// CHECK:STDOUT: !36 = !DISubroutineType(types: !37) +// CHECK:STDOUT: !37 = !{null, !7} +// CHECK:STDOUT: !38 = !{!39} +// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !35, type: !7) +// CHECK:STDOUT: !40 = !DILocation(line: 30, column: 10, scope: !35) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "Op", linkageName: "_COp.9960bfe90b4ad2b6:core.Destroy.Core", scope: null, file: !3, line: 30, type: !36, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !42) +// CHECK:STDOUT: !42 = !{!43} +// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !41, type: !7) +// CHECK:STDOUT: !44 = !DILocation(line: 30, column: 10, scope: !41) diff --git a/toolchain/lower/testdata/pointer/address_of_field.carbon b/toolchain/lower/testdata/pointer/address_of_field.carbon index a1a513f3bc4d..473c0e44ab3f 100644 --- a/toolchain/lower/testdata/pointer/address_of_field.carbon +++ b/toolchain/lower/testdata/pointer/address_of_field.carbon @@ -34,9 +34,22 @@ fn F() { // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %s.var, ptr align 4 @struct.ed5.loc16_3, i64 8, i1 false), !dbg !7 // CHECK:STDOUT: %.loc17.b = getelementptr inbounds nuw { i32, i32 }, ptr %s.var, i32 0, i32 1, !dbg !9 // CHECK:STDOUT: call void @_CG.Main(ptr %.loc17.b), !dbg !10 +// CHECK:STDOUT: call void @"_COp.fb32c4dfca65e378:core.Destroy.Core"(ptr %s.var), !dbg !7 // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !12 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.fb32c4dfca65e378:core.Destroy.Core"(ptr %self) #0 !dbg !19 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !25 +// 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: @@ -62,3 +75,17 @@ fn F() { // CHECK:STDOUT: !9 = !DILocation(line: 17, column: 6, scope: !4) // CHECK:STDOUT: !10 = !DILocation(line: 17, column: 3, scope: !4) // CHECK:STDOUT: !11 = !DILocation(line: 15, column: 1, scope: !4) +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 16, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !16) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null, !15} +// CHECK:STDOUT: !15 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !16 = !{!17} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15) +// CHECK:STDOUT: !18 = !DILocation(line: 16, column: 3, scope: !12) +// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fb32c4dfca65e378:core.Destroy.Core", scope: null, file: !3, line: 16, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !23) +// CHECK:STDOUT: !20 = !DISubroutineType(types: !21) +// CHECK:STDOUT: !21 = !{null, !22} +// CHECK:STDOUT: !22 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !23 = !{!24} +// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !19, type: !22) +// CHECK:STDOUT: !25 = !DILocation(line: 16, column: 3, scope: !19) diff --git a/toolchain/lower/testdata/pointer/address_of_unused.carbon b/toolchain/lower/testdata/pointer/address_of_unused.carbon index 72dda3989d66..e7e240512a60 100644 --- a/toolchain/lower/testdata/pointer/address_of_unused.carbon +++ b/toolchain/lower/testdata/pointer/address_of_unused.carbon @@ -24,9 +24,16 @@ fn F() { // CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !7 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !7 // CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !7 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %n.var), !dbg !7 // CHECK:STDOUT: ret void, !dbg !8 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !9 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !15 +// 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: @@ -45,3 +52,10 @@ fn F() { // CHECK:STDOUT: !6 = !{null} // CHECK:STDOUT: !7 = !DILocation(line: 14, column: 3, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 13, column: 1, scope: !4) +// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 14, type: !10, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !13) +// CHECK:STDOUT: !10 = !DISubroutineType(types: !11) +// CHECK:STDOUT: !11 = !{null, !12} +// CHECK:STDOUT: !12 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !13 = !{!14} +// CHECK:STDOUT: !14 = !DILocalVariable(arg: 1, scope: !9, type: !12) +// CHECK:STDOUT: !15 = !DILocation(line: 14, column: 3, scope: !9) diff --git a/toolchain/lower/testdata/pointer/basic.carbon b/toolchain/lower/testdata/pointer/basic.carbon index e551d231dc45..e4291e6a8fd8 100644 --- a/toolchain/lower/testdata/pointer/basic.carbon +++ b/toolchain/lower/testdata/pointer/basic.carbon @@ -36,9 +36,16 @@ fn F() -> i32 { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !16 // CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !16 // CHECK:STDOUT: %G.call = call i32 @_CG.Main(ptr %n.var), !dbg !17 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %n.var), !dbg !16 // CHECK:STDOUT: ret i32 %G.call, !dbg !18 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !19 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !24 +// 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,3 +74,9 @@ fn F() -> i32 { // CHECK:STDOUT: !16 = !DILocation(line: 18, column: 3, scope: !13) // CHECK:STDOUT: !17 = !DILocation(line: 19, column: 10, scope: !13) // CHECK:STDOUT: !18 = !DILocation(line: 19, column: 3, scope: !13) +// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 18, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !22) +// CHECK:STDOUT: !20 = !DISubroutineType(types: !21) +// CHECK:STDOUT: !21 = !{null, !7} +// CHECK:STDOUT: !22 = !{!23} +// CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !19, type: !7) +// CHECK:STDOUT: !24 = !DILocation(line: 18, column: 3, scope: !19) diff --git a/toolchain/lower/testdata/primitives/numeric_literals.carbon b/toolchain/lower/testdata/primitives/numeric_literals.carbon index 22b9378dfd94..d74af81bd71d 100644 --- a/toolchain/lower/testdata/primitives/numeric_literals.carbon +++ b/toolchain/lower/testdata/primitives/numeric_literals.carbon @@ -54,9 +54,35 @@ fn F() { // CHECK:STDOUT: %.loc29_3.15.array.index = getelementptr inbounds [6 x double], ptr %_.var.loc22, i32 0, i64 4, !dbg !10 // CHECK:STDOUT: %.loc29_3.18.array.index = getelementptr inbounds [6 x double], ptr %_.var.loc22, i32 0, i64 5, !dbg !10 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %_.var.loc22, ptr align 8 @array.6e0.loc22_3, i64 48, i1 false), !dbg !8 +// CHECK:STDOUT: call void @"_COp.78641801e7f451a0:core.Destroy.Core"(ptr %_.var.loc22), !dbg !8 +// CHECK:STDOUT: call void @"_COp.91faacee3b3f55ab:core.Destroy.Core"(ptr %_.var.loc16), !dbg !7 // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.98006a366c2ffd6c:core.Destroy.Core"(ptr %self) #0 !dbg !12 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.78641801e7f451a0:core.Destroy.Core"(ptr %self) #0 !dbg !19 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !22 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !23 { +// 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.91faacee3b3f55ab:core.Destroy.Core"(ptr %self) #0 !dbg !30 { +// 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) // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #1 // CHECK:STDOUT: @@ -86,3 +112,25 @@ fn F() { // CHECK:STDOUT: !9 = !DILocation(line: 16, column: 26, scope: !4) // CHECK:STDOUT: !10 = !DILocation(line: 22, column: 26, scope: !4) // CHECK:STDOUT: !11 = !DILocation(line: 13, column: 1, scope: !4) +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Op", linkageName: "_COp.98006a366c2ffd6c:core.Destroy.Core", scope: null, file: !3, line: 22, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !16) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null, !15} +// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !16 = !{!17} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15) +// CHECK:STDOUT: !18 = !DILocation(line: 22, column: 3, scope: !12) +// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "Op", linkageName: "_COp.78641801e7f451a0:core.Destroy.Core", scope: null, file: !3, line: 22, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !20) +// CHECK:STDOUT: !20 = !{!21} +// CHECK:STDOUT: !21 = !DILocalVariable(arg: 1, scope: !19, type: !15) +// CHECK:STDOUT: !22 = !DILocation(line: 22, column: 3, scope: !19) +// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 16, type: !24, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !27) +// CHECK:STDOUT: !24 = !DISubroutineType(types: !25) +// CHECK:STDOUT: !25 = !{null, !26} +// CHECK:STDOUT: !26 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !27 = !{!28} +// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !23, type: !26) +// CHECK:STDOUT: !29 = !DILocation(line: 16, column: 3, scope: !23) +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Op", linkageName: "_COp.91faacee3b3f55ab:core.Destroy.Core", scope: null, file: !3, line: 16, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !31) +// CHECK:STDOUT: !31 = !{!32} +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !30, type: !15) +// CHECK:STDOUT: !33 = !DILocation(line: 16, column: 3, scope: !30) diff --git a/toolchain/lower/testdata/primitives/optional.carbon b/toolchain/lower/testdata/primitives/optional.carbon index c2c8586cc4e6..3eeab2b608e5 100644 --- a/toolchain/lower/testdata/primitives/optional.carbon +++ b/toolchain/lower/testdata/primitives/optional.carbon @@ -35,211 +35,296 @@ fn AddOrRemoveConst(a: i32, b: const i32) { // CHECK:STDOUT: source_filename = "optional.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CConvert.Main(ptr sret({ i32, i1 }) %return, ptr %o) #0 !dbg !4 { +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !4 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Optional.HasValue.call = call i1 @_CHasValue.Optional.Core.03e3348579103d79(ptr %o), !dbg !10 -// CHECK:STDOUT: br i1 %Optional.HasValue.call, label %if.then, label %if.else, !dbg !11 +// CHECK:STDOUT: ret void, !dbg !10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CConvert.Main(ptr sret({ i32, i1 }) %return, ptr %o) #0 !dbg !11 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %Optional.HasValue.call = call i1 @_CHasValue.Optional.Core.03e3348579103d79(ptr %o), !dbg !17 +// CHECK:STDOUT: br i1 %Optional.HasValue.call, label %if.then, label %if.else, !dbg !18 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: %Optional.Get.call = call ptr @_CGet.Optional.Core.03e3348579103d79(ptr %o), !dbg !12 -// CHECK:STDOUT: %.loc18_12.2 = load i32, ptr %Optional.Get.call, align 4, !dbg !13 -// CHECK:STDOUT: call void @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.6b1f19368d09e579"(ptr %return, i32 %.loc18_12.2), !dbg !14 -// CHECK:STDOUT: ret void, !dbg !14 +// CHECK:STDOUT: %Optional.Get.call = call ptr @_CGet.Optional.Core.03e3348579103d79(ptr %o), !dbg !19 +// CHECK:STDOUT: %.loc18_12.2 = load i32, ptr %Optional.Get.call, align 4, !dbg !20 +// CHECK:STDOUT: call void @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.6b1f19368d09e579"(ptr %return, i32 %.loc18_12.2), !dbg !21 +// CHECK:STDOUT: ret void, !dbg !21 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: call void @_CNone.Optional.Core.30ced37eb1e63547(ptr %return), !dbg !15 -// CHECK:STDOUT: ret void, !dbg !16 +// CHECK:STDOUT: call void @_CNone.Optional.Core.30ced37eb1e63547(ptr %return), !dbg !22 +// CHECK:STDOUT: ret void, !dbg !23 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CAddOrRemoveConst.Main(i32 %a, i32 %b) #0 !dbg !17 { +// CHECK:STDOUT: define void @_CAddOrRemoveConst.Main(i32 %a, i32 %b) #0 !dbg !24 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var.loc24 = alloca { i32, i1 }, align 8, !dbg !24 -// CHECK:STDOUT: %_.var.loc25 = alloca { i32, i1 }, align 8, !dbg !25 -// CHECK:STDOUT: %_.var.loc26 = alloca { i32, i1 }, align 8, !dbg !26 -// CHECK:STDOUT: %_.var.loc27 = alloca { i32, i1 }, align 8, !dbg !27 -// CHECK:STDOUT: %_.var.loc28 = alloca { i32, i1 }, align 8, !dbg !28 -// CHECK:STDOUT: %_.var.loc29 = alloca { i32, i1 }, align 8, !dbg !29 -// CHECK:STDOUT: %_.var.loc30 = alloca { i32, i1 }, align 8, !dbg !30 -// CHECK:STDOUT: %_.var.loc31 = alloca { i32, i1 }, align 8, !dbg !31 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc24), !dbg !24 -// CHECK:STDOUT: call void @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.6b1f19368d09e579"(ptr %_.var.loc24, i32 %a), !dbg !24 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc25), !dbg !25 -// CHECK:STDOUT: call void @"_CConvert.a44fce96e16342e7:ImplicitAs.ad22d1bbc0605210.Core.77b263a5fd240ddf"(ptr %_.var.loc25, i32 %a), !dbg !25 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc26), !dbg !26 -// CHECK:STDOUT: call void @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.787d589b54a95071"(ptr %_.var.loc26, i32 %a), !dbg !26 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc27), !dbg !27 -// CHECK:STDOUT: call void @"_CConvert.a44fce96e16342e7:ImplicitAs.ad22d1bbc0605210.Core.25fb32d66f981ccd"(ptr %_.var.loc27, i32 %a), !dbg !27 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc28), !dbg !28 -// CHECK:STDOUT: call void @"_CConvert.17f42c13d842b71d:ImplicitAs.eb057aa32837c84e.Core.77b263a5fd240ddf"(ptr %_.var.loc28, i32 %b), !dbg !28 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc29), !dbg !29 -// CHECK:STDOUT: call void @"_CConvert.17f42c13d842b71d:ImplicitAs.eb057aa32837c84e.Core.693532dcb04bf6dc"(ptr %_.var.loc29, i32 %b), !dbg !29 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc30), !dbg !30 -// CHECK:STDOUT: call void @"_CConvert.17f42c13d842b71d:ImplicitAs.eb057aa32837c84e.Core.25fb32d66f981ccd"(ptr %_.var.loc30, i32 %b), !dbg !30 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc31), !dbg !31 -// CHECK:STDOUT: call void @"_CConvert.17f42c13d842b71d:ImplicitAs.eb057aa32837c84e.Core.1c991c9fdfba671f"(ptr %_.var.loc31, i32 %b), !dbg !31 -// CHECK:STDOUT: ret void, !dbg !32 +// CHECK:STDOUT: %_.var.loc24 = alloca { i32, i1 }, align 8, !dbg !30 +// CHECK:STDOUT: %_.var.loc25 = alloca { i32, i1 }, align 8, !dbg !31 +// CHECK:STDOUT: %_.var.loc26 = alloca { i32, i1 }, align 8, !dbg !32 +// CHECK:STDOUT: %_.var.loc27 = alloca { i32, i1 }, align 8, !dbg !33 +// CHECK:STDOUT: %_.var.loc28 = alloca { i32, i1 }, align 8, !dbg !34 +// CHECK:STDOUT: %_.var.loc29 = alloca { i32, i1 }, align 8, !dbg !35 +// CHECK:STDOUT: %_.var.loc30 = alloca { i32, i1 }, align 8, !dbg !36 +// CHECK:STDOUT: %_.var.loc31 = alloca { i32, i1 }, align 8, !dbg !37 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc24), !dbg !30 +// CHECK:STDOUT: call void @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.6b1f19368d09e579"(ptr %_.var.loc24, i32 %a), !dbg !30 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc25), !dbg !31 +// CHECK:STDOUT: call void @"_CConvert.a44fce96e16342e7:ImplicitAs.ad22d1bbc0605210.Core.77b263a5fd240ddf"(ptr %_.var.loc25, i32 %a), !dbg !31 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc26), !dbg !32 +// CHECK:STDOUT: call void @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.787d589b54a95071"(ptr %_.var.loc26, i32 %a), !dbg !32 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc27), !dbg !33 +// CHECK:STDOUT: call void @"_CConvert.a44fce96e16342e7:ImplicitAs.ad22d1bbc0605210.Core.25fb32d66f981ccd"(ptr %_.var.loc27, i32 %a), !dbg !33 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc28), !dbg !34 +// CHECK:STDOUT: call void @"_CConvert.17f42c13d842b71d:ImplicitAs.eb057aa32837c84e.Core.77b263a5fd240ddf"(ptr %_.var.loc28, i32 %b), !dbg !34 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc29), !dbg !35 +// CHECK:STDOUT: call void @"_CConvert.17f42c13d842b71d:ImplicitAs.eb057aa32837c84e.Core.693532dcb04bf6dc"(ptr %_.var.loc29, i32 %b), !dbg !35 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc30), !dbg !36 +// CHECK:STDOUT: call void @"_CConvert.17f42c13d842b71d:ImplicitAs.eb057aa32837c84e.Core.25fb32d66f981ccd"(ptr %_.var.loc30, i32 %b), !dbg !36 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc31), !dbg !37 +// CHECK:STDOUT: call void @"_CConvert.17f42c13d842b71d:ImplicitAs.eb057aa32837c84e.Core.1c991c9fdfba671f"(ptr %_.var.loc31, i32 %b), !dbg !37 +// CHECK:STDOUT: call void @"_COp.d36c7307651a37b3:core.Destroy.Core"(ptr %_.var.loc31), !dbg !37 +// CHECK:STDOUT: call void @"_COp.5553625be1dd8a40:core.Destroy.Core"(ptr %_.var.loc30), !dbg !36 +// CHECK:STDOUT: call void @"_COp.674b1a1b79996ecc:core.Destroy.Core"(ptr %_.var.loc29), !dbg !35 +// CHECK:STDOUT: call void @"_COp.0bee941dbd1b8cad:core.Destroy.Core"(ptr %_.var.loc28), !dbg !34 +// CHECK:STDOUT: call void @"_COp.d36c7307651a37b3:core.Destroy.Core"(ptr %_.var.loc27), !dbg !33 +// CHECK:STDOUT: call void @"_COp.5553625be1dd8a40:core.Destroy.Core"(ptr %_.var.loc26), !dbg !32 +// CHECK:STDOUT: call void @"_COp.674b1a1b79996ecc:core.Destroy.Core"(ptr %_.var.loc25), !dbg !31 +// CHECK:STDOUT: call void @"_COp.0bee941dbd1b8cad:core.Destroy.Core"(ptr %_.var.loc24), !dbg !30 +// CHECK:STDOUT: ret void, !dbg !38 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.03e3348579103d79(ptr %self) #0 !dbg !33 { -// CHECK:STDOUT: %1 = call i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.b88d1103f417c6d4"(ptr %self), !dbg !37 -// CHECK:STDOUT: ret i1 %1, !dbg !38 +// CHECK:STDOUT: define weak_odr void @"_COp.957ebacb0fd15edb:core.Destroy.Core"(ptr %self) #0 !dbg !39 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !44 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CGet.Optional.Core.03e3348579103d79(ptr %self) #0 !dbg !39 { -// CHECK:STDOUT: %1 = call ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.b88d1103f417c6d4"(ptr %self), !dbg !42 -// CHECK:STDOUT: ret ptr %1, !dbg !43 +// CHECK:STDOUT: define weak_odr void @"_COp.9ec466cd9fb9d70b:core.Destroy.Core"(ptr %self) #0 !dbg !45 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !48 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.6b1f19368d09e579"(ptr sret({ i32, i1 }) %return, i32 %self) #0 !dbg !44 { -// CHECK:STDOUT: call void @"_CConvert.90961d7b1ce4f089:OptionalAs.0e326e799dad0c64.Core.30ced37eb1e63547"(ptr %return, i32 %self), !dbg !49 -// CHECK:STDOUT: ret void, !dbg !50 +// CHECK:STDOUT: define weak_odr void @"_COp.05fd1694057796b3:core.Destroy.Core"(ptr %self) #0 !dbg !49 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !52 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.30ced37eb1e63547(ptr sret({ i32, i1 }) %return) #0 !dbg !51 { -// CHECK:STDOUT: call void @"_CNone.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1"(ptr %return), !dbg !54 -// CHECK:STDOUT: ret void, !dbg !55 +// CHECK:STDOUT: define weak_odr void @"_COp.9fb3992c261f67a7:core.Destroy.Core"(ptr %self) #0 !dbg !53 { +// 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.5553625be1dd8a40:core.Destroy.Core"(ptr %self) #0 !dbg !57 { +// 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.d36c7307651a37b3:core.Destroy.Core"(ptr %self) #0 !dbg !61 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !64 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.b9f59d4d0f116c67:core.Destroy.Core"(ptr %self) #0 !dbg !65 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !68 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.59d039ff34f2fb65:core.Destroy.Core"(ptr %self) #0 !dbg !69 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !72 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.099822cde4c680b1:core.Destroy.Core"(ptr %self) #0 !dbg !73 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !76 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.0bee941dbd1b8cad:core.Destroy.Core"(ptr %self) #0 !dbg !77 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !80 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.674b1a1b79996ecc:core.Destroy.Core"(ptr %self) #0 !dbg !81 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !84 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.03e3348579103d79(ptr %self) #0 !dbg !85 { +// CHECK:STDOUT: %1 = call i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.b88d1103f417c6d4"(ptr %self), !dbg !89 +// CHECK:STDOUT: ret i1 %1, !dbg !90 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr ptr @_CGet.Optional.Core.03e3348579103d79(ptr %self) #0 !dbg !91 { +// CHECK:STDOUT: %1 = call ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.b88d1103f417c6d4"(ptr %self), !dbg !94 +// CHECK:STDOUT: ret ptr %1, !dbg !95 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.6b1f19368d09e579"(ptr sret({ i32, i1 }) %return, i32 %self) #0 !dbg !96 { +// CHECK:STDOUT: call void @"_CConvert.90961d7b1ce4f089:OptionalAs.0e326e799dad0c64.Core.30ced37eb1e63547"(ptr %return, i32 %self), !dbg !101 +// CHECK:STDOUT: ret void, !dbg !102 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.30ced37eb1e63547(ptr sret({ i32, i1 }) %return) #0 !dbg !103 { +// CHECK:STDOUT: call void @"_CNone.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1"(ptr %return), !dbg !106 +// CHECK:STDOUT: ret void, !dbg !107 // 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.a44fce96e16342e7:ImplicitAs.ad22d1bbc0605210.Core.77b263a5fd240ddf"(ptr sret({ i32, i1 }) %return, i32 %self) #0 !dbg !56 { -// CHECK:STDOUT: call void @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.6b1f19368d09e579"(ptr %return, i32 %self), !dbg !60 -// CHECK:STDOUT: ret void, !dbg !61 +// CHECK:STDOUT: define linkonce_odr void @"_CConvert.a44fce96e16342e7:ImplicitAs.ad22d1bbc0605210.Core.77b263a5fd240ddf"(ptr sret({ i32, i1 }) %return, i32 %self) #0 !dbg !108 { +// CHECK:STDOUT: call void @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.6b1f19368d09e579"(ptr %return, i32 %self), !dbg !112 +// CHECK:STDOUT: ret void, !dbg !113 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.787d589b54a95071"(ptr sret({ i32, i1 }) %return, i32 %self) #0 !dbg !62 { -// CHECK:STDOUT: call void @"_CConvert.3667eb502d1ddfa9:OptionalAs.c7a50af9bdd61b43.Core.5d35ad54738af8e4"(ptr %return, i32 %self), !dbg !65 -// CHECK:STDOUT: ret void, !dbg !66 +// CHECK:STDOUT: define linkonce_odr void @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.787d589b54a95071"(ptr sret({ i32, i1 }) %return, i32 %self) #0 !dbg !114 { +// CHECK:STDOUT: call void @"_CConvert.3667eb502d1ddfa9:OptionalAs.c7a50af9bdd61b43.Core.5d35ad54738af8e4"(ptr %return, i32 %self), !dbg !117 +// CHECK:STDOUT: ret void, !dbg !118 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CConvert.a44fce96e16342e7:ImplicitAs.ad22d1bbc0605210.Core.25fb32d66f981ccd"(ptr sret({ i32, i1 }) %return, i32 %self) #0 !dbg !67 { -// CHECK:STDOUT: call void @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.787d589b54a95071"(ptr %return, i32 %self), !dbg !70 -// CHECK:STDOUT: ret void, !dbg !71 +// CHECK:STDOUT: define linkonce_odr void @"_CConvert.a44fce96e16342e7:ImplicitAs.ad22d1bbc0605210.Core.25fb32d66f981ccd"(ptr sret({ i32, i1 }) %return, i32 %self) #0 !dbg !119 { +// CHECK:STDOUT: call void @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.787d589b54a95071"(ptr %return, i32 %self), !dbg !122 +// CHECK:STDOUT: ret void, !dbg !123 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CConvert.17f42c13d842b71d:ImplicitAs.eb057aa32837c84e.Core.77b263a5fd240ddf"(ptr sret({ i32, i1 }) %return, i32 %self) #0 !dbg !72 { -// CHECK:STDOUT: call void @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.6b1f19368d09e579"(ptr %return, i32 %self), !dbg !75 -// CHECK:STDOUT: ret void, !dbg !76 +// CHECK:STDOUT: define linkonce_odr void @"_CConvert.17f42c13d842b71d:ImplicitAs.eb057aa32837c84e.Core.77b263a5fd240ddf"(ptr sret({ i32, i1 }) %return, i32 %self) #0 !dbg !124 { +// CHECK:STDOUT: call void @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.6b1f19368d09e579"(ptr %return, i32 %self), !dbg !127 +// CHECK:STDOUT: ret void, !dbg !128 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CConvert.17f42c13d842b71d:ImplicitAs.eb057aa32837c84e.Core.693532dcb04bf6dc"(ptr sret({ i32, i1 }) %return, i32 %self) #0 !dbg !77 { -// CHECK:STDOUT: call void @"_CConvert.a44fce96e16342e7:ImplicitAs.ad22d1bbc0605210.Core.77b263a5fd240ddf"(ptr %return, i32 %self), !dbg !80 -// CHECK:STDOUT: ret void, !dbg !81 +// CHECK:STDOUT: define linkonce_odr void @"_CConvert.17f42c13d842b71d:ImplicitAs.eb057aa32837c84e.Core.693532dcb04bf6dc"(ptr sret({ i32, i1 }) %return, i32 %self) #0 !dbg !129 { +// CHECK:STDOUT: call void @"_CConvert.a44fce96e16342e7:ImplicitAs.ad22d1bbc0605210.Core.77b263a5fd240ddf"(ptr %return, i32 %self), !dbg !132 +// CHECK:STDOUT: ret void, !dbg !133 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CConvert.17f42c13d842b71d:ImplicitAs.eb057aa32837c84e.Core.25fb32d66f981ccd"(ptr sret({ i32, i1 }) %return, i32 %self) #0 !dbg !82 { -// CHECK:STDOUT: call void @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.787d589b54a95071"(ptr %return, i32 %self), !dbg !85 -// CHECK:STDOUT: ret void, !dbg !86 +// CHECK:STDOUT: define linkonce_odr void @"_CConvert.17f42c13d842b71d:ImplicitAs.eb057aa32837c84e.Core.25fb32d66f981ccd"(ptr sret({ i32, i1 }) %return, i32 %self) #0 !dbg !134 { +// CHECK:STDOUT: call void @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.787d589b54a95071"(ptr %return, i32 %self), !dbg !137 +// CHECK:STDOUT: ret void, !dbg !138 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CConvert.17f42c13d842b71d:ImplicitAs.eb057aa32837c84e.Core.1c991c9fdfba671f"(ptr sret({ i32, i1 }) %return, i32 %self) #0 !dbg !87 { -// CHECK:STDOUT: call void @"_CConvert.a44fce96e16342e7:ImplicitAs.ad22d1bbc0605210.Core.25fb32d66f981ccd"(ptr %return, i32 %self), !dbg !90 -// CHECK:STDOUT: ret void, !dbg !91 +// CHECK:STDOUT: define linkonce_odr void @"_CConvert.17f42c13d842b71d:ImplicitAs.eb057aa32837c84e.Core.1c991c9fdfba671f"(ptr sret({ i32, i1 }) %return, i32 %self) #0 !dbg !139 { +// CHECK:STDOUT: call void @"_CConvert.a44fce96e16342e7:ImplicitAs.ad22d1bbc0605210.Core.25fb32d66f981ccd"(ptr %return, i32 %self), !dbg !142 +// CHECK:STDOUT: ret void, !dbg !143 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.b88d1103f417c6d4"(ptr %value) #0 !dbg !92 { -// CHECK:STDOUT: %1 = icmp eq ptr %value, null, !dbg !95 -// CHECK:STDOUT: %2 = xor i1 %1, true, !dbg !96 -// CHECK:STDOUT: ret i1 %2, !dbg !97 +// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.b88d1103f417c6d4"(ptr %value) #0 !dbg !144 { +// CHECK:STDOUT: %1 = icmp eq ptr %value, null, !dbg !147 +// CHECK:STDOUT: %2 = xor i1 %1, true, !dbg !148 +// CHECK:STDOUT: ret i1 %2, !dbg !149 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.b88d1103f417c6d4"(ptr %value) #0 !dbg !98 { -// CHECK:STDOUT: ret ptr %value, !dbg !101 +// CHECK:STDOUT: define linkonce_odr ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.b88d1103f417c6d4"(ptr %value) #0 !dbg !150 { +// CHECK:STDOUT: ret ptr %value, !dbg !153 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CConvert.90961d7b1ce4f089:OptionalAs.0e326e799dad0c64.Core.30ced37eb1e63547"(ptr sret({ i32, i1 }) %return, i32 %self) #0 !dbg !102 { -// CHECK:STDOUT: call void @_CSome.Optional.Core.30ced37eb1e63547(ptr %return, i32 %self), !dbg !105 -// CHECK:STDOUT: ret void, !dbg !106 +// CHECK:STDOUT: define linkonce_odr void @"_CConvert.90961d7b1ce4f089:OptionalAs.0e326e799dad0c64.Core.30ced37eb1e63547"(ptr sret({ i32, i1 }) %return, i32 %self) #0 !dbg !154 { +// CHECK:STDOUT: call void @_CSome.Optional.Core.30ced37eb1e63547(ptr %return, i32 %self), !dbg !157 +// CHECK:STDOUT: ret void, !dbg !158 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CNone.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1"(ptr sret({ i32, i1 }) %return) #0 !dbg !107 { -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i32, i1 }, ptr %return, i32 0, i32 1, !dbg !108 -// CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !108 -// CHECK:STDOUT: ret void, !dbg !109 +// CHECK:STDOUT: define linkonce_odr void @"_CNone.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1"(ptr sret({ i32, i1 }) %return) #0 !dbg !159 { +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i32, i1 }, ptr %return, i32 0, i32 1, !dbg !160 +// CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !160 +// CHECK:STDOUT: ret void, !dbg !161 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CConvert.3667eb502d1ddfa9:OptionalAs.c7a50af9bdd61b43.Core.5d35ad54738af8e4"(ptr sret({ i32, i1 }) %return, i32 %self) #0 !dbg !110 { -// CHECK:STDOUT: %temp = alloca i32, align 4, !dbg !113 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !113 -// CHECK:STDOUT: %1 = call i32 @"_CConvert.a44fce96e16342e7:ImplicitAs.ad22d1bbc0605210.Core.90a4f5ca3e06badd"(i32 %self), !dbg !113 -// CHECK:STDOUT: store i32 %1, ptr %temp, align 4, !dbg !113 -// CHECK:STDOUT: %2 = load i32, ptr %temp, align 4, !dbg !113 -// CHECK:STDOUT: call void @_CSome.Optional.Core.b0246d3dd29c9210(ptr %return, i32 %2), !dbg !114 -// CHECK:STDOUT: ret void, !dbg !115 +// CHECK:STDOUT: define linkonce_odr void @"_CConvert.3667eb502d1ddfa9:OptionalAs.c7a50af9bdd61b43.Core.5d35ad54738af8e4"(ptr sret({ i32, i1 }) %return, i32 %self) #0 !dbg !162 { +// CHECK:STDOUT: %temp = alloca i32, align 4, !dbg !165 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !165 +// CHECK:STDOUT: %1 = call i32 @"_CConvert.a44fce96e16342e7:ImplicitAs.ad22d1bbc0605210.Core.90a4f5ca3e06badd"(i32 %self), !dbg !165 +// CHECK:STDOUT: store i32 %1, ptr %temp, align 4, !dbg !165 +// CHECK:STDOUT: %2 = load i32, ptr %temp, align 4, !dbg !165 +// CHECK:STDOUT: call void @_CSome.Optional.Core.b0246d3dd29c9210(ptr %return, i32 %2), !dbg !166 +// CHECK:STDOUT: call void @"_COp.957ebacb0fd15edb:core.Destroy.Core"(ptr %temp), !dbg !165 +// CHECK:STDOUT: ret void, !dbg !167 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.30ced37eb1e63547(ptr sret({ i32, i1 }) %return, i32 %value) #0 !dbg !116 { -// CHECK:STDOUT: call void @"_CSome.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1"(ptr %return, i32 %value), !dbg !119 -// CHECK:STDOUT: ret void, !dbg !120 +// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.30ced37eb1e63547(ptr sret({ i32, i1 }) %return, i32 %value) #0 !dbg !168 { +// CHECK:STDOUT: call void @"_CSome.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1"(ptr %return, i32 %value), !dbg !171 +// CHECK:STDOUT: ret void, !dbg !172 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.a44fce96e16342e7:ImplicitAs.ad22d1bbc0605210.Core.90a4f5ca3e06badd"(i32 %self) #0 !dbg !121 { -// CHECK:STDOUT: %1 = call i32 @"_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d"(i32 %self), !dbg !124 -// CHECK:STDOUT: ret i32 %1, !dbg !125 +// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.a44fce96e16342e7:ImplicitAs.ad22d1bbc0605210.Core.90a4f5ca3e06badd"(i32 %self) #0 !dbg !173 { +// CHECK:STDOUT: %1 = call i32 @"_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d"(i32 %self), !dbg !176 +// CHECK:STDOUT: ret i32 %1, !dbg !177 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.b0246d3dd29c9210(ptr sret({ i32, i1 }) %return, i32 %value) #0 !dbg !126 { -// CHECK:STDOUT: call void @"_CSome.3e8267224c5dc9c2:OptionalStorage.Core.5325ffa2b57e13bd"(ptr %return, i32 %value), !dbg !129 -// CHECK:STDOUT: ret void, !dbg !130 +// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.b0246d3dd29c9210(ptr sret({ i32, i1 }) %return, i32 %value) #0 !dbg !178 { +// CHECK:STDOUT: call void @"_CSome.3e8267224c5dc9c2:OptionalStorage.Core.5325ffa2b57e13bd"(ptr %return, i32 %value), !dbg !181 +// CHECK:STDOUT: ret void, !dbg !182 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CSome.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1"(ptr sret({ i32, i1 }) %return, i32 %self) #0 !dbg !131 { -// CHECK:STDOUT: %value = getelementptr inbounds nuw { i32, i1 }, ptr %return, i32 0, i32 0, !dbg !134 -// CHECK:STDOUT: store i32 %self, ptr %value, align 4, !dbg !134 -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i32, i1 }, ptr %return, i32 0, i32 1, !dbg !135 -// CHECK:STDOUT: store i8 1, ptr %has_value, align 1, !dbg !135 -// CHECK:STDOUT: ret void, !dbg !136 +// CHECK:STDOUT: define linkonce_odr void @"_CSome.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1"(ptr sret({ i32, i1 }) %return, i32 %self) #0 !dbg !183 { +// CHECK:STDOUT: %value = getelementptr inbounds nuw { i32, i1 }, ptr %return, i32 0, i32 0, !dbg !186 +// CHECK:STDOUT: store i32 %self, ptr %value, align 4, !dbg !186 +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i32, i1 }, ptr %return, i32 0, i32 1, !dbg !187 +// CHECK:STDOUT: store i8 1, ptr %has_value, align 1, !dbg !187 +// CHECK:STDOUT: ret void, !dbg !188 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d"(i32 %self) #0 !dbg !137 { -// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !143 -// CHECK:STDOUT: ret i32 %1, !dbg !144 +// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d"(i32 %self) #0 !dbg !189 { +// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !195 +// CHECK:STDOUT: ret i32 %1, !dbg !196 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CSome.3e8267224c5dc9c2:OptionalStorage.Core.5325ffa2b57e13bd"(ptr sret({ i32, i1 }) %return, i32 %self) #0 !dbg !145 { -// CHECK:STDOUT: %value = getelementptr inbounds nuw { i32, i1 }, ptr %return, i32 0, i32 0, !dbg !148 -// CHECK:STDOUT: %1 = call i32 @"_COp.34e7a685d3648824:Copy.Core.64ccbb8e5d9a0b8e"(i32 %self), !dbg !149 -// CHECK:STDOUT: store i32 %1, ptr %value, align 4, !dbg !148 -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i32, i1 }, ptr %return, i32 0, i32 1, !dbg !150 -// CHECK:STDOUT: store i8 1, ptr %has_value, align 1, !dbg !150 -// CHECK:STDOUT: ret void, !dbg !151 +// CHECK:STDOUT: define linkonce_odr void @"_CSome.3e8267224c5dc9c2:OptionalStorage.Core.5325ffa2b57e13bd"(ptr sret({ i32, i1 }) %return, i32 %self) #0 !dbg !197 { +// CHECK:STDOUT: %value = getelementptr inbounds nuw { i32, i1 }, ptr %return, i32 0, i32 0, !dbg !200 +// CHECK:STDOUT: %1 = call i32 @"_COp.34e7a685d3648824:Copy.Core.64ccbb8e5d9a0b8e"(i32 %self), !dbg !201 +// CHECK:STDOUT: store i32 %1, ptr %value, align 4, !dbg !200 +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i32, i1 }, ptr %return, i32 0, i32 1, !dbg !202 +// CHECK:STDOUT: store i8 1, ptr %has_value, align 1, !dbg !202 +// CHECK:STDOUT: ret void, !dbg !203 // 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 !152 { -// CHECK:STDOUT: ret i32 %self, !dbg !155 +// CHECK:STDOUT: define linkonce_odr i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self) #0 !dbg !204 { +// CHECK:STDOUT: ret i32 %self, !dbg !207 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_COp.34e7a685d3648824:Copy.Core.64ccbb8e5d9a0b8e"(i32 %self) #0 !dbg !156 { -// CHECK:STDOUT: ret i32 %self, !dbg !160 +// CHECK:STDOUT: define linkonce_odr i32 @"_COp.34e7a685d3648824:Copy.Core.64ccbb8e5d9a0b8e"(i32 %self) #0 !dbg !208 { +// CHECK:STDOUT: ret i32 %self, !dbg !212 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @"_COp.5553625be1dd8a40:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_COp.d36c7307651a37b3:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_COp.0bee941dbd1b8cad:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_COp.674b1a1b79996ecc:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @"_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.6b1f19368d09e579", { 0, 1, 3, 2 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 0, 8, 7, 6, 5, 4, 3, 2, 1 } // CHECK:STDOUT: @@ -253,160 +338,212 @@ fn AddOrRemoveConst(a: i32, b: const i32) { // CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) // CHECK:STDOUT: !3 = !DIFile(filename: "optional.carbon", directory: "") -// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Main", scope: null, file: !3, line: 16, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !8) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 16, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !8) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) -// CHECK:STDOUT: !6 = !{!7, !7} -// CHECK:STDOUT: !7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !6 = !{null, !7} +// CHECK:STDOUT: !7 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) // CHECK:STDOUT: !8 = !{!9} // CHECK:STDOUT: !9 = !DILocalVariable(arg: 1, scope: !4, type: !7) -// CHECK:STDOUT: !10 = !DILocation(line: 17, column: 7, scope: !4) -// CHECK:STDOUT: !11 = !DILocation(line: 17, column: 6, scope: !4) -// CHECK:STDOUT: !12 = !DILocation(line: 18, column: 13, scope: !4) -// CHECK:STDOUT: !13 = !DILocation(line: 18, column: 12, scope: !4) -// CHECK:STDOUT: !14 = !DILocation(line: 18, column: 5, scope: !4) -// CHECK:STDOUT: !15 = !DILocation(line: 20, column: 10, scope: !4) -// CHECK:STDOUT: !16 = !DILocation(line: 20, column: 3, scope: !4) -// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "AddOrRemoveConst", linkageName: "_CAddOrRemoveConst.Main", scope: null, file: !3, line: 23, type: !18, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !21) -// CHECK:STDOUT: !18 = !DISubroutineType(types: !19) -// CHECK:STDOUT: !19 = !{null, !20, !20} -// CHECK:STDOUT: !20 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !21 = !{!22, !23} -// CHECK:STDOUT: !22 = !DILocalVariable(arg: 1, scope: !17, type: !20) -// CHECK:STDOUT: !23 = !DILocalVariable(arg: 2, scope: !17, type: !20) -// CHECK:STDOUT: !24 = !DILocation(line: 24, column: 3, scope: !17) -// CHECK:STDOUT: !25 = !DILocation(line: 25, column: 3, scope: !17) -// CHECK:STDOUT: !26 = !DILocation(line: 26, column: 3, scope: !17) -// CHECK:STDOUT: !27 = !DILocation(line: 27, column: 3, scope: !17) -// CHECK:STDOUT: !28 = !DILocation(line: 28, column: 3, scope: !17) -// CHECK:STDOUT: !29 = !DILocation(line: 29, column: 3, scope: !17) -// CHECK:STDOUT: !30 = !DILocation(line: 30, column: 3, scope: !17) -// CHECK:STDOUT: !31 = !DILocation(line: 31, column: 3, scope: !17) -// CHECK:STDOUT: !32 = !DILocation(line: 23, column: 1, scope: !17) -// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.03e3348579103d79", scope: null, file: !34, line: 33, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !35) -// CHECK:STDOUT: !34 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !35 = !{!36} -// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !33, type: !7) -// CHECK:STDOUT: !37 = !DILocation(line: 34, column: 12, scope: !33) -// CHECK:STDOUT: !38 = !DILocation(line: 34, column: 5, scope: !33) -// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.03e3348579103d79", scope: null, file: !34, line: 36, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !40) -// CHECK:STDOUT: !40 = !{!41} -// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !39, type: !7) -// CHECK:STDOUT: !42 = !DILocation(line: 37, column: 12, scope: !39) -// CHECK:STDOUT: !43 = !DILocation(line: 37, column: 5, scope: !39) -// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.6b1f19368d09e579", scope: null, file: !34, line: 96, type: !45, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !47) -// CHECK:STDOUT: !45 = !DISubroutineType(types: !46) -// CHECK:STDOUT: !46 = !{!7, !20} -// CHECK:STDOUT: !47 = !{!48} -// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !44, type: !20) -// CHECK:STDOUT: !49 = !DILocation(line: 97, column: 12, scope: !44) -// CHECK:STDOUT: !50 = !DILocation(line: 97, column: 5, scope: !44) -// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.30ced37eb1e63547", scope: null, file: !34, line: 27, type: !52, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !52 = !DISubroutineType(types: !53) -// CHECK:STDOUT: !53 = !{!7} -// CHECK:STDOUT: !54 = !DILocation(line: 28, column: 12, scope: !51) -// CHECK:STDOUT: !55 = !DILocation(line: 28, column: 5, scope: !51) -// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.a44fce96e16342e7:ImplicitAs.ad22d1bbc0605210.Core.77b263a5fd240ddf", scope: null, file: !57, line: 40, type: !45, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !58) -// CHECK:STDOUT: !57 = !DIFile(filename: "{{.*}}/prelude/operators/as.carbon", directory: "") +// CHECK:STDOUT: !10 = !DILocation(line: 16, column: 39, scope: !4) +// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Main", scope: null, file: !3, line: 16, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !15) +// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) +// CHECK:STDOUT: !13 = !{!14, !14} +// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !15 = !{!16} +// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !11, type: !14) +// CHECK:STDOUT: !17 = !DILocation(line: 17, column: 7, scope: !11) +// CHECK:STDOUT: !18 = !DILocation(line: 17, column: 6, scope: !11) +// CHECK:STDOUT: !19 = !DILocation(line: 18, column: 13, scope: !11) +// CHECK:STDOUT: !20 = !DILocation(line: 18, column: 12, scope: !11) +// CHECK:STDOUT: !21 = !DILocation(line: 18, column: 5, scope: !11) +// CHECK:STDOUT: !22 = !DILocation(line: 20, column: 10, scope: !11) +// CHECK:STDOUT: !23 = !DILocation(line: 20, column: 3, scope: !11) +// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "AddOrRemoveConst", linkageName: "_CAddOrRemoveConst.Main", scope: null, file: !3, line: 23, type: !25, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !27) +// CHECK:STDOUT: !25 = !DISubroutineType(types: !26) +// CHECK:STDOUT: !26 = !{null, !7, !7} +// CHECK:STDOUT: !27 = !{!28, !29} +// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !24, type: !7) +// CHECK:STDOUT: !29 = !DILocalVariable(arg: 2, scope: !24, type: !7) +// CHECK:STDOUT: !30 = !DILocation(line: 24, column: 3, scope: !24) +// CHECK:STDOUT: !31 = !DILocation(line: 25, column: 3, scope: !24) +// CHECK:STDOUT: !32 = !DILocation(line: 26, column: 3, scope: !24) +// CHECK:STDOUT: !33 = !DILocation(line: 27, column: 3, scope: !24) +// CHECK:STDOUT: !34 = !DILocation(line: 28, column: 3, scope: !24) +// CHECK:STDOUT: !35 = !DILocation(line: 29, column: 3, scope: !24) +// CHECK:STDOUT: !36 = !DILocation(line: 30, column: 3, scope: !24) +// CHECK:STDOUT: !37 = !DILocation(line: 31, column: 3, scope: !24) +// CHECK:STDOUT: !38 = !DILocation(line: 23, column: 1, scope: !24) +// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "Op", linkageName: "_COp.957ebacb0fd15edb:core.Destroy.Core", scope: null, file: !3, line: 26, type: !40, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !42) +// CHECK:STDOUT: !40 = !DISubroutineType(types: !41) +// CHECK:STDOUT: !41 = !{null, !14} +// CHECK:STDOUT: !42 = !{!43} +// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !39, type: !14) +// CHECK:STDOUT: !44 = !DILocation(line: 26, column: 10, scope: !39) +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Op", linkageName: "_COp.9ec466cd9fb9d70b:core.Destroy.Core", scope: null, file: !3, line: 31, type: !40, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !46) +// CHECK:STDOUT: !46 = !{!47} +// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !45, type: !14) +// CHECK:STDOUT: !48 = !DILocation(line: 31, column: 3, scope: !45) +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "Op", linkageName: "_COp.05fd1694057796b3:core.Destroy.Core", scope: null, file: !3, line: 31, type: !40, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !50) +// CHECK:STDOUT: !50 = !{!51} +// CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !49, type: !14) +// CHECK:STDOUT: !52 = !DILocation(line: 31, column: 3, scope: !49) +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "Op", linkageName: "_COp.9fb3992c261f67a7:core.Destroy.Core", scope: null, file: !3, line: 31, type: !40, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !54) +// CHECK:STDOUT: !54 = !{!55} +// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !53, type: !14) +// CHECK:STDOUT: !56 = !DILocation(line: 31, column: 3, scope: !53) +// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5553625be1dd8a40:core.Destroy.Core", scope: null, file: !3, line: 31, type: !40, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !58) // CHECK:STDOUT: !58 = !{!59} -// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !56, type: !20) -// CHECK:STDOUT: !60 = !DILocation(line: 40, column: 45, scope: !56) -// CHECK:STDOUT: !61 = !DILocation(line: 40, column: 38, scope: !56) -// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.787d589b54a95071", scope: null, file: !34, line: 96, type: !45, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !63) -// CHECK:STDOUT: !63 = !{!64} -// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !62, type: !20) -// CHECK:STDOUT: !65 = !DILocation(line: 97, column: 12, scope: !62) -// CHECK:STDOUT: !66 = !DILocation(line: 97, column: 5, scope: !62) -// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.a44fce96e16342e7:ImplicitAs.ad22d1bbc0605210.Core.25fb32d66f981ccd", scope: null, file: !57, line: 40, type: !45, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !68) -// CHECK:STDOUT: !68 = !{!69} -// CHECK:STDOUT: !69 = !DILocalVariable(arg: 1, scope: !67, type: !20) -// CHECK:STDOUT: !70 = !DILocation(line: 40, column: 45, scope: !67) -// CHECK:STDOUT: !71 = !DILocation(line: 40, column: 38, scope: !67) -// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.17f42c13d842b71d:ImplicitAs.eb057aa32837c84e.Core.77b263a5fd240ddf", scope: null, file: !57, line: 44, type: !45, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !73) -// CHECK:STDOUT: !73 = !{!74} -// CHECK:STDOUT: !74 = !DILocalVariable(arg: 1, scope: !72, type: !20) -// CHECK:STDOUT: !75 = !DILocation(line: 44, column: 45, scope: !72) -// CHECK:STDOUT: !76 = !DILocation(line: 44, column: 38, scope: !72) -// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.17f42c13d842b71d:ImplicitAs.eb057aa32837c84e.Core.693532dcb04bf6dc", scope: null, file: !57, line: 44, type: !45, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !78) +// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !57, type: !14) +// CHECK:STDOUT: !60 = !DILocation(line: 31, column: 3, scope: !57) +// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d36c7307651a37b3:core.Destroy.Core", scope: null, file: !3, line: 31, type: !40, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !62) +// CHECK:STDOUT: !62 = !{!63} +// CHECK:STDOUT: !63 = !DILocalVariable(arg: 1, scope: !61, type: !14) +// CHECK:STDOUT: !64 = !DILocation(line: 31, column: 3, scope: !61) +// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b9f59d4d0f116c67:core.Destroy.Core", scope: null, file: !3, line: 29, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !66) +// CHECK:STDOUT: !66 = !{!67} +// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !65, type: !7) +// CHECK:STDOUT: !68 = !DILocation(line: 29, column: 3, scope: !65) +// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "Op", linkageName: "_COp.59d039ff34f2fb65:core.Destroy.Core", scope: null, file: !3, line: 29, type: !40, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !70) +// CHECK:STDOUT: !70 = !{!71} +// CHECK:STDOUT: !71 = !DILocalVariable(arg: 1, scope: !69, type: !14) +// CHECK:STDOUT: !72 = !DILocation(line: 29, column: 3, scope: !69) +// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "Op", linkageName: "_COp.099822cde4c680b1:core.Destroy.Core", scope: null, file: !3, line: 29, type: !40, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !74) +// CHECK:STDOUT: !74 = !{!75} +// CHECK:STDOUT: !75 = !DILocalVariable(arg: 1, scope: !73, type: !14) +// CHECK:STDOUT: !76 = !DILocation(line: 29, column: 3, scope: !73) +// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0bee941dbd1b8cad:core.Destroy.Core", scope: null, file: !3, line: 29, type: !40, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !78) // CHECK:STDOUT: !78 = !{!79} -// CHECK:STDOUT: !79 = !DILocalVariable(arg: 1, scope: !77, type: !20) -// CHECK:STDOUT: !80 = !DILocation(line: 44, column: 45, scope: !77) -// CHECK:STDOUT: !81 = !DILocation(line: 44, column: 38, scope: !77) -// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.17f42c13d842b71d:ImplicitAs.eb057aa32837c84e.Core.25fb32d66f981ccd", scope: null, file: !57, line: 44, type: !45, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !83) -// CHECK:STDOUT: !83 = !{!84} -// CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !82, type: !20) -// CHECK:STDOUT: !85 = !DILocation(line: 44, column: 45, scope: !82) -// CHECK:STDOUT: !86 = !DILocation(line: 44, column: 38, scope: !82) -// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.17f42c13d842b71d:ImplicitAs.eb057aa32837c84e.Core.1c991c9fdfba671f", scope: null, file: !57, line: 44, type: !45, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !88) -// CHECK:STDOUT: !88 = !{!89} -// CHECK:STDOUT: !89 = !DILocalVariable(arg: 1, scope: !87, type: !20) -// CHECK:STDOUT: !90 = !DILocation(line: 44, column: 45, scope: !87) -// CHECK:STDOUT: !91 = !DILocation(line: 44, column: 38, scope: !87) -// CHECK:STDOUT: !92 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.e8f8f92d3d08d149:OptionalStorage.Core.b88d1103f417c6d4", scope: null, file: !34, line: 156, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !93) -// CHECK:STDOUT: !93 = !{!94} -// CHECK:STDOUT: !94 = !DILocalVariable(arg: 1, scope: !92, type: !7) -// CHECK:STDOUT: !95 = !DILocation(line: 157, column: 16, scope: !92) -// CHECK:STDOUT: !96 = !DILocation(line: 157, column: 12, scope: !92) -// CHECK:STDOUT: !97 = !DILocation(line: 157, column: 5, scope: !92) -// CHECK:STDOUT: !98 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.e8f8f92d3d08d149:OptionalStorage.Core.b88d1103f417c6d4", scope: null, file: !34, line: 159, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !99) +// CHECK:STDOUT: !79 = !DILocalVariable(arg: 1, scope: !77, type: !14) +// CHECK:STDOUT: !80 = !DILocation(line: 29, column: 3, scope: !77) +// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "Op", linkageName: "_COp.674b1a1b79996ecc:core.Destroy.Core", scope: null, file: !3, line: 29, type: !40, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !82) +// CHECK:STDOUT: !82 = !{!83} +// CHECK:STDOUT: !83 = !DILocalVariable(arg: 1, scope: !81, type: !14) +// CHECK:STDOUT: !84 = !DILocation(line: 29, column: 3, scope: !81) +// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.03e3348579103d79", scope: null, file: !86, line: 33, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !87) +// CHECK:STDOUT: !86 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !87 = !{!88} +// CHECK:STDOUT: !88 = !DILocalVariable(arg: 1, scope: !85, type: !14) +// CHECK:STDOUT: !89 = !DILocation(line: 34, column: 12, scope: !85) +// CHECK:STDOUT: !90 = !DILocation(line: 34, column: 5, scope: !85) +// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.03e3348579103d79", scope: null, file: !86, line: 36, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !92) +// CHECK:STDOUT: !92 = !{!93} +// CHECK:STDOUT: !93 = !DILocalVariable(arg: 1, scope: !91, type: !14) +// CHECK:STDOUT: !94 = !DILocation(line: 37, column: 12, scope: !91) +// CHECK:STDOUT: !95 = !DILocation(line: 37, column: 5, scope: !91) +// CHECK:STDOUT: !96 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.6b1f19368d09e579", scope: null, file: !86, line: 96, type: !97, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !99) +// CHECK:STDOUT: !97 = !DISubroutineType(types: !98) +// CHECK:STDOUT: !98 = !{!14, !7} // CHECK:STDOUT: !99 = !{!100} -// CHECK:STDOUT: !100 = !DILocalVariable(arg: 1, scope: !98, type: !7) -// CHECK:STDOUT: !101 = !DILocation(line: 160, column: 5, scope: !98) -// CHECK:STDOUT: !102 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.90961d7b1ce4f089:OptionalAs.0e326e799dad0c64.Core.30ced37eb1e63547", scope: null, file: !34, line: 71, type: !45, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !103) -// CHECK:STDOUT: !103 = !{!104} -// CHECK:STDOUT: !104 = !DILocalVariable(arg: 1, scope: !102, type: !20) -// CHECK:STDOUT: !105 = !DILocation(line: 72, column: 12, scope: !102) -// CHECK:STDOUT: !106 = !DILocation(line: 72, column: 5, scope: !102) -// CHECK:STDOUT: !107 = distinct !DISubprogram(name: "None", linkageName: "_CNone.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1", scope: null, file: !34, line: 116, type: !52, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !108 = !DILocation(line: 119, column: 5, scope: !107) -// CHECK:STDOUT: !109 = !DILocation(line: 120, column: 5, scope: !107) -// CHECK:STDOUT: !110 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.3667eb502d1ddfa9:OptionalAs.c7a50af9bdd61b43.Core.5d35ad54738af8e4", scope: null, file: !34, line: 78, type: !45, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !111) -// CHECK:STDOUT: !111 = !{!112} -// CHECK:STDOUT: !112 = !DILocalVariable(arg: 1, scope: !110, type: !20) -// CHECK:STDOUT: !113 = !DILocation(line: 79, column: 29, scope: !110) -// CHECK:STDOUT: !114 = !DILocation(line: 79, column: 12, scope: !110) -// CHECK:STDOUT: !115 = !DILocation(line: 79, column: 5, scope: !110) -// CHECK:STDOUT: !116 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.30ced37eb1e63547", scope: null, file: !34, line: 30, type: !45, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !117) -// CHECK:STDOUT: !117 = !{!118} -// CHECK:STDOUT: !118 = !DILocalVariable(arg: 1, scope: !116, type: !20) -// CHECK:STDOUT: !119 = !DILocation(line: 31, column: 12, scope: !116) -// CHECK:STDOUT: !120 = !DILocation(line: 31, column: 5, scope: !116) -// CHECK:STDOUT: !121 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.a44fce96e16342e7:ImplicitAs.ad22d1bbc0605210.Core.90a4f5ca3e06badd", scope: null, file: !57, line: 40, type: !45, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !122) -// CHECK:STDOUT: !122 = !{!123} -// CHECK:STDOUT: !123 = !DILocalVariable(arg: 1, scope: !121, type: !20) -// CHECK:STDOUT: !124 = !DILocation(line: 40, column: 45, scope: !121) -// CHECK:STDOUT: !125 = !DILocation(line: 40, column: 38, scope: !121) -// CHECK:STDOUT: !126 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.b0246d3dd29c9210", scope: null, file: !34, line: 30, type: !45, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !127) -// CHECK:STDOUT: !127 = !{!128} -// CHECK:STDOUT: !128 = !DILocalVariable(arg: 1, scope: !126, type: !20) -// CHECK:STDOUT: !129 = !DILocation(line: 31, column: 12, scope: !126) -// CHECK:STDOUT: !130 = !DILocation(line: 31, column: 5, scope: !126) -// CHECK:STDOUT: !131 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1", scope: null, file: !34, line: 122, type: !45, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !132) -// CHECK:STDOUT: !132 = !{!133} -// CHECK:STDOUT: !133 = !DILocalVariable(arg: 1, scope: !131, type: !20) -// CHECK:STDOUT: !134 = !DILocation(line: 128, column: 5, scope: !131) -// CHECK:STDOUT: !135 = !DILocation(line: 129, column: 5, scope: !131) -// CHECK:STDOUT: !136 = !DILocation(line: 130, column: 5, scope: !131) -// CHECK:STDOUT: !137 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d", scope: null, file: !138, line: 62, type: !139, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !141) -// CHECK:STDOUT: !138 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") -// CHECK:STDOUT: !139 = !DISubroutineType(types: !140) -// CHECK:STDOUT: !140 = !{!20, !20} -// CHECK:STDOUT: !141 = !{!142} -// CHECK:STDOUT: !142 = !DILocalVariable(arg: 1, scope: !137, type: !20) -// CHECK:STDOUT: !143 = !DILocation(line: 64, column: 17, scope: !137) -// CHECK:STDOUT: !144 = !DILocation(line: 64, column: 5, scope: !137) -// CHECK:STDOUT: !145 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.3e8267224c5dc9c2:OptionalStorage.Core.5325ffa2b57e13bd", scope: null, file: !34, line: 122, type: !45, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !146) -// CHECK:STDOUT: !146 = !{!147} -// CHECK:STDOUT: !147 = !DILocalVariable(arg: 1, scope: !145, type: !20) -// CHECK:STDOUT: !148 = !DILocation(line: 128, column: 5, scope: !145) -// CHECK:STDOUT: !149 = !DILocation(line: 128, column: 28, scope: !145) -// CHECK:STDOUT: !150 = !DILocation(line: 129, column: 5, scope: !145) -// CHECK:STDOUT: !151 = !DILocation(line: 130, column: 5, scope: !145) -// CHECK:STDOUT: !152 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !138, line: 57, type: !139, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !153) -// CHECK:STDOUT: !153 = !{!154} -// CHECK:STDOUT: !154 = !DILocalVariable(arg: 1, scope: !152, type: !20) -// CHECK:STDOUT: !155 = !DILocation(line: 57, column: 36, scope: !152) -// CHECK:STDOUT: !156 = distinct !DISubprogram(name: "Op", linkageName: "_COp.34e7a685d3648824:Copy.Core.64ccbb8e5d9a0b8e", scope: null, file: !157, line: 19, type: !45, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !158) -// CHECK:STDOUT: !157 = !DIFile(filename: "{{.*}}/prelude/copy.carbon", directory: "") -// CHECK:STDOUT: !158 = !{!159} -// CHECK:STDOUT: !159 = !DILocalVariable(arg: 1, scope: !156, type: !20) -// CHECK:STDOUT: !160 = !DILocation(line: 19, column: 33, scope: !156) +// CHECK:STDOUT: !100 = !DILocalVariable(arg: 1, scope: !96, type: !7) +// CHECK:STDOUT: !101 = !DILocation(line: 97, column: 12, scope: !96) +// CHECK:STDOUT: !102 = !DILocation(line: 97, column: 5, scope: !96) +// CHECK:STDOUT: !103 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.30ced37eb1e63547", scope: null, file: !86, line: 27, type: !104, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !104 = !DISubroutineType(types: !105) +// CHECK:STDOUT: !105 = !{!14} +// CHECK:STDOUT: !106 = !DILocation(line: 28, column: 12, scope: !103) +// CHECK:STDOUT: !107 = !DILocation(line: 28, column: 5, scope: !103) +// CHECK:STDOUT: !108 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.a44fce96e16342e7:ImplicitAs.ad22d1bbc0605210.Core.77b263a5fd240ddf", scope: null, file: !109, line: 40, type: !97, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !110) +// CHECK:STDOUT: !109 = !DIFile(filename: "{{.*}}/prelude/operators/as.carbon", directory: "") +// CHECK:STDOUT: !110 = !{!111} +// CHECK:STDOUT: !111 = !DILocalVariable(arg: 1, scope: !108, type: !7) +// CHECK:STDOUT: !112 = !DILocation(line: 40, column: 45, scope: !108) +// CHECK:STDOUT: !113 = !DILocation(line: 40, column: 38, scope: !108) +// CHECK:STDOUT: !114 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.e5cf8fcbb4feaae2:ImplicitAs.0f95c9e18c91e00a.Core.787d589b54a95071", scope: null, file: !86, line: 96, type: !97, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !115) +// CHECK:STDOUT: !115 = !{!116} +// CHECK:STDOUT: !116 = !DILocalVariable(arg: 1, scope: !114, type: !7) +// CHECK:STDOUT: !117 = !DILocation(line: 97, column: 12, scope: !114) +// CHECK:STDOUT: !118 = !DILocation(line: 97, column: 5, scope: !114) +// CHECK:STDOUT: !119 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.a44fce96e16342e7:ImplicitAs.ad22d1bbc0605210.Core.25fb32d66f981ccd", scope: null, file: !109, line: 40, type: !97, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !120) +// CHECK:STDOUT: !120 = !{!121} +// CHECK:STDOUT: !121 = !DILocalVariable(arg: 1, scope: !119, type: !7) +// CHECK:STDOUT: !122 = !DILocation(line: 40, column: 45, scope: !119) +// CHECK:STDOUT: !123 = !DILocation(line: 40, column: 38, scope: !119) +// CHECK:STDOUT: !124 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.17f42c13d842b71d:ImplicitAs.eb057aa32837c84e.Core.77b263a5fd240ddf", scope: null, file: !109, line: 44, type: !97, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !125) +// CHECK:STDOUT: !125 = !{!126} +// CHECK:STDOUT: !126 = !DILocalVariable(arg: 1, scope: !124, type: !7) +// CHECK:STDOUT: !127 = !DILocation(line: 44, column: 45, scope: !124) +// CHECK:STDOUT: !128 = !DILocation(line: 44, column: 38, scope: !124) +// CHECK:STDOUT: !129 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.17f42c13d842b71d:ImplicitAs.eb057aa32837c84e.Core.693532dcb04bf6dc", scope: null, file: !109, line: 44, type: !97, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !130) +// CHECK:STDOUT: !130 = !{!131} +// CHECK:STDOUT: !131 = !DILocalVariable(arg: 1, scope: !129, type: !7) +// CHECK:STDOUT: !132 = !DILocation(line: 44, column: 45, scope: !129) +// CHECK:STDOUT: !133 = !DILocation(line: 44, column: 38, scope: !129) +// CHECK:STDOUT: !134 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.17f42c13d842b71d:ImplicitAs.eb057aa32837c84e.Core.25fb32d66f981ccd", scope: null, file: !109, line: 44, type: !97, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !135) +// CHECK:STDOUT: !135 = !{!136} +// CHECK:STDOUT: !136 = !DILocalVariable(arg: 1, scope: !134, type: !7) +// CHECK:STDOUT: !137 = !DILocation(line: 44, column: 45, scope: !134) +// CHECK:STDOUT: !138 = !DILocation(line: 44, column: 38, scope: !134) +// CHECK:STDOUT: !139 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.17f42c13d842b71d:ImplicitAs.eb057aa32837c84e.Core.1c991c9fdfba671f", scope: null, file: !109, line: 44, type: !97, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !140) +// CHECK:STDOUT: !140 = !{!141} +// CHECK:STDOUT: !141 = !DILocalVariable(arg: 1, scope: !139, type: !7) +// CHECK:STDOUT: !142 = !DILocation(line: 44, column: 45, scope: !139) +// CHECK:STDOUT: !143 = !DILocation(line: 44, column: 38, scope: !139) +// CHECK:STDOUT: !144 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.e8f8f92d3d08d149:OptionalStorage.Core.b88d1103f417c6d4", scope: null, file: !86, line: 156, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !145) +// CHECK:STDOUT: !145 = !{!146} +// CHECK:STDOUT: !146 = !DILocalVariable(arg: 1, scope: !144, type: !14) +// CHECK:STDOUT: !147 = !DILocation(line: 157, column: 16, scope: !144) +// CHECK:STDOUT: !148 = !DILocation(line: 157, column: 12, scope: !144) +// CHECK:STDOUT: !149 = !DILocation(line: 157, column: 5, scope: !144) +// CHECK:STDOUT: !150 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.e8f8f92d3d08d149:OptionalStorage.Core.b88d1103f417c6d4", scope: null, file: !86, line: 159, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !151) +// CHECK:STDOUT: !151 = !{!152} +// CHECK:STDOUT: !152 = !DILocalVariable(arg: 1, scope: !150, type: !14) +// CHECK:STDOUT: !153 = !DILocation(line: 160, column: 5, scope: !150) +// CHECK:STDOUT: !154 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.90961d7b1ce4f089:OptionalAs.0e326e799dad0c64.Core.30ced37eb1e63547", scope: null, file: !86, line: 71, type: !97, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !155) +// CHECK:STDOUT: !155 = !{!156} +// CHECK:STDOUT: !156 = !DILocalVariable(arg: 1, scope: !154, type: !7) +// CHECK:STDOUT: !157 = !DILocation(line: 72, column: 12, scope: !154) +// CHECK:STDOUT: !158 = !DILocation(line: 72, column: 5, scope: !154) +// CHECK:STDOUT: !159 = distinct !DISubprogram(name: "None", linkageName: "_CNone.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1", scope: null, file: !86, line: 116, type: !104, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !160 = !DILocation(line: 119, column: 5, scope: !159) +// CHECK:STDOUT: !161 = !DILocation(line: 120, column: 5, scope: !159) +// CHECK:STDOUT: !162 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.3667eb502d1ddfa9:OptionalAs.c7a50af9bdd61b43.Core.5d35ad54738af8e4", scope: null, file: !86, line: 78, type: !97, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !163) +// CHECK:STDOUT: !163 = !{!164} +// CHECK:STDOUT: !164 = !DILocalVariable(arg: 1, scope: !162, type: !7) +// CHECK:STDOUT: !165 = !DILocation(line: 79, column: 29, scope: !162) +// CHECK:STDOUT: !166 = !DILocation(line: 79, column: 12, scope: !162) +// CHECK:STDOUT: !167 = !DILocation(line: 79, column: 5, scope: !162) +// CHECK:STDOUT: !168 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.30ced37eb1e63547", scope: null, file: !86, line: 30, type: !97, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !169) +// CHECK:STDOUT: !169 = !{!170} +// CHECK:STDOUT: !170 = !DILocalVariable(arg: 1, scope: !168, type: !7) +// CHECK:STDOUT: !171 = !DILocation(line: 31, column: 12, scope: !168) +// CHECK:STDOUT: !172 = !DILocation(line: 31, column: 5, scope: !168) +// CHECK:STDOUT: !173 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.a44fce96e16342e7:ImplicitAs.ad22d1bbc0605210.Core.90a4f5ca3e06badd", scope: null, file: !109, line: 40, type: !97, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !174) +// CHECK:STDOUT: !174 = !{!175} +// CHECK:STDOUT: !175 = !DILocalVariable(arg: 1, scope: !173, type: !7) +// CHECK:STDOUT: !176 = !DILocation(line: 40, column: 45, scope: !173) +// CHECK:STDOUT: !177 = !DILocation(line: 40, column: 38, scope: !173) +// CHECK:STDOUT: !178 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.b0246d3dd29c9210", scope: null, file: !86, line: 30, type: !97, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !179) +// CHECK:STDOUT: !179 = !{!180} +// CHECK:STDOUT: !180 = !DILocalVariable(arg: 1, scope: !178, type: !7) +// CHECK:STDOUT: !181 = !DILocation(line: 31, column: 12, scope: !178) +// CHECK:STDOUT: !182 = !DILocation(line: 31, column: 5, scope: !178) +// CHECK:STDOUT: !183 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.3e8267224c5dc9c2:OptionalStorage.Core.bfb441135f07cbe1", scope: null, file: !86, line: 122, type: !97, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !184) +// CHECK:STDOUT: !184 = !{!185} +// CHECK:STDOUT: !185 = !DILocalVariable(arg: 1, scope: !183, type: !7) +// CHECK:STDOUT: !186 = !DILocation(line: 128, column: 5, scope: !183) +// CHECK:STDOUT: !187 = !DILocation(line: 129, column: 5, scope: !183) +// CHECK:STDOUT: !188 = !DILocation(line: 130, column: 5, scope: !183) +// CHECK:STDOUT: !189 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.272fc3e88346d0d9:ImplicitAs.d993a5132e000405.Core.628184612c80324d", scope: null, file: !190, line: 62, type: !191, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !193) +// CHECK:STDOUT: !190 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") +// CHECK:STDOUT: !191 = !DISubroutineType(types: !192) +// CHECK:STDOUT: !192 = !{!7, !7} +// CHECK:STDOUT: !193 = !{!194} +// CHECK:STDOUT: !194 = !DILocalVariable(arg: 1, scope: !189, type: !7) +// CHECK:STDOUT: !195 = !DILocation(line: 64, column: 17, scope: !189) +// CHECK:STDOUT: !196 = !DILocation(line: 64, column: 5, scope: !189) +// CHECK:STDOUT: !197 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.3e8267224c5dc9c2:OptionalStorage.Core.5325ffa2b57e13bd", scope: null, file: !86, line: 122, type: !97, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !198) +// CHECK:STDOUT: !198 = !{!199} +// CHECK:STDOUT: !199 = !DILocalVariable(arg: 1, scope: !197, type: !7) +// CHECK:STDOUT: !200 = !DILocation(line: 128, column: 5, scope: !197) +// CHECK:STDOUT: !201 = !DILocation(line: 128, column: 28, scope: !197) +// CHECK:STDOUT: !202 = !DILocation(line: 129, column: 5, scope: !197) +// CHECK:STDOUT: !203 = !DILocation(line: 130, column: 5, scope: !197) +// CHECK:STDOUT: !204 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !190, line: 57, type: !191, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !205) +// CHECK:STDOUT: !205 = !{!206} +// CHECK:STDOUT: !206 = !DILocalVariable(arg: 1, scope: !204, type: !7) +// CHECK:STDOUT: !207 = !DILocation(line: 57, column: 36, scope: !204) +// CHECK:STDOUT: !208 = distinct !DISubprogram(name: "Op", linkageName: "_COp.34e7a685d3648824:Copy.Core.64ccbb8e5d9a0b8e", scope: null, file: !209, line: 19, type: !97, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !210) +// CHECK:STDOUT: !209 = !DIFile(filename: "{{.*}}/prelude/copy.carbon", directory: "") +// CHECK:STDOUT: !210 = !{!211} +// CHECK:STDOUT: !211 = !DILocalVariable(arg: 1, scope: !208, type: !7) +// CHECK:STDOUT: !212 = !DILocation(line: 19, column: 33, scope: !208) diff --git a/toolchain/lower/testdata/return/return_var_byval.carbon b/toolchain/lower/testdata/return/return_var_byval.carbon index bd783946853b..e365faa126ed 100644 --- a/toolchain/lower/testdata/return/return_var_byval.carbon +++ b/toolchain/lower/testdata/return/return_var_byval.carbon @@ -25,9 +25,16 @@ fn Main() -> i32 { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !8 // CHECK:STDOUT: store i32 0, ptr %x.var, align 4, !dbg !8 // CHECK:STDOUT: %.loc14_17 = load i32, ptr %x.var, align 4, !dbg !9 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %x.var), !dbg !8 // CHECK:STDOUT: ret i32 %.loc14_17, !dbg !10 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !11 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !16 +// 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: @@ -48,3 +55,9 @@ fn Main() -> i32 { // CHECK:STDOUT: !8 = !DILocation(line: 14, column: 12, scope: !4) // CHECK:STDOUT: !9 = !DILocation(line: 14, column: 16, scope: !4) // CHECK:STDOUT: !10 = !DILocation(line: 15, column: 3, scope: !4) +// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 14, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !14) +// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) +// CHECK:STDOUT: !13 = !{null, !7} +// CHECK:STDOUT: !14 = !{!15} +// CHECK:STDOUT: !15 = !DILocalVariable(arg: 1, scope: !11, type: !7) +// CHECK:STDOUT: !16 = !DILocation(line: 14, column: 12, scope: !11) diff --git a/toolchain/lower/testdata/return/var.carbon b/toolchain/lower/testdata/return/var.carbon index 8a9be3fc41dd..4172eeff89cf 100644 --- a/toolchain/lower/testdata/return/var.carbon +++ b/toolchain/lower/testdata/return/var.carbon @@ -25,9 +25,16 @@ fn Main() -> i32 { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !8 // CHECK:STDOUT: store i32 0, ptr %x.var, align 4, !dbg !8 // CHECK:STDOUT: %.loc15 = load i32, ptr %x.var, align 4, !dbg !9 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %x.var), !dbg !8 // CHECK:STDOUT: ret i32 %.loc15, !dbg !10 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !11 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !16 +// 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: @@ -48,3 +55,9 @@ fn Main() -> i32 { // CHECK:STDOUT: !8 = !DILocation(line: 14, column: 3, scope: !4) // CHECK:STDOUT: !9 = !DILocation(line: 15, column: 10, scope: !4) // CHECK:STDOUT: !10 = !DILocation(line: 15, column: 3, scope: !4) +// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 14, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !14) +// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) +// CHECK:STDOUT: !13 = !{null, !7} +// CHECK:STDOUT: !14 = !{!15} +// CHECK:STDOUT: !15 = !DILocalVariable(arg: 1, scope: !11, type: !7) +// CHECK:STDOUT: !16 = !DILocation(line: 14, column: 3, scope: !11) diff --git a/toolchain/lower/testdata/struct/member_access.carbon b/toolchain/lower/testdata/struct/member_access.carbon index 716b8a92b4d6..567dd89552ac 100644 --- a/toolchain/lower/testdata/struct/member_access.carbon +++ b/toolchain/lower/testdata/struct/member_access.carbon @@ -39,9 +39,30 @@ fn Run() -> i32 { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !10 // CHECK:STDOUT: %.loc16 = load i32, ptr %y.var, align 4, !dbg !13 // CHECK:STDOUT: store i32 %.loc16, ptr %_.var, align 4, !dbg !10 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %_.var), !dbg !10 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %y.var), !dbg !9 +// CHECK:STDOUT: call void @"_COp.c873a7d633fbed8d:core.Destroy.Core"(ptr %x.var), !dbg !8 // CHECK:STDOUT: ret i32 0, !dbg !14 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !15 { +// 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.98006a366c2ffd6c:core.Destroy.Core"(ptr %self) #0 !dbg !21 { +// 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.c873a7d633fbed8d:core.Destroy.Core"(ptr %self) #0 !dbg !28 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !31 +// 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: @@ -49,6 +70,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) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @"_COp.7e389eab4a7e5487:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 2, 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -73,3 +95,20 @@ fn Run() -> i32 { // CHECK:STDOUT: !12 = !DILocation(line: 15, column: 16, scope: !4) // CHECK:STDOUT: !13 = !DILocation(line: 16, column: 16, scope: !4) // CHECK:STDOUT: !14 = !DILocation(line: 17, column: 3, scope: !4) +// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 16, type: !16, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !18) +// CHECK:STDOUT: !16 = !DISubroutineType(types: !17) +// CHECK:STDOUT: !17 = !{null, !7} +// CHECK:STDOUT: !18 = !{!19} +// CHECK:STDOUT: !19 = !DILocalVariable(arg: 1, scope: !15, type: !7) +// CHECK:STDOUT: !20 = !DILocation(line: 16, column: 3, scope: !15) +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "Op", linkageName: "_COp.98006a366c2ffd6c:core.Destroy.Core", scope: null, file: !3, line: 14, type: !22, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !25) +// CHECK:STDOUT: !22 = !DISubroutineType(types: !23) +// CHECK:STDOUT: !23 = !{null, !24} +// CHECK:STDOUT: !24 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !25 = !{!26} +// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !21, type: !24) +// CHECK:STDOUT: !27 = !DILocation(line: 14, column: 3, scope: !21) +// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "Op", linkageName: "_COp.c873a7d633fbed8d:core.Destroy.Core", scope: null, file: !3, line: 14, type: !22, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !29) +// CHECK:STDOUT: !29 = !{!30} +// CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !28, type: !24) +// CHECK:STDOUT: !31 = !DILocation(line: 14, column: 3, scope: !28) diff --git a/toolchain/lower/testdata/struct/nested_struct_in_place.carbon b/toolchain/lower/testdata/struct/nested_struct_in_place.carbon index 860ca552ad6a..b5ccb14bfb04 100644 --- a/toolchain/lower/testdata/struct/nested_struct_in_place.carbon +++ b/toolchain/lower/testdata/struct/nested_struct_in_place.carbon @@ -30,9 +30,28 @@ fn G() { // CHECK:STDOUT: call void @_CF.Main(ptr %.loc16_74.1.a), !dbg !9 // CHECK:STDOUT: %.loc16_74.2.b = getelementptr inbounds nuw { { i32, i32, i32 }, { i32, i32, i32 } }, ptr %_.var, i32 0, i32 1, !dbg !8 // CHECK:STDOUT: call void @_CF.Main(ptr %.loc16_74.2.b), !dbg !10 +// CHECK:STDOUT: call void @"_COp.a6b73fa9f14b1978:core.Destroy.Core"(ptr %_.var), !dbg !7 // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !12 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.819e9e1e390140e8:core.Destroy.Core"(ptr %self) #0 !dbg !19 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !25 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.a6b73fa9f14b1978:core.Destroy.Core"(ptr %self) #0 !dbg !26 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !29 +// 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: @@ -54,3 +73,21 @@ fn G() { // CHECK:STDOUT: !9 = !DILocation(line: 16, column: 61, scope: !4) // CHECK:STDOUT: !10 = !DILocation(line: 16, column: 71, scope: !4) // CHECK:STDOUT: !11 = !DILocation(line: 15, column: 1, scope: !4) +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 16, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !16) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null, !15} +// CHECK:STDOUT: !15 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !16 = !{!17} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15) +// CHECK:STDOUT: !18 = !DILocation(line: 16, column: 3, scope: !12) +// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "Op", linkageName: "_COp.819e9e1e390140e8:core.Destroy.Core", scope: null, file: !3, line: 16, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !23) +// CHECK:STDOUT: !20 = !DISubroutineType(types: !21) +// CHECK:STDOUT: !21 = !{null, !22} +// CHECK:STDOUT: !22 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !23 = !{!24} +// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !19, type: !22) +// CHECK:STDOUT: !25 = !DILocation(line: 16, column: 3, scope: !19) +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a6b73fa9f14b1978:core.Destroy.Core", scope: null, file: !3, line: 16, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !27) +// CHECK:STDOUT: !27 = !{!28} +// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !26, type: !22) +// CHECK:STDOUT: !29 = !DILocation(line: 16, column: 3, scope: !26) diff --git a/toolchain/lower/testdata/struct/one_entry.carbon b/toolchain/lower/testdata/struct/one_entry.carbon index a78d03543395..0ba491665e9f 100644 --- a/toolchain/lower/testdata/struct/one_entry.carbon +++ b/toolchain/lower/testdata/struct/one_entry.carbon @@ -31,13 +31,28 @@ fn Run() -> i32 { // CHECK:STDOUT: %.loc15_22.2 = load i32, ptr %.loc15_22.1.a, align 4, !dbg !10 // CHECK:STDOUT: %.loc15_22.3.struct.init = insertvalue { i32 } poison, i32 %.loc15_22.2, 0, !dbg !10 // CHECK:STDOUT: store { i32 } %.loc15_22.3.struct.init, ptr %_.var, align 4, !dbg !9 +// CHECK:STDOUT: call void @"_COp.2595c2fa6d16d130:core.Destroy.Core"(ptr %_.var), !dbg !9 +// CHECK:STDOUT: call void @"_COp.2595c2fa6d16d130:core.Destroy.Core"(ptr %x.var), !dbg !8 // CHECK:STDOUT: ret i32 0, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !12 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.2595c2fa6d16d130:core.Destroy.Core"(ptr %self) #0 !dbg !18 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !24 +// 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.2595c2fa6d16d130:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -58,3 +73,16 @@ fn Run() -> i32 { // CHECK:STDOUT: !9 = !DILocation(line: 15, column: 3, scope: !4) // CHECK:STDOUT: !10 = !DILocation(line: 15, column: 22, scope: !4) // CHECK:STDOUT: !11 = !DILocation(line: 16, column: 3, scope: !4) +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 15, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !15) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null, !7} +// CHECK:STDOUT: !15 = !{!16} +// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !12, type: !7) +// CHECK:STDOUT: !17 = !DILocation(line: 15, column: 3, scope: !12) +// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "Op", linkageName: "_COp.2595c2fa6d16d130:core.Destroy.Core", scope: null, file: !3, line: 15, type: !19, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !22) +// CHECK:STDOUT: !19 = !DISubroutineType(types: !20) +// CHECK:STDOUT: !20 = !{null, !21} +// CHECK:STDOUT: !21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !22 = !{!23} +// CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !18, type: !21) +// CHECK:STDOUT: !24 = !DILocation(line: 15, column: 3, scope: !18) diff --git a/toolchain/lower/testdata/struct/two_entries.carbon b/toolchain/lower/testdata/struct/two_entries.carbon index 8f517c625613..f59d7ae5fa13 100644 --- a/toolchain/lower/testdata/struct/two_entries.carbon +++ b/toolchain/lower/testdata/struct/two_entries.carbon @@ -39,9 +39,23 @@ fn Run() -> i32 { // CHECK:STDOUT: %.loc15_31.6 = load i32, ptr %.loc15_31.5.b, align 4, !dbg !11 // CHECK:STDOUT: %.loc15_31.7.b = getelementptr inbounds nuw { i32, i32 }, ptr %_.var, i32 0, i32 1, !dbg !11 // CHECK:STDOUT: store i32 %.loc15_31.6, ptr %.loc15_31.7.b, align 4, !dbg !11 +// CHECK:STDOUT: call void @"_COp.fb32c4dfca65e378:core.Destroy.Core"(ptr %_.var), !dbg !9 +// CHECK:STDOUT: call void @"_COp.fb32c4dfca65e378:core.Destroy.Core"(ptr %x.var), !dbg !8 // CHECK:STDOUT: ret i32 0, !dbg !12 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !13 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.fb32c4dfca65e378:core.Destroy.Core"(ptr %self) #0 !dbg !19 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !25 +// 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: @@ -49,6 +63,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) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @"_COp.fb32c4dfca65e378:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -71,3 +86,16 @@ fn Run() -> i32 { // CHECK:STDOUT: !10 = !DILocation(line: 14, column: 31, scope: !4) // CHECK:STDOUT: !11 = !DILocation(line: 15, column: 31, scope: !4) // CHECK:STDOUT: !12 = !DILocation(line: 16, column: 3, scope: !4) +// CHECK:STDOUT: !13 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 15, type: !14, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !16) +// CHECK:STDOUT: !14 = !DISubroutineType(types: !15) +// CHECK:STDOUT: !15 = !{null, !7} +// CHECK:STDOUT: !16 = !{!17} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !13, type: !7) +// CHECK:STDOUT: !18 = !DILocation(line: 15, column: 3, scope: !13) +// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fb32c4dfca65e378:core.Destroy.Core", scope: null, file: !3, line: 15, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !23) +// CHECK:STDOUT: !20 = !DISubroutineType(types: !21) +// CHECK:STDOUT: !21 = !{null, !22} +// CHECK:STDOUT: !22 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !23 = !{!24} +// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !19, type: !22) +// CHECK:STDOUT: !25 = !DILocation(line: 15, column: 3, scope: !19) diff --git a/toolchain/lower/testdata/tuple/access/element_access.carbon b/toolchain/lower/testdata/tuple/access/element_access.carbon index 350fd0812d9d..eb7b510acac5 100644 --- a/toolchain/lower/testdata/tuple/access/element_access.carbon +++ b/toolchain/lower/testdata/tuple/access/element_access.carbon @@ -41,9 +41,24 @@ fn Run() -> i32 { // CHECK:STDOUT: %tuple.elem2.loc16.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 2, !dbg !13 // CHECK:STDOUT: %.loc16 = load i32, ptr %tuple.elem2.loc16.tuple.elem, align 4, !dbg !13 // CHECK:STDOUT: store i32 %.loc16, ptr %_.var.loc16, align 4, !dbg !10 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %_.var.loc16), !dbg !10 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %_.var.loc15), !dbg !9 +// CHECK:STDOUT: call void @"_COp.819e9e1e390140e8:core.Destroy.Core"(ptr %a.var), !dbg !8 // CHECK:STDOUT: ret i32 0, !dbg !14 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !15 { +// 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.819e9e1e390140e8:core.Destroy.Core"(ptr %self) #0 !dbg !21 { +// CHECK:STDOUT: entry: +// 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: @@ -51,6 +66,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) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @"_COp.7e389eab4a7e5487:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 2, 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -75,3 +91,16 @@ fn Run() -> i32 { // CHECK:STDOUT: !12 = !DILocation(line: 15, column: 16, scope: !4) // CHECK:STDOUT: !13 = !DILocation(line: 16, column: 16, scope: !4) // CHECK:STDOUT: !14 = !DILocation(line: 17, column: 3, scope: !4) +// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 16, type: !16, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !18) +// CHECK:STDOUT: !16 = !DISubroutineType(types: !17) +// CHECK:STDOUT: !17 = !{null, !7} +// CHECK:STDOUT: !18 = !{!19} +// CHECK:STDOUT: !19 = !DILocalVariable(arg: 1, scope: !15, type: !7) +// CHECK:STDOUT: !20 = !DILocation(line: 16, column: 3, scope: !15) +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "Op", linkageName: "_COp.819e9e1e390140e8:core.Destroy.Core", scope: null, file: !3, line: 14, type: !22, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !25) +// CHECK:STDOUT: !22 = !DISubroutineType(types: !23) +// CHECK:STDOUT: !23 = !{null, !24} +// CHECK:STDOUT: !24 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !25 = !{!26} +// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !21, type: !24) +// CHECK:STDOUT: !27 = !DILocation(line: 14, column: 3, scope: !21) diff --git a/toolchain/lower/testdata/tuple/access/return_value_access.carbon b/toolchain/lower/testdata/tuple/access/return_value_access.carbon index ad4e0132109e..cba1880d6315 100644 --- a/toolchain/lower/testdata/tuple/access/return_value_access.carbon +++ b/toolchain/lower/testdata/tuple/access/return_value_access.carbon @@ -41,9 +41,23 @@ fn Run() { // CHECK:STDOUT: %tuple.elem1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %.loc16_18.1.temp, i32 0, i32 1, !dbg !14 // CHECK:STDOUT: %.loc16_19 = load i32, ptr %tuple.elem1.tuple.elem, align 4, !dbg !14 // CHECK:STDOUT: store i32 %.loc16_19, ptr %_.var, align 4, !dbg !13 +// CHECK:STDOUT: call void @"_COp.8e354c83fe88ab86:core.Destroy.Core"(ptr %.loc16_18.1.temp), !dbg !14 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %_.var), !dbg !13 // CHECK:STDOUT: ret void, !dbg !15 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !16 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !22 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.8e354c83fe88ab86:core.Destroy.Core"(ptr %self) #0 !dbg !23 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !28 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree 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: @@ -76,3 +90,16 @@ fn Run() { // CHECK:STDOUT: !13 = !DILocation(line: 16, column: 3, scope: !10) // CHECK:STDOUT: !14 = !DILocation(line: 16, column: 16, scope: !10) // CHECK:STDOUT: !15 = !DILocation(line: 15, column: 1, scope: !10) +// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 16, type: !17, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !20) +// CHECK:STDOUT: !17 = !DISubroutineType(types: !18) +// CHECK:STDOUT: !18 = !{null, !19} +// CHECK:STDOUT: !19 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !20 = !{!21} +// CHECK:STDOUT: !21 = !DILocalVariable(arg: 1, scope: !16, type: !19) +// CHECK:STDOUT: !22 = !DILocation(line: 16, column: 16, scope: !16) +// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8e354c83fe88ab86:core.Destroy.Core", scope: null, file: !3, line: 16, type: !24, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !26) +// CHECK:STDOUT: !24 = !DISubroutineType(types: !25) +// CHECK:STDOUT: !25 = !{null, !7} +// CHECK:STDOUT: !26 = !{!27} +// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !23, type: !7) +// CHECK:STDOUT: !28 = !DILocation(line: 16, column: 16, scope: !23) diff --git a/toolchain/lower/testdata/tuple/nested_tuple_in_place.carbon b/toolchain/lower/testdata/tuple/nested_tuple_in_place.carbon index c90f70dbf65e..93b06d733d82 100644 --- a/toolchain/lower/testdata/tuple/nested_tuple_in_place.carbon +++ b/toolchain/lower/testdata/tuple/nested_tuple_in_place.carbon @@ -30,9 +30,28 @@ fn G() { // CHECK:STDOUT: call void @_CF.Main(ptr %tuple.elem0.tuple.elem), !dbg !9 // CHECK:STDOUT: %tuple.elem1.tuple.elem = getelementptr inbounds nuw { { i32, i32, i32 }, { i32, i32, i32 } }, ptr %_.var, i32 0, i32 1, !dbg !8 // CHECK:STDOUT: call void @_CF.Main(ptr %tuple.elem1.tuple.elem), !dbg !10 +// CHECK:STDOUT: call void @"_COp.ec68410f9384d3e0:core.Destroy.Core"(ptr %_.var), !dbg !7 // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !12 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.819e9e1e390140e8:core.Destroy.Core"(ptr %self) #0 !dbg !19 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !25 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.ec68410f9384d3e0:core.Destroy.Core"(ptr %self) #0 !dbg !26 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !29 +// 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: @@ -54,3 +73,21 @@ fn G() { // CHECK:STDOUT: !9 = !DILocation(line: 16, column: 48, scope: !4) // CHECK:STDOUT: !10 = !DILocation(line: 16, column: 53, scope: !4) // CHECK:STDOUT: !11 = !DILocation(line: 15, column: 1, scope: !4) +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 16, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !16) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null, !15} +// CHECK:STDOUT: !15 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !16 = !{!17} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15) +// CHECK:STDOUT: !18 = !DILocation(line: 16, column: 3, scope: !12) +// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "Op", linkageName: "_COp.819e9e1e390140e8:core.Destroy.Core", scope: null, file: !3, line: 16, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !23) +// CHECK:STDOUT: !20 = !DISubroutineType(types: !21) +// CHECK:STDOUT: !21 = !{null, !22} +// CHECK:STDOUT: !22 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !23 = !{!24} +// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !19, type: !22) +// CHECK:STDOUT: !25 = !DILocation(line: 16, column: 3, scope: !19) +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.ec68410f9384d3e0:core.Destroy.Core", scope: null, file: !3, line: 16, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !27) +// CHECK:STDOUT: !27 = !{!28} +// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !26, type: !22) +// CHECK:STDOUT: !29 = !DILocation(line: 16, column: 3, scope: !26) diff --git a/toolchain/lower/testdata/tuple/one_entry.carbon b/toolchain/lower/testdata/tuple/one_entry.carbon index 43b438e0a01c..d2febb39d020 100644 --- a/toolchain/lower/testdata/tuple/one_entry.carbon +++ b/toolchain/lower/testdata/tuple/one_entry.carbon @@ -31,13 +31,28 @@ fn Run() -> i32 { // CHECK:STDOUT: %.loc15_20.1 = load i32, ptr %tuple.elem0.tuple.elem, align 4, !dbg !10 // CHECK:STDOUT: %.loc15_20.2.tuple.init = insertvalue { i32 } poison, i32 %.loc15_20.1, 0, !dbg !10 // CHECK:STDOUT: store { i32 } %.loc15_20.2.tuple.init, ptr %_.var, align 4, !dbg !9 +// CHECK:STDOUT: call void @"_COp.9921a4f78eb335d8:core.Destroy.Core"(ptr %_.var), !dbg !9 +// CHECK:STDOUT: call void @"_COp.9921a4f78eb335d8:core.Destroy.Core"(ptr %x.var), !dbg !8 // CHECK:STDOUT: ret i32 0, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !12 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.9921a4f78eb335d8:core.Destroy.Core"(ptr %self) #0 !dbg !18 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !24 +// 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.9921a4f78eb335d8:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -58,3 +73,16 @@ fn Run() -> i32 { // CHECK:STDOUT: !9 = !DILocation(line: 15, column: 3, scope: !4) // CHECK:STDOUT: !10 = !DILocation(line: 15, column: 20, scope: !4) // CHECK:STDOUT: !11 = !DILocation(line: 16, column: 3, scope: !4) +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 15, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !15) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null, !7} +// CHECK:STDOUT: !15 = !{!16} +// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !12, type: !7) +// CHECK:STDOUT: !17 = !DILocation(line: 15, column: 3, scope: !12) +// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "Op", linkageName: "_COp.9921a4f78eb335d8:core.Destroy.Core", scope: null, file: !3, line: 15, type: !19, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !22) +// CHECK:STDOUT: !19 = !DISubroutineType(types: !20) +// CHECK:STDOUT: !20 = !{null, !21} +// CHECK:STDOUT: !21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !22 = !{!23} +// CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !18, type: !21) +// CHECK:STDOUT: !24 = !DILocation(line: 15, column: 3, scope: !18) diff --git a/toolchain/lower/testdata/tuple/two_entries.carbon b/toolchain/lower/testdata/tuple/two_entries.carbon index 7313e33e3d5c..77f8dbc3bd09 100644 --- a/toolchain/lower/testdata/tuple/two_entries.carbon +++ b/toolchain/lower/testdata/tuple/two_entries.carbon @@ -39,9 +39,23 @@ fn Run() -> i32 { // CHECK:STDOUT: %.loc15_23.3 = load i32, ptr %tuple.elem1.loc15_23.1.tuple.elem, align 4, !dbg !11 // CHECK:STDOUT: %tuple.elem1.loc15_23.2.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %_.var, i32 0, i32 1, !dbg !11 // CHECK:STDOUT: store i32 %.loc15_23.3, ptr %tuple.elem1.loc15_23.2.tuple.elem, align 4, !dbg !11 +// CHECK:STDOUT: call void @"_COp.8e354c83fe88ab86:core.Destroy.Core"(ptr %_.var), !dbg !9 +// CHECK:STDOUT: call void @"_COp.8e354c83fe88ab86:core.Destroy.Core"(ptr %x.var), !dbg !8 // CHECK:STDOUT: ret i32 0, !dbg !12 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !13 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.8e354c83fe88ab86:core.Destroy.Core"(ptr %self) #0 !dbg !19 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !25 +// 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: @@ -49,6 +63,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) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @"_COp.8e354c83fe88ab86:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -71,3 +86,16 @@ fn Run() -> i32 { // CHECK:STDOUT: !10 = !DILocation(line: 14, column: 23, scope: !4) // CHECK:STDOUT: !11 = !DILocation(line: 15, column: 23, scope: !4) // CHECK:STDOUT: !12 = !DILocation(line: 16, column: 3, scope: !4) +// CHECK:STDOUT: !13 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 15, type: !14, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !16) +// CHECK:STDOUT: !14 = !DISubroutineType(types: !15) +// CHECK:STDOUT: !15 = !{null, !7} +// CHECK:STDOUT: !16 = !{!17} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !13, type: !7) +// CHECK:STDOUT: !18 = !DILocation(line: 15, column: 3, scope: !13) +// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8e354c83fe88ab86:core.Destroy.Core", scope: null, file: !3, line: 15, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !23) +// CHECK:STDOUT: !20 = !DISubroutineType(types: !21) +// CHECK:STDOUT: !21 = !{null, !22} +// CHECK:STDOUT: !22 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !23 = !{!24} +// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !19, type: !22) +// CHECK:STDOUT: !25 = !DILocation(line: 15, column: 3, scope: !19) diff --git a/toolchain/lower/testdata/tuple/value_formation.carbon b/toolchain/lower/testdata/tuple/value_formation.carbon index 5dc21a6b27e1..54e3aab4b4e6 100644 --- a/toolchain/lower/testdata/tuple/value_formation.carbon +++ b/toolchain/lower/testdata/tuple/value_formation.carbon @@ -62,13 +62,28 @@ fn F() { // CHECK:STDOUT: %tuple.loc18_108 = getelementptr inbounds nuw { ptr, ptr }, ptr %tuple.loc18_10, i32 0, i32 1, !dbg !11 // CHECK:STDOUT: store ptr %tuple.loc18_9, ptr %tuple.loc18_108, align 8, !dbg !11 // CHECK:STDOUT: call void @_CG.Main(ptr %tuple.loc18_10), !dbg !12 +// CHECK:STDOUT: call void @"_COp.819e9e1e390140e8:core.Destroy.Core"(ptr %b.var), !dbg !8 +// CHECK:STDOUT: call void @"_COp.819e9e1e390140e8:core.Destroy.Core"(ptr %a.var), !dbg !7 // CHECK:STDOUT: ret void, !dbg !13 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !14 { +// 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.819e9e1e390140e8:core.Destroy.Core"(ptr %self) #0 !dbg !21 { +// CHECK:STDOUT: entry: +// 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: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @"_COp.819e9e1e390140e8:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -91,3 +106,17 @@ fn F() { // CHECK:STDOUT: !11 = !DILocation(line: 18, column: 5, scope: !4) // CHECK:STDOUT: !12 = !DILocation(line: 18, column: 3, scope: !4) // CHECK:STDOUT: !13 = !DILocation(line: 15, column: 1, scope: !4) +// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 17, type: !15, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !18) +// CHECK:STDOUT: !15 = !DISubroutineType(types: !16) +// CHECK:STDOUT: !16 = !{null, !17} +// CHECK:STDOUT: !17 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !18 = !{!19} +// CHECK:STDOUT: !19 = !DILocalVariable(arg: 1, scope: !14, type: !17) +// CHECK:STDOUT: !20 = !DILocation(line: 17, column: 3, scope: !14) +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "Op", linkageName: "_COp.819e9e1e390140e8:core.Destroy.Core", scope: null, file: !3, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !25) +// CHECK:STDOUT: !22 = !DISubroutineType(types: !23) +// CHECK:STDOUT: !23 = !{null, !24} +// CHECK:STDOUT: !24 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !25 = !{!26} +// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !21, type: !24) +// CHECK:STDOUT: !27 = !DILocation(line: 17, column: 3, scope: !21) diff --git a/toolchain/lower/testdata/var/local.carbon b/toolchain/lower/testdata/var/local.carbon index 8895e72dbb84..4e5c35d761ba 100644 --- a/toolchain/lower/testdata/var/local.carbon +++ b/toolchain/lower/testdata/var/local.carbon @@ -40,9 +40,16 @@ fn G() -> (i32, i32, i32) { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !8 // CHECK:STDOUT: store i32 1, ptr %x.var, align 4, !dbg !8 // CHECK:STDOUT: %.loc6 = load i32, ptr %x.var, align 4, !dbg !9 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %x.var), !dbg !8 // CHECK:STDOUT: ret i32 %.loc6, !dbg !10 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !11 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !16 +// 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,6 +70,12 @@ fn G() -> (i32, i32, i32) { // CHECK:STDOUT: !8 = !DILocation(line: 5, column: 3, scope: !4) // CHECK:STDOUT: !9 = !DILocation(line: 6, column: 10, scope: !4) // CHECK:STDOUT: !10 = !DILocation(line: 6, column: 3, scope: !4) +// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 5, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !14) +// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) +// CHECK:STDOUT: !13 = !{null, !7} +// CHECK:STDOUT: !14 = !{!15} +// CHECK:STDOUT: !15 = !DILocalVariable(arg: 1, scope: !11, type: !7) +// CHECK:STDOUT: !16 = !DILocation(line: 5, column: 3, scope: !11) // CHECK:STDOUT: ; ModuleID = 'eval_init_in_place.carbon' // CHECK:STDOUT: source_filename = "eval_init_in_place.carbon" // CHECK:STDOUT: @@ -96,9 +109,22 @@ fn G() -> (i32, i32, i32) { // CHECK:STDOUT: %.loc8_10.5 = load i32, ptr %tuple.elem2.loc8_10.1.tuple.elem, align 4, !dbg !12 // CHECK:STDOUT: %tuple.elem2.loc8_10.2.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 2, !dbg !12 // CHECK:STDOUT: store i32 %.loc8_10.5, ptr %tuple.elem2.loc8_10.2.tuple.elem, align 4, !dbg !12 +// CHECK:STDOUT: call void @"_COp.819e9e1e390140e8:core.Destroy.Core"(ptr %a.var), !dbg !11 // CHECK:STDOUT: ret void, !dbg !13 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !14 { +// 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.819e9e1e390140e8:core.Destroy.Core"(ptr %self) #0 !dbg !21 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !26 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree 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: @@ -129,3 +155,16 @@ fn G() -> (i32, i32, i32) { // CHECK:STDOUT: !11 = !DILocation(line: 7, column: 3, scope: !10) // CHECK:STDOUT: !12 = !DILocation(line: 8, column: 10, scope: !10) // CHECK:STDOUT: !13 = !DILocation(line: 8, column: 3, scope: !10) +// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 7, type: !15, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !18) +// CHECK:STDOUT: !15 = !DISubroutineType(types: !16) +// CHECK:STDOUT: !16 = !{null, !17} +// CHECK:STDOUT: !17 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !18 = !{!19} +// CHECK:STDOUT: !19 = !DILocalVariable(arg: 1, scope: !14, type: !17) +// CHECK:STDOUT: !20 = !DILocation(line: 7, column: 3, scope: !14) +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "Op", linkageName: "_COp.819e9e1e390140e8:core.Destroy.Core", scope: null, file: !3, line: 7, type: !22, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !24) +// CHECK:STDOUT: !22 = !DISubroutineType(types: !23) +// CHECK:STDOUT: !23 = !{null, !7} +// CHECK:STDOUT: !24 = !{!25} +// CHECK:STDOUT: !25 = !DILocalVariable(arg: 1, scope: !21, type: !7) +// CHECK:STDOUT: !26 = !DILocation(line: 7, column: 3, scope: !21) diff --git a/toolchain/lower/testdata/var/nested.carbon b/toolchain/lower/testdata/var/nested.carbon index 263fc8aecb29..092d5383a715 100644 --- a/toolchain/lower/testdata/var/nested.carbon +++ b/toolchain/lower/testdata/var/nested.carbon @@ -44,13 +44,22 @@ fn Run() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: while.done: ; preds = %while.cond // CHECK:STDOUT: %.loc19 = load i32, ptr %a.var, align 4, !dbg !15 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %b.var), !dbg !9 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %a.var), !dbg !8 // CHECK:STDOUT: ret i32 %.loc19, !dbg !16 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !17 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !22 +// 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.7e389eab4a7e5487:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -76,3 +85,9 @@ fn Run() -> i32 { // CHECK:STDOUT: !14 = !DILocation(line: 15, column: 3, scope: !4) // CHECK:STDOUT: !15 = !DILocation(line: 19, column: 10, scope: !4) // CHECK:STDOUT: !16 = !DILocation(line: 19, column: 3, scope: !4) +// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 16, type: !18, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !20) +// CHECK:STDOUT: !18 = !DISubroutineType(types: !19) +// CHECK:STDOUT: !19 = !{null, !7} +// CHECK:STDOUT: !20 = !{!21} +// CHECK:STDOUT: !21 = !DILocalVariable(arg: 1, scope: !17, type: !7) +// CHECK:STDOUT: !22 = !DILocation(line: 16, column: 5, scope: !17) diff --git a/toolchain/lower/testdata/var/uninitialized.carbon b/toolchain/lower/testdata/var/uninitialized.carbon index 82576130c989..88ada112f769 100644 --- a/toolchain/lower/testdata/var/uninitialized.carbon +++ b/toolchain/lower/testdata/var/uninitialized.carbon @@ -41,9 +41,23 @@ fn Run() { // CHECK:STDOUT: store i8 poison, ptr %e.var, align 1, !dbg !11 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %f.var), !dbg !12 // CHECK:STDOUT: store ptr poison, ptr %f.var, align 8, !dbg !12 +// CHECK:STDOUT: call void @"_COp.98006a366c2ffd6c:core.Destroy.Core"(ptr %b.var), !dbg !8 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %a.var), !dbg !7 // CHECK:STDOUT: ret void, !dbg !13 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.98006a366c2ffd6c:core.Destroy.Core"(ptr %self) #0 !dbg !14 { +// 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.7e389eab4a7e5487:core.Destroy.Core"(ptr %self) #0 !dbg !21 { +// CHECK:STDOUT: entry: +// 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: @@ -70,3 +84,17 @@ fn Run() { // CHECK:STDOUT: !11 = !DILocation(line: 18, column: 3, scope: !4) // CHECK:STDOUT: !12 = !DILocation(line: 19, column: 3, scope: !4) // CHECK:STDOUT: !13 = !DILocation(line: 13, column: 1, scope: !4) +// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "Op", linkageName: "_COp.98006a366c2ffd6c:core.Destroy.Core", scope: null, file: !3, line: 15, type: !15, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !18) +// CHECK:STDOUT: !15 = !DISubroutineType(types: !16) +// CHECK:STDOUT: !16 = !{null, !17} +// CHECK:STDOUT: !17 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !18 = !{!19} +// CHECK:STDOUT: !19 = !DILocalVariable(arg: 1, scope: !14, type: !17) +// CHECK:STDOUT: !20 = !DILocation(line: 15, column: 3, scope: !14) +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7e389eab4a7e5487:core.Destroy.Core", scope: null, file: !3, line: 14, type: !22, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !25) +// CHECK:STDOUT: !22 = !DISubroutineType(types: !23) +// CHECK:STDOUT: !23 = !{null, !24} +// CHECK:STDOUT: !24 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !25 = !{!26} +// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !21, type: !24) +// CHECK:STDOUT: !27 = !DILocation(line: 14, column: 3, scope: !21) diff --git a/toolchain/sem_ir/function.h b/toolchain/sem_ir/function.h index 146a25757e21..b25d08f3eeca 100644 --- a/toolchain/sem_ir/function.h +++ b/toolchain/sem_ir/function.h @@ -263,10 +263,10 @@ struct Function : public EntityWithParamsBase, } // Sets that this function is generated for a `Core` witness. These will - // typically have a custom implementation, but may use builtin functions, such - // as `NoOp`. We still track them differently in order to support mangling. - auto SetCoreWitness(BuiltinFunctionKind kind = BuiltinFunctionKind::None) - -> void { + // typically have a custom implementation for a `None` kind, but may use + // builtin functions, most often `NoOp`. We still track them differently in + // order to support mangling. + auto SetCoreWitness(BuiltinFunctionKind kind) -> void { CARBON_CHECK(special_function_kind == SpecialFunctionKind::None); special_function_kind = SpecialFunctionKind::CoreWitness; special_function_kind_data = AnyRawId(kind.AsInt()); diff --git a/toolchain/sem_ir/type_iterator.cpp b/toolchain/sem_ir/type_iterator.cpp index 6cb14613f51f..65f14dcd762a 100644 --- a/toolchain/sem_ir/type_iterator.cpp +++ b/toolchain/sem_ir/type_iterator.cpp @@ -110,6 +110,7 @@ auto TypeIterator::ProcessTypeId(TypeId type_id) -> std::optional { case RequireSpecificDefinitionType::Kind: case TypeType::Kind: case UnboundElementType::Kind: + case VtableType::Kind: case WitnessType::Kind: { return Step::ConcreteType{.type_id = type_id}; }