diff --git a/toolchain/check/custom_witness.cpp b/toolchain/check/custom_witness.cpp index 823a86c8dd50..fa64a5eccf8c 100644 --- a/toolchain/check/custom_witness.cpp +++ b/toolchain/check/custom_witness.cpp @@ -6,6 +6,7 @@ #include "llvm/ADT/APFloat.h" #include "toolchain/base/kind_switch.h" +#include "toolchain/check/eval.h" #include "toolchain/check/facet_type.h" #include "toolchain/check/function.h" #include "toolchain/check/generic.h" @@ -152,7 +153,12 @@ static auto CanDestroyClass( } auto object_repr_id = - class_info.GetObjectRepr(context.sem_ir(), class_type.specific_id); + class_info.GetAdaptedType(context.sem_ir(), class_type.specific_id); + if (!object_repr_id.has_value()) { + 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); @@ -214,8 +220,8 @@ static auto CanDestroyType( } 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. + // Dependent type constructor calls that cannot be resolved under the + // generic context. return DestroyFormat::NoDestroy; case CARBON_KIND(SemIR::ClassType class_type): { diff --git a/toolchain/check/testdata/as/maybe_unformed.carbon b/toolchain/check/testdata/as/maybe_unformed.carbon index 2ff3790f893a..02296b8bb808 100644 --- a/toolchain/check/testdata/as/maybe_unformed.carbon +++ b/toolchain/check/testdata/as/maybe_unformed.carbon @@ -218,12 +218,13 @@ fn Use() { // CHECK:STDOUT: %MaybeUnformed.type: type = generic_class_type @MaybeUnformed [concrete] // CHECK:STDOUT: %MaybeUnformed.generic: %MaybeUnformed.type = struct_value () [concrete] // CHECK:STDOUT: %MaybeUnformed.198: type = class_type @MaybeUnformed, @MaybeUnformed(%X) [concrete] +// CHECK:STDOUT: %.f01: type = maybe_unformed_type %X [concrete] // CHECK:STDOUT: %pattern_type.009: type = pattern_type %MaybeUnformed.198 [concrete] // CHECK:STDOUT: %As.type.116: type = generic_interface_type @As [concrete] // CHECK:STDOUT: %As.generic: %As.type.116 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.3: type = fn_type @Destroy.Op.loc19_3.3 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.3: %Destroy.Op.type.1d8f74.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.4: type = fn_type @Destroy.Op.loc19_3.4 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.4: %Destroy.Op.type.1d8f74.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -278,7 +279,7 @@ fn Use() { // CHECK:STDOUT: %MaybeUnformed.loc27_37: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.198] // CHECK:STDOUT: } // CHECK:STDOUT: %v: %MaybeUnformed.198 = value_binding v, [concrete = ] -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %i.var, constants.%Destroy.Op.1a2547.3 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %i.var, constants.%Destroy.Op.1a2547.4 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%i.var) // CHECK:STDOUT: // CHECK:STDOUT: } @@ -290,7 +291,12 @@ fn Use() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc19_3.3(%self.param: ref %MaybeUnformed.198) { +// CHECK:STDOUT: fn @Destroy.Op.loc19_3.3(%self.param: ref %.f01) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc19_3.4(%self.param: ref %MaybeUnformed.198) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/adapter/adapt_copy.carbon b/toolchain/check/testdata/class/adapter/adapt_copy.carbon index 935fff73fd10..20dbb0741af9 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.1d8f74.2: type = fn_type @Destroy.Op.loc16_3.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.3: type = fn_type @Destroy.Op.loc16_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.3: %Destroy.Op.type.1d8f74.3 = struct_value () [concrete] // CHECK:STDOUT: %UInt.type: type = generic_class_type @UInt [concrete] // CHECK:STDOUT: %UInt.generic: %UInt.type = struct_value () [concrete] // CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [concrete] @@ -195,8 +195,8 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // 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: %Destroy.Op.type.1d8f74.5: type = fn_type @Destroy.Op.loc35_3.3 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.5: %Destroy.Op.type.1d8f74.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.6: type = fn_type @Destroy.Op.loc35_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.6: %Destroy.Op.type.1d8f74.6 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -284,14 +284,19 @@ 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.1a2547.2 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %d.var, constants.%Destroy.Op.1a2547.3 // 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_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: 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 %AdaptCopyable) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -316,7 +321,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %d.ref: ref %tuple.type.28f = name_ref d, %d // CHECK:STDOUT: %tuple.elem0.loc43: ref %AdaptCopyable = tuple_access %d.ref, element0 // CHECK:STDOUT: %.loc43: %AdaptCopyable = acquire_value %tuple.elem0.loc43 -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %d.var, constants.%Destroy.Op.1a2547.5 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %d.var, constants.%Destroy.Op.1a2547.6 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%d.var) // CHECK:STDOUT: return to %return.param // CHECK:STDOUT: } @@ -662,8 +667,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.1d8f74.2: type = fn_type @Destroy.Op.loc20_3.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.3: type = fn_type @Destroy.Op.loc20_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.3: %Destroy.Op.type.1d8f74.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -735,14 +740,19 @@ 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.1a2547.2 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %b.var, constants.%Destroy.Op.1a2547.3 // 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.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: fn @Destroy.Op.loc20_3.2(%self.param: ref %Noncopyable) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc20_3.3(%self.param: ref %AdaptNoncopyable) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interop/cpp/function/import/arithmetic_types_bridged.carbon b/toolchain/check/testdata/interop/cpp/function/import/arithmetic_types_bridged.carbon index c4fbc2477077..618d2adcafdd 100644 --- a/toolchain/check/testdata/interop/cpp/function/import/arithmetic_types_bridged.carbon +++ b/toolchain/check/testdata/interop/cpp/function/import/arithmetic_types_bridged.carbon @@ -881,6 +881,7 @@ fn F() { // 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: type = class_type @UInt, @UInt(%int_8) [concrete] // CHECK:STDOUT: %u8.builtin: type = int_type unsigned, %int_8 [concrete] // CHECK:STDOUT: %ptr.b46: type = ptr_type %char [concrete] // CHECK:STDOUT: %foo__carbon_thunk.type: type = fn_type @foo__carbon_thunk [concrete] @@ -904,9 +905,9 @@ fn F() { // CHECK:STDOUT: %char.as.Copy.impl.Op.bound: = bound_method %int_88, %char.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %.2ff: ref %char = temporary invalid, %int_88 [concrete] // CHECK:STDOUT: %addr: %ptr.b46 = addr_of %.2ff [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc8_11.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.2ff, %Destroy.Op.1a2547.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.3: type = fn_type @Destroy.Op.loc8_11.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.3: %Destroy.Op.type.1d8f74.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.2ff, %Destroy.Op.1a2547.3 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -949,7 +950,12 @@ fn F() { // CHECK:STDOUT: // 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: fn @Destroy.Op.loc8_11.2(%self.param: ref %u8) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_11.3(%self.param: ref %char) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interop/cpp/function/import/decayed_param.carbon b/toolchain/check/testdata/interop/cpp/function/import/decayed_param.carbon index f1b599dc352d..41555e2b8f88 100644 --- a/toolchain/check/testdata/interop/cpp/function/import/decayed_param.carbon +++ b/toolchain/check/testdata/interop/cpp/function/import/decayed_param.carbon @@ -132,6 +132,7 @@ fn F() { // CHECK:STDOUT: %Destroy.facet.4c4: %Destroy.type = facet_value %ptr.d08, (%custom_witness.df9cc1.1) [concrete] // CHECK:STDOUT: %MaybeUnformed.b84: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.4c4) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.16a: = impl_witness imports.%OptionalStorage.impl_witness_table.271, @ptr.as.OptionalStorage.impl(%i32) [concrete] +// CHECK:STDOUT: %.0f8: type = maybe_unformed_type %ptr.d08 [concrete] // CHECK:STDOUT: %OptionalStorage.facet.472: %OptionalStorage.type = facet_value %ptr.d08, (%OptionalStorage.impl_witness.16a) [concrete] // CHECK:STDOUT: %Optional.c4d: type = class_type @Optional, @Optional(%OptionalStorage.facet.472) [concrete] // CHECK:STDOUT: %TakesArray.type: type = fn_type @TakesArray [concrete] @@ -166,10 +167,10 @@ fn F() { // CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.bound: = bound_method %uninit, %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.3b7 [concrete] // CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.3b7, @Cpp.nullptr_t.as.ImplicitAs.impl.Convert(%i32) [concrete] // CHECK:STDOUT: %bound_method.f6e: = bound_method %uninit, %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.specific_fn [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.4: type = fn_type @Destroy.Op.loc13_21.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.4: %Destroy.Op.type.1d8f74.4 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.7: type = fn_type @Destroy.Op.loc10_3.3 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.7: %Destroy.Op.type.1d8f74.7 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.5: type = fn_type @Destroy.Op.loc13_21.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.5: %Destroy.Op.type.1d8f74.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.8: type = fn_type @Destroy.Op.loc10_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.8: %Destroy.Op.type.1d8f74.8 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -271,21 +272,26 @@ fn F() { // CHECK:STDOUT: %.loc13_21.3: ref %Optional.c4d = temporary %.loc13_21.2, %.loc13_21.1 // CHECK:STDOUT: %.loc13_21.4: %Optional.c4d = 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.1a2547.4 +// CHECK:STDOUT: %Destroy.Op.bound.loc13: = bound_method %.loc13_21.3, constants.%Destroy.Op.1a2547.5 // 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.1a2547.4 +// CHECK:STDOUT: %Destroy.Op.bound.loc11: = bound_method %.loc11_18.3, constants.%Destroy.Op.1a2547.5 // 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.1a2547.7 +// CHECK:STDOUT: %Destroy.Op.bound.loc10: = bound_method %n.var, constants.%Destroy.Op.1a2547.8 // 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_21.1(%self.param: ref %MaybeUnformed.b84) { +// CHECK:STDOUT: fn @Destroy.Op.loc13_21.1(%self.param: ref %.0f8) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc13_21.2(%self.param: ref %Optional.c4d) { +// CHECK:STDOUT: fn @Destroy.Op.loc13_21.2(%self.param: ref %MaybeUnformed.b84) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc13_21.3(%self.param: ref %Optional.c4d) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interop/cpp/function/import/pointer.carbon b/toolchain/check/testdata/interop/cpp/function/import/pointer.carbon index 23c977ab82d0..f85bb8bbf8ee 100644 --- a/toolchain/check/testdata/interop/cpp/function/import/pointer.carbon +++ b/toolchain/check/testdata/interop/cpp/function/import/pointer.carbon @@ -938,6 +938,7 @@ fn F() { // CHECK:STDOUT: %Destroy.facet.5b4: %Destroy.type = facet_value %ptr.037, (%custom_witness.df9cc1.1) [concrete] // CHECK:STDOUT: %MaybeUnformed.9f2: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.5b4) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.582: = impl_witness imports.%OptionalStorage.impl_witness_table.7bc, @ptr.as.OptionalStorage.impl(%S) [concrete] +// CHECK:STDOUT: %.08a0: type = maybe_unformed_type %ptr.037 [concrete] // CHECK:STDOUT: %OptionalStorage.facet.0ce: %OptionalStorage.type = facet_value %ptr.037, (%OptionalStorage.impl_witness.582) [concrete] // CHECK:STDOUT: %Optional.659: type = class_type @Optional, @Optional(%OptionalStorage.facet.0ce) [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] @@ -965,10 +966,10 @@ fn F() { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.9f9: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%Optional.659, %ImplicitAs.facet.9d6) [concrete] // CHECK:STDOUT: %.ba9: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.9f9, %ImplicitAs.facet.9d6 [concrete] // CHECK:STDOUT: %const.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %const.as.ImplicitAs.impl.Convert.1e5, @const.as.ImplicitAs.impl.Convert(%Optional.659, %ImplicitAs.facet.21e) [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.3: type = fn_type @Destroy.Op.loc11_11.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.3: %Destroy.Op.type.1d8f74.3 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.4: type = fn_type @Destroy.Op.loc10 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.4: type = fn_type @Destroy.Op.loc11_11.3 [concrete] // CHECK:STDOUT: %Destroy.Op.1a2547.4: %Destroy.Op.type.1d8f74.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.5: type = fn_type @Destroy.Op.loc10 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.5: %Destroy.Op.type.1d8f74.5 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1036,19 +1037,24 @@ fn F() { // CHECK:STDOUT: %.loc11_11.4: ref %Optional.659 = temporary %.loc11_11.3, %.loc11_11.2 // CHECK:STDOUT: %.loc11_11.5: %Optional.659 = 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.1a2547.3 +// CHECK:STDOUT: %Destroy.Op.bound.loc11: = bound_method %.loc11_11.4, constants.%Destroy.Op.1a2547.4 // 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.1a2547.4 +// CHECK:STDOUT: %Destroy.Op.bound.loc10: = bound_method %p.var, constants.%Destroy.Op.1a2547.5 // 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_11.1(%self.param: ref %MaybeUnformed.9f2) { +// CHECK:STDOUT: fn @Destroy.Op.loc11_11.1(%self.param: ref %.08a0) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc11_11.2(%self.param: ref %Optional.659) { +// CHECK:STDOUT: fn @Destroy.Op.loc11_11.2(%self.param: ref %MaybeUnformed.9f2) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc11_11.3(%self.param: ref %Optional.659) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -1085,6 +1091,7 @@ fn F() { // CHECK:STDOUT: %Destroy.facet.5b4: %Destroy.type = facet_value %ptr.037, (%custom_witness.df9cc1.1) [concrete] // CHECK:STDOUT: %MaybeUnformed.9f2: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.5b4) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.582: = impl_witness imports.%OptionalStorage.impl_witness_table.7bc, @ptr.as.OptionalStorage.impl(%S) [concrete] +// CHECK:STDOUT: %.08a0: type = maybe_unformed_type %ptr.037 [concrete] // CHECK:STDOUT: %OptionalStorage.facet.0ce: %OptionalStorage.type = facet_value %ptr.037, (%OptionalStorage.impl_witness.582) [concrete] // CHECK:STDOUT: %Optional.659: type = class_type @Optional, @Optional(%OptionalStorage.facet.0ce) [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] @@ -1106,8 +1113,8 @@ fn F() { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.c92: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%Optional.659, %ImplicitAs.facet.21e) [concrete] // CHECK:STDOUT: %.c09: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.c92, %ImplicitAs.facet.21e [concrete] // CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %U.as_type.as.ImplicitAs.impl.Convert.8f4, @U.as_type.as.ImplicitAs.impl.Convert.2(%OptionalStorage.facet.0ce, %OptionalAs.facet) [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.3: type = fn_type @Destroy.Op.loc11_11.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.3: %Destroy.Op.type.1d8f74.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.4: type = fn_type @Destroy.Op.loc11_11.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.4: %Destroy.Op.type.1d8f74.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1172,19 +1179,24 @@ fn F() { // CHECK:STDOUT: %.loc11_11.4: ref %Optional.659 = temporary %.loc11_11.3, %.loc11_11.2 // CHECK:STDOUT: %.loc11_11.5: %Optional.659 = 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.1a2547.3 +// CHECK:STDOUT: %Destroy.Op.bound.loc11: = bound_method %.loc11_11.4, constants.%Destroy.Op.1a2547.4 // 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.1a2547.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_11.1(%self.param: ref %MaybeUnformed.9f2) { +// CHECK:STDOUT: fn @Destroy.Op.loc11_11.1(%self.param: ref %.08a0) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc11_11.2(%self.param: ref %Optional.659) { +// CHECK:STDOUT: fn @Destroy.Op.loc11_11.2(%self.param: ref %MaybeUnformed.9f2) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc11_11.3(%self.param: ref %Optional.659) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -1351,6 +1363,7 @@ fn F() { // CHECK:STDOUT: %Destroy.facet.5b4: %Destroy.type = facet_value %ptr.037, (%custom_witness.df9cc1.1) [concrete] // CHECK:STDOUT: %MaybeUnformed.9f2: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.5b4) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.582: = impl_witness imports.%OptionalStorage.impl_witness_table.7bc, @ptr.as.OptionalStorage.impl(%S) [concrete] +// CHECK:STDOUT: %.08a0: type = maybe_unformed_type %ptr.037 [concrete] // CHECK:STDOUT: %OptionalStorage.facet.0ce: %OptionalStorage.type = facet_value %ptr.037, (%OptionalStorage.impl_witness.582) [concrete] // CHECK:STDOUT: %Optional.659: type = class_type @Optional, @Optional(%OptionalStorage.facet.0ce) [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] @@ -1372,8 +1385,8 @@ fn F() { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.c92: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%Optional.659, %ImplicitAs.facet.21e) [concrete] // CHECK:STDOUT: %.c09: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.c92, %ImplicitAs.facet.21e [concrete] // CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %U.as_type.as.ImplicitAs.impl.Convert.8f4, @U.as_type.as.ImplicitAs.impl.Convert.2(%OptionalStorage.facet.0ce, %OptionalAs.facet) [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.3: type = fn_type @Destroy.Op.loc9_11.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.3: %Destroy.Op.type.1d8f74.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.4: type = fn_type @Destroy.Op.loc9_11.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.4: %Destroy.Op.type.1d8f74.4 = 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: } @@ -1440,19 +1453,24 @@ fn F() { // CHECK:STDOUT: %.loc9_11.3: ref %Optional.659 = temporary %.loc9_11.2, %.loc9_11.1 // CHECK:STDOUT: %.loc9_11.4: %Optional.659 = 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.1a2547.3 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc9_11.3, constants.%Destroy.Op.1a2547.4 // 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_11.1(%self.param: ref %MaybeUnformed.9f2) { +// CHECK:STDOUT: fn @Destroy.Op.loc9_11.1(%self.param: ref %.08a0) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc9_11.2(%self.param: ref %Optional.659) { +// CHECK:STDOUT: fn @Destroy.Op.loc9_11.2(%self.param: ref %MaybeUnformed.9f2) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_11.3(%self.param: ref %Optional.659) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -1485,6 +1503,7 @@ fn F() { // CHECK:STDOUT: %Destroy.facet.5b4: %Destroy.type = facet_value %ptr.037, (%custom_witness.df9cc1.1) [concrete] // CHECK:STDOUT: %MaybeUnformed.9f2: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.5b4) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.725: = impl_witness imports.%OptionalStorage.impl_witness_table.aa4, @ptr.as.OptionalStorage.impl(%S) [concrete] +// CHECK:STDOUT: %.08a: type = maybe_unformed_type %ptr.037 [concrete] // CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value %ptr.037, (%OptionalStorage.impl_witness.725) [concrete] // CHECK:STDOUT: %Optional.db1: type = class_type @Optional, @Optional(%OptionalStorage.facet) [concrete] // CHECK:STDOUT: %Optional.None.type.fc8: type = fn_type @Optional.None, @Optional(%OptionalStorage.facet) [concrete] @@ -1492,8 +1511,8 @@ fn F() { // CHECK:STDOUT: %Optional.None.specific_fn: = specific_function %Optional.None.9d4, @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.1d8f74.3: type = fn_type @Destroy.Op.loc8_38.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.3: %Destroy.Op.type.1d8f74.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.4: type = fn_type @Destroy.Op.loc8_38.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.4: %Destroy.Op.type.1d8f74.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1553,17 +1572,22 @@ fn F() { // CHECK:STDOUT: %.loc8_38.2: ref %Optional.db1 = temporary %.loc8_38.1, %Optional.None.call // CHECK:STDOUT: %.loc8_38.3: %Optional.db1 = 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.1a2547.3 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc8_38.2, constants.%Destroy.Op.1a2547.4 // 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_38.1(%self.param: ref %MaybeUnformed.9f2) { +// CHECK:STDOUT: fn @Destroy.Op.loc8_38.1(%self.param: ref %.08a) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc8_38.2(%self.param: ref %Optional.db1) { +// CHECK:STDOUT: fn @Destroy.Op.loc8_38.2(%self.param: ref %MaybeUnformed.9f2) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_38.3(%self.param: ref %Optional.db1) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -1600,6 +1624,7 @@ fn F() { // CHECK:STDOUT: %Destroy.facet.5b4: %Destroy.type = facet_value %ptr.037, (%custom_witness.df9cc1.1) [concrete] // CHECK:STDOUT: %MaybeUnformed.9f2: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.5b4) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.582: = impl_witness imports.%OptionalStorage.impl_witness_table.7bc, @ptr.as.OptionalStorage.impl(%S) [concrete] +// CHECK:STDOUT: %.08a0: type = maybe_unformed_type %ptr.037 [concrete] // CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value %ptr.037, (%OptionalStorage.impl_witness.582) [concrete] // CHECK:STDOUT: %Optional.659: type = class_type @Optional, @Optional(%OptionalStorage.facet) [concrete] // CHECK:STDOUT: %Optional.Some.type.004: type = fn_type @Optional.Some, @Optional(%OptionalStorage.facet) [concrete] @@ -1607,8 +1632,8 @@ fn F() { // CHECK:STDOUT: %Optional.Some.specific_fn: = specific_function %Optional.Some.9ba, @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.1d8f74.3: type = fn_type @Destroy.Op.loc9_40.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.3: %Destroy.Op.type.1d8f74.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.4: type = fn_type @Destroy.Op.loc9_40.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.4: %Destroy.Op.type.1d8f74.4 = 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: } @@ -1688,19 +1713,24 @@ fn F() { // CHECK:STDOUT: %.loc9_40.3: ref %Optional.659 = temporary %.loc9_40.2, %Optional.Some.call // CHECK:STDOUT: %.loc9_40.4: %Optional.659 = 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.1a2547.3 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc9_40.3, constants.%Destroy.Op.1a2547.4 // 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_40.1(%self.param: ref %MaybeUnformed.9f2) { +// CHECK:STDOUT: fn @Destroy.Op.loc9_40.1(%self.param: ref %.08a0) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc9_40.2(%self.param: ref %Optional.659) { +// CHECK:STDOUT: fn @Destroy.Op.loc9_40.2(%self.param: ref %MaybeUnformed.9f2) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_40.3(%self.param: ref %Optional.659) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -1728,14 +1758,15 @@ fn F() { // CHECK:STDOUT: %Destroy.facet.5b4: %Destroy.type = facet_value %ptr.037, (%custom_witness.df9cc1.1) [concrete] // CHECK:STDOUT: %MaybeUnformed.9f2: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.5b4) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.392: = impl_witness imports.%OptionalStorage.impl_witness_table.76e, @ptr.as.OptionalStorage.impl(%S) [concrete] +// CHECK:STDOUT: %.08a: type = maybe_unformed_type %ptr.037 [concrete] // CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value %ptr.037, (%OptionalStorage.impl_witness.392) [concrete] // CHECK:STDOUT: %Optional.19d: type = class_type @Optional, @Optional(%OptionalStorage.facet) [concrete] // CHECK:STDOUT: %get.type: type = fn_type @get [concrete] // 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.1d8f74.3: type = fn_type @Destroy.Op.loc8_19.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.3: %Destroy.Op.type.1d8f74.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.4: type = fn_type @Destroy.Op.loc8_19.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.4: %Destroy.Op.type.1d8f74.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1785,17 +1816,22 @@ fn F() { // CHECK:STDOUT: %.loc8_19.2: ref %Optional.19d = temporary %.loc8_19.1, %get.call // CHECK:STDOUT: %.loc8_19.3: %Optional.19d = 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.1a2547.3 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc8_19.2, constants.%Destroy.Op.1a2547.4 // 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_19.1(%self.param: ref %MaybeUnformed.9f2) { +// CHECK:STDOUT: fn @Destroy.Op.loc8_19.1(%self.param: ref %.08a) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc8_19.2(%self.param: ref %Optional.19d) { +// CHECK:STDOUT: fn @Destroy.Op.loc8_19.2(%self.param: ref %MaybeUnformed.9f2) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_19.3(%self.param: ref %Optional.19d) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -1901,6 +1937,7 @@ fn F() { // CHECK:STDOUT: %Destroy.facet.5b4: %Destroy.type = facet_value %ptr.037, (%custom_witness.df9cc1.1) [concrete] // CHECK:STDOUT: %MaybeUnformed.9f2: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.5b4) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.582: = impl_witness imports.%OptionalStorage.impl_witness_table.7bc, @ptr.as.OptionalStorage.impl(%S) [concrete] +// CHECK:STDOUT: %.08a0: type = maybe_unformed_type %ptr.037 [concrete] // CHECK:STDOUT: %OptionalStorage.facet.0ce: %OptionalStorage.type = facet_value %ptr.037, (%OptionalStorage.impl_witness.582) [concrete] // CHECK:STDOUT: %Optional.659: type = class_type @Optional, @Optional(%OptionalStorage.facet.0ce) [concrete] // CHECK:STDOUT: %pattern_type.9f4: type = pattern_type %Optional.659 [concrete] @@ -1930,8 +1967,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: %.a94: ref %S = temporary invalid, %S.val [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.3: type = fn_type @Destroy.Op.loc13_65.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.3: %Destroy.Op.type.1d8f74.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.4: type = fn_type @Destroy.Op.loc13_65.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.4: %Destroy.Op.type.1d8f74.4 = 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: } @@ -2051,21 +2088,26 @@ fn F() { // CHECK:STDOUT: %.loc13_65.2: ref %Optional.659 = temporary %.loc13_65.1, %Indirect__carbon_thunk.call // CHECK:STDOUT: %.loc13_65.3: %Optional.659 = acquire_value %.loc13_65.2 // CHECK:STDOUT: %a: %Optional.659 = value_binding a, %.loc13_65.3 -// CHECK:STDOUT: %Destroy.Op.bound.loc13: = bound_method %.loc13_65.2, constants.%Destroy.Op.1a2547.3 +// CHECK:STDOUT: %Destroy.Op.bound.loc13: = bound_method %.loc13_65.2, constants.%Destroy.Op.1a2547.4 // 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.1a2547.3 +// CHECK:STDOUT: %Destroy.Op.bound.loc11: = bound_method %.loc11_14.3, constants.%Destroy.Op.1a2547.4 // 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_65.1(%self.param: ref %MaybeUnformed.9f2) { +// CHECK:STDOUT: fn @Destroy.Op.loc13_65.1(%self.param: ref %.08a0) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc13_65.2(%self.param: ref %Optional.659) { +// CHECK:STDOUT: fn @Destroy.Op.loc13_65.2(%self.param: ref %MaybeUnformed.9f2) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc13_65.3(%self.param: ref %Optional.659) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interop/cpp/function/import/return.carbon b/toolchain/check/testdata/interop/cpp/function/import/return.carbon index a8b924dd03b6..df243a610754 100644 --- a/toolchain/check/testdata/interop/cpp/function/import/return.carbon +++ b/toolchain/check/testdata/interop/cpp/function/import/return.carbon @@ -186,16 +186,23 @@ fn Var() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Cpp.nullptr_t: type = class_type @NullptrT [concrete] +// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.1: type = fn_type @Destroy.Op.1 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.1: %Destroy.Op.type.1d8f74.1 = struct_value () [concrete] // CHECK:STDOUT: %Cpp.void: type = class_type @VoidBase [concrete] // CHECK:STDOUT: %ptr.00a: type = ptr_type %Cpp.void [concrete] +// CHECK:STDOUT: %custom_witness.df9cc1.1: = custom_witness (%Destroy.Op.1a2547.1), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.49e: %Destroy.type = facet_value %ptr.00a, (%custom_witness.df9cc1.1) [concrete] +// CHECK:STDOUT: %MaybeUnformed.399: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.49e) [concrete] +// CHECK:STDOUT: %.a7d: type = maybe_unformed_type %ptr.00a [concrete] // CHECK:STDOUT: %pattern_type.af6: type = pattern_type %Cpp.nullptr_t [concrete] // CHECK:STDOUT: %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.ab6: type = ptr_type %Cpp.nullptr_t [concrete] // CHECK:STDOUT: %ReturnNullPtr__carbon_thunk.type: type = fn_type @ReturnNullPtr__carbon_thunk [concrete] // CHECK:STDOUT: %ReturnNullPtr__carbon_thunk: %ReturnNullPtr__carbon_thunk.type = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.3: type = fn_type @Destroy.Op.loc11_3.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.3: %Destroy.Op.type.1d8f74.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.5: type = fn_type @Destroy.Op.loc11_3.4 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.5: %Destroy.Op.type.1d8f74.5 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -231,14 +238,24 @@ 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.1a2547.3 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %c.var, constants.%Destroy.Op.1a2547.5 // 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_3.1(%self.param: ref %ptr.00a) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc11_3.2(%self.param: ref %Cpp.nullptr_t) { +// CHECK:STDOUT: fn @Destroy.Op.loc11_3.2(%self.param: ref %.a7d) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc11_3.3(%self.param: ref %MaybeUnformed.399) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc11_3.4(%self.param: ref %Cpp.nullptr_t) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interop/cpp/function/import/void_pointer.carbon b/toolchain/check/testdata/interop/cpp/function/import/void_pointer.carbon index d22e401cfc87..b82fd8a54e4b 100644 --- a/toolchain/check/testdata/interop/cpp/function/import/void_pointer.carbon +++ b/toolchain/check/testdata/interop/cpp/function/import/void_pointer.carbon @@ -216,6 +216,7 @@ fn F() { // CHECK:STDOUT: %Destroy.facet.49e: %Destroy.type = facet_value %ptr.00a, (%custom_witness.df9cc1.1) [concrete] // CHECK:STDOUT: %MaybeUnformed.399: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.49e) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.cc5: = impl_witness imports.%OptionalStorage.impl_witness_table.7bc, @ptr.as.OptionalStorage.impl(%Cpp.void) [concrete] +// CHECK:STDOUT: %.a7d: type = maybe_unformed_type %ptr.00a [concrete] // CHECK:STDOUT: %OptionalStorage.facet.f19: %OptionalStorage.type = facet_value %ptr.00a, (%OptionalStorage.impl_witness.cc5) [concrete] // CHECK:STDOUT: %Optional.c11: type = class_type @Optional, @Optional(%OptionalStorage.facet.f19) [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] @@ -237,8 +238,8 @@ fn F() { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.bdd: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%Optional.c11, %ImplicitAs.facet.d85) [concrete] // CHECK:STDOUT: %.c7c: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.bdd, %ImplicitAs.facet.d85 [concrete] // CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %U.as_type.as.ImplicitAs.impl.Convert.504, @U.as_type.as.ImplicitAs.impl.Convert.2(%OptionalStorage.facet.f19, %OptionalAs.facet) [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.3: type = fn_type @Destroy.Op.loc10_11.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.3: %Destroy.Op.type.1d8f74.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.4: type = fn_type @Destroy.Op.loc10_11.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.4: %Destroy.Op.type.1d8f74.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -287,17 +288,22 @@ fn F() { // CHECK:STDOUT: %.loc10_11.3: ref %Optional.c11 = temporary %.loc10_11.2, %.loc10_11.1 // CHECK:STDOUT: %.loc10_11.4: %Optional.c11 = 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.1a2547.3 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc10_11.3, constants.%Destroy.Op.1a2547.4 // 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_11.1(%self.param: ref %MaybeUnformed.399) { +// CHECK:STDOUT: fn @Destroy.Op.loc10_11.1(%self.param: ref %.a7d) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc10_11.2(%self.param: ref %Optional.c11) { +// CHECK:STDOUT: fn @Destroy.Op.loc10_11.2(%self.param: ref %MaybeUnformed.399) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_11.3(%self.param: ref %Optional.c11) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -330,6 +336,7 @@ fn F() { // CHECK:STDOUT: %Destroy.facet.49e: %Destroy.type = facet_value %ptr.00a, (%custom_witness.df9cc1.1) [concrete] // CHECK:STDOUT: %MaybeUnformed.399: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.49e) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.ae9: = impl_witness imports.%OptionalStorage.impl_witness_table.aa4, @ptr.as.OptionalStorage.impl(%Cpp.void) [concrete] +// CHECK:STDOUT: %.a7d: type = maybe_unformed_type %ptr.00a [concrete] // CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value %ptr.00a, (%OptionalStorage.impl_witness.ae9) [concrete] // CHECK:STDOUT: %Optional.d90: type = class_type @Optional, @Optional(%OptionalStorage.facet) [concrete] // CHECK:STDOUT: %Optional.None.type.c50: type = fn_type @Optional.None, @Optional(%OptionalStorage.facet) [concrete] @@ -337,8 +344,8 @@ fn F() { // CHECK:STDOUT: %Optional.None.specific_fn: = specific_function %Optional.None.5c6, @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.1d8f74.3: type = fn_type @Destroy.Op.loc10_41.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.3: %Destroy.Op.type.1d8f74.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.4: type = fn_type @Destroy.Op.loc10_41.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.4: %Destroy.Op.type.1d8f74.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -405,17 +412,22 @@ fn F() { // CHECK:STDOUT: %.loc10_41.2: ref %Optional.d90 = temporary %.loc10_41.1, %Optional.None.call // CHECK:STDOUT: %.loc10_41.3: %Optional.d90 = 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.1a2547.3 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc10_41.2, constants.%Destroy.Op.1a2547.4 // 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_41.1(%self.param: ref %MaybeUnformed.399) { +// CHECK:STDOUT: fn @Destroy.Op.loc10_41.1(%self.param: ref %.a7d) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc10_41.2(%self.param: ref %Optional.d90) { +// CHECK:STDOUT: fn @Destroy.Op.loc10_41.2(%self.param: ref %MaybeUnformed.399) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_41.3(%self.param: ref %Optional.d90) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -441,6 +453,7 @@ fn F() { // CHECK:STDOUT: %Destroy.facet.49e: %Destroy.type = facet_value %ptr.00a, (%custom_witness.df9cc1.1) [concrete] // CHECK:STDOUT: %MaybeUnformed.399: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.49e) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.570: = impl_witness imports.%OptionalStorage.impl_witness_table.76e, @ptr.as.OptionalStorage.impl(%Cpp.void) [concrete] +// CHECK:STDOUT: %.a7d: type = maybe_unformed_type %ptr.00a [concrete] // CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value %ptr.00a, (%OptionalStorage.impl_witness.570) [concrete] // CHECK:STDOUT: %Optional.752: type = class_type @Optional, @Optional(%OptionalStorage.facet) [concrete] // CHECK:STDOUT: %pattern_type.d62: type = pattern_type %Optional.752 [concrete] @@ -448,8 +461,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.1d8f74.3: type = fn_type @Destroy.Op.loc10_57.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.3: %Destroy.Op.type.1d8f74.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.4: type = fn_type @Destroy.Op.loc10_57.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.4: %Destroy.Op.type.1d8f74.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -514,17 +527,22 @@ fn F() { // CHECK:STDOUT: %.loc10_57.2: ref %Optional.752 = temporary %.loc10_57.1, %foo.call // CHECK:STDOUT: %.loc10_57.3: %Optional.752 = acquire_value %.loc10_57.2 // CHECK:STDOUT: %output: %Optional.752 = value_binding output, %.loc10_57.3 -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc10_57.2, constants.%Destroy.Op.1a2547.3 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc10_57.2, constants.%Destroy.Op.1a2547.4 // 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_57.1(%self.param: ref %MaybeUnformed.399) { +// CHECK:STDOUT: fn @Destroy.Op.loc10_57.1(%self.param: ref %.a7d) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc10_57.2(%self.param: ref %Optional.752) { +// CHECK:STDOUT: fn @Destroy.Op.loc10_57.2(%self.param: ref %MaybeUnformed.399) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc10_57.3(%self.param: ref %Optional.752) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interop/cpp/impls/destroy.carbon b/toolchain/check/testdata/interop/cpp/impls/destroy.carbon index 8c948d1541e4..85f89f9fc3d3 100644 --- a/toolchain/check/testdata/interop/cpp/impls/destroy.carbon +++ b/toolchain/check/testdata/interop/cpp/impls/destroy.carbon @@ -200,6 +200,30 @@ fn EqualWitnesses(p: Wrap(Cpp.PublicDestructor)*) -> Wrap(Cpp.PublicDestructor)* return p; } +// --- fail_no_destroy.carbon + +library "[[@TEST_NAME]]"; + +import Cpp library "types.h"; + +class AdaptNoDestroy { + adapt Cpp.DeletedDestructor; +} + +fn Make() -> AdaptNoDestroy; + +fn F() { + // CHECK:STDERR: fail_no_destroy.carbon:[[@LINE+8]]:3: error: attempt to use a deleted function [CppInteropParseError] + // CHECK:STDERR: 21 | var _: AdaptNoDestroy = Make(); + // CHECK:STDERR: | ^ + // CHECK:STDERR: fail_no_destroy.carbon:[[@LINE-12]]:10: in file included here [InCppInclude] + // CHECK:STDERR: ./types.h:23:3: note: '~DeletedDestructor' has been explicitly marked deleted here [CppInteropParseNote] + // CHECK:STDERR: 23 | ~DeletedDestructor() = delete; + // CHECK:STDERR: | ^ + // CHECK:STDERR: + var _: AdaptNoDestroy = Make(); +} + // CHECK:STDOUT: --- destroy_destroyable.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { diff --git a/toolchain/check/testdata/interop/cpp/macros/macros.carbon b/toolchain/check/testdata/interop/cpp/macros/macros.carbon index 4e06d4c69ae7..7c1d11498c44 100644 --- a/toolchain/check/testdata/interop/cpp/macros/macros.carbon +++ b/toolchain/check/testdata/interop/cpp/macros/macros.carbon @@ -1759,6 +1759,7 @@ fn F() { // CHECK:STDOUT: %Destroy.facet.4c4: %Destroy.type = facet_value %ptr.d08, (%custom_witness.df9cc1.2) [concrete] // CHECK:STDOUT: %MaybeUnformed.b84: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.4c4) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.734: = impl_witness imports.%OptionalStorage.impl_witness_table.aa4, @ptr.as.OptionalStorage.impl(%i32) [concrete] +// CHECK:STDOUT: %.0f8: type = maybe_unformed_type %ptr.d08 [concrete] // CHECK:STDOUT: %OptionalStorage.facet.194: %OptionalStorage.type = facet_value %ptr.d08, (%OptionalStorage.impl_witness.734) [concrete] // CHECK:STDOUT: %Optional.a18: type = class_type @Optional, @Optional(%OptionalStorage.facet.194) [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] @@ -1775,8 +1776,8 @@ fn F() { // CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.bound: = bound_method %uninit, %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.41f [concrete] // CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.41f, @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.1d8f74.4: type = fn_type @Destroy.Op.loc11_14.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.4: %Destroy.Op.type.1d8f74.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.5: type = fn_type @Destroy.Op.loc11_14.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.5: %Destroy.Op.type.1d8f74.5 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1826,17 +1827,22 @@ fn F() { // CHECK:STDOUT: %.loc11_14.3: ref %Optional.a18 = temporary %.loc11_14.2, %.loc11_14.1 // CHECK:STDOUT: %.loc11_14.4: %Optional.a18 = 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.1a2547.4 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc11_14.3, constants.%Destroy.Op.1a2547.5 // 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_14.1(%self.param: ref %MaybeUnformed.b84) { +// CHECK:STDOUT: fn @Destroy.Op.loc11_14.1(%self.param: ref %.0f8) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc11_14.2(%self.param: ref %Optional.a18) { +// CHECK:STDOUT: fn @Destroy.Op.loc11_14.2(%self.param: ref %MaybeUnformed.b84) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc11_14.3(%self.param: ref %Optional.a18) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.llp64.carbon b/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.llp64.carbon index 098d2390237d..30ebb366581f 100644 --- a/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.llp64.carbon +++ b/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.llp64.carbon @@ -1344,6 +1344,7 @@ fn CopyUnsignedLong() { // 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: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %pattern_type.25e: type = pattern_type %Cpp.long [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] @@ -1363,8 +1364,8 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.3dd: type = fn_type_with_self_type %Copy.WithSelf.Op.type.8db, %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.1d8f74.2: type = fn_type @Destroy.Op.loc9_3.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.3: type = fn_type @Destroy.Op.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.3: %Destroy.Op.type.1d8f74.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1412,16 +1413,21 @@ 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.1a2547.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc9: = bound_method %b.var, constants.%Destroy.Op.1a2547.3 // 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.1a2547.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc8: = bound_method %a.var, constants.%Destroy.Op.1a2547.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_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: 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 %Cpp.long) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -2627,6 +2633,7 @@ fn CopyUnsignedLong() { // 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: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %pattern_type.25e: type = pattern_type %Cpp.long [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] @@ -2798,8 +2805,8 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.7cc: type = fn_type_with_self_type %RightShiftAssignWith.WithSelf.Op.type.75e, %RightShiftAssignWith.facet.c66 [concrete] // CHECK:STDOUT: %Cpp.long.as.RightShiftAssignWith.impl.Op.specific_fn.5a2726.1: = specific_function %Cpp.long.as.RightShiftAssignWith.impl.Op.108e17.2, @Cpp.long.as.RightShiftAssignWith.impl.Op.1(%ImplicitAs.facet.7ac) [concrete] // CHECK:STDOUT: %Cpp.long.as.RightShiftAssignWith.impl.Op.specific_fn.5a2726.2: = specific_function %Cpp.long.as.RightShiftAssignWith.impl.Op.108e17.1, @Cpp.long.as.RightShiftAssignWith.impl.Op.2(%ImplicitAs.facet.7ac) [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc9_3.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.3: type = fn_type @Destroy.Op.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.3: %Destroy.Op.type.1d8f74.3 = struct_value () [concrete] // CHECK:STDOUT: %Cpp.long.as.Copy.impl.Op.type: type = fn_type @Cpp.long.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %Cpp.long.as.Copy.impl.Op: %Cpp.long.as.Copy.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: } @@ -3031,16 +3038,21 @@ 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.7ac) [concrete = constants.%Cpp.long.as.RightShiftAssignWith.impl.Op.specific_fn.5a2726.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.1a2547.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc9: = bound_method %b.var, constants.%Destroy.Op.1a2547.3 // 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.1a2547.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc8: = bound_method %a.var, constants.%Destroy.Op.1a2547.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_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: 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 %Cpp.long) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -3221,8 +3233,8 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.17e: type = fn_type_with_self_type %RightShiftAssignWith.WithSelf.Op.type.caf, %RightShiftAssignWith.facet.4cd [concrete] // CHECK:STDOUT: %Cpp.long.as.RightShiftAssignWith.impl.Op.specific_fn.708585.1: = specific_function %Cpp.long.as.RightShiftAssignWith.impl.Op.76ada1.2, @Cpp.long.as.RightShiftAssignWith.impl.Op.1(%ImplicitAs.facet.ce4) [concrete] // CHECK:STDOUT: %Cpp.long.as.RightShiftAssignWith.impl.Op.specific_fn.708585.2: = specific_function %Cpp.long.as.RightShiftAssignWith.impl.Op.76ada1.1, @Cpp.long.as.RightShiftAssignWith.impl.Op.2(%ImplicitAs.facet.ce4) [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc9_3.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.3: type = fn_type @Destroy.Op.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.3: %Destroy.Op.type.1d8f74.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3475,14 +3487,19 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.loc20_9.1: %Cpp.long = value_of_initializer %i32.as.ImplicitAs.impl.Convert.call.loc20 // CHECK:STDOUT: %.loc20_9.2: %Cpp.long = converted %b.ref.loc20, %.loc20_9.1 // CHECK:STDOUT: %Cpp.long.as.RightShiftAssignWith.impl.Op.call: init %empty_tuple.type = call %bound_method.loc20_5.3(%a.ref.loc20, %.loc20_9.2) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.1a2547.2 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.1a2547.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.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: 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 %Cpp.long) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -3493,6 +3510,7 @@ fn CopyUnsignedLong() { // 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: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %pattern_type.25e: type = pattern_type %Cpp.long [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] @@ -3521,8 +3539,8 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.f86: type = fn_type_with_self_type %AddAssignWith.WithSelf.Op.type.a65, %AddAssignWith.facet.c43 [concrete] // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.specific_fn.ffe0b1.1: = specific_function %Cpp.long.as.AddAssignWith.impl.Op.2303e0.2, @Cpp.long.as.AddAssignWith.impl.Op.1(%ImplicitAs.facet) [concrete] // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.specific_fn.ffe0b1.2: = specific_function %Cpp.long.as.AddAssignWith.impl.Op.2303e0.1, @Cpp.long.as.AddAssignWith.impl.Op.2(%ImplicitAs.facet) [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc8_3.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.3: type = fn_type @Destroy.Op.loc8_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.3: %Destroy.Op.type.1d8f74.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3574,14 +3592,19 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.loc9_8.1: %Cpp.long = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9 [concrete = constants.%int_1.9ce] // CHECK:STDOUT: %.loc9_8.2: %Cpp.long = converted %int_1.loc9, %.loc9_8.1 [concrete = constants.%int_1.9ce] // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.call: init %empty_tuple.type = call %bound_method.loc9_5.3(%a.ref, %.loc9_8.2) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.1a2547.2 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.1a2547.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.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: 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 %Cpp.long) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -3642,8 +3665,8 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.9c4: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.59b, %ImplicitAs.facet.ce4 [concrete] // CHECK:STDOUT: %i32.as.ImplicitAs.impl.Convert.type: type = fn_type @i32.as.ImplicitAs.impl.Convert [concrete] // CHECK:STDOUT: %i32.as.ImplicitAs.impl.Convert: %i32.as.ImplicitAs.impl.Convert.type = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc8_3.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.3: type = fn_type @Destroy.Op.loc8_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.3: %Destroy.Op.type.1d8f74.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3712,14 +3735,19 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.loc10_8.1: %Cpp.long = value_of_initializer %i32.as.ImplicitAs.impl.Convert.call // CHECK:STDOUT: %.loc10_8.2: %Cpp.long = converted %b.ref, %.loc10_8.1 // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.call: init %empty_tuple.type = call %bound_method.loc10_5.3(%a.ref, %.loc10_8.2) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.1a2547.2 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.1a2547.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.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: 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 %Cpp.long) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -3730,6 +3758,7 @@ fn CopyUnsignedLong() { // 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: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %pattern_type.25e: type = pattern_type %Cpp.long [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] @@ -3756,8 +3785,8 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.9e8: type = fn_type_with_self_type %Dec.WithSelf.Op.type.cb3, %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.1d8f74.2: type = fn_type @Destroy.Op.loc8_3.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.3: type = fn_type @Destroy.Op.loc8_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.3: %Destroy.Op.type.1d8f74.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3799,14 +3828,19 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %impl.elem0.loc10: %.9e8 = 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.1a2547.2 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.1a2547.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.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: 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 %Cpp.long) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -4123,6 +4157,7 @@ fn CopyUnsignedLong() { // 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: type = class_type @UInt, @UInt(%int_32) [concrete] // CHECK:STDOUT: %u32.builtin: type = int_type unsigned, %int_32 [concrete] // CHECK:STDOUT: %pattern_type.1a0: type = pattern_type %Cpp.unsigned_long [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] @@ -4142,8 +4177,8 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.a6d: type = fn_type_with_self_type %Copy.WithSelf.Op.type.2ea, %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.1d8f74.2: type = fn_type @Destroy.Op.loc9_3.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.3: type = fn_type @Destroy.Op.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.3: %Destroy.Op.type.1d8f74.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -4191,16 +4226,21 @@ 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.1a2547.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc9: = bound_method %b.var, constants.%Destroy.Op.1a2547.3 // 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.1a2547.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc8: = bound_method %a.var, constants.%Destroy.Op.1a2547.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_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: fn @Destroy.Op.loc9_3.2(%self.param: ref %u32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.3(%self.param: ref %Cpp.unsigned_long) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.lp64.carbon b/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.lp64.carbon index 4d0eda2d562b..c578df931007 100644 --- a/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.lp64.carbon +++ b/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.lp64.carbon @@ -1270,6 +1270,7 @@ fn CopyUnsignedLongLong() { // 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: type = class_type @Int, @Int(%int_64) [concrete] // CHECK:STDOUT: %i64.builtin: type = int_type signed, %int_64 [concrete] // CHECK:STDOUT: %pattern_type.d58: type = pattern_type %Cpp.long_long [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] @@ -1289,8 +1290,8 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.3c3: type = fn_type_with_self_type %Copy.WithSelf.Op.type.4bd, %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.1d8f74.2: type = fn_type @Destroy.Op.loc9_3.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.3: type = fn_type @Destroy.Op.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.3: %Destroy.Op.type.1d8f74.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1338,16 +1339,21 @@ 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.1a2547.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc9: = bound_method %b.var, constants.%Destroy.Op.1a2547.3 // 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.1a2547.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc8: = bound_method %a.var, constants.%Destroy.Op.1a2547.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_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: fn @Destroy.Op.loc9_3.2(%self.param: ref %i64) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.3(%self.param: ref %Cpp.long_long) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -2345,6 +2351,7 @@ fn CopyUnsignedLongLong() { // 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: type = class_type @Int, @Int(%int_64) [concrete] // CHECK:STDOUT: %i64.builtin: type = int_type signed, %int_64 [concrete] // CHECK:STDOUT: %pattern_type.d58: type = pattern_type %Cpp.long_long [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] @@ -2516,8 +2523,8 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.888: type = fn_type_with_self_type %RightShiftAssignWith.WithSelf.Op.type.82e, %RightShiftAssignWith.facet.347 [concrete] // CHECK:STDOUT: %Cpp.long_long.as.RightShiftAssignWith.impl.Op.specific_fn.fa67f5.1: = specific_function %Cpp.long_long.as.RightShiftAssignWith.impl.Op.02ad61.2, @Cpp.long_long.as.RightShiftAssignWith.impl.Op.1(%ImplicitAs.facet.7bc) [concrete] // CHECK:STDOUT: %Cpp.long_long.as.RightShiftAssignWith.impl.Op.specific_fn.fa67f5.2: = specific_function %Cpp.long_long.as.RightShiftAssignWith.impl.Op.02ad61.1, @Cpp.long_long.as.RightShiftAssignWith.impl.Op.2(%ImplicitAs.facet.7bc) [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc9_3.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.3: type = fn_type @Destroy.Op.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.3: %Destroy.Op.type.1d8f74.3 = struct_value () [concrete] // CHECK:STDOUT: %Cpp.long_long.as.Copy.impl.Op.type: type = fn_type @Cpp.long_long.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %Cpp.long_long.as.Copy.impl.Op: %Cpp.long_long.as.Copy.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: } @@ -2749,16 +2756,21 @@ 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.7bc) [concrete = constants.%Cpp.long_long.as.RightShiftAssignWith.impl.Op.specific_fn.fa67f5.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.1a2547.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc9: = bound_method %b.var, constants.%Destroy.Op.1a2547.3 // 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.1a2547.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc8: = bound_method %a.var, constants.%Destroy.Op.1a2547.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_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: fn @Destroy.Op.loc9_3.2(%self.param: ref %i64) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.3(%self.param: ref %Cpp.long_long) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -2939,8 +2951,8 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.128: type = fn_type_with_self_type %RightShiftAssignWith.WithSelf.Op.type.263, %RightShiftAssignWith.facet.e02 [concrete] // CHECK:STDOUT: %Cpp.long_long.as.RightShiftAssignWith.impl.Op.specific_fn.eff961.1: = specific_function %Cpp.long_long.as.RightShiftAssignWith.impl.Op.f75d42.2, @Cpp.long_long.as.RightShiftAssignWith.impl.Op.1(%ImplicitAs.facet.7a4) [concrete] // CHECK:STDOUT: %Cpp.long_long.as.RightShiftAssignWith.impl.Op.specific_fn.eff961.2: = specific_function %Cpp.long_long.as.RightShiftAssignWith.impl.Op.f75d42.1, @Cpp.long_long.as.RightShiftAssignWith.impl.Op.2(%ImplicitAs.facet.7a4) [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc9_3.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.3: type = fn_type @Destroy.Op.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.3: %Destroy.Op.type.1d8f74.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3193,14 +3205,19 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.loc20_9.1: %Cpp.long_long = value_of_initializer %i64.as.ImplicitAs.impl.Convert.call.loc20 // CHECK:STDOUT: %.loc20_9.2: %Cpp.long_long = converted %b.ref.loc20, %.loc20_9.1 // CHECK:STDOUT: %Cpp.long_long.as.RightShiftAssignWith.impl.Op.call: init %empty_tuple.type = call %bound_method.loc20_5.3(%a.ref.loc20, %.loc20_9.2) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.1a2547.2 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.1a2547.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.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: fn @Destroy.Op.loc9_3.2(%self.param: ref %i64) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.3(%self.param: ref %Cpp.long_long) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -3211,6 +3228,7 @@ fn CopyUnsignedLongLong() { // 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: type = class_type @Int, @Int(%int_64) [concrete] // CHECK:STDOUT: %i64.builtin: type = int_type signed, %int_64 [concrete] // CHECK:STDOUT: %pattern_type.d58: type = pattern_type %Cpp.long_long [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] @@ -3239,8 +3257,8 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.eab: type = fn_type_with_self_type %AddAssignWith.WithSelf.Op.type.ca5, %AddAssignWith.facet.6b7 [concrete] // CHECK:STDOUT: %Cpp.long_long.as.AddAssignWith.impl.Op.specific_fn.d7abb9.1: = specific_function %Cpp.long_long.as.AddAssignWith.impl.Op.7e3843.2, @Cpp.long_long.as.AddAssignWith.impl.Op.1(%ImplicitAs.facet) [concrete] // CHECK:STDOUT: %Cpp.long_long.as.AddAssignWith.impl.Op.specific_fn.d7abb9.2: = specific_function %Cpp.long_long.as.AddAssignWith.impl.Op.7e3843.1, @Cpp.long_long.as.AddAssignWith.impl.Op.2(%ImplicitAs.facet) [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc8_3.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.3: type = fn_type @Destroy.Op.loc8_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.3: %Destroy.Op.type.1d8f74.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3292,14 +3310,19 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.loc9_8.1: %Cpp.long_long = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9 [concrete = constants.%int_1.b19] // CHECK:STDOUT: %.loc9_8.2: %Cpp.long_long = converted %int_1.loc9, %.loc9_8.1 [concrete = constants.%int_1.b19] // CHECK:STDOUT: %Cpp.long_long.as.AddAssignWith.impl.Op.call: init %empty_tuple.type = call %bound_method.loc9_5.3(%a.ref, %.loc9_8.2) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.1a2547.2 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.1a2547.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.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: fn @Destroy.Op.loc8_3.2(%self.param: ref %i64) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.3(%self.param: ref %Cpp.long_long) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -3360,8 +3383,8 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.25e: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.3ae, %ImplicitAs.facet.7a4 [concrete] // CHECK:STDOUT: %i64.as.ImplicitAs.impl.Convert.type: type = fn_type @i64.as.ImplicitAs.impl.Convert [concrete] // CHECK:STDOUT: %i64.as.ImplicitAs.impl.Convert: %i64.as.ImplicitAs.impl.Convert.type = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc8_3.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.3: type = fn_type @Destroy.Op.loc8_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.3: %Destroy.Op.type.1d8f74.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3430,14 +3453,19 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.loc10_8.1: %Cpp.long_long = value_of_initializer %i64.as.ImplicitAs.impl.Convert.call // CHECK:STDOUT: %.loc10_8.2: %Cpp.long_long = converted %b.ref, %.loc10_8.1 // CHECK:STDOUT: %Cpp.long_long.as.AddAssignWith.impl.Op.call: init %empty_tuple.type = call %bound_method.loc10_5.3(%a.ref, %.loc10_8.2) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.1a2547.2 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.1a2547.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.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: fn @Destroy.Op.loc8_3.2(%self.param: ref %i64) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.3(%self.param: ref %Cpp.long_long) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -3448,6 +3476,7 @@ fn CopyUnsignedLongLong() { // 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: type = class_type @Int, @Int(%int_64) [concrete] // CHECK:STDOUT: %i64.builtin: type = int_type signed, %int_64 [concrete] // CHECK:STDOUT: %pattern_type.d58: type = pattern_type %Cpp.long_long [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] @@ -3474,8 +3503,8 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.a4b: type = fn_type_with_self_type %Dec.WithSelf.Op.type.2cb, %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.1d8f74.2: type = fn_type @Destroy.Op.loc8_3.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.3: type = fn_type @Destroy.Op.loc8_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.3: %Destroy.Op.type.1d8f74.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3517,14 +3546,19 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %impl.elem0.loc10: %.a4b = 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.1a2547.2 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %a.var, constants.%Destroy.Op.1a2547.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.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: fn @Destroy.Op.loc8_3.2(%self.param: ref %i64) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc8_3.3(%self.param: ref %Cpp.long_long) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -3842,6 +3876,7 @@ fn CopyUnsignedLongLong() { // 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: type = class_type @UInt, @UInt(%int_64) [concrete] // CHECK:STDOUT: %u64.builtin: type = int_type unsigned, %int_64 [concrete] // CHECK:STDOUT: %pattern_type.4cd: type = pattern_type %Cpp.unsigned_long_long [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] @@ -3861,8 +3896,8 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.294: type = fn_type_with_self_type %Copy.WithSelf.Op.type.a3f, %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.1d8f74.2: type = fn_type @Destroy.Op.loc9_3.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.3: type = fn_type @Destroy.Op.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.3: %Destroy.Op.type.1d8f74.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3910,16 +3945,21 @@ 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.1a2547.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc9: = bound_method %b.var, constants.%Destroy.Op.1a2547.3 // 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.1a2547.2 +// CHECK:STDOUT: %Destroy.Op.bound.loc8: = bound_method %a.var, constants.%Destroy.Op.1a2547.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_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: fn @Destroy.Op.loc9_3.2(%self.param: ref %u64) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc9_3.3(%self.param: ref %Cpp.unsigned_long_long) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interop/cpp/range_for.carbon b/toolchain/check/testdata/interop/cpp/range_for.carbon index 5f5267049746..e10200f3ae1f 100644 --- a/toolchain/check/testdata/interop/cpp/range_for.carbon +++ b/toolchain/check/testdata/interop/cpp/range_for.carbon @@ -732,6 +732,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Optional.Get.722: %Optional.Get.type.7e6 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.facet.d07318.2: %Destroy.type = facet_value %i32, (%custom_witness.df9cc1.2) [concrete] // CHECK:STDOUT: %MaybeUnformed.023: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.d07318.2) [concrete] +// CHECK:STDOUT: %.1d6a7: type = maybe_unformed_type %i32 [concrete] // CHECK:STDOUT: %struct_type.value.has_value.ad0: type = struct_type {.value: %MaybeUnformed.023, .has_value: bool} [concrete] // CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.89b, @Optional.HasValue(%OptionalStorage.facet.172) [concrete] // CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.722, @Optional.Get(%OptionalStorage.facet.172) [concrete] @@ -760,8 +761,8 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %.b28: type = fn_type_with_self_type %AddAssignWith.WithSelf.Op.type.f66, %AddAssignWith.facet.d42 [concrete] // CHECK:STDOUT: %Int.as.AddAssignWith.impl.Op.specific_fn.b14d9d.1: = specific_function %Int.as.AddAssignWith.impl.Op.00e760.2, @Int.as.AddAssignWith.impl.Op.1(%int_32, %ImplicitAs.facet.eaa) [concrete] // CHECK:STDOUT: %Int.as.AddAssignWith.impl.Op.specific_fn.b14d9d.2: = specific_function %Int.as.AddAssignWith.impl.Op.00e760.1, @Int.as.AddAssignWith.impl.Op.2(%int_32, %ImplicitAs.facet.eaa) [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.8: type = fn_type @Destroy.Op.loc34_19.5 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.8: %Destroy.Op.type.1d8f74.8 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.9: type = fn_type @Destroy.Op.loc34_19.6 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.9: %Destroy.Op.type.1d8f74.9 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.lookup_impl_witness.5d5: = lookup_impl_witness %impl.elem1.d31, @Destroy [symbolic] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.515: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%impl.elem1.d31) [symbolic] // CHECK:STDOUT: %.94f: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.515, %impl.elem1.d31 [symbolic] @@ -798,10 +799,10 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %custom_witness.444: = custom_witness (%Iterator.Op.a2a866.4), @Inc [concrete] // CHECK:STDOUT: %facet_value.cd6: %CppRangeForIterate_where.type = facet_value %MutableRange, (%custom_witness.df9cc1.2, %Copy.impl_witness.0e0, %custom_witness.ed3, %custom_witness.955, %custom_witness.1f5, %custom_witness.ef8, %custom_witness.981, %custom_witness.444) [concrete] // CHECK:STDOUT: %tuple.type.508: type = tuple_type (%Iterator.3ee, %Iterator.3ee) [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.9: type = fn_type @Destroy.Op.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.9: %Destroy.Op.type.1d8f74.9 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.df9cc1.9: = custom_witness (%Destroy.Op.1a2547.9), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.30f: %Destroy.type = facet_value %tuple.type.508, (%custom_witness.df9cc1.9) [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.10: type = fn_type @Destroy.Op.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.10: %Destroy.Op.type.1d8f74.10 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.df9cc1.10: = custom_witness (%Destroy.Op.1a2547.10), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.30f: %Destroy.type = facet_value %tuple.type.508, (%custom_witness.df9cc1.10) [concrete] // CHECK:STDOUT: %Iterate.impl_witness.cea: = impl_witness imports.%Iterate.impl_witness_table.344, @R.as_type.as.Iterate.impl(%facet_value.cd6) [concrete] // CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.type.f1f: type = fn_type @R.as_type.as.Iterate.impl.NewCursor, @R.as_type.as.Iterate.impl(%facet_value.cd6) [concrete] // CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.8d2: %R.as_type.as.Iterate.impl.NewCursor.type.f1f = struct_value () [concrete] @@ -834,10 +835,10 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %custom_witness.746: = custom_witness (%Iterator.Op.1c3e4a.4), @Inc [concrete] // CHECK:STDOUT: %facet_value.e88: %CppRangeForIterate_where.type = facet_value %ConstRange, (%custom_witness.df9cc1.2, %Copy.impl_witness.0e0, %custom_witness.23e, %custom_witness.6e8, %custom_witness.150, %custom_witness.adb, %custom_witness.941, %custom_witness.746) [concrete] // CHECK:STDOUT: %tuple.type.69f: type = tuple_type (%Iterator.260, %Iterator.260) [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.10: type = fn_type @Destroy.Op.3 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.10: %Destroy.Op.type.1d8f74.10 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.df9cc1.10: = custom_witness (%Destroy.Op.1a2547.10), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.e4c: %Destroy.type = facet_value %tuple.type.69f, (%custom_witness.df9cc1.10) [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.11: type = fn_type @Destroy.Op.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.11: %Destroy.Op.type.1d8f74.11 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.df9cc1.11: = custom_witness (%Destroy.Op.1a2547.11), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.e4c: %Destroy.type = facet_value %tuple.type.69f, (%custom_witness.df9cc1.11) [concrete] // CHECK:STDOUT: %Iterate.impl_witness.12a: = impl_witness imports.%Iterate.impl_witness_table.344, @R.as_type.as.Iterate.impl(%facet_value.e88) [concrete] // CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.type.fe1: type = fn_type @R.as_type.as.Iterate.impl.NewCursor, @R.as_type.as.Iterate.impl(%facet_value.e88) [concrete] // CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.2f6: %R.as_type.as.Iterate.impl.NewCursor.type.fe1 = struct_value () [concrete] @@ -981,7 +982,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %Destroy.Op.bound.loc34: = bound_method %.loc34_19.3, constants.%Destroy.Op.1a2547.8 +// CHECK:STDOUT: %Destroy.Op.bound.loc34: = bound_method %.loc34_19.3, constants.%Destroy.Op.1a2547.9 // CHECK:STDOUT: %Destroy.Op.call.loc34: init %empty_tuple.type = call %Destroy.Op.bound.loc34(%.loc34_19.3) // CHECK:STDOUT: %impl.elem0.loc34_19.1: @Test.%.loc34_19.14 (%.94f) = impl_witness_access constants.%Destroy.lookup_impl_witness.5d5, element0 [symbolic = %impl.elem0.loc34_19.2 (constants.%impl.elem0.e52)] // CHECK:STDOUT: %bound_method.loc34_19.7: = bound_method %var, %impl.elem0.loc34_19.1 @@ -992,24 +993,29 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc34_19.1(%self.param: ref %MaybeUnformed.023) { +// CHECK:STDOUT: fn @Destroy.Op.loc34_19.1(%self.param: ref %.1d6a7) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc34_19.2(%self.param: ref bool) = "no_op"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc34_19.3(%self.param: ref %struct_type.value.has_value.ad0) { +// CHECK:STDOUT: fn @Destroy.Op.loc34_19.2(%self.param: ref %MaybeUnformed.023) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc34_19.4(%self.param: ref %DefaultOptionalStorage.970) { +// CHECK:STDOUT: fn @Destroy.Op.loc34_19.3(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc34_19.4(%self.param: ref %struct_type.value.has_value.ad0) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc34_19.5(%self.param: ref %Optional.e28) { +// CHECK:STDOUT: fn @Destroy.Op.loc34_19.5(%self.param: ref %DefaultOptionalStorage.970) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc34_19.6(%self.param: ref %Optional.e28) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -1043,9 +1049,9 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %specific_impl_fn.loc34_19.5 => constants.%R.as_type.as.Iterate.impl.Next.specific_fn.dd5 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.c6c // CHECK:STDOUT: %.loc34_19.14 => constants.%.0a4 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.df9cc1.9 -// CHECK:STDOUT: %impl.elem0.loc34_19.2 => constants.%Destroy.Op.1a2547.9 -// CHECK:STDOUT: %specific_impl_fn.loc34_19.6 => constants.%Destroy.Op.1a2547.9 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.df9cc1.10 +// CHECK:STDOUT: %impl.elem0.loc34_19.2 => constants.%Destroy.Op.1a2547.10 +// CHECK:STDOUT: %specific_impl_fn.loc34_19.6 => constants.%Destroy.Op.1a2547.10 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Test(constants.%facet_value.740) { @@ -1071,9 +1077,9 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %specific_impl_fn.loc34_19.5 => constants.%R.as_type.as.Iterate.impl.Next.specific_fn.4cc // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.7ec // CHECK:STDOUT: %.loc34_19.14 => constants.%.0e7 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.df9cc1.10 -// CHECK:STDOUT: %impl.elem0.loc34_19.2 => constants.%Destroy.Op.1a2547.10 -// CHECK:STDOUT: %specific_impl_fn.loc34_19.6 => constants.%Destroy.Op.1a2547.10 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.df9cc1.11 +// CHECK:STDOUT: %impl.elem0.loc34_19.2 => constants.%Destroy.Op.1a2547.11 +// CHECK:STDOUT: %specific_impl_fn.loc34_19.6 => constants.%Destroy.Op.1a2547.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- methods_return_different_types.carbon @@ -1169,6 +1175,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Optional.Get.59c: %Optional.Get.type.30f = struct_value () [concrete] // CHECK:STDOUT: %Destroy.facet.4e5: %Destroy.type = facet_value %ValueType, (%custom_witness.e7a31c.1) [concrete] // CHECK:STDOUT: %MaybeUnformed.02e: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.4e5) [concrete] +// CHECK:STDOUT: %.98c: type = maybe_unformed_type %ValueType [concrete] // CHECK:STDOUT: %struct_type.value.has_value.761: type = struct_type {.value: %MaybeUnformed.02e, .has_value: bool} [concrete] // CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.988, @Optional.HasValue(%OptionalStorage.facet.705) [concrete] // CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.59c, @Optional.Get(%OptionalStorage.facet.705) [concrete] @@ -1176,8 +1183,8 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %ValueType.cpp_operator: %ValueType.cpp_operator.type = struct_value () [concrete] // CHECK:STDOUT: %operator_PlusEqual__carbon_thunk.type: type = fn_type @operator_PlusEqual__carbon_thunk [concrete] // CHECK:STDOUT: %operator_PlusEqual__carbon_thunk: %operator_PlusEqual__carbon_thunk.type = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.6: type = fn_type @Destroy.Op.loc44_29.5 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.6: %Destroy.Op.type.1d8f74.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.7: type = fn_type @Destroy.Op.loc44_29.6 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.7: %Destroy.Op.type.1d8f74.7 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.lookup_impl_witness.ff8: = lookup_impl_witness %impl.elem1.411, @Destroy [symbolic] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.d67: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%impl.elem1.411) [symbolic] // CHECK:STDOUT: %.4b9: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.d67, %impl.elem1.411 [symbolic] @@ -1219,10 +1226,10 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %custom_witness.1f52e9.2: = custom_witness (%Sentinel.Op.a2a866.2), @Copy [concrete] // CHECK:STDOUT: %facet_value.55a: %CppRangeForIterate_where.type = facet_value %MutableRange, (%custom_witness.e7a31c.1, %custom_witness.d0da43.1, %custom_witness.6b6, %custom_witness.95581e.1, %custom_witness.1f52e9.1, %custom_witness.90a, %custom_witness.3e8, %custom_witness.444, %custom_witness.95581e.2, %custom_witness.1f52e9.2) [concrete] // CHECK:STDOUT: %tuple.type.829: type = tuple_type (%Iterator.3ee, %Sentinel.9b2) [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.7: type = fn_type @Destroy.Op.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.7: %Destroy.Op.type.1d8f74.7 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.df9cc1.7: = custom_witness (%Destroy.Op.1a2547.7), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.305: %Destroy.type = facet_value %tuple.type.829, (%custom_witness.df9cc1.7) [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.8: type = fn_type @Destroy.Op.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.8: %Destroy.Op.type.1d8f74.8 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.df9cc1.8: = custom_witness (%Destroy.Op.1a2547.8), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.305: %Destroy.type = facet_value %tuple.type.829, (%custom_witness.df9cc1.8) [concrete] // CHECK:STDOUT: %Iterate.impl_witness.096: = impl_witness imports.%Iterate.impl_witness_table.344, @R.as_type.as.Iterate.impl(%facet_value.55a) [concrete] // CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.type.c00: type = fn_type @R.as_type.as.Iterate.impl.NewCursor, @R.as_type.as.Iterate.impl(%facet_value.55a) [concrete] // CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.498: %R.as_type.as.Iterate.impl.NewCursor.type.c00 = struct_value () [concrete] @@ -1262,10 +1269,10 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %custom_witness.15091a.2: = custom_witness (%Sentinel.Op.1c3e4a.2), @Copy [concrete] // CHECK:STDOUT: %facet_value.445: %CppRangeForIterate_where.type = facet_value %ConstRange, (%custom_witness.e7a31c.1, %custom_witness.d0da43.1, %custom_witness.a03, %custom_witness.6e8a2e.1, %custom_witness.15091a.1, %custom_witness.78b, %custom_witness.c55, %custom_witness.746, %custom_witness.6e8a2e.2, %custom_witness.15091a.2) [concrete] // CHECK:STDOUT: %tuple.type.99f: type = tuple_type (%Iterator.260, %Sentinel.4c4) [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.8: type = fn_type @Destroy.Op.3 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.8: %Destroy.Op.type.1d8f74.8 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.df9cc1.8: = custom_witness (%Destroy.Op.1a2547.8), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.e08: %Destroy.type = facet_value %tuple.type.99f, (%custom_witness.df9cc1.8) [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.9: type = fn_type @Destroy.Op.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.9: %Destroy.Op.type.1d8f74.9 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.df9cc1.9: = custom_witness (%Destroy.Op.1a2547.9), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.e08: %Destroy.type = facet_value %tuple.type.99f, (%custom_witness.df9cc1.9) [concrete] // CHECK:STDOUT: %Iterate.impl_witness.40c: = impl_witness imports.%Iterate.impl_witness_table.344, @R.as_type.as.Iterate.impl(%facet_value.445) [concrete] // CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.type.8c3: type = fn_type @R.as_type.as.Iterate.impl.NewCursor, @R.as_type.as.Iterate.impl(%facet_value.445) [concrete] // CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.bd2: %R.as_type.as.Iterate.impl.NewCursor.type.8c3 = struct_value () [concrete] @@ -1429,7 +1436,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Op.ref.loc44: %ValueType.cpp_destructor.type = name_ref Op, imports.%ValueType.cpp_destructor.decl [concrete = constants.%ValueType.cpp_destructor] // CHECK:STDOUT: %ValueType.cpp_destructor.bound.loc44: = bound_method %.loc44_29.11, %Op.ref.loc44 // CHECK:STDOUT: %ValueType.cpp_destructor.call.loc44: init %empty_tuple.type = call %ValueType.cpp_destructor.bound.loc44(%.loc44_29.11) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc44_29.3, constants.%Destroy.Op.1a2547.6 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc44_29.3, constants.%Destroy.Op.1a2547.7 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc44_29.3) // CHECK:STDOUT: %impl.elem0.loc44_29.1: @Test.%.loc44_29.15 (%.4b9) = impl_witness_access constants.%Destroy.lookup_impl_witness.ff8, element0 [symbolic = %impl.elem0.loc44_29.2 (constants.%impl.elem0.fbe)] // CHECK:STDOUT: %bound_method.loc44_29.7: = bound_method %var, %impl.elem0.loc44_29.1 @@ -1440,24 +1447,29 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc44_29.1(%self.param: ref %MaybeUnformed.02e) { +// CHECK:STDOUT: fn @Destroy.Op.loc44_29.1(%self.param: ref %.98c) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc44_29.2(%self.param: ref bool) = "no_op"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc44_29.3(%self.param: ref %struct_type.value.has_value.761) { +// CHECK:STDOUT: fn @Destroy.Op.loc44_29.2(%self.param: ref %MaybeUnformed.02e) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc44_29.4(%self.param: ref %DefaultOptionalStorage.84c) { +// CHECK:STDOUT: fn @Destroy.Op.loc44_29.3(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc44_29.4(%self.param: ref %struct_type.value.has_value.761) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc44_29.5(%self.param: ref %Optional.95f) { +// CHECK:STDOUT: fn @Destroy.Op.loc44_29.5(%self.param: ref %DefaultOptionalStorage.84c) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc44_29.6(%self.param: ref %Optional.95f) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -1491,9 +1503,9 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %specific_impl_fn.loc44_29.5 => constants.%R.as_type.as.Iterate.impl.Next.specific_fn.5cb // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.c89 // CHECK:STDOUT: %.loc44_29.15 => constants.%.e8a -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.df9cc1.7 -// CHECK:STDOUT: %impl.elem0.loc44_29.2 => constants.%Destroy.Op.1a2547.7 -// CHECK:STDOUT: %specific_impl_fn.loc44_29.6 => constants.%Destroy.Op.1a2547.7 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.df9cc1.8 +// CHECK:STDOUT: %impl.elem0.loc44_29.2 => constants.%Destroy.Op.1a2547.8 +// CHECK:STDOUT: %specific_impl_fn.loc44_29.6 => constants.%Destroy.Op.1a2547.8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Test(constants.%facet_value.e78) { @@ -1519,9 +1531,9 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %specific_impl_fn.loc44_29.5 => constants.%R.as_type.as.Iterate.impl.Next.specific_fn.a9a // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.e30 // CHECK:STDOUT: %.loc44_29.15 => constants.%.987 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.df9cc1.8 -// CHECK:STDOUT: %impl.elem0.loc44_29.2 => constants.%Destroy.Op.1a2547.8 -// CHECK:STDOUT: %specific_impl_fn.loc44_29.6 => constants.%Destroy.Op.1a2547.8 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.df9cc1.9 +// CHECK:STDOUT: %impl.elem0.loc44_29.2 => constants.%Destroy.Op.1a2547.9 +// CHECK:STDOUT: %specific_impl_fn.loc44_29.6 => constants.%Destroy.Op.1a2547.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- adl_return_same_types.carbon @@ -1612,6 +1624,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Optional.Get.f05: %Optional.Get.type.822 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.facet.339: %Destroy.type = facet_value %f64.dc1, (%custom_witness.df9cc1.2) [concrete] // CHECK:STDOUT: %MaybeUnformed.b7e: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.339) [concrete] +// CHECK:STDOUT: %.cc0: type = maybe_unformed_type %f64.dc1 [concrete] // CHECK:STDOUT: %struct_type.value.has_value.ad9: type = struct_type {.value: %MaybeUnformed.b7e, .has_value: bool} [concrete] // CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.e79, @Optional.HasValue(%OptionalStorage.facet.cc1) [concrete] // CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.f05, @Optional.Get(%OptionalStorage.facet.cc1) [concrete] @@ -1625,8 +1638,8 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %AddAssignWith.WithSelf.Op.type.f8a: type = fn_type @AddAssignWith.WithSelf.Op, @AddAssignWith.WithSelf(%f64.dc1, %AddAssignWith.facet) [concrete] // CHECK:STDOUT: %.746: type = fn_type_with_self_type %AddAssignWith.WithSelf.Op.type.f8a, %AddAssignWith.facet [concrete] // CHECK:STDOUT: %Float.as.AddAssignWith.impl.Op.specific_fn: = specific_function %Float.as.AddAssignWith.impl.Op.ac1, @Float.as.AddAssignWith.impl.Op(%int_64) [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.8: type = fn_type @Destroy.Op.loc24_19.5 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.8: %Destroy.Op.type.1d8f74.8 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.9: type = fn_type @Destroy.Op.loc24_19.6 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.9: %Destroy.Op.type.1d8f74.9 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.lookup_impl_witness.f8f: = lookup_impl_witness %impl.elem1.f12, @Destroy [symbolic] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.b9c: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%impl.elem1.f12) [symbolic] // CHECK:STDOUT: %.75c: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.b9c, %impl.elem1.f12 [symbolic] @@ -1661,10 +1674,10 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %custom_witness.393: = custom_witness (%Iterator.Op.583fda.4), @Inc [concrete] // CHECK:STDOUT: %facet_value.c05: %CppRangeForIterate_where.type = facet_value %ConstRange, (%custom_witness.df9cc1.2, %Copy.impl_witness.873, %custom_witness.5d5, %custom_witness.213, %custom_witness.a31, %custom_witness.994, %custom_witness.821, %custom_witness.393) [concrete] // CHECK:STDOUT: %tuple.type.005: type = tuple_type (%Iterator, %Iterator) [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.9: type = fn_type @Destroy.Op.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.9: %Destroy.Op.type.1d8f74.9 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.df9cc1.9: = custom_witness (%Destroy.Op.1a2547.9), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.40b: %Destroy.type = facet_value %tuple.type.005, (%custom_witness.df9cc1.9) [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.10: type = fn_type @Destroy.Op.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.10: %Destroy.Op.type.1d8f74.10 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.df9cc1.10: = custom_witness (%Destroy.Op.1a2547.10), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.40b: %Destroy.type = facet_value %tuple.type.005, (%custom_witness.df9cc1.10) [concrete] // CHECK:STDOUT: %Iterate.impl_witness.1f0: = impl_witness imports.%Iterate.impl_witness_table.344, @R.as_type.as.Iterate.impl(%facet_value.c05) [concrete] // CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.type.315: type = fn_type @R.as_type.as.Iterate.impl.NewCursor, @R.as_type.as.Iterate.impl(%facet_value.c05) [concrete] // CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.d2e: %R.as_type.as.Iterate.impl.NewCursor.type.315 = struct_value () [concrete] @@ -1787,7 +1800,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %Destroy.Op.bound.loc24: = bound_method %.loc24_19.3, constants.%Destroy.Op.1a2547.8 +// CHECK:STDOUT: %Destroy.Op.bound.loc24: = bound_method %.loc24_19.3, constants.%Destroy.Op.1a2547.9 // CHECK:STDOUT: %Destroy.Op.call.loc24: init %empty_tuple.type = call %Destroy.Op.bound.loc24(%.loc24_19.3) // CHECK:STDOUT: %impl.elem0.loc24_19.1: @Test.%.loc24_19.14 (%.75c) = impl_witness_access constants.%Destroy.lookup_impl_witness.f8f, element0 [symbolic = %impl.elem0.loc24_19.2 (constants.%impl.elem0.688)] // CHECK:STDOUT: %bound_method.loc24_19.7: = bound_method %var, %impl.elem0.loc24_19.1 @@ -1798,24 +1811,29 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc24_19.1(%self.param: ref %MaybeUnformed.b7e) { +// CHECK:STDOUT: fn @Destroy.Op.loc24_19.1(%self.param: ref %.cc0) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc24_19.2(%self.param: ref bool) = "no_op"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc24_19.3(%self.param: ref %struct_type.value.has_value.ad9) { +// CHECK:STDOUT: fn @Destroy.Op.loc24_19.2(%self.param: ref %MaybeUnformed.b7e) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc24_19.4(%self.param: ref %DefaultOptionalStorage.541) { +// CHECK:STDOUT: fn @Destroy.Op.loc24_19.3(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc24_19.4(%self.param: ref %struct_type.value.has_value.ad9) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc24_19.5(%self.param: ref %Optional.f48) { +// CHECK:STDOUT: fn @Destroy.Op.loc24_19.5(%self.param: ref %DefaultOptionalStorage.541) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc24_19.6(%self.param: ref %Optional.f48) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -1849,9 +1867,9 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %specific_impl_fn.loc24_19.5 => constants.%R.as_type.as.Iterate.impl.Next.specific_fn // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.117 // CHECK:STDOUT: %.loc24_19.14 => constants.%.5a4 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.df9cc1.9 -// CHECK:STDOUT: %impl.elem0.loc24_19.2 => constants.%Destroy.Op.1a2547.9 -// CHECK:STDOUT: %specific_impl_fn.loc24_19.6 => constants.%Destroy.Op.1a2547.9 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.df9cc1.10 +// CHECK:STDOUT: %impl.elem0.loc24_19.2 => constants.%Destroy.Op.1a2547.10 +// CHECK:STDOUT: %specific_impl_fn.loc24_19.6 => constants.%Destroy.Op.1a2547.10 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_adl_returns_same_types_mutable.carbon @@ -1942,6 +1960,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Optional.Get.f05: %Optional.Get.type.822 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.facet.339: %Destroy.type = facet_value %f64.dc1, (%custom_witness.df9cc1.2) [concrete] // CHECK:STDOUT: %MaybeUnformed.b7e: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.339) [concrete] +// CHECK:STDOUT: %.cc0: type = maybe_unformed_type %f64.dc1 [concrete] // CHECK:STDOUT: %struct_type.value.has_value.ad9: type = struct_type {.value: %MaybeUnformed.b7e, .has_value: bool} [concrete] // CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.e79, @Optional.HasValue(%OptionalStorage.facet.cc1) [concrete] // CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.f05, @Optional.Get(%OptionalStorage.facet.cc1) [concrete] @@ -1955,8 +1974,8 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %AddAssignWith.WithSelf.Op.type.f8a: type = fn_type @AddAssignWith.WithSelf.Op, @AddAssignWith.WithSelf(%f64.dc1, %AddAssignWith.facet) [concrete] // CHECK:STDOUT: %.746: type = fn_type_with_self_type %AddAssignWith.WithSelf.Op.type.f8a, %AddAssignWith.facet [concrete] // CHECK:STDOUT: %Float.as.AddAssignWith.impl.Op.specific_fn: = specific_function %Float.as.AddAssignWith.impl.Op.ac1, @Float.as.AddAssignWith.impl.Op(%int_64) [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.8: type = fn_type @Destroy.Op.loc26_19.5 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.8: %Destroy.Op.type.1d8f74.8 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.9: type = fn_type @Destroy.Op.loc26_19.6 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.9: %Destroy.Op.type.1d8f74.9 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.lookup_impl_witness.f8f: = lookup_impl_witness %impl.elem1.f12, @Destroy [symbolic] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.b9c: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%impl.elem1.f12) [symbolic] // CHECK:STDOUT: %.75c: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.b9c, %impl.elem1.f12 [symbolic] @@ -1991,10 +2010,10 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %custom_witness.491: = custom_witness (%Iterator.Op.ac6aad.4), @Inc [concrete] // CHECK:STDOUT: %facet_value.85f: %CppRangeForIterate_where.type = facet_value %MutableRange, (%custom_witness.df9cc1.2, %Copy.impl_witness.873, %custom_witness.902, %custom_witness.c08, %custom_witness.29f, %custom_witness.05b, %custom_witness.ed8, %custom_witness.491) [concrete] // CHECK:STDOUT: %tuple.type.dd0: type = tuple_type (%Iterator, %Iterator) [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.9: type = fn_type @Destroy.Op.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.9: %Destroy.Op.type.1d8f74.9 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.df9cc1.9: = custom_witness (%Destroy.Op.1a2547.9), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.e1e: %Destroy.type = facet_value %tuple.type.dd0, (%custom_witness.df9cc1.9) [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.10: type = fn_type @Destroy.Op.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.10: %Destroy.Op.type.1d8f74.10 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.df9cc1.10: = custom_witness (%Destroy.Op.1a2547.10), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.e1e: %Destroy.type = facet_value %tuple.type.dd0, (%custom_witness.df9cc1.10) [concrete] // CHECK:STDOUT: %Iterate.impl_witness.5f7: = impl_witness imports.%Iterate.impl_witness_table.344, @R.as_type.as.Iterate.impl(%facet_value.85f) [concrete] // CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.type.a95: type = fn_type @R.as_type.as.Iterate.impl.NewCursor, @R.as_type.as.Iterate.impl(%facet_value.85f) [concrete] // CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.41a: %R.as_type.as.Iterate.impl.NewCursor.type.a95 = struct_value () [concrete] @@ -2117,7 +2136,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %Destroy.Op.bound.loc26: = bound_method %.loc26_19.3, constants.%Destroy.Op.1a2547.8 +// CHECK:STDOUT: %Destroy.Op.bound.loc26: = bound_method %.loc26_19.3, constants.%Destroy.Op.1a2547.9 // CHECK:STDOUT: %Destroy.Op.call.loc26: init %empty_tuple.type = call %Destroy.Op.bound.loc26(%.loc26_19.3) // CHECK:STDOUT: %impl.elem0.loc26_19.1: @Test.%.loc26_19.14 (%.75c) = impl_witness_access constants.%Destroy.lookup_impl_witness.f8f, element0 [symbolic = %impl.elem0.loc26_19.2 (constants.%impl.elem0.688)] // CHECK:STDOUT: %bound_method.loc26_19.7: = bound_method %var, %impl.elem0.loc26_19.1 @@ -2128,24 +2147,29 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc26_19.1(%self.param: ref %MaybeUnformed.b7e) { +// CHECK:STDOUT: fn @Destroy.Op.loc26_19.1(%self.param: ref %.cc0) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc26_19.2(%self.param: ref bool) = "no_op"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc26_19.3(%self.param: ref %struct_type.value.has_value.ad9) { +// CHECK:STDOUT: fn @Destroy.Op.loc26_19.2(%self.param: ref %MaybeUnformed.b7e) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc26_19.4(%self.param: ref %DefaultOptionalStorage.541) { +// CHECK:STDOUT: fn @Destroy.Op.loc26_19.3(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc26_19.4(%self.param: ref %struct_type.value.has_value.ad9) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc26_19.5(%self.param: ref %Optional.f48) { +// CHECK:STDOUT: fn @Destroy.Op.loc26_19.5(%self.param: ref %DefaultOptionalStorage.541) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc26_19.6(%self.param: ref %Optional.f48) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -2179,9 +2203,9 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %specific_impl_fn.loc26_19.5 => constants.%R.as_type.as.Iterate.impl.Next.specific_fn // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.452 // CHECK:STDOUT: %.loc26_19.14 => constants.%.899 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.df9cc1.9 -// CHECK:STDOUT: %impl.elem0.loc26_19.2 => constants.%Destroy.Op.1a2547.9 -// CHECK:STDOUT: %specific_impl_fn.loc26_19.6 => constants.%Destroy.Op.1a2547.9 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.df9cc1.10 +// CHECK:STDOUT: %impl.elem0.loc26_19.2 => constants.%Destroy.Op.1a2547.10 +// CHECK:STDOUT: %specific_impl_fn.loc26_19.6 => constants.%Destroy.Op.1a2547.10 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- adl_returns_different_types.carbon @@ -2277,6 +2301,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Optional.Get.5aa: %Optional.Get.type.135 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.facet.306: %Destroy.type = facet_value %ValueType, (%custom_witness.fef) [concrete] // CHECK:STDOUT: %MaybeUnformed.669: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.306) [concrete] +// CHECK:STDOUT: %.b36: type = maybe_unformed_type %ValueType [concrete] // CHECK:STDOUT: %struct_type.value.has_value.5a1: type = struct_type {.value: %MaybeUnformed.669, .has_value: bool} [concrete] // CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.605, @Optional.HasValue(%OptionalStorage.facet.7ce) [concrete] // CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.5aa, @Optional.Get(%OptionalStorage.facet.7ce) [concrete] @@ -2284,8 +2309,8 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %ValueType.cpp_operator: %ValueType.cpp_operator.type = struct_value () [concrete] // CHECK:STDOUT: %operator_PlusEqual__carbon_thunk.type: type = fn_type @operator_PlusEqual__carbon_thunk [concrete] // CHECK:STDOUT: %operator_PlusEqual__carbon_thunk: %operator_PlusEqual__carbon_thunk.type = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.6: type = fn_type @Destroy.Op.loc31_31.5 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.6: %Destroy.Op.type.1d8f74.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.7: type = fn_type @Destroy.Op.loc31_31.6 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.7: %Destroy.Op.type.1d8f74.7 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.lookup_impl_witness.f37: = lookup_impl_witness %impl.elem1.46a, @Destroy [symbolic] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.e7e: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%impl.elem1.46a) [symbolic] // CHECK:STDOUT: %.bc1: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.e7e, %impl.elem1.46a [symbolic] @@ -2325,10 +2350,10 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %custom_witness.a3150e.2: = custom_witness (%Sentinel.Op.583fda.2), @Copy [concrete] // CHECK:STDOUT: %facet_value.b1e: %CppRangeForIterate_where.type = facet_value %ConstRange, (%custom_witness.fef, %custom_witness.c19, %custom_witness.c2f, %custom_witness.21358e.1, %custom_witness.a3150e.1, %custom_witness.1d3, %custom_witness.aa4, %custom_witness.393, %custom_witness.21358e.2, %custom_witness.a3150e.2) [concrete] // CHECK:STDOUT: %tuple.type.df8: type = tuple_type (%Iterator, %Sentinel) [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.7: type = fn_type @Destroy.Op.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.7: %Destroy.Op.type.1d8f74.7 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.df9cc1.7: = custom_witness (%Destroy.Op.1a2547.7), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.777: %Destroy.type = facet_value %tuple.type.df8, (%custom_witness.df9cc1.7) [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.8: type = fn_type @Destroy.Op.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.8: %Destroy.Op.type.1d8f74.8 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.df9cc1.8: = custom_witness (%Destroy.Op.1a2547.8), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.777: %Destroy.type = facet_value %tuple.type.df8, (%custom_witness.df9cc1.8) [concrete] // CHECK:STDOUT: %Iterate.impl_witness.466: = impl_witness imports.%Iterate.impl_witness_table.344, @R.as_type.as.Iterate.impl(%facet_value.b1e) [concrete] // CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.type.0b3: type = fn_type @R.as_type.as.Iterate.impl.NewCursor, @R.as_type.as.Iterate.impl(%facet_value.b1e) [concrete] // CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.a27: %R.as_type.as.Iterate.impl.NewCursor.type.0b3 = struct_value () [concrete] @@ -2483,7 +2508,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Op.ref.loc31: %ValueType.cpp_destructor.type = name_ref Op, imports.%ValueType.cpp_destructor.decl [concrete = constants.%ValueType.cpp_destructor] // CHECK:STDOUT: %ValueType.cpp_destructor.bound.loc31: = bound_method %.loc31_31.11, %Op.ref.loc31 // CHECK:STDOUT: %ValueType.cpp_destructor.call.loc31: init %empty_tuple.type = call %ValueType.cpp_destructor.bound.loc31(%.loc31_31.11) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc31_31.3, constants.%Destroy.Op.1a2547.6 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc31_31.3, constants.%Destroy.Op.1a2547.7 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc31_31.3) // CHECK:STDOUT: %impl.elem0.loc31_31.1: @Test.%.loc31_31.15 (%.bc1) = impl_witness_access constants.%Destroy.lookup_impl_witness.f37, element0 [symbolic = %impl.elem0.loc31_31.2 (constants.%impl.elem0.c7c)] // CHECK:STDOUT: %bound_method.loc31_31.7: = bound_method %var, %impl.elem0.loc31_31.1 @@ -2494,24 +2519,29 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc31_31.1(%self.param: ref %MaybeUnformed.669) { +// CHECK:STDOUT: fn @Destroy.Op.loc31_31.1(%self.param: ref %.b36) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc31_31.2(%self.param: ref bool) = "no_op"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc31_31.3(%self.param: ref %struct_type.value.has_value.5a1) { +// CHECK:STDOUT: fn @Destroy.Op.loc31_31.2(%self.param: ref %MaybeUnformed.669) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc31_31.4(%self.param: ref %DefaultOptionalStorage.257) { +// CHECK:STDOUT: fn @Destroy.Op.loc31_31.3(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc31_31.4(%self.param: ref %struct_type.value.has_value.5a1) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc31_31.5(%self.param: ref %Optional.552) { +// CHECK:STDOUT: fn @Destroy.Op.loc31_31.5(%self.param: ref %DefaultOptionalStorage.257) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc31_31.6(%self.param: ref %Optional.552) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -2545,9 +2575,9 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %specific_impl_fn.loc31_31.5 => constants.%R.as_type.as.Iterate.impl.Next.specific_fn // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.589 // CHECK:STDOUT: %.loc31_31.15 => constants.%.4e1 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.df9cc1.7 -// CHECK:STDOUT: %impl.elem0.loc31_31.2 => constants.%Destroy.Op.1a2547.7 -// CHECK:STDOUT: %specific_impl_fn.loc31_31.6 => constants.%Destroy.Op.1a2547.7 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.df9cc1.8 +// CHECK:STDOUT: %impl.elem0.loc31_31.2 => constants.%Destroy.Op.1a2547.8 +// CHECK:STDOUT: %specific_impl_fn.loc31_31.6 => constants.%Destroy.Op.1a2547.8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_adl_returns_different_types_mutable.carbon @@ -2613,6 +2643,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Optional.Get.6bf: %Optional.Get.type.112 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.facet.306: %Destroy.type = facet_value %ValueType, (%custom_witness.fef) [concrete] // CHECK:STDOUT: %MaybeUnformed.669: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.306) [concrete] +// CHECK:STDOUT: %.b36: type = maybe_unformed_type %ValueType [concrete] // CHECK:STDOUT: %struct_type.value.has_value.5a1: type = struct_type {.value: %MaybeUnformed.669, .has_value: bool} [concrete] // CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.cdf, @Optional.HasValue(%OptionalStorage.facet.642) [concrete] // CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.6bf, @Optional.Get(%OptionalStorage.facet.642) [concrete] @@ -2620,8 +2651,8 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %ValueType.cpp_operator: %ValueType.cpp_operator.type = struct_value () [concrete] // CHECK:STDOUT: %operator_PlusEqual__carbon_thunk.type: type = fn_type @operator_PlusEqual__carbon_thunk [concrete] // CHECK:STDOUT: %operator_PlusEqual__carbon_thunk: %operator_PlusEqual__carbon_thunk.type = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.6: type = fn_type @Destroy.Op.loc32_31.5 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.6: %Destroy.Op.type.1d8f74.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.7: type = fn_type @Destroy.Op.loc32_31.6 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.7: %Destroy.Op.type.1d8f74.7 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.lookup_impl_witness.f37: = lookup_impl_witness %impl.elem1.46a, @Destroy [symbolic] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.e7e: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%impl.elem1.46a) [symbolic] // CHECK:STDOUT: %.bc1: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.e7e, %impl.elem1.46a [symbolic] @@ -2760,7 +2791,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Op.ref.loc32: %ValueType.cpp_destructor.type = name_ref Op, imports.%ValueType.cpp_destructor.decl [concrete = constants.%ValueType.cpp_destructor] // CHECK:STDOUT: %ValueType.cpp_destructor.bound.loc32: = bound_method %.loc32_31.11, %Op.ref.loc32 // CHECK:STDOUT: %ValueType.cpp_destructor.call.loc32: init %empty_tuple.type = call %ValueType.cpp_destructor.bound.loc32(%.loc32_31.11) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc32_31.3, constants.%Destroy.Op.1a2547.6 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc32_31.3, constants.%Destroy.Op.1a2547.7 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc32_31.3) // CHECK:STDOUT: %impl.elem0.loc32_31.1: @Test.%.loc32_31.15 (%.bc1) = impl_witness_access constants.%Destroy.lookup_impl_witness.f37, element0 [symbolic = %impl.elem0.loc32_31.2 (constants.%impl.elem0.c7c)] // CHECK:STDOUT: %bound_method.loc32_31.7: = bound_method %var, %impl.elem0.loc32_31.1 @@ -2771,24 +2802,29 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc32_31.1(%self.param: ref %MaybeUnformed.669) { +// CHECK:STDOUT: fn @Destroy.Op.loc32_31.1(%self.param: ref %.b36) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc32_31.2(%self.param: ref bool) = "no_op"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc32_31.3(%self.param: ref %struct_type.value.has_value.5a1) { +// CHECK:STDOUT: fn @Destroy.Op.loc32_31.2(%self.param: ref %MaybeUnformed.669) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc32_31.4(%self.param: ref %DefaultOptionalStorage.257) { +// CHECK:STDOUT: fn @Destroy.Op.loc32_31.3(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc32_31.4(%self.param: ref %struct_type.value.has_value.5a1) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc32_31.5(%self.param: ref %Optional.be6) { +// CHECK:STDOUT: fn @Destroy.Op.loc32_31.5(%self.param: ref %DefaultOptionalStorage.257) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc32_31.6(%self.param: ref %Optional.be6) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -2892,6 +2928,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Optional.Get.5aa: %Optional.Get.type.135 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.facet.306: %Destroy.type = facet_value %ValueType, (%custom_witness.fef) [concrete] // CHECK:STDOUT: %MaybeUnformed.669: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.306) [concrete] +// CHECK:STDOUT: %.b36: type = maybe_unformed_type %ValueType [concrete] // CHECK:STDOUT: %struct_type.value.has_value.5a1: type = struct_type {.value: %MaybeUnformed.669, .has_value: bool} [concrete] // CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.605, @Optional.HasValue(%OptionalStorage.facet.7ce) [concrete] // CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.5aa, @Optional.Get(%OptionalStorage.facet.7ce) [concrete] @@ -2899,8 +2936,8 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %ValueType.cpp_operator: %ValueType.cpp_operator.type = struct_value () [concrete] // CHECK:STDOUT: %operator_PlusEqual__carbon_thunk.type: type = fn_type @operator_PlusEqual__carbon_thunk [concrete] // CHECK:STDOUT: %operator_PlusEqual__carbon_thunk: %operator_PlusEqual__carbon_thunk.type = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.6: type = fn_type @Destroy.Op.loc39_31.5 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.6: %Destroy.Op.type.1d8f74.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.7: type = fn_type @Destroy.Op.loc39_31.6 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.7: %Destroy.Op.type.1d8f74.7 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.lookup_impl_witness.f37: = lookup_impl_witness %impl.elem1.46a, @Destroy [symbolic] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.e7e: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%impl.elem1.46a) [symbolic] // CHECK:STDOUT: %.bc1: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.e7e, %impl.elem1.46a [symbolic] @@ -2933,10 +2970,10 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %custom_witness.01a: = custom_witness (%Iterator.Op.549055.4), @Inc [concrete] // CHECK:STDOUT: %facet_value.88d: %CppRangeForIterate_where.type = facet_value %MutableAndConstRange, (%custom_witness.fef, %custom_witness.c19, %custom_witness.a40, %custom_witness.04a, %custom_witness.cfc, %custom_witness.dd5, %custom_witness.c66, %custom_witness.01a) [concrete] // CHECK:STDOUT: %tuple.type.56e: type = tuple_type (%Iterator, %Iterator) [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.7: type = fn_type @Destroy.Op.2 [concrete] -// CHECK:STDOUT: %Destroy.Op.1a2547.7: %Destroy.Op.type.1d8f74.7 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.df9cc1.7: = custom_witness (%Destroy.Op.1a2547.7), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.7aa: %Destroy.type = facet_value %tuple.type.56e, (%custom_witness.df9cc1.7) [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.8: type = fn_type @Destroy.Op.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.1a2547.8: %Destroy.Op.type.1d8f74.8 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.df9cc1.8: = custom_witness (%Destroy.Op.1a2547.8), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.7aa: %Destroy.type = facet_value %tuple.type.56e, (%custom_witness.df9cc1.8) [concrete] // CHECK:STDOUT: %Iterate.impl_witness.a6e: = impl_witness imports.%Iterate.impl_witness_table.344, @R.as_type.as.Iterate.impl(%facet_value.88d) [concrete] // CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.type.11b: type = fn_type @R.as_type.as.Iterate.impl.NewCursor, @R.as_type.as.Iterate.impl(%facet_value.88d) [concrete] // CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.96c: %R.as_type.as.Iterate.impl.NewCursor.type.11b = struct_value () [concrete] @@ -3091,7 +3128,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Op.ref.loc39: %ValueType.cpp_destructor.type = name_ref Op, imports.%ValueType.cpp_destructor.decl [concrete = constants.%ValueType.cpp_destructor] // CHECK:STDOUT: %ValueType.cpp_destructor.bound.loc39: = bound_method %.loc39_31.11, %Op.ref.loc39 // CHECK:STDOUT: %ValueType.cpp_destructor.call.loc39: init %empty_tuple.type = call %ValueType.cpp_destructor.bound.loc39(%.loc39_31.11) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc39_31.3, constants.%Destroy.Op.1a2547.6 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc39_31.3, constants.%Destroy.Op.1a2547.7 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc39_31.3) // CHECK:STDOUT: %impl.elem0.loc39_31.1: @Test.%.loc39_31.15 (%.bc1) = impl_witness_access constants.%Destroy.lookup_impl_witness.f37, element0 [symbolic = %impl.elem0.loc39_31.2 (constants.%impl.elem0.c7c)] // CHECK:STDOUT: %bound_method.loc39_31.7: = bound_method %var, %impl.elem0.loc39_31.1 @@ -3102,24 +3139,29 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc39_31.1(%self.param: ref %MaybeUnformed.669) { +// CHECK:STDOUT: fn @Destroy.Op.loc39_31.1(%self.param: ref %.b36) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc39_31.2(%self.param: ref bool) = "no_op"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc39_31.3(%self.param: ref %struct_type.value.has_value.5a1) { +// CHECK:STDOUT: fn @Destroy.Op.loc39_31.2(%self.param: ref %MaybeUnformed.669) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc39_31.4(%self.param: ref %DefaultOptionalStorage.257) { +// CHECK:STDOUT: fn @Destroy.Op.loc39_31.3(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc39_31.4(%self.param: ref %struct_type.value.has_value.5a1) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc39_31.5(%self.param: ref %Optional.552) { +// CHECK:STDOUT: fn @Destroy.Op.loc39_31.5(%self.param: ref %DefaultOptionalStorage.257) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc39_31.6(%self.param: ref %Optional.552) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -3153,8 +3195,8 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %specific_impl_fn.loc39_31.5 => constants.%R.as_type.as.Iterate.impl.Next.specific_fn // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b7b // CHECK:STDOUT: %.loc39_31.15 => constants.%.1ad -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.df9cc1.7 -// CHECK:STDOUT: %impl.elem0.loc39_31.2 => constants.%Destroy.Op.1a2547.7 -// CHECK:STDOUT: %specific_impl_fn.loc39_31.6 => constants.%Destroy.Op.1a2547.7 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.df9cc1.8 +// CHECK:STDOUT: %impl.elem0.loc39_31.2 => constants.%Destroy.Op.1a2547.8 +// CHECK:STDOUT: %specific_impl_fn.loc39_31.6 => constants.%Destroy.Op.1a2547.8 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/array/iterate.carbon b/toolchain/lower/testdata/array/iterate.carbon index 58d0ec4b1c89..ae0c01183b0c 100644 --- a/toolchain/lower/testdata/array/iterate.carbon +++ b/toolchain/lower/testdata/array/iterate.carbon @@ -70,142 +70,148 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.0fc9634857315db2:core.Destroy.Core"(ptr %self) #0 !dbg !19 { +// CHECK:STDOUT: define weak_odr void @"_COp.94ba1c30d421702e:core.Destroy.Core"(ptr %self) #0 !dbg !19 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !22 +// CHECK:STDOUT: ret void, !dbg !25 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.69700c1fc1b2744c:core.Destroy.Core"(ptr %self) #0 !dbg !23 { +// CHECK:STDOUT: define weak_odr void @"_COp.0fc9634857315db2: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.f49c06ba556be406:core.Destroy.Core"(ptr %self) #0 !dbg !30 { +// CHECK:STDOUT: define weak_odr void @"_COp.69700c1fc1b2744c: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.ab782c7eec490fc7:core.Destroy.Core"(ptr %self) #0 !dbg !34 { +// CHECK:STDOUT: define weak_odr void @"_COp.f49c06ba556be406: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.3a5df7cec745952b:core.Destroy.Core"(ptr %self) #0 !dbg !38 { +// CHECK:STDOUT: define weak_odr void @"_COp.ab782c7eec490fc7: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: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.3a5df7cec745952b:core.Destroy.Core"(ptr %self) #0 !dbg !42 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !45 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CNewCursor.e163a239f9fa927c:Iterate.Core.620427d555024fe2"(ptr %self) #0 !dbg !42 { -// CHECK:STDOUT: ret i32 0, !dbg !48 +// CHECK:STDOUT: define linkonce_odr i32 @"_CNewCursor.e163a239f9fa927c:Iterate.Core.620427d555024fe2"(ptr %self) #0 !dbg !46 { +// CHECK:STDOUT: ret i32 0, !dbg !52 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CNext.e163a239f9fa927c:Iterate.Core.620427d555024fe2"(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: define linkonce_odr void @"_CNext.e163a239f9fa927c:Iterate.Core.620427d555024fe2"(ptr sret(<{ i32, i1 }>) %return, ptr %self, ptr %cursor) #0 !dbg !53 { +// CHECK:STDOUT: %1 = load i32, ptr %cursor, align 4, !dbg !59 +// CHECK:STDOUT: %2 = icmp slt i32 %1, 6, !dbg !59 +// CHECK:STDOUT: br i1 %2, label %3, label %7, !dbg !60 // CHECK:STDOUT: // CHECK:STDOUT: 3: ; preds = %0 -// 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.18012f5191ea64dc(ptr %return, i32 %6), !dbg !60 -// CHECK:STDOUT: ret void, !dbg !61 +// CHECK:STDOUT: call void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %cursor), !dbg !61 +// CHECK:STDOUT: %4 = load i32, ptr %cursor, align 4, !dbg !62 +// CHECK:STDOUT: %5 = sub i32 %4, 1, !dbg !62 +// CHECK:STDOUT: %array.index = getelementptr inbounds [6 x i32], ptr %self, i32 0, i32 %5, !dbg !63 +// CHECK:STDOUT: %6 = load i32, ptr %array.index, align 4, !dbg !63 +// CHECK:STDOUT: call void @_CSome.Optional.Core.18012f5191ea64dc(ptr %return, i32 %6), !dbg !64 +// CHECK:STDOUT: ret void, !dbg !65 // CHECK:STDOUT: // CHECK:STDOUT: 7: ; preds = %0 -// CHECK:STDOUT: call void @_CNone.Optional.Core.18012f5191ea64dc(ptr %return), !dbg !62 -// CHECK:STDOUT: ret void, !dbg !63 +// CHECK:STDOUT: call void @_CNone.Optional.Core.18012f5191ea64dc(ptr %return), !dbg !66 +// CHECK:STDOUT: ret void, !dbg !67 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.18012f5191ea64dc(ptr %self) #0 !dbg !64 { -// CHECK:STDOUT: %1 = call i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.58016a73bff04416"(ptr %self), !dbg !70 -// CHECK:STDOUT: ret i1 %1, !dbg !71 +// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.18012f5191ea64dc(ptr %self) #0 !dbg !68 { +// CHECK:STDOUT: %1 = call i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.58016a73bff04416"(ptr %self), !dbg !74 +// CHECK:STDOUT: ret i1 %1, !dbg !75 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CGet.Optional.Core.18012f5191ea64dc(ptr %self) #0 !dbg !72 { -// CHECK:STDOUT: %1 = call i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.58016a73bff04416"(ptr %self), !dbg !75 -// CHECK:STDOUT: ret i32 %1, !dbg !76 +// CHECK:STDOUT: define linkonce_odr i32 @_CGet.Optional.Core.18012f5191ea64dc(ptr %self) #0 !dbg !76 { +// CHECK:STDOUT: %1 = call i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.58016a73bff04416"(ptr %self), !dbg !79 +// CHECK:STDOUT: ret i32 %1, !dbg !80 // 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 !77 { -// CHECK:STDOUT: call void @"_COp:thunk:AddAssignWith.6f9e8c1abf8bb3ea.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.44914b6ff6901661"(ptr %self, i32 1), !dbg !81 -// CHECK:STDOUT: ret void, !dbg !82 +// CHECK:STDOUT: define linkonce_odr void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !81 { +// CHECK:STDOUT: call void @"_COp:thunk:AddAssignWith.6f9e8c1abf8bb3ea.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.44914b6ff6901661"(ptr %self, i32 1), !dbg !85 +// CHECK:STDOUT: ret void, !dbg !86 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.18012f5191ea64dc(ptr sret(<{ i32, i1 }>) %return, i32 %value) #0 !dbg !83 { -// CHECK:STDOUT: call void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.58016a73bff04416"(ptr %return, i32 %value), !dbg !88 -// CHECK:STDOUT: ret void, !dbg !89 +// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.18012f5191ea64dc(ptr sret(<{ i32, i1 }>) %return, i32 %value) #0 !dbg !87 { +// CHECK:STDOUT: call void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.58016a73bff04416"(ptr %return, i32 %value), !dbg !92 +// CHECK:STDOUT: ret void, !dbg !93 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.18012f5191ea64dc(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !90 { -// CHECK:STDOUT: call void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.58016a73bff04416"(ptr %return), !dbg !93 -// CHECK:STDOUT: ret void, !dbg !94 +// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.18012f5191ea64dc(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !94 { +// CHECK:STDOUT: call void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.58016a73bff04416"(ptr %return), !dbg !97 +// CHECK:STDOUT: ret void, !dbg !98 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.58016a73bff04416"(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: define linkonce_odr i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.58016a73bff04416"(ptr %value) #0 !dbg !99 { +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %value, i32 0, i32 1, !dbg !102 +// CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !102 +// CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !102 +// CHECK:STDOUT: ret i1 %2, !dbg !103 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.58016a73bff04416"(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: define linkonce_odr i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.58016a73bff04416"(ptr %value) #0 !dbg !104 { +// CHECK:STDOUT: %value1 = getelementptr inbounds nuw <{ i32, i1 }>, ptr %value, i32 0, i32 0, !dbg !107 +// CHECK:STDOUT: %1 = load i32, ptr %value1, align 4, !dbg !107 +// CHECK:STDOUT: ret i32 %1, !dbg !108 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp:thunk:AddAssignWith.6f9e8c1abf8bb3ea.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.44914b6ff6901661"(ptr %self, i32 %other) #2 !dbg !105 { -// CHECK:STDOUT: %1 = call i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.40372ba0ea03ef47"(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: define linkonce_odr void @"_COp:thunk:AddAssignWith.6f9e8c1abf8bb3ea.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.44914b6ff6901661"(ptr %self, i32 %other) #2 !dbg !109 { +// CHECK:STDOUT: %1 = call i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.40372ba0ea03ef47"(i32 %other), !dbg !115 +// CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !116 +// CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !116 +// CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !116 +// CHECK:STDOUT: ret void, !dbg !116 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.58016a73bff04416"(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: define linkonce_odr void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.58016a73bff04416"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !117 { +// CHECK:STDOUT: %value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 0, !dbg !120 +// CHECK:STDOUT: store i32 %self, ptr %value, align 4, !dbg !120 +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !121 +// CHECK:STDOUT: store i8 1, ptr %has_value, align 1, !dbg !121 +// CHECK:STDOUT: ret void, !dbg !122 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.58016a73bff04416"(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: define linkonce_odr void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.58016a73bff04416"(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !123 { +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !124 +// CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !124 +// CHECK:STDOUT: ret void, !dbg !125 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.40372ba0ea03ef47"(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: define linkonce_odr i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.40372ba0ea03ef47"(i32 %self) #0 !dbg !126 { +// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !131 +// CHECK:STDOUT: ret i32 %1, !dbg !132 // 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 !129 { -// CHECK:STDOUT: ret i32 %self, !dbg !132 +// CHECK:STDOUT: define linkonce_odr i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self) #0 !dbg !133 { +// CHECK:STDOUT: ret i32 %self, !dbg !136 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -237,117 +243,121 @@ fn F() { // 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.0fc9634857315db2: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.69700c1fc1b2744c: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: !19 = distinct !DISubprogram(name: "Op", linkageName: "_COp.94ba1c30d421702e: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: 7, scope: !19) +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0fc9634857315db2:core.Destroy.Core", scope: null, file: !3, line: 17, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !27) // 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.f49c06ba556be406:core.Destroy.Core", scope: null, file: !3, line: 17, type: !24, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !31) +// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !26, type: !15) +// CHECK:STDOUT: !29 = !DILocation(line: 17, column: 7, scope: !26) +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Op", linkageName: "_COp.69700c1fc1b2744c: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: !26) +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !30, type: !22) // CHECK:STDOUT: !33 = !DILocation(line: 17, column: 7, scope: !30) -// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "Op", linkageName: "_COp.ab782c7eec490fc7:core.Destroy.Core", scope: null, file: !3, line: 17, type: !24, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !35) +// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f49c06ba556be406: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: !26) +// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !34, type: !22) // CHECK:STDOUT: !37 = !DILocation(line: 17, column: 7, scope: !34) -// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Op", linkageName: "_COp.3a5df7cec745952b:core.Destroy.Core", scope: null, file: !3, line: 16, type: !24, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !39) +// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Op", linkageName: "_COp.ab782c7eec490fc7:core.Destroy.Core", scope: null, file: !3, line: 17, type: !20, 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.e163a239f9fa927c:Iterate.Core.620427d555024fe2", 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.e163a239f9fa927c:Iterate.Core.620427d555024fe2", 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.18012f5191ea64dc", scope: null, file: !65, line: 36, 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: 37, column: 12, scope: !64) -// CHECK:STDOUT: !71 = !DILocation(line: 37, column: 5, scope: !64) -// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.18012f5191ea64dc", scope: null, file: !65, line: 39, 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: 40, column: 12, scope: !72) -// CHECK:STDOUT: !76 = !DILocation(line: 40, column: 5, scope: !72) -// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !78, line: 370, 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: 372, column: 5, scope: !77) -// CHECK:STDOUT: !82 = !DILocation(line: 370, column: 3, scope: !77) -// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.18012f5191ea64dc", scope: null, file: !65, line: 33, 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: 34, column: 12, scope: !83) -// CHECK:STDOUT: !89 = !DILocation(line: 34, column: 5, scope: !83) -// CHECK:STDOUT: !90 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.18012f5191ea64dc", scope: null, file: !65, line: 30, type: !91, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !91 = !DISubroutineType(types: !92) -// CHECK:STDOUT: !92 = !{!26} -// CHECK:STDOUT: !93 = !DILocation(line: 31, column: 12, scope: !90) -// CHECK:STDOUT: !94 = !DILocation(line: 31, column: 5, scope: !90) -// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.58016a73bff04416", scope: null, file: !65, line: 141, 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: 142, column: 12, scope: !95) -// CHECK:STDOUT: !99 = !DILocation(line: 142, column: 5, scope: !95) -// CHECK:STDOUT: !100 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.58016a73bff04416", scope: null, file: !65, line: 144, 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: 145, column: 12, scope: !100) -// CHECK:STDOUT: !104 = !DILocation(line: 145, column: 5, scope: !100) -// CHECK:STDOUT: !105 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.6f9e8c1abf8bb3ea.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.44914b6ff6901661", scope: null, file: !78, line: 306, 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: 306, column: 3, scope: !105) -// CHECK:STDOUT: !113 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.58016a73bff04416", scope: null, file: !65, line: 131, 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: 137, column: 5, scope: !113) -// CHECK:STDOUT: !117 = !DILocation(line: 138, column: 5, scope: !113) -// CHECK:STDOUT: !118 = !DILocation(line: 139, column: 5, scope: !113) -// CHECK:STDOUT: !119 = distinct !DISubprogram(name: "None", linkageName: "_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.58016a73bff04416", scope: null, file: !65, line: 125, type: !91, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !120 = !DILocation(line: 128, column: 5, scope: !119) -// CHECK:STDOUT: !121 = !DILocation(line: 129, column: 5, scope: !119) -// CHECK:STDOUT: !122 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.40372ba0ea03ef47", scope: null, file: !78, line: 63, 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: 65, column: 17, scope: !122) -// CHECK:STDOUT: !128 = !DILocation(line: 65, column: 5, scope: !122) -// CHECK:STDOUT: !129 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !78, line: 58, 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: 58, column: 36, scope: !129) +// CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !38, type: !22) +// CHECK:STDOUT: !41 = !DILocation(line: 17, column: 7, scope: !38) +// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "Op", linkageName: "_COp.3a5df7cec745952b:core.Destroy.Core", scope: null, file: !3, line: 16, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !43) +// CHECK:STDOUT: !43 = !{!44} +// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !42, type: !22) +// CHECK:STDOUT: !45 = !DILocation(line: 16, column: 26, scope: !42) +// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "NewCursor", linkageName: "_CNewCursor.e163a239f9fa927c:Iterate.Core.620427d555024fe2", scope: null, file: !47, line: 23, type: !48, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !50) +// CHECK:STDOUT: !47 = !DIFile(filename: "{{.*}}/prelude/iterate.carbon", directory: "") +// CHECK:STDOUT: !48 = !DISubroutineType(types: !49) +// CHECK:STDOUT: !49 = !{!15, !22} +// CHECK:STDOUT: !50 = !{!51} +// CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !46, type: !22) +// CHECK:STDOUT: !52 = !DILocation(line: 23, column: 46, scope: !46) +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.e163a239f9fa927c:Iterate.Core.620427d555024fe2", scope: null, file: !47, line: 24, type: !54, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !56) +// CHECK:STDOUT: !54 = !DISubroutineType(types: !55) +// CHECK:STDOUT: !55 = !{!22, !22, !22} +// CHECK:STDOUT: !56 = !{!57, !58} +// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !53, type: !22) +// CHECK:STDOUT: !58 = !DILocalVariable(arg: 2, scope: !53, type: !22) +// CHECK:STDOUT: !59 = !DILocation(line: 25, column: 9, scope: !53) +// CHECK:STDOUT: !60 = !DILocation(line: 25, column: 8, scope: !53) +// CHECK:STDOUT: !61 = !DILocation(line: 26, column: 7, scope: !53) +// CHECK:STDOUT: !62 = !DILocation(line: 27, column: 36, scope: !53) +// CHECK:STDOUT: !63 = !DILocation(line: 27, column: 31, scope: !53) +// CHECK:STDOUT: !64 = !DILocation(line: 27, column: 14, scope: !53) +// CHECK:STDOUT: !65 = !DILocation(line: 27, column: 7, scope: !53) +// CHECK:STDOUT: !66 = !DILocation(line: 29, column: 14, scope: !53) +// CHECK:STDOUT: !67 = !DILocation(line: 29, column: 7, scope: !53) +// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.18012f5191ea64dc", scope: null, file: !69, line: 36, type: !70, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !72) +// CHECK:STDOUT: !69 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !70 = !DISubroutineType(types: !71) +// CHECK:STDOUT: !71 = !{!22, !22} +// CHECK:STDOUT: !72 = !{!73} +// CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !68, type: !22) +// CHECK:STDOUT: !74 = !DILocation(line: 37, column: 12, scope: !68) +// CHECK:STDOUT: !75 = !DILocation(line: 37, column: 5, scope: !68) +// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.18012f5191ea64dc", scope: null, file: !69, line: 39, type: !48, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !77) +// CHECK:STDOUT: !77 = !{!78} +// CHECK:STDOUT: !78 = !DILocalVariable(arg: 1, scope: !76, type: !22) +// CHECK:STDOUT: !79 = !DILocation(line: 40, column: 12, scope: !76) +// CHECK:STDOUT: !80 = !DILocation(line: 40, column: 5, scope: !76) +// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !82, line: 370, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !83) +// CHECK:STDOUT: !82 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") +// CHECK:STDOUT: !83 = !{!84} +// CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !81, type: !15) +// CHECK:STDOUT: !85 = !DILocation(line: 372, column: 5, scope: !81) +// CHECK:STDOUT: !86 = !DILocation(line: 370, column: 3, scope: !81) +// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.18012f5191ea64dc", scope: null, file: !69, line: 33, type: !88, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !90) +// CHECK:STDOUT: !88 = !DISubroutineType(types: !89) +// CHECK:STDOUT: !89 = !{!22, !15} +// CHECK:STDOUT: !90 = !{!91} +// CHECK:STDOUT: !91 = !DILocalVariable(arg: 1, scope: !87, type: !15) +// CHECK:STDOUT: !92 = !DILocation(line: 34, column: 12, scope: !87) +// CHECK:STDOUT: !93 = !DILocation(line: 34, column: 5, scope: !87) +// CHECK:STDOUT: !94 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.18012f5191ea64dc", scope: null, file: !69, line: 30, type: !95, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !95 = !DISubroutineType(types: !96) +// CHECK:STDOUT: !96 = !{!22} +// CHECK:STDOUT: !97 = !DILocation(line: 31, column: 12, scope: !94) +// CHECK:STDOUT: !98 = !DILocation(line: 31, column: 5, scope: !94) +// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.58016a73bff04416", scope: null, file: !69, line: 141, type: !70, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !100) +// CHECK:STDOUT: !100 = !{!101} +// CHECK:STDOUT: !101 = !DILocalVariable(arg: 1, scope: !99, type: !22) +// CHECK:STDOUT: !102 = !DILocation(line: 142, column: 12, scope: !99) +// CHECK:STDOUT: !103 = !DILocation(line: 142, column: 5, scope: !99) +// CHECK:STDOUT: !104 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.58016a73bff04416", scope: null, file: !69, line: 144, type: !48, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !105) +// CHECK:STDOUT: !105 = !{!106} +// CHECK:STDOUT: !106 = !DILocalVariable(arg: 1, scope: !104, type: !22) +// CHECK:STDOUT: !107 = !DILocation(line: 145, column: 12, scope: !104) +// CHECK:STDOUT: !108 = !DILocation(line: 145, column: 5, scope: !104) +// CHECK:STDOUT: !109 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.6f9e8c1abf8bb3ea.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.44914b6ff6901661", scope: null, file: !82, line: 306, type: !110, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !112) +// CHECK:STDOUT: !110 = !DISubroutineType(types: !111) +// CHECK:STDOUT: !111 = !{null, !15, !15} +// CHECK:STDOUT: !112 = !{!113, !114} +// CHECK:STDOUT: !113 = !DILocalVariable(arg: 1, scope: !109, type: !15) +// CHECK:STDOUT: !114 = !DILocalVariable(arg: 2, scope: !109, type: !15) +// CHECK:STDOUT: !115 = !DILocation(line: 4294967295, scope: !109) +// CHECK:STDOUT: !116 = !DILocation(line: 306, column: 3, scope: !109) +// CHECK:STDOUT: !117 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.58016a73bff04416", scope: null, file: !69, line: 131, type: !88, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !118) +// CHECK:STDOUT: !118 = !{!119} +// CHECK:STDOUT: !119 = !DILocalVariable(arg: 1, scope: !117, type: !15) +// CHECK:STDOUT: !120 = !DILocation(line: 137, column: 5, scope: !117) +// CHECK:STDOUT: !121 = !DILocation(line: 138, column: 5, scope: !117) +// CHECK:STDOUT: !122 = !DILocation(line: 139, column: 5, scope: !117) +// CHECK:STDOUT: !123 = distinct !DISubprogram(name: "None", linkageName: "_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.58016a73bff04416", scope: null, file: !69, line: 125, type: !95, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !124 = !DILocation(line: 128, column: 5, scope: !123) +// CHECK:STDOUT: !125 = !DILocation(line: 129, column: 5, scope: !123) +// CHECK:STDOUT: !126 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.40372ba0ea03ef47", scope: null, file: !82, line: 63, type: !127, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !129) +// CHECK:STDOUT: !127 = !DISubroutineType(types: !128) +// CHECK:STDOUT: !128 = !{!15, !15} +// CHECK:STDOUT: !129 = !{!130} +// CHECK:STDOUT: !130 = !DILocalVariable(arg: 1, scope: !126, type: !15) +// CHECK:STDOUT: !131 = !DILocation(line: 65, column: 17, scope: !126) +// CHECK:STDOUT: !132 = !DILocation(line: 65, column: 5, scope: !126) +// CHECK:STDOUT: !133 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !82, line: 58, type: !127, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !134) +// CHECK:STDOUT: !134 = !{!135} +// CHECK:STDOUT: !135 = !DILocalVariable(arg: 1, scope: !133, type: !15) +// CHECK:STDOUT: !136 = !DILocation(line: 58, column: 36, scope: !133) diff --git a/toolchain/lower/testdata/builtins/char.carbon b/toolchain/lower/testdata/builtins/char.carbon index e93519a0fcc7..9cd0d687eaf9 100644 --- a/toolchain/lower/testdata/builtins/char.carbon +++ b/toolchain/lower/testdata/builtins/char.carbon @@ -34,11 +34,17 @@ fn Example() -> char { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.387a2b9c43474daf:core.Destroy.Core"(ptr %self) #0 !dbg !11 { +// CHECK:STDOUT: define weak_odr void @"_COp.c3b9dc9c7e0d5d3d: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: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.387a2b9c43474daf: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: @@ -59,9 +65,13 @@ 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.387a2b9c43474daf:core.Destroy.Core", scope: null, file: !3, line: 5, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !14) +// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Op", linkageName: "_COp.c3b9dc9c7e0d5d3d: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: !17 = distinct !DISubprogram(name: "Op", linkageName: "_COp.387a2b9c43474daf:core.Destroy.Core", scope: null, file: !3, line: 5, 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: 5, column: 3, scope: !17) diff --git a/toolchain/lower/testdata/builtins/maybe_unformed.carbon b/toolchain/lower/testdata/builtins/maybe_unformed.carbon index 3d7a5d80594d..73d170be52d7 100644 --- a/toolchain/lower/testdata/builtins/maybe_unformed.carbon +++ b/toolchain/lower/testdata/builtins/maybe_unformed.carbon @@ -134,34 +134,40 @@ fn PassAdapterBool() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.37bf4066dfa3831f:core.Destroy.Core"(ptr %self) #0 !dbg !49 { +// CHECK:STDOUT: define weak_odr void @"_COp.94ba1c30d421702e: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: define weak_odr void @"_COp.37bf4066dfa3831f: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 void @_CTakeAdapterBool.Main(ptr %_) #0 !dbg !57 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !60 +// 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 !57 { +// CHECK:STDOUT: define void @_CPassAdapterBool.Main() #0 !dbg !61 { // CHECK:STDOUT: entry: -// 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.f633bf9c4580207a:core.Destroy.Core"(ptr %.loc55_35.1.temp), !dbg !58 -// CHECK:STDOUT: ret void, !dbg !60 +// CHECK:STDOUT: %.loc55_35.1.temp = alloca i1, align 1, !dbg !62 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc55_35.1.temp), !dbg !62 +// CHECK:STDOUT: call void @_CMakeAdapterBool.Main(ptr %.loc55_35.1.temp), !dbg !62 +// CHECK:STDOUT: call void @_CTakeAdapterBool.Main(ptr %.loc55_35.1.temp), !dbg !63 +// CHECK:STDOUT: call void @"_COp.f633bf9c4580207a:core.Destroy.Core"(ptr %.loc55_35.1.temp), !dbg !62 +// CHECK:STDOUT: ret void, !dbg !64 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f633bf9c4580207a:core.Destroy.Core"(ptr %self) #0 !dbg !61 { +// CHECK:STDOUT: define weak_odr void @"_COp.f633bf9c4580207a:core.Destroy.Core"(ptr %self) #0 !dbg !65 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !64 +// CHECK:STDOUT: ret void, !dbg !68 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -225,19 +231,23 @@ fn PassAdapterBool() { // 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.37bf4066dfa3831f:core.Destroy.Core", scope: null, file: !3, line: 48, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !50) +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "Op", linkageName: "_COp.94ba1c30d421702e:core.Destroy.Core", scope: null, file: !3, line: 48, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !50) // CHECK:STDOUT: !50 = !{!51} -// CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !49, type: !7) +// CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !49, type: !14) // 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: !53 = distinct !DISubprogram(name: "Op", linkageName: "_COp.37bf4066dfa3831f:core.Destroy.Core", scope: null, file: !3, line: 48, type: !5, 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.f633bf9c4580207a: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) +// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !53, type: !7) +// CHECK:STDOUT: !56 = !DILocation(line: 48, column: 18, scope: !53) +// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "TakeAdapterBool", linkageName: "_CTakeAdapterBool.Main", scope: null, file: !3, line: 51, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !58) +// CHECK:STDOUT: !58 = !{!59} +// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !57, type: !14) +// CHECK:STDOUT: !60 = !DILocation(line: 51, column: 1, scope: !57) +// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "PassAdapterBool", linkageName: "_CPassAdapterBool.Main", scope: null, file: !3, line: 54, type: !19, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !62 = !DILocation(line: 55, column: 19, scope: !61) +// CHECK:STDOUT: !63 = !DILocation(line: 55, column: 3, scope: !61) +// CHECK:STDOUT: !64 = !DILocation(line: 54, column: 1, scope: !61) +// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f633bf9c4580207a:core.Destroy.Core", scope: null, file: !3, line: 55, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !66) +// CHECK:STDOUT: !66 = !{!67} +// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !65, type: !14) +// CHECK:STDOUT: !68 = !DILocation(line: 55, column: 19, scope: !65) diff --git a/toolchain/lower/testdata/class/adapt.carbon b/toolchain/lower/testdata/class/adapt.carbon index 03ecb14cf388..89d06a865a88 100644 --- a/toolchain/lower/testdata/class/adapt.carbon +++ b/toolchain/lower/testdata/class/adapt.carbon @@ -110,11 +110,17 @@ fn DoStuff(a: Int) -> Int { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.d8149a936c4ca850:core.Destroy.Core"(ptr %self) #0 !dbg !40 { +// CHECK:STDOUT: define weak_odr void @"_COp.c0f3aeca38cdfaa6: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.d8149a936c4ca850: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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) // CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 // CHECK:STDOUT: @@ -167,10 +173,14 @@ fn DoStuff(a: Int) -> Int { // 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.d8149a936c4ca850:core.Destroy.Core", scope: null, file: !3, line: 27, type: !35, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !41) +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "Op", linkageName: "_COp.c0f3aeca38cdfaa6: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: !44 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d8149a936c4ca850:core.Destroy.Core", scope: null, file: !3, line: 27, type: !35, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !45) +// CHECK:STDOUT: !45 = !{!46} +// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !44, type: !7) +// CHECK:STDOUT: !47 = !DILocation(line: 27, column: 3, scope: !44) // CHECK:STDOUT: ; ModuleID = 'adapt_int.carbon' // CHECK:STDOUT: source_filename = "adapt_int.carbon" // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/for/bindings.carbon b/toolchain/lower/testdata/for/bindings.carbon index bb0f7d7d9a33..8938f374c16b 100644 --- a/toolchain/lower/testdata/for/bindings.carbon +++ b/toolchain/lower/testdata/for/bindings.carbon @@ -91,35 +91,41 @@ fn For() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.938741932578d142:core.Destroy.Core"(ptr %self) #0 !dbg !27 { +// CHECK:STDOUT: define weak_odr void @"_COp.5172fb5622df6926: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.b935d6615b90a01b:core.Destroy.Core"(ptr %self) #0 !dbg !31 { +// CHECK:STDOUT: define weak_odr void @"_COp.938741932578d142: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.854750c92287bb79:core.Destroy.Core"(ptr %self) #0 !dbg !35 { +// CHECK:STDOUT: define weak_odr void @"_COp.b935d6615b90a01b: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.72fec7d6e0df4c57:core.Destroy.Core"(ptr %self) #0 !dbg !39 { +// CHECK:STDOUT: define weak_odr void @"_COp.854750c92287bb79: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.88c97397fb274b67:core.Destroy.Core"(ptr %self) #0 !dbg !43 { +// CHECK:STDOUT: define weak_odr void @"_COp.72fec7d6e0df4c57: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.88c97397fb274b67: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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #1 // CHECK:STDOUT: @@ -127,69 +133,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) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CNewCursor.EmptyRange.a081b942542726db.Main:Iterate.Core.c9f733d9bf35d2e5"(ptr %self) #0 !dbg !47 { +// CHECK:STDOUT: define linkonce_odr void @"_CNewCursor.EmptyRange.a081b942542726db.Main:Iterate.Core.c9f733d9bf35d2e5"(ptr %self) #0 !dbg !51 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !50 +// CHECK:STDOUT: ret void, !dbg !54 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CNext.EmptyRange.a081b942542726db.Main:Iterate.Core.c9f733d9bf35d2e5"(ptr sret(<{ { i32, i32 }, i1 }>) %return, ptr %self, ptr %_) #0 !dbg !51 { +// CHECK:STDOUT: define linkonce_odr void @"_CNext.EmptyRange.a081b942542726db.Main:Iterate.Core.c9f733d9bf35d2e5"(ptr sret(<{ { i32, i32 }, i1 }>) %return, ptr %self, ptr %_) #0 !dbg !55 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CNone.Optional.Core.66b735e0a187b4e4(ptr %return), !dbg !57 -// CHECK:STDOUT: ret void, !dbg !58 +// CHECK:STDOUT: call void @_CNone.Optional.Core.66b735e0a187b4e4(ptr %return), !dbg !61 +// CHECK:STDOUT: ret void, !dbg !62 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.66b735e0a187b4e4(ptr %self) #0 !dbg !59 { -// CHECK:STDOUT: %1 = call i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.c9f733d9bf35d2e5"(ptr %self), !dbg !65 -// CHECK:STDOUT: ret i1 %1, !dbg !66 +// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.66b735e0a187b4e4(ptr %self) #0 !dbg !63 { +// CHECK:STDOUT: %1 = call i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.c9f733d9bf35d2e5"(ptr %self), !dbg !69 +// CHECK:STDOUT: ret i1 %1, !dbg !70 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CGet.Optional.Core.66b735e0a187b4e4(ptr sret({ i32, i32 }) %return, ptr %self) #0 !dbg !67 { -// CHECK:STDOUT: call void @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.c9f733d9bf35d2e5"(ptr %return, ptr %self), !dbg !70 -// CHECK:STDOUT: ret void, !dbg !71 +// CHECK:STDOUT: define linkonce_odr void @_CGet.Optional.Core.66b735e0a187b4e4(ptr sret({ i32, i32 }) %return, ptr %self) #0 !dbg !71 { +// CHECK:STDOUT: call void @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.c9f733d9bf35d2e5"(ptr %return, ptr %self), !dbg !74 +// CHECK:STDOUT: ret void, !dbg !75 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.66b735e0a187b4e4(ptr sret(<{ { i32, i32 }, i1 }>) %return) #0 !dbg !72 { -// CHECK:STDOUT: call void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.c9f733d9bf35d2e5"(ptr %return), !dbg !75 -// CHECK:STDOUT: ret void, !dbg !76 +// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.66b735e0a187b4e4(ptr sret(<{ { i32, i32 }, i1 }>) %return) #0 !dbg !76 { +// CHECK:STDOUT: call void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.c9f733d9bf35d2e5"(ptr %return), !dbg !79 +// CHECK:STDOUT: ret void, !dbg !80 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.c9f733d9bf35d2e5"(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: define linkonce_odr i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.c9f733d9bf35d2e5"(ptr %value) #0 !dbg !81 { +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ { i32, i32 }, i1 }>, ptr %value, i32 0, i32 1, !dbg !84 +// CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !84 +// CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !84 +// CHECK:STDOUT: ret i1 %2, !dbg !85 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.c9f733d9bf35d2e5"(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.4e4edddc7580c79b:Copy.Core.58bedf1100cb91a8"(ptr %return, ptr %value1), !dbg !85 -// CHECK:STDOUT: ret void, !dbg !86 +// CHECK:STDOUT: define linkonce_odr void @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.c9f733d9bf35d2e5"(ptr sret({ i32, i32 }) %return, ptr %value) #0 !dbg !86 { +// CHECK:STDOUT: %value1 = getelementptr inbounds nuw <{ { i32, i32 }, i1 }>, ptr %value, i32 0, i32 0, !dbg !89 +// CHECK:STDOUT: call void @"_COp.4e4edddc7580c79b:Copy.Core.58bedf1100cb91a8"(ptr %return, ptr %value1), !dbg !89 +// CHECK:STDOUT: ret void, !dbg !90 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.c9f733d9bf35d2e5"(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: define linkonce_odr void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.c9f733d9bf35d2e5"(ptr sret(<{ { i32, i32 }, i1 }>) %return) #0 !dbg !91 { +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ { i32, i32 }, i1 }>, ptr %return, i32 0, i32 1, !dbg !92 +// CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !92 +// CHECK:STDOUT: ret void, !dbg !93 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp.4e4edddc7580c79b:Copy.Core.58bedf1100cb91a8"(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: define linkonce_odr void @"_COp.4e4edddc7580c79b:Copy.Core.58bedf1100cb91a8"(ptr sret({ i32, i32 }) %return, ptr %self) #0 !dbg !94 { +// CHECK:STDOUT: %tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 0, !dbg !98 +// CHECK:STDOUT: %tuple.elem.load = load i32, ptr %tuple.elem, align 4, !dbg !98 +// CHECK:STDOUT: %tuple.elem1 = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0, !dbg !99 +// CHECK:STDOUT: %tuple.elem2 = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !100 +// CHECK:STDOUT: %tuple.elem.load3 = load i32, ptr %tuple.elem2, align 4, !dbg !100 +// CHECK:STDOUT: %tuple.elem4 = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !99 +// CHECK:STDOUT: store i32 %tuple.elem.load, ptr %tuple.elem1, align 4, !dbg !99 +// CHECK:STDOUT: store i32 %tuple.elem.load3, ptr %tuple.elem4, align 4, !dbg !99 +// CHECK:STDOUT: ret void, !dbg !101 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -228,74 +234,78 @@ fn For() { // 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.938741932578d142:core.Destroy.Core", scope: null, file: !3, line: 29, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !28) +// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5172fb5622df6926: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.b935d6615b90a01b:core.Destroy.Core", scope: null, file: !3, line: 29, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !32) +// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "Op", linkageName: "_COp.938741932578d142: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: !31, type: !23) // CHECK:STDOUT: !34 = !DILocation(line: 29, column: 7, scope: !31) -// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "Op", linkageName: "_COp.854750c92287bb79:core.Destroy.Core", scope: null, file: !3, line: 29, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !36) +// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b935d6615b90a01b: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.72fec7d6e0df4c57:core.Destroy.Core", scope: null, file: !3, line: 29, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !40) +// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "Op", linkageName: "_COp.854750c92287bb79: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.88c97397fb274b67:core.Destroy.Core", scope: null, file: !3, line: 27, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !44) +// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "Op", linkageName: "_COp.72fec7d6e0df4c57:core.Destroy.Core", scope: null, file: !3, line: 29, 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.a081b942542726db.Main:Iterate.Core.c9f733d9bf35d2e5", scope: null, file: !3, line: 15, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !48) +// CHECK:STDOUT: !46 = !DILocation(line: 29, column: 7, scope: !43) +// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "Op", linkageName: "_COp.88c97397fb274b67:core.Destroy.Core", scope: null, file: !3, line: 27, 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.a081b942542726db.Main:Iterate.Core.c9f733d9bf35d2e5", 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.66b735e0a187b4e4", scope: null, file: !60, line: 36, 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: 37, column: 12, scope: !59) -// CHECK:STDOUT: !66 = !DILocation(line: 37, column: 5, scope: !59) -// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.66b735e0a187b4e4", scope: null, file: !60, line: 39, 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: 40, column: 12, scope: !67) -// CHECK:STDOUT: !71 = !DILocation(line: 40, column: 5, scope: !67) -// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.66b735e0a187b4e4", scope: null, file: !60, line: 30, type: !73, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !73 = !DISubroutineType(types: !74) -// CHECK:STDOUT: !74 = !{!23} -// CHECK:STDOUT: !75 = !DILocation(line: 31, column: 12, scope: !72) -// CHECK:STDOUT: !76 = !DILocation(line: 31, column: 5, scope: !72) -// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.c9f733d9bf35d2e5", scope: null, file: !60, line: 141, 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: 142, column: 12, scope: !77) -// CHECK:STDOUT: !81 = !DILocation(line: 142, column: 5, scope: !77) -// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.c9f733d9bf35d2e5", scope: null, file: !60, line: 144, 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: 145, column: 12, scope: !82) -// CHECK:STDOUT: !86 = !DILocation(line: 145, column: 5, scope: !82) -// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "None", linkageName: "_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.c9f733d9bf35d2e5", scope: null, file: !60, line: 125, type: !73, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !88 = !DILocation(line: 128, column: 5, scope: !87) -// CHECK:STDOUT: !89 = !DILocation(line: 129, column: 5, scope: !87) -// CHECK:STDOUT: !90 = distinct !DISubprogram(name: "Op", linkageName: "_COp.4e4edddc7580c79b:Copy.Core.58bedf1100cb91a8", scope: null, file: !91, line: 62, 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: 63, column: 13, scope: !90) -// CHECK:STDOUT: !95 = !DILocation(line: 63, column: 12, scope: !90) -// CHECK:STDOUT: !96 = !DILocation(line: 63, column: 26, scope: !90) -// CHECK:STDOUT: !97 = !DILocation(line: 63, column: 5, scope: !90) +// CHECK:STDOUT: !50 = !DILocation(line: 27, column: 3, scope: !47) +// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "NewCursor", linkageName: "_CNewCursor.EmptyRange.a081b942542726db.Main:Iterate.Core.c9f733d9bf35d2e5", scope: null, file: !3, line: 15, type: !21, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !52) +// CHECK:STDOUT: !52 = !{!53} +// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !51, type: !23) +// CHECK:STDOUT: !54 = !DILocation(line: 16, column: 7, scope: !51) +// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.EmptyRange.a081b942542726db.Main:Iterate.Core.c9f733d9bf35d2e5", scope: null, file: !3, line: 18, type: !56, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !58) +// CHECK:STDOUT: !56 = !DISubroutineType(types: !57) +// CHECK:STDOUT: !57 = !{!23, !23, !23} +// CHECK:STDOUT: !58 = !{!59, !60} +// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !55, type: !23) +// CHECK:STDOUT: !60 = !DILocalVariable(arg: 2, scope: !55, type: !23) +// CHECK:STDOUT: !61 = !DILocation(line: 19, column: 14, scope: !55) +// CHECK:STDOUT: !62 = !DILocation(line: 19, column: 7, scope: !55) +// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.66b735e0a187b4e4", scope: null, file: !64, line: 36, type: !65, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !67) +// CHECK:STDOUT: !64 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !65 = !DISubroutineType(types: !66) +// CHECK:STDOUT: !66 = !{!23, !23} +// CHECK:STDOUT: !67 = !{!68} +// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !63, type: !23) +// CHECK:STDOUT: !69 = !DILocation(line: 37, column: 12, scope: !63) +// CHECK:STDOUT: !70 = !DILocation(line: 37, column: 5, scope: !63) +// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.66b735e0a187b4e4", scope: null, file: !64, line: 39, type: !65, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !72) +// CHECK:STDOUT: !72 = !{!73} +// CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !71, type: !23) +// CHECK:STDOUT: !74 = !DILocation(line: 40, column: 12, scope: !71) +// CHECK:STDOUT: !75 = !DILocation(line: 40, column: 5, scope: !71) +// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.66b735e0a187b4e4", scope: null, file: !64, line: 30, type: !77, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !77 = !DISubroutineType(types: !78) +// CHECK:STDOUT: !78 = !{!23} +// CHECK:STDOUT: !79 = !DILocation(line: 31, column: 12, scope: !76) +// CHECK:STDOUT: !80 = !DILocation(line: 31, column: 5, scope: !76) +// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.c9f733d9bf35d2e5", scope: null, file: !64, line: 141, type: !65, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !82) +// CHECK:STDOUT: !82 = !{!83} +// CHECK:STDOUT: !83 = !DILocalVariable(arg: 1, scope: !81, type: !23) +// CHECK:STDOUT: !84 = !DILocation(line: 142, column: 12, scope: !81) +// CHECK:STDOUT: !85 = !DILocation(line: 142, column: 5, scope: !81) +// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.c9f733d9bf35d2e5", scope: null, file: !64, line: 144, type: !65, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !87) +// CHECK:STDOUT: !87 = !{!88} +// CHECK:STDOUT: !88 = !DILocalVariable(arg: 1, scope: !86, type: !23) +// CHECK:STDOUT: !89 = !DILocation(line: 145, column: 12, scope: !86) +// CHECK:STDOUT: !90 = !DILocation(line: 145, column: 5, scope: !86) +// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "None", linkageName: "_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.c9f733d9bf35d2e5", scope: null, file: !64, line: 125, type: !77, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !92 = !DILocation(line: 128, column: 5, scope: !91) +// CHECK:STDOUT: !93 = !DILocation(line: 129, column: 5, scope: !91) +// CHECK:STDOUT: !94 = distinct !DISubprogram(name: "Op", linkageName: "_COp.4e4edddc7580c79b:Copy.Core.58bedf1100cb91a8", scope: null, file: !95, line: 62, type: !65, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !96) +// CHECK:STDOUT: !95 = !DIFile(filename: "{{.*}}/prelude/copy.carbon", directory: "") +// CHECK:STDOUT: !96 = !{!97} +// CHECK:STDOUT: !97 = !DILocalVariable(arg: 1, scope: !94, type: !23) +// CHECK:STDOUT: !98 = !DILocation(line: 63, column: 13, scope: !94) +// CHECK:STDOUT: !99 = !DILocation(line: 63, column: 12, scope: !94) +// CHECK:STDOUT: !100 = !DILocation(line: 63, column: 26, scope: !94) +// CHECK:STDOUT: !101 = !DILocation(line: 63, column: 5, scope: !94) diff --git a/toolchain/lower/testdata/for/break_continue.carbon b/toolchain/lower/testdata/for/break_continue.carbon index e1603295ec94..5ef99d7e4ca0 100644 --- a/toolchain/lower/testdata/for/break_continue.carbon +++ b/toolchain/lower/testdata/for/break_continue.carbon @@ -87,157 +87,163 @@ fn For() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.0fc9634857315db2:core.Destroy.Core"(ptr %self) #0 !dbg !26 { +// CHECK:STDOUT: define weak_odr void @"_COp.94ba1c30d421702e:core.Destroy.Core"(ptr %self) #0 !dbg !26 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !29 +// CHECK:STDOUT: ret void, !dbg !32 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.69700c1fc1b2744c:core.Destroy.Core"(ptr %self) #0 !dbg !30 { +// CHECK:STDOUT: define weak_odr void @"_COp.0fc9634857315db2: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.278d9a31079e7ff2:core.Destroy.Core"(ptr %self) #0 !dbg !37 { +// CHECK:STDOUT: define weak_odr void @"_COp.69700c1fc1b2744c: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.ab3effcb00e348a7:core.Destroy.Core"(ptr %self) #0 !dbg !41 { +// CHECK:STDOUT: define weak_odr void @"_COp.278d9a31079e7ff2: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 weak_odr void @"_COp.db43fa38232c28dd:core.Destroy.Core"(ptr %self) #0 !dbg !45 { +// CHECK:STDOUT: define weak_odr void @"_COp.ab3effcb00e348a7: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 weak_odr void @"_COp.0d5da2659ce22e5f:core.Destroy.Core"(ptr %self) #0 !dbg !49 { +// CHECK:STDOUT: define weak_odr void @"_COp.db43fa38232c28dd: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 weak_odr void @"_COp.0d5da2659ce22e5f: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: 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: define linkonce_odr i32 @"_CNewCursor.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !57 { +// CHECK:STDOUT: %start = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 0, !dbg !62 +// CHECK:STDOUT: %1 = load i32, ptr %start, align 4, !dbg !62 +// CHECK:STDOUT: ret i32 %1, !dbg !63 // 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: define linkonce_odr void @"_CNext.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8"(ptr sret(<{ i32, i1 }>) %return, ptr %self, ptr %cursor) #0 !dbg !64 { +// CHECK:STDOUT: %1 = alloca i32, align 4, !dbg !70 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !70 +// CHECK:STDOUT: %2 = load i32, ptr %cursor, align 4, !dbg !71 +// CHECK:STDOUT: store i32 %2, ptr %1, align 4, !dbg !70 +// CHECK:STDOUT: %end = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !72 +// CHECK:STDOUT: %3 = load i32, ptr %end, align 4, !dbg !72 +// CHECK:STDOUT: %4 = load i32, ptr %1, align 4, !dbg !73 +// CHECK:STDOUT: %5 = icmp slt i32 %4, %3, !dbg !73 +// CHECK:STDOUT: br i1 %5, label %6, label %8, !dbg !74 // 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.95ac245efc335d3f(ptr %return, i32 %7), !dbg !73 -// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %1), !dbg !66 -// CHECK:STDOUT: ret void, !dbg !74 +// CHECK:STDOUT: call void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %cursor), !dbg !75 +// CHECK:STDOUT: %7 = load i32, ptr %1, align 4, !dbg !76 +// CHECK:STDOUT: call void @_CSome.Optional.Core.95ac245efc335d3f(ptr %return, i32 %7), !dbg !77 +// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %1), !dbg !70 +// CHECK:STDOUT: ret void, !dbg !78 // CHECK:STDOUT: // CHECK:STDOUT: 8: ; preds = %0 -// CHECK:STDOUT: call void @_CNone.Optional.Core.95ac245efc335d3f(ptr %return), !dbg !75 -// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %1), !dbg !66 -// CHECK:STDOUT: ret void, !dbg !76 +// CHECK:STDOUT: call void @_CNone.Optional.Core.95ac245efc335d3f(ptr %return), !dbg !79 +// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %1), !dbg !70 +// CHECK:STDOUT: ret void, !dbg !80 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.95ac245efc335d3f(ptr %self) #0 !dbg !77 { -// CHECK:STDOUT: %1 = call i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a"(ptr %self), !dbg !83 -// CHECK:STDOUT: ret i1 %1, !dbg !84 +// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.95ac245efc335d3f(ptr %self) #0 !dbg !81 { +// CHECK:STDOUT: %1 = call i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a"(ptr %self), !dbg !87 +// CHECK:STDOUT: ret i1 %1, !dbg !88 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CGet.Optional.Core.95ac245efc335d3f(ptr %self) #0 !dbg !85 { -// CHECK:STDOUT: %1 = call i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a"(ptr %self), !dbg !88 -// CHECK:STDOUT: ret i32 %1, !dbg !89 +// CHECK:STDOUT: define linkonce_odr i32 @_CGet.Optional.Core.95ac245efc335d3f(ptr %self) #0 !dbg !89 { +// CHECK:STDOUT: %1 = call i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a"(ptr %self), !dbg !92 +// CHECK:STDOUT: ret i32 %1, !dbg !93 // 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 !90 { -// CHECK:STDOUT: call void @"_COp:thunk:AddAssignWith.d395a13f81aa0e29.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.44914b6ff6901661"(ptr %self, i32 1), !dbg !94 -// CHECK:STDOUT: ret void, !dbg !95 +// CHECK:STDOUT: define linkonce_odr void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !94 { +// CHECK:STDOUT: call void @"_COp:thunk:AddAssignWith.d395a13f81aa0e29.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.44914b6ff6901661"(ptr %self, i32 1), !dbg !98 +// CHECK:STDOUT: ret void, !dbg !99 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.95ac245efc335d3f(ptr sret(<{ i32, i1 }>) %return, i32 %value) #0 !dbg !96 { -// CHECK:STDOUT: call void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a"(ptr %return, i32 %value), !dbg !101 -// CHECK:STDOUT: ret void, !dbg !102 +// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.95ac245efc335d3f(ptr sret(<{ i32, i1 }>) %return, i32 %value) #0 !dbg !100 { +// CHECK:STDOUT: call void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a"(ptr %return, i32 %value), !dbg !105 +// CHECK:STDOUT: ret void, !dbg !106 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.95ac245efc335d3f(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !103 { -// CHECK:STDOUT: call void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a"(ptr %return), !dbg !106 -// CHECK:STDOUT: ret void, !dbg !107 +// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.95ac245efc335d3f(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !107 { +// CHECK:STDOUT: call void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a"(ptr %return), !dbg !110 +// CHECK:STDOUT: ret void, !dbg !111 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a"(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: define linkonce_odr i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a"(ptr %value) #0 !dbg !112 { +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %value, i32 0, i32 1, !dbg !115 +// CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !115 +// CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !115 +// CHECK:STDOUT: ret i1 %2, !dbg !116 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a"(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: define linkonce_odr i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a"(ptr %value) #0 !dbg !117 { +// CHECK:STDOUT: %value1 = getelementptr inbounds nuw <{ i32, i1 }>, ptr %value, i32 0, i32 0, !dbg !120 +// CHECK:STDOUT: %1 = load i32, ptr %value1, align 4, !dbg !120 +// CHECK:STDOUT: ret i32 %1, !dbg !121 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp:thunk:AddAssignWith.d395a13f81aa0e29.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.44914b6ff6901661"(ptr %self, i32 %other) #2 !dbg !118 { -// CHECK:STDOUT: %1 = call i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.40372ba0ea03ef47"(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: define linkonce_odr void @"_COp:thunk:AddAssignWith.d395a13f81aa0e29.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.44914b6ff6901661"(ptr %self, i32 %other) #2 !dbg !122 { +// CHECK:STDOUT: %1 = call i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.40372ba0ea03ef47"(i32 %other), !dbg !128 +// CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !129 +// CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !129 +// CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !129 +// CHECK:STDOUT: ret void, !dbg !129 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a"(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: define linkonce_odr void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !130 { +// CHECK:STDOUT: %value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 0, !dbg !133 +// CHECK:STDOUT: store i32 %self, ptr %value, align 4, !dbg !133 +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !134 +// CHECK:STDOUT: store i8 1, ptr %has_value, align 1, !dbg !134 +// CHECK:STDOUT: ret void, !dbg !135 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a"(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: define linkonce_odr void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a"(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !136 { +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !137 +// CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !137 +// CHECK:STDOUT: ret void, !dbg !138 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.40372ba0ea03ef47"(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: define linkonce_odr i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.40372ba0ea03ef47"(i32 %self) #0 !dbg !139 { +// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !144 +// CHECK:STDOUT: ret i32 %1, !dbg !145 // 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: define linkonce_odr i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self) #0 !dbg !146 { +// CHECK:STDOUT: ret i32 %self, !dbg !149 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -276,123 +282,127 @@ fn For() { // CHECK:STDOUT: !23 = !{!24} // CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !18, type: !22) // CHECK:STDOUT: !25 = !DILocation(line: 24, column: 39, scope: !18) -// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0fc9634857315db2: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.69700c1fc1b2744c: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: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.94ba1c30d421702e:core.Destroy.Core", scope: null, file: !3, line: 20, 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: 20, column: 7, scope: !26) +// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0fc9634857315db2:core.Destroy.Core", scope: null, file: !3, line: 20, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !34) // 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.278d9a31079e7ff2:core.Destroy.Core", scope: null, file: !3, line: 20, type: !31, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !38) +// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !33, type: !22) +// CHECK:STDOUT: !36 = !DILocation(line: 20, column: 7, scope: !33) +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.69700c1fc1b2744c:core.Destroy.Core", scope: null, file: !3, line: 20, type: !27, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !38) // CHECK:STDOUT: !38 = !{!39} -// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !37, type: !33) +// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !37, type: !29) // CHECK:STDOUT: !40 = !DILocation(line: 20, column: 7, scope: !37) -// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "Op", linkageName: "_COp.ab3effcb00e348a7:core.Destroy.Core", scope: null, file: !3, line: 20, type: !31, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !42) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "Op", linkageName: "_COp.278d9a31079e7ff2:core.Destroy.Core", scope: null, file: !3, line: 20, type: !27, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !42) // CHECK:STDOUT: !42 = !{!43} -// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !41, type: !33) +// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !41, type: !29) // CHECK:STDOUT: !44 = !DILocation(line: 20, column: 7, scope: !41) -// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Op", linkageName: "_COp.db43fa38232c28dd:core.Destroy.Core", scope: null, file: !3, line: 20, type: !31, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !46) +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Op", linkageName: "_COp.ab3effcb00e348a7:core.Destroy.Core", scope: null, file: !3, line: 20, type: !27, 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.0d5da2659ce22e5f:core.Destroy.Core", scope: null, file: !3, line: 20, type: !31, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !50) +// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !45, type: !29) +// CHECK:STDOUT: !48 = !DILocation(line: 20, column: 7, scope: !45) +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "Op", linkageName: "_COp.db43fa38232c28dd:core.Destroy.Core", scope: null, file: !3, line: 20, type: !27, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !50) // CHECK:STDOUT: !50 = !{!51} -// CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !49, type: !33) +// CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !49, type: !29) // 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.95ac245efc335d3f", scope: null, file: !78, line: 36, 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: 37, column: 12, scope: !77) -// CHECK:STDOUT: !84 = !DILocation(line: 37, column: 5, scope: !77) -// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.95ac245efc335d3f", scope: null, file: !78, line: 39, 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: 40, column: 12, scope: !85) -// CHECK:STDOUT: !89 = !DILocation(line: 40, column: 5, scope: !85) -// CHECK:STDOUT: !90 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !91, line: 370, 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: 372, column: 5, scope: !90) -// CHECK:STDOUT: !95 = !DILocation(line: 370, column: 3, scope: !90) -// CHECK:STDOUT: !96 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.95ac245efc335d3f", scope: null, file: !78, line: 33, 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: 34, column: 12, scope: !96) -// CHECK:STDOUT: !102 = !DILocation(line: 34, column: 5, scope: !96) -// CHECK:STDOUT: !103 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.95ac245efc335d3f", scope: null, file: !78, line: 30, type: !104, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !104 = !DISubroutineType(types: !105) -// CHECK:STDOUT: !105 = !{!33} -// CHECK:STDOUT: !106 = !DILocation(line: 31, column: 12, scope: !103) -// CHECK:STDOUT: !107 = !DILocation(line: 31, column: 5, scope: !103) -// CHECK:STDOUT: !108 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a", scope: null, file: !78, line: 141, 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: 142, column: 12, scope: !108) -// CHECK:STDOUT: !112 = !DILocation(line: 142, column: 5, scope: !108) -// CHECK:STDOUT: !113 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a", scope: null, file: !78, line: 144, 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: 145, column: 12, scope: !113) -// CHECK:STDOUT: !117 = !DILocation(line: 145, column: 5, scope: !113) -// CHECK:STDOUT: !118 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.d395a13f81aa0e29.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.44914b6ff6901661", scope: null, file: !91, line: 306, 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: 306, column: 3, scope: !118) -// CHECK:STDOUT: !126 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a", scope: null, file: !78, line: 131, 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: 137, column: 5, scope: !126) -// CHECK:STDOUT: !130 = !DILocation(line: 138, column: 5, scope: !126) -// CHECK:STDOUT: !131 = !DILocation(line: 139, column: 5, scope: !126) -// CHECK:STDOUT: !132 = distinct !DISubprogram(name: "None", linkageName: "_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a", scope: null, file: !78, line: 125, type: !104, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !133 = !DILocation(line: 128, column: 5, scope: !132) -// CHECK:STDOUT: !134 = !DILocation(line: 129, column: 5, scope: !132) -// CHECK:STDOUT: !135 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.40372ba0ea03ef47", scope: null, file: !91, line: 63, 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: 65, column: 17, scope: !135) -// CHECK:STDOUT: !141 = !DILocation(line: 65, column: 5, scope: !135) -// CHECK:STDOUT: !142 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !91, line: 58, 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: 58, column: 36, scope: !142) +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0d5da2659ce22e5f:core.Destroy.Core", scope: null, file: !3, line: 20, type: !27, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !54) +// CHECK:STDOUT: !54 = !{!55} +// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !53, type: !29) +// CHECK:STDOUT: !56 = !DILocation(line: 20, column: 18, scope: !53) +// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "NewCursor", linkageName: "_CNewCursor.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8", scope: null, file: !19, line: 25, type: !58, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !60) +// CHECK:STDOUT: !58 = !DISubroutineType(types: !59) +// CHECK:STDOUT: !59 = !{!22, !29} +// CHECK:STDOUT: !60 = !{!61} +// CHECK:STDOUT: !61 = !DILocalVariable(arg: 1, scope: !57, type: !29) +// CHECK:STDOUT: !62 = !DILocation(line: 25, column: 51, scope: !57) +// CHECK:STDOUT: !63 = !DILocation(line: 25, column: 44, scope: !57) +// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8", scope: null, file: !19, line: 26, type: !65, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !67) +// CHECK:STDOUT: !65 = !DISubroutineType(types: !66) +// CHECK:STDOUT: !66 = !{!29, !29, !29} +// CHECK:STDOUT: !67 = !{!68, !69} +// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !64, type: !29) +// CHECK:STDOUT: !69 = !DILocalVariable(arg: 2, scope: !64, type: !29) +// CHECK:STDOUT: !70 = !DILocation(line: 27, column: 7, scope: !64) +// CHECK:STDOUT: !71 = !DILocation(line: 27, column: 27, scope: !64) +// CHECK:STDOUT: !72 = !DILocation(line: 28, column: 19, scope: !64) +// CHECK:STDOUT: !73 = !DILocation(line: 28, column: 11, scope: !64) +// CHECK:STDOUT: !74 = !DILocation(line: 28, column: 10, scope: !64) +// CHECK:STDOUT: !75 = !DILocation(line: 29, column: 9, scope: !64) +// CHECK:STDOUT: !76 = !DILocation(line: 30, column: 38, scope: !64) +// CHECK:STDOUT: !77 = !DILocation(line: 30, column: 16, scope: !64) +// CHECK:STDOUT: !78 = !DILocation(line: 30, column: 9, scope: !64) +// CHECK:STDOUT: !79 = !DILocation(line: 32, column: 16, scope: !64) +// CHECK:STDOUT: !80 = !DILocation(line: 32, column: 9, scope: !64) +// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.95ac245efc335d3f", scope: null, file: !82, line: 36, type: !83, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !85) +// CHECK:STDOUT: !82 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !83 = !DISubroutineType(types: !84) +// CHECK:STDOUT: !84 = !{!29, !29} +// CHECK:STDOUT: !85 = !{!86} +// CHECK:STDOUT: !86 = !DILocalVariable(arg: 1, scope: !81, type: !29) +// CHECK:STDOUT: !87 = !DILocation(line: 37, column: 12, scope: !81) +// CHECK:STDOUT: !88 = !DILocation(line: 37, column: 5, scope: !81) +// CHECK:STDOUT: !89 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.95ac245efc335d3f", scope: null, file: !82, line: 39, type: !58, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !90) +// CHECK:STDOUT: !90 = !{!91} +// CHECK:STDOUT: !91 = !DILocalVariable(arg: 1, scope: !89, type: !29) +// CHECK:STDOUT: !92 = !DILocation(line: 40, column: 12, scope: !89) +// CHECK:STDOUT: !93 = !DILocation(line: 40, column: 5, scope: !89) +// CHECK:STDOUT: !94 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !95, line: 370, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !96) +// CHECK:STDOUT: !95 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") +// CHECK:STDOUT: !96 = !{!97} +// CHECK:STDOUT: !97 = !DILocalVariable(arg: 1, scope: !94, type: !22) +// CHECK:STDOUT: !98 = !DILocation(line: 372, column: 5, scope: !94) +// CHECK:STDOUT: !99 = !DILocation(line: 370, column: 3, scope: !94) +// CHECK:STDOUT: !100 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.95ac245efc335d3f", scope: null, file: !82, line: 33, type: !101, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !103) +// CHECK:STDOUT: !101 = !DISubroutineType(types: !102) +// CHECK:STDOUT: !102 = !{!29, !22} +// CHECK:STDOUT: !103 = !{!104} +// CHECK:STDOUT: !104 = !DILocalVariable(arg: 1, scope: !100, type: !22) +// CHECK:STDOUT: !105 = !DILocation(line: 34, column: 12, scope: !100) +// CHECK:STDOUT: !106 = !DILocation(line: 34, column: 5, scope: !100) +// CHECK:STDOUT: !107 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.95ac245efc335d3f", scope: null, file: !82, line: 30, type: !108, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !108 = !DISubroutineType(types: !109) +// CHECK:STDOUT: !109 = !{!29} +// CHECK:STDOUT: !110 = !DILocation(line: 31, column: 12, scope: !107) +// CHECK:STDOUT: !111 = !DILocation(line: 31, column: 5, scope: !107) +// CHECK:STDOUT: !112 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a", scope: null, file: !82, line: 141, type: !83, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !113) +// CHECK:STDOUT: !113 = !{!114} +// CHECK:STDOUT: !114 = !DILocalVariable(arg: 1, scope: !112, type: !29) +// CHECK:STDOUT: !115 = !DILocation(line: 142, column: 12, scope: !112) +// CHECK:STDOUT: !116 = !DILocation(line: 142, column: 5, scope: !112) +// CHECK:STDOUT: !117 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a", scope: null, file: !82, line: 144, type: !58, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !118) +// CHECK:STDOUT: !118 = !{!119} +// CHECK:STDOUT: !119 = !DILocalVariable(arg: 1, scope: !117, type: !29) +// CHECK:STDOUT: !120 = !DILocation(line: 145, column: 12, scope: !117) +// CHECK:STDOUT: !121 = !DILocation(line: 145, column: 5, scope: !117) +// CHECK:STDOUT: !122 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.d395a13f81aa0e29.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.44914b6ff6901661", scope: null, file: !95, line: 306, type: !123, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !125) +// CHECK:STDOUT: !123 = !DISubroutineType(types: !124) +// CHECK:STDOUT: !124 = !{null, !22, !22} +// CHECK:STDOUT: !125 = !{!126, !127} +// CHECK:STDOUT: !126 = !DILocalVariable(arg: 1, scope: !122, type: !22) +// CHECK:STDOUT: !127 = !DILocalVariable(arg: 2, scope: !122, type: !22) +// CHECK:STDOUT: !128 = !DILocation(line: 4294967295, scope: !122) +// CHECK:STDOUT: !129 = !DILocation(line: 306, column: 3, scope: !122) +// CHECK:STDOUT: !130 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a", scope: null, file: !82, line: 131, type: !101, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !131) +// CHECK:STDOUT: !131 = !{!132} +// CHECK:STDOUT: !132 = !DILocalVariable(arg: 1, scope: !130, type: !22) +// CHECK:STDOUT: !133 = !DILocation(line: 137, column: 5, scope: !130) +// CHECK:STDOUT: !134 = !DILocation(line: 138, column: 5, scope: !130) +// CHECK:STDOUT: !135 = !DILocation(line: 139, column: 5, scope: !130) +// CHECK:STDOUT: !136 = distinct !DISubprogram(name: "None", linkageName: "_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a", scope: null, file: !82, line: 125, type: !108, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !137 = !DILocation(line: 128, column: 5, scope: !136) +// CHECK:STDOUT: !138 = !DILocation(line: 129, column: 5, scope: !136) +// CHECK:STDOUT: !139 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.40372ba0ea03ef47", scope: null, file: !95, line: 63, type: !140, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !142) +// CHECK:STDOUT: !140 = !DISubroutineType(types: !141) +// CHECK:STDOUT: !141 = !{!22, !22} +// CHECK:STDOUT: !142 = !{!143} +// CHECK:STDOUT: !143 = !DILocalVariable(arg: 1, scope: !139, type: !22) +// CHECK:STDOUT: !144 = !DILocation(line: 65, column: 17, scope: !139) +// CHECK:STDOUT: !145 = !DILocation(line: 65, column: 5, scope: !139) +// CHECK:STDOUT: !146 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !95, line: 58, type: !140, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !147) +// CHECK:STDOUT: !147 = !{!148} +// CHECK:STDOUT: !148 = !DILocalVariable(arg: 1, scope: !146, type: !22) +// CHECK:STDOUT: !149 = !DILocation(line: 58, column: 36, scope: !146) diff --git a/toolchain/lower/testdata/for/for.carbon b/toolchain/lower/testdata/for/for.carbon index 52855f4af9d0..71f87a7127e9 100644 --- a/toolchain/lower/testdata/for/for.carbon +++ b/toolchain/lower/testdata/for/for.carbon @@ -75,157 +75,163 @@ fn For() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.0fc9634857315db2:core.Destroy.Core"(ptr %self) #0 !dbg !22 { +// CHECK:STDOUT: define weak_odr void @"_COp.94ba1c30d421702e:core.Destroy.Core"(ptr %self) #0 !dbg !22 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !25 +// CHECK:STDOUT: ret void, !dbg !28 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.69700c1fc1b2744c:core.Destroy.Core"(ptr %self) #0 !dbg !26 { +// CHECK:STDOUT: define weak_odr void @"_COp.0fc9634857315db2: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.278d9a31079e7ff2:core.Destroy.Core"(ptr %self) #0 !dbg !33 { +// CHECK:STDOUT: define weak_odr void @"_COp.69700c1fc1b2744c: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.ab3effcb00e348a7:core.Destroy.Core"(ptr %self) #0 !dbg !37 { +// CHECK:STDOUT: define weak_odr void @"_COp.278d9a31079e7ff2: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.db43fa38232c28dd:core.Destroy.Core"(ptr %self) #0 !dbg !41 { +// CHECK:STDOUT: define weak_odr void @"_COp.ab3effcb00e348a7: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 weak_odr void @"_COp.0d5da2659ce22e5f:core.Destroy.Core"(ptr %self) #0 !dbg !45 { +// CHECK:STDOUT: define weak_odr void @"_COp.db43fa38232c28dd: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 weak_odr void @"_COp.0d5da2659ce22e5f: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 !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: 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 !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: 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 !67 -// CHECK:STDOUT: %7 = load i32, ptr %1, align 4, !dbg !68 -// CHECK:STDOUT: call void @_CSome.Optional.Core.95ac245efc335d3f(ptr %return, i32 %7), !dbg !69 -// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %1), !dbg !62 -// CHECK:STDOUT: ret void, !dbg !70 +// 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.95ac245efc335d3f(ptr %return, i32 %7), !dbg !73 +// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14: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.95ac245efc335d3f(ptr %return), !dbg !71 -// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %1), !dbg !62 -// CHECK:STDOUT: ret void, !dbg !72 +// CHECK:STDOUT: call void @_CNone.Optional.Core.95ac245efc335d3f(ptr %return), !dbg !75 +// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14: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.95ac245efc335d3f(ptr %self) #0 !dbg !73 { -// CHECK:STDOUT: %1 = call i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a"(ptr %self), !dbg !79 -// CHECK:STDOUT: ret i1 %1, !dbg !80 +// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.95ac245efc335d3f(ptr %self) #0 !dbg !77 { +// CHECK:STDOUT: %1 = call i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a"(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.95ac245efc335d3f(ptr %self) #0 !dbg !81 { -// CHECK:STDOUT: %1 = call i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a"(ptr %self), !dbg !84 -// CHECK:STDOUT: ret i32 %1, !dbg !85 +// CHECK:STDOUT: define linkonce_odr i32 @_CGet.Optional.Core.95ac245efc335d3f(ptr %self) #0 !dbg !85 { +// CHECK:STDOUT: %1 = call i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a"(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 !86 { -// CHECK:STDOUT: call void @"_COp:thunk:AddAssignWith.d395a13f81aa0e29.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.44914b6ff6901661"(ptr %self, i32 1), !dbg !90 -// CHECK:STDOUT: ret void, !dbg !91 +// CHECK:STDOUT: define linkonce_odr void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !90 { +// CHECK:STDOUT: call void @"_COp:thunk:AddAssignWith.d395a13f81aa0e29.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.44914b6ff6901661"(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.Optional.Core.95ac245efc335d3f(ptr sret(<{ i32, i1 }>) %return, i32 %value) #0 !dbg !92 { -// CHECK:STDOUT: call void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a"(ptr %return, i32 %value), !dbg !97 -// CHECK:STDOUT: ret void, !dbg !98 +// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.95ac245efc335d3f(ptr sret(<{ i32, i1 }>) %return, i32 %value) #0 !dbg !96 { +// CHECK:STDOUT: call void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a"(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.Optional.Core.95ac245efc335d3f(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !99 { -// CHECK:STDOUT: call void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a"(ptr %return), !dbg !102 -// CHECK:STDOUT: ret void, !dbg !103 +// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.95ac245efc335d3f(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !103 { +// CHECK:STDOUT: call void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a"(ptr %return), !dbg !106 +// CHECK:STDOUT: ret void, !dbg !107 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a"(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: define linkonce_odr i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a"(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 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a"(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: define linkonce_odr i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a"(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:AddAssignWith.d395a13f81aa0e29.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.44914b6ff6901661"(ptr %self, i32 %other) #2 !dbg !114 { -// CHECK:STDOUT: %1 = call i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.40372ba0ea03ef47"(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: define linkonce_odr void @"_COp:thunk:AddAssignWith.d395a13f81aa0e29.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.44914b6ff6901661"(ptr %self, i32 %other) #2 !dbg !118 { +// CHECK:STDOUT: %1 = call i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.40372ba0ea03ef47"(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.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a"(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: define linkonce_odr void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a"(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.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a"(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: define linkonce_odr void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a"(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.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.40372ba0ea03ef47"(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: define linkonce_odr i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.40372ba0ea03ef47"(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 !138 { -// CHECK:STDOUT: ret i32 %self, !dbg !141 +// 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 @@ -260,123 +266,127 @@ fn For() { // CHECK:STDOUT: !19 = !{!20} // CHECK:STDOUT: !20 = !DILocalVariable(arg: 1, scope: !14, type: !18) // CHECK:STDOUT: !21 = !DILocation(line: 24, column: 39, scope: !14) -// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0fc9634857315db2: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.69700c1fc1b2744c: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: !22 = distinct !DISubprogram(name: "Op", linkageName: "_COp.94ba1c30d421702e:core.Destroy.Core", scope: null, file: !3, line: 21, type: !23, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !26) +// CHECK:STDOUT: !23 = !DISubroutineType(types: !24) +// CHECK:STDOUT: !24 = !{null, !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: 21, column: 7, scope: !22) +// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0fc9634857315db2:core.Destroy.Core", scope: null, file: !3, line: 21, type: !16, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !30) // 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.278d9a31079e7ff2:core.Destroy.Core", scope: null, file: !3, line: 21, type: !27, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !34) +// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !29, type: !18) +// CHECK:STDOUT: !32 = !DILocation(line: 21, column: 7, scope: !29) +// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "Op", linkageName: "_COp.69700c1fc1b2744c:core.Destroy.Core", scope: null, file: !3, line: 21, type: !23, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !34) // CHECK:STDOUT: !34 = !{!35} -// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !33, type: !29) +// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !33, type: !25) // CHECK:STDOUT: !36 = !DILocation(line: 21, column: 7, scope: !33) -// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.ab3effcb00e348a7:core.Destroy.Core", scope: null, file: !3, line: 21, type: !27, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !38) +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.278d9a31079e7ff2:core.Destroy.Core", scope: null, file: !3, line: 21, type: !23, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !38) // CHECK:STDOUT: !38 = !{!39} -// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !37, type: !29) +// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !37, type: !25) // CHECK:STDOUT: !40 = !DILocation(line: 21, column: 7, scope: !37) -// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "Op", linkageName: "_COp.db43fa38232c28dd:core.Destroy.Core", scope: null, file: !3, line: 21, type: !27, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !42) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "Op", linkageName: "_COp.ab3effcb00e348a7:core.Destroy.Core", scope: null, file: !3, line: 21, type: !23, 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.0d5da2659ce22e5f:core.Destroy.Core", scope: null, file: !3, line: 21, type: !27, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !46) +// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !41, type: !25) +// CHECK:STDOUT: !44 = !DILocation(line: 21, column: 7, scope: !41) +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Op", linkageName: "_COp.db43fa38232c28dd:core.Destroy.Core", scope: null, file: !3, line: 21, type: !23, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !46) // CHECK:STDOUT: !46 = !{!47} -// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !45, type: !29) +// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !45, type: !25) // 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.95ac245efc335d3f", scope: null, file: !74, line: 36, 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: 37, column: 12, scope: !73) -// CHECK:STDOUT: !80 = !DILocation(line: 37, column: 5, scope: !73) -// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.95ac245efc335d3f", scope: null, file: !74, line: 39, 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: 40, column: 12, scope: !81) -// CHECK:STDOUT: !85 = !DILocation(line: 40, column: 5, scope: !81) -// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !87, line: 370, 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: 372, column: 5, scope: !86) -// CHECK:STDOUT: !91 = !DILocation(line: 370, column: 3, scope: !86) -// CHECK:STDOUT: !92 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.95ac245efc335d3f", scope: null, file: !74, line: 33, 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: 34, column: 12, scope: !92) -// CHECK:STDOUT: !98 = !DILocation(line: 34, column: 5, scope: !92) -// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.95ac245efc335d3f", scope: null, file: !74, line: 30, type: !100, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !100 = !DISubroutineType(types: !101) -// CHECK:STDOUT: !101 = !{!29} -// 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: "Has", linkageName: "_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a", scope: null, file: !74, line: 141, 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: 142, column: 12, scope: !104) -// CHECK:STDOUT: !108 = !DILocation(line: 142, column: 5, scope: !104) -// CHECK:STDOUT: !109 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a", scope: null, file: !74, line: 144, 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: 145, column: 12, scope: !109) -// CHECK:STDOUT: !113 = !DILocation(line: 145, column: 5, scope: !109) -// CHECK:STDOUT: !114 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.d395a13f81aa0e29.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.44914b6ff6901661", scope: null, file: !87, line: 306, 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: 306, column: 3, scope: !114) -// CHECK:STDOUT: !122 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a", scope: null, file: !74, line: 131, 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: 137, column: 5, scope: !122) -// CHECK:STDOUT: !126 = !DILocation(line: 138, column: 5, scope: !122) -// CHECK:STDOUT: !127 = !DILocation(line: 139, column: 5, scope: !122) -// CHECK:STDOUT: !128 = distinct !DISubprogram(name: "None", linkageName: "_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a", scope: null, file: !74, line: 125, type: !100, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !129 = !DILocation(line: 128, column: 5, scope: !128) -// CHECK:STDOUT: !130 = !DILocation(line: 129, column: 5, scope: !128) -// CHECK:STDOUT: !131 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.40372ba0ea03ef47", scope: null, file: !87, line: 63, 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: 65, column: 17, scope: !131) -// CHECK:STDOUT: !137 = !DILocation(line: 65, column: 5, scope: !131) -// CHECK:STDOUT: !138 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !87, line: 58, 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: 58, column: 36, scope: !138) +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0d5da2659ce22e5f:core.Destroy.Core", scope: null, file: !3, line: 21, type: !23, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !50) +// CHECK:STDOUT: !50 = !{!51} +// CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !49, type: !25) +// CHECK:STDOUT: !52 = !DILocation(line: 21, column: 18, scope: !49) +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "NewCursor", linkageName: "_CNewCursor.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8", scope: null, file: !15, line: 25, type: !54, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !56) +// CHECK:STDOUT: !54 = !DISubroutineType(types: !55) +// CHECK:STDOUT: !55 = !{!18, !25} +// CHECK:STDOUT: !56 = !{!57} +// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !53, type: !25) +// 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: !15, line: 26, type: !61, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !63) +// CHECK:STDOUT: !61 = !DISubroutineType(types: !62) +// CHECK:STDOUT: !62 = !{!25, !25, !25} +// CHECK:STDOUT: !63 = !{!64, !65} +// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !60, type: !25) +// CHECK:STDOUT: !65 = !DILocalVariable(arg: 2, scope: !60, type: !25) +// 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.95ac245efc335d3f", scope: null, file: !78, line: 36, 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 = !{!25, !25} +// CHECK:STDOUT: !81 = !{!82} +// CHECK:STDOUT: !82 = !DILocalVariable(arg: 1, scope: !77, type: !25) +// CHECK:STDOUT: !83 = !DILocation(line: 37, column: 12, scope: !77) +// CHECK:STDOUT: !84 = !DILocation(line: 37, column: 5, scope: !77) +// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.95ac245efc335d3f", scope: null, file: !78, line: 39, type: !54, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !86) +// CHECK:STDOUT: !86 = !{!87} +// CHECK:STDOUT: !87 = !DILocalVariable(arg: 1, scope: !85, type: !25) +// CHECK:STDOUT: !88 = !DILocation(line: 40, column: 12, scope: !85) +// CHECK:STDOUT: !89 = !DILocation(line: 40, column: 5, scope: !85) +// CHECK:STDOUT: !90 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !91, line: 370, type: !16, 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: !18) +// CHECK:STDOUT: !94 = !DILocation(line: 372, column: 5, scope: !90) +// CHECK:STDOUT: !95 = !DILocation(line: 370, column: 3, scope: !90) +// CHECK:STDOUT: !96 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.95ac245efc335d3f", scope: null, file: !78, line: 33, type: !97, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !99) +// CHECK:STDOUT: !97 = !DISubroutineType(types: !98) +// CHECK:STDOUT: !98 = !{!25, !18} +// CHECK:STDOUT: !99 = !{!100} +// CHECK:STDOUT: !100 = !DILocalVariable(arg: 1, scope: !96, type: !18) +// CHECK:STDOUT: !101 = !DILocation(line: 34, column: 12, scope: !96) +// CHECK:STDOUT: !102 = !DILocation(line: 34, column: 5, scope: !96) +// CHECK:STDOUT: !103 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.95ac245efc335d3f", scope: null, file: !78, line: 30, type: !104, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !104 = !DISubroutineType(types: !105) +// CHECK:STDOUT: !105 = !{!25} +// CHECK:STDOUT: !106 = !DILocation(line: 31, column: 12, scope: !103) +// CHECK:STDOUT: !107 = !DILocation(line: 31, column: 5, scope: !103) +// CHECK:STDOUT: !108 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a", scope: null, file: !78, line: 141, type: !79, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !109) +// CHECK:STDOUT: !109 = !{!110} +// CHECK:STDOUT: !110 = !DILocalVariable(arg: 1, scope: !108, type: !25) +// CHECK:STDOUT: !111 = !DILocation(line: 142, column: 12, scope: !108) +// CHECK:STDOUT: !112 = !DILocation(line: 142, column: 5, scope: !108) +// CHECK:STDOUT: !113 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a", scope: null, file: !78, line: 144, type: !54, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !114) +// CHECK:STDOUT: !114 = !{!115} +// CHECK:STDOUT: !115 = !DILocalVariable(arg: 1, scope: !113, type: !25) +// CHECK:STDOUT: !116 = !DILocation(line: 145, column: 12, scope: !113) +// CHECK:STDOUT: !117 = !DILocation(line: 145, column: 5, scope: !113) +// CHECK:STDOUT: !118 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.d395a13f81aa0e29.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.44914b6ff6901661", scope: null, file: !91, line: 306, type: !119, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !121) +// CHECK:STDOUT: !119 = !DISubroutineType(types: !120) +// CHECK:STDOUT: !120 = !{null, !18, !18} +// CHECK:STDOUT: !121 = !{!122, !123} +// CHECK:STDOUT: !122 = !DILocalVariable(arg: 1, scope: !118, type: !18) +// CHECK:STDOUT: !123 = !DILocalVariable(arg: 2, scope: !118, type: !18) +// CHECK:STDOUT: !124 = !DILocation(line: 4294967295, scope: !118) +// CHECK:STDOUT: !125 = !DILocation(line: 306, column: 3, scope: !118) +// CHECK:STDOUT: !126 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a", scope: null, file: !78, line: 131, type: !97, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !127) +// CHECK:STDOUT: !127 = !{!128} +// CHECK:STDOUT: !128 = !DILocalVariable(arg: 1, scope: !126, type: !18) +// CHECK:STDOUT: !129 = !DILocation(line: 137, column: 5, scope: !126) +// CHECK:STDOUT: !130 = !DILocation(line: 138, column: 5, scope: !126) +// CHECK:STDOUT: !131 = !DILocation(line: 139, column: 5, scope: !126) +// CHECK:STDOUT: !132 = distinct !DISubprogram(name: "None", linkageName: "_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.39417379e302314a", scope: null, file: !78, line: 125, type: !104, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !133 = !DILocation(line: 128, column: 5, scope: !132) +// CHECK:STDOUT: !134 = !DILocation(line: 129, column: 5, scope: !132) +// CHECK:STDOUT: !135 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.40372ba0ea03ef47", scope: null, file: !91, line: 63, type: !136, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !138) +// CHECK:STDOUT: !136 = !DISubroutineType(types: !137) +// CHECK:STDOUT: !137 = !{!18, !18} +// CHECK:STDOUT: !138 = !{!139} +// CHECK:STDOUT: !139 = !DILocalVariable(arg: 1, scope: !135, type: !18) +// CHECK:STDOUT: !140 = !DILocation(line: 65, column: 17, scope: !135) +// CHECK:STDOUT: !141 = !DILocation(line: 65, column: 5, scope: !135) +// CHECK:STDOUT: !142 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !91, line: 58, type: !136, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !143) +// CHECK:STDOUT: !143 = !{!144} +// CHECK:STDOUT: !144 = !DILocalVariable(arg: 1, scope: !142, type: !18) +// CHECK:STDOUT: !145 = !DILocation(line: 58, column: 36, scope: !142) diff --git a/toolchain/lower/testdata/function/generic/import_unused_def.carbon b/toolchain/lower/testdata/function/generic/import_unused_def.carbon index 3de51ff73863..e0ad104546c0 100644 --- a/toolchain/lower/testdata/function/generic/import_unused_def.carbon +++ b/toolchain/lower/testdata/function/generic/import_unused_def.carbon @@ -50,11 +50,17 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.7a21de4d15dcb5df:core.Destroy.Core"(ptr %self) #0 !dbg !11 { +// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14: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: nounwind +// CHECK:STDOUT: define weak_odr void @"_COp.7a21de4d15dcb5df:core.Destroy.Core"(ptr %self) #0 !dbg !17 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !20 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} @@ -71,12 +77,16 @@ fn Main() { // 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.7a21de4d15dcb5df:core.Destroy.Core", scope: null, file: !3, line: 18, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !14) +// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14: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: !17 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7a21de4d15dcb5df:core.Destroy.Core", scope: null, file: !3, line: 18, 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: 18, column: 3, scope: !17) // CHECK:STDOUT: ; ModuleID = 'b.carbon' // CHECK:STDOUT: source_filename = "b.carbon" // CHECK:STDOUT: @@ -101,6 +111,8 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: declare i32 @"_COp.Foo.Main:Copy.Core"(i32) // CHECK:STDOUT: +// CHECK:STDOUT: declare void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr) +// CHECK:STDOUT: // CHECK:STDOUT: declare void @"_COp.7a21de4d15dcb5df:core.Destroy.Core"(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) diff --git a/toolchain/lower/testdata/interop/cpp/nullptr.carbon b/toolchain/lower/testdata/interop/cpp/nullptr.carbon index e90bfae25fca..c9a3f395846b 100644 --- a/toolchain/lower/testdata/interop/cpp/nullptr.carbon +++ b/toolchain/lower/testdata/interop/cpp/nullptr.carbon @@ -88,53 +88,71 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) { // CHECK:STDOUT: declare ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.37a0be3fec6961f4:core.Destroy.Core"(ptr %self) #0 !dbg !22 { +// CHECK:STDOUT: define weak_odr void @"_COp.fd39a15e7d61228d: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.958634845f762cfe:core.Destroy.Core"(ptr %self) #0 !dbg !29 { +// CHECK:STDOUT: define weak_odr void @"_COp.125695b29f2cf97c: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.197d85846f87d79f:core.Destroy.Core"(ptr %self) #0 !dbg !33 { +// CHECK:STDOUT: define weak_odr void @"_COp.37a0be3fec6961f4: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 ptr @_CReturnNullptr.Main() #0 !dbg !37 { +// CHECK:STDOUT: define weak_odr void @"_COp.32a070744df634d9:core.Destroy.Core"(ptr %self) #0 !dbg !37 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr poison), !dbg !40 -// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.Copy.impl.Op.call, !dbg !41 +// CHECK:STDOUT: ret void, !dbg !40 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CReturnNullptrCopy.Main() #0 !dbg !42 { +// CHECK:STDOUT: define weak_odr void @"_COp.958634845f762cfe:core.Destroy.Core"(ptr %self) #0 !dbg !41 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a.var = alloca ptr, align 8, !dbg !43 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !43 -// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call.loc22 = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr poison), !dbg !44 -// CHECK:STDOUT: store ptr %Cpp.nullptr_t.as.Copy.impl.Op.call.loc22, ptr %a.var, align 8, !dbg !43 -// CHECK:STDOUT: %.loc23 = load ptr, ptr %a.var, align 8, !dbg !45 -// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call.loc23 = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr %.loc23), !dbg !45 -// CHECK:STDOUT: call void @"_COp.37a0be3fec6961f4:core.Destroy.Core"(ptr %a.var), !dbg !43 -// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.Copy.impl.Op.call.loc23, !dbg !46 +// CHECK:STDOUT: ret void, !dbg !44 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CReturnConvertedNullptrIndirectly.Main() #0 !dbg !47 { +// CHECK:STDOUT: define weak_odr void @"_COp.197d85846f87d79f:core.Destroy.Core"(ptr %self) #0 !dbg !45 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a.var = alloca ptr, align 8, !dbg !48 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !48 -// CHECK:STDOUT: call void @_Z13ReturnNullptrv.carbon_thunk.(ptr %a.var), !dbg !49 -// CHECK:STDOUT: %.loc28_10 = load ptr, ptr %a.var, align 8, !dbg !50 -// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.269b9b75d033aabb.Core.84588f41d61dafba"(ptr %.loc28_10), !dbg !51 -// CHECK:STDOUT: call void @"_COp.37a0be3fec6961f4:core.Destroy.Core"(ptr %a.var), !dbg !48 -// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !51 +// CHECK:STDOUT: ret void, !dbg !48 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define ptr @_CReturnNullptr.Main() #0 !dbg !49 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr poison), !dbg !52 +// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.Copy.impl.Op.call, !dbg !53 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define ptr @_CReturnNullptrCopy.Main() #0 !dbg !54 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %a.var = alloca ptr, align 8, !dbg !55 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !55 +// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call.loc22 = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr poison), !dbg !56 +// CHECK:STDOUT: store ptr %Cpp.nullptr_t.as.Copy.impl.Op.call.loc22, ptr %a.var, align 8, !dbg !55 +// CHECK:STDOUT: %.loc23 = load ptr, ptr %a.var, align 8, !dbg !57 +// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call.loc23 = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr %.loc23), !dbg !57 +// CHECK:STDOUT: call void @"_COp.37a0be3fec6961f4:core.Destroy.Core"(ptr %a.var), !dbg !55 +// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.Copy.impl.Op.call.loc23, !dbg !58 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define ptr @_CReturnConvertedNullptrIndirectly.Main() #0 !dbg !59 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %a.var = alloca ptr, align 8, !dbg !60 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !60 +// CHECK:STDOUT: call void @_Z13ReturnNullptrv.carbon_thunk.(ptr %a.var), !dbg !61 +// CHECK:STDOUT: %.loc28_10 = load ptr, ptr %a.var, align 8, !dbg !62 +// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.269b9b75d033aabb.Core.84588f41d61dafba"(ptr %.loc28_10), !dbg !63 +// CHECK:STDOUT: call void @"_COp.37a0be3fec6961f4:core.Destroy.Core"(ptr %a.var), !dbg !60 +// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !63 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -144,33 +162,33 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) { // CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !19 // CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !19 // CHECK:STDOUT: %call = call ptr @_Z13ReturnNullptrv() -// CHECK:STDOUT: store ptr %call, ptr %0, align 8, !tbaa !52 +// CHECK:STDOUT: store ptr %call, ptr %0, align 8, !tbaa !64 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CReturnConvertedNullptrDirectly.Main() #0 !dbg !54 { +// CHECK:STDOUT: define ptr @_CReturnConvertedNullptrDirectly.Main() #0 !dbg !66 { // 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.269b9b75d033aabb.Core.84588f41d61dafba"(ptr %.loc32_28.4), !dbg !56 -// CHECK:STDOUT: call void @"_COp.37a0be3fec6961f4: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: %.loc32_28.1.temp = alloca ptr, align 8, !dbg !67 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc32_28.1.temp), !dbg !67 +// CHECK:STDOUT: call void @_Z13ReturnNullptrv.carbon_thunk.(ptr %.loc32_28.1.temp), !dbg !67 +// CHECK:STDOUT: %.loc32_28.4 = load ptr, ptr %.loc32_28.1.temp, align 8, !dbg !67 +// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.269b9b75d033aabb.Core.84588f41d61dafba"(ptr %.loc32_28.4), !dbg !68 +// CHECK:STDOUT: call void @"_COp.37a0be3fec6961f4:core.Destroy.Core"(ptr %.loc32_28.1.temp), !dbg !67 +// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !68 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CConvertNullptrConstant.Main() #0 !dbg !57 { +// CHECK:STDOUT: define ptr @_CConvertNullptrConstant.Main() #0 !dbg !69 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.269b9b75d033aabb.Core.84588f41d61dafba"(ptr poison), !dbg !58 -// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !58 +// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.269b9b75d033aabb.Core.84588f41d61dafba"(ptr poison), !dbg !70 +// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !70 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.269b9b75d033aabb.Core.84588f41d61dafba"(ptr %self) #0 !dbg !59 { -// CHECK:STDOUT: %1 = call ptr @_CNone.Optional.Core.a636f8d928e21310(), !dbg !65 -// CHECK:STDOUT: ret ptr %1, !dbg !66 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.269b9b75d033aabb.Core.84588f41d61dafba"(ptr %self) #0 !dbg !71 { +// CHECK:STDOUT: %1 = call ptr @_CNone.Optional.Core.a636f8d928e21310(), !dbg !77 +// CHECK:STDOUT: ret ptr %1, !dbg !78 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -179,8 +197,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.a636f8d928e21310() #0 !dbg !67 { -// CHECK:STDOUT: ret ptr null, !dbg !69 +// CHECK:STDOUT: define linkonce_odr ptr @_CNone.Optional.Core.a636f8d928e21310() #0 !dbg !79 { +// CHECK:STDOUT: ret ptr null, !dbg !81 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z11TakeNullptrDn(ptr) #1 @@ -222,51 +240,63 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) { // CHECK:STDOUT: !19 = !{!20, !20, i64 0} // CHECK:STDOUT: !20 = !{!"p1 std::nullptr_t", !21, i64 0} // CHECK:STDOUT: !21 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Op", linkageName: "_COp.37a0be3fec6961f4:core.Destroy.Core", scope: null, file: !6, line: 14, type: !23, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !26) +// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fd39a15e7d61228d:core.Destroy.Core", scope: null, file: !6, line: 14, type: !23, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !26) // CHECK:STDOUT: !23 = !DISubroutineType(types: !24) // CHECK:STDOUT: !24 = !{null, !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: 14, column: 19, scope: !22) -// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "Op", linkageName: "_COp.958634845f762cfe:core.Destroy.Core", scope: null, file: !6, line: 12, type: !23, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !30) +// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "Op", linkageName: "_COp.125695b29f2cf97c:core.Destroy.Core", scope: null, file: !6, line: 14, type: !23, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !30) // CHECK:STDOUT: !30 = !{!31} // CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !29, type: !25) -// CHECK:STDOUT: !32 = !DILocation(line: 12, column: 15, scope: !29) -// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "Op", linkageName: "_COp.197d85846f87d79f:core.Destroy.Core", scope: null, file: !6, line: 12, type: !23, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !34) +// CHECK:STDOUT: !32 = !DILocation(line: 14, column: 19, scope: !29) +// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "Op", linkageName: "_COp.37a0be3fec6961f4:core.Destroy.Core", scope: null, file: !6, line: 14, type: !23, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !34) // CHECK:STDOUT: !34 = !{!35} // CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !33, type: !25) -// CHECK:STDOUT: !36 = !DILocation(line: 12, column: 15, scope: !33) -// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "ReturnNullptr", linkageName: "_CReturnNullptr.Main", scope: null, file: !6, line: 17, type: !38, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !38 = !DISubroutineType(types: !39) -// CHECK:STDOUT: !39 = !{!25} -// CHECK:STDOUT: !40 = !DILocation(line: 18, column: 10, scope: !37) -// CHECK:STDOUT: !41 = !DILocation(line: 18, column: 3, scope: !37) -// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "ReturnNullptrCopy", linkageName: "_CReturnNullptrCopy.Main", scope: null, file: !6, line: 21, type: !38, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !43 = !DILocation(line: 22, column: 3, scope: !42) -// CHECK:STDOUT: !44 = !DILocation(line: 22, column: 26, scope: !42) -// CHECK:STDOUT: !45 = !DILocation(line: 23, column: 10, scope: !42) -// CHECK:STDOUT: !46 = !DILocation(line: 23, column: 3, scope: !42) -// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "ReturnConvertedNullptrIndirectly", linkageName: "_CReturnConvertedNullptrIndirectly.Main", scope: null, file: !6, line: 26, type: !38, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !48 = !DILocation(line: 27, column: 3, scope: !47) -// CHECK:STDOUT: !49 = !DILocation(line: 27, column: 26, scope: !47) -// CHECK:STDOUT: !50 = !DILocation(line: 28, column: 10, scope: !47) -// CHECK:STDOUT: !51 = !DILocation(line: 28, column: 3, scope: !47) -// CHECK:STDOUT: !52 = !{!53, !53, i64 0} -// CHECK:STDOUT: !53 = !{!"std::nullptr_t", !9, i64 0} -// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "ReturnConvertedNullptrDirectly", linkageName: "_CReturnConvertedNullptrDirectly.Main", scope: null, file: !6, line: 31, type: !38, 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: !38, 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.269b9b75d033aabb.Core.84588f41d61dafba", 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 = !{!25, !25} -// CHECK:STDOUT: !63 = !{!64} -// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !59, type: !25) -// 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.a636f8d928e21310", scope: null, file: !68, line: 30, type: !38, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !68 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !69 = !DILocation(line: 31, column: 5, scope: !67) +// CHECK:STDOUT: !36 = !DILocation(line: 14, column: 19, scope: !33) +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.32a070744df634d9:core.Destroy.Core", scope: null, file: !6, line: 12, type: !23, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !38) +// CHECK:STDOUT: !38 = !{!39} +// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !37, type: !25) +// CHECK:STDOUT: !40 = !DILocation(line: 12, column: 15, scope: !37) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "Op", linkageName: "_COp.958634845f762cfe:core.Destroy.Core", scope: null, file: !6, line: 12, type: !23, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !42) +// CHECK:STDOUT: !42 = !{!43} +// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !41, type: !25) +// CHECK:STDOUT: !44 = !DILocation(line: 12, column: 15, scope: !41) +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Op", linkageName: "_COp.197d85846f87d79f:core.Destroy.Core", scope: null, file: !6, line: 12, type: !23, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !46) +// CHECK:STDOUT: !46 = !{!47} +// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !45, type: !25) +// CHECK:STDOUT: !48 = !DILocation(line: 12, column: 15, scope: !45) +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "ReturnNullptr", linkageName: "_CReturnNullptr.Main", scope: null, file: !6, line: 17, type: !50, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !50 = !DISubroutineType(types: !51) +// CHECK:STDOUT: !51 = !{!25} +// CHECK:STDOUT: !52 = !DILocation(line: 18, column: 10, scope: !49) +// CHECK:STDOUT: !53 = !DILocation(line: 18, column: 3, scope: !49) +// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "ReturnNullptrCopy", linkageName: "_CReturnNullptrCopy.Main", scope: null, file: !6, line: 21, type: !50, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !55 = !DILocation(line: 22, column: 3, scope: !54) +// CHECK:STDOUT: !56 = !DILocation(line: 22, column: 26, scope: !54) +// CHECK:STDOUT: !57 = !DILocation(line: 23, column: 10, scope: !54) +// CHECK:STDOUT: !58 = !DILocation(line: 23, column: 3, scope: !54) +// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "ReturnConvertedNullptrIndirectly", linkageName: "_CReturnConvertedNullptrIndirectly.Main", scope: null, file: !6, line: 26, type: !50, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !60 = !DILocation(line: 27, column: 3, scope: !59) +// CHECK:STDOUT: !61 = !DILocation(line: 27, column: 26, scope: !59) +// CHECK:STDOUT: !62 = !DILocation(line: 28, column: 10, scope: !59) +// CHECK:STDOUT: !63 = !DILocation(line: 28, column: 3, scope: !59) +// CHECK:STDOUT: !64 = !{!65, !65, i64 0} +// CHECK:STDOUT: !65 = !{!"std::nullptr_t", !9, i64 0} +// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "ReturnConvertedNullptrDirectly", linkageName: "_CReturnConvertedNullptrDirectly.Main", scope: null, file: !6, line: 31, type: !50, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !67 = !DILocation(line: 32, column: 10, scope: !66) +// CHECK:STDOUT: !68 = !DILocation(line: 32, column: 3, scope: !66) +// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "ConvertNullptrConstant", linkageName: "_CConvertNullptrConstant.Main", scope: null, file: !6, line: 35, type: !50, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !70 = !DILocation(line: 36, column: 3, scope: !69) +// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.NullptrT.CppCompat.Core:ImplicitAs.269b9b75d033aabb.Core.84588f41d61dafba", scope: null, file: !72, line: 51, type: !73, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !75) +// CHECK:STDOUT: !72 = !DIFile(filename: "{{.*}}/prelude/types/cpp/nullptr.carbon", directory: "") +// CHECK:STDOUT: !73 = !DISubroutineType(types: !74) +// CHECK:STDOUT: !74 = !{!25, !25} +// CHECK:STDOUT: !75 = !{!76} +// CHECK:STDOUT: !76 = !DILocalVariable(arg: 1, scope: !71, type: !25) +// CHECK:STDOUT: !77 = !DILocation(line: 52, column: 14, scope: !71) +// CHECK:STDOUT: !78 = !DILocation(line: 52, column: 7, scope: !71) +// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.a636f8d928e21310", scope: null, file: !80, line: 30, type: !50, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !80 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !81 = !DILocation(line: 31, column: 5, scope: !79) diff --git a/toolchain/lower/testdata/interop/cpp/pointer.carbon b/toolchain/lower/testdata/interop/cpp/pointer.carbon index 8ef1c744c540..fa6543715a69 100644 --- a/toolchain/lower/testdata/interop/cpp/pointer.carbon +++ b/toolchain/lower/testdata/interop/cpp/pointer.carbon @@ -230,60 +230,66 @@ fn Convert() { // CHECK:STDOUT: declare void @_Z7TakePtrP1C(ptr noundef) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.0eaa291c18f0461d:core.Destroy.Core"(ptr %self) #0 !dbg !24 { +// CHECK:STDOUT: define weak_odr void @"_COp.b66d38b36d1f26ac: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 weak_odr void @"_COp.f38d07f92d84f295:core.Destroy.Core"(ptr %self) #0 !dbg !28 { +// CHECK:STDOUT: define weak_odr void @"_COp.0eaa291c18f0461d: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: nounwind -// CHECK:STDOUT: define ptr @_CReturnPtr.Main() #0 !dbg !32 { +// CHECK:STDOUT: define weak_odr void @"_COp.f38d07f92d84f295:core.Destroy.Core"(ptr %self) #0 !dbg !32 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %ReturnPtr.call = call ptr @_Z9ReturnPtrv(), !dbg !35 -// CHECK:STDOUT: ret ptr %ReturnPtr.call, !dbg !36 +// CHECK:STDOUT: ret void, !dbg !35 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define ptr @_CReturnPtr.Main() #0 !dbg !36 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %ReturnPtr.call = call ptr @_Z9ReturnPtrv(), !dbg !39 +// CHECK:STDOUT: ret ptr %ReturnPtr.call, !dbg !40 // 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 %_) #0 !dbg !37 { +// CHECK:STDOUT: define void @_CPassPtrWithThunk.Main(ptr %_) #0 !dbg !41 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !40 +// CHECK:STDOUT: ret void, !dbg !44 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassNonnullPtrWithThunk.Main(ptr %p) #0 !dbg !41 { +// CHECK:STDOUT: define void @_CPassNonnullPtrWithThunk.Main(ptr %p) #0 !dbg !45 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc35_24.2.temp = alloca ptr, align 8, !dbg !44 -// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.0df7ee04ac3e2bca"(ptr %p), !dbg !44 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc35_24.2.temp), !dbg !44 -// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc35_24.2.temp, align 8, !dbg !44 -// CHECK:STDOUT: %.loc35_24.4 = load ptr, ptr %.loc35_24.2.temp, align 8, !dbg !44 -// CHECK:STDOUT: call void @_Z16TakePtrWithThunkP1Ci.carbon_thunk._(ptr %.loc35_24.4), !dbg !45 -// CHECK:STDOUT: call void @"_COp.f38d07f92d84f295:core.Destroy.Core"(ptr %.loc35_24.2.temp), !dbg !44 -// CHECK:STDOUT: ret void, !dbg !46 +// CHECK:STDOUT: %.loc35_24.2.temp = alloca ptr, align 8, !dbg !48 +// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.0df7ee04ac3e2bca"(ptr %p), !dbg !48 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc35_24.2.temp), !dbg !48 +// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc35_24.2.temp, align 8, !dbg !48 +// CHECK:STDOUT: %.loc35_24.4 = load ptr, ptr %.loc35_24.2.temp, align 8, !dbg !48 +// CHECK:STDOUT: call void @_Z16TakePtrWithThunkP1Ci.carbon_thunk._(ptr %.loc35_24.4), !dbg !49 +// CHECK:STDOUT: call void @"_COp.f38d07f92d84f295:core.Destroy.Core"(ptr %.loc35_24.2.temp), !dbg !48 +// CHECK:STDOUT: ret void, !dbg !50 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_Z16TakePtrWithThunkP1Ci.carbon_thunk._(ptr noundef %0) #2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !47 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !47 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !51 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !51 // CHECK:STDOUT: call void @_Z16TakePtrWithThunkP1Ci(ptr noundef %1, i32 noundef 0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CReturnPtrWithThunk.Main() #0 !dbg !50 { +// CHECK:STDOUT: define ptr @_CReturnPtrWithThunk.Main() #0 !dbg !54 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %ReturnPtrWithThunk__carbon_thunk.call = call ptr @_Z18ReturnPtrWithThunki.carbon_thunk.(), !dbg !51 -// CHECK:STDOUT: ret ptr %ReturnPtrWithThunk__carbon_thunk.call, !dbg !52 +// CHECK:STDOUT: %ReturnPtrWithThunk__carbon_thunk.call = call ptr @_Z18ReturnPtrWithThunki.carbon_thunk.(), !dbg !55 +// CHECK:STDOUT: ret ptr %ReturnPtrWithThunk__carbon_thunk.call, !dbg !56 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -294,35 +300,35 @@ fn Convert() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.0df7ee04ac3e2bca"(ptr %self) #0 !dbg !53 { -// CHECK:STDOUT: %1 = call ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.ce205433e72b0023"(ptr %self), !dbg !59 -// CHECK:STDOUT: ret ptr %1, !dbg !60 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.0df7ee04ac3e2bca"(ptr %self) #0 !dbg !57 { +// CHECK:STDOUT: %1 = call ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.ce205433e72b0023"(ptr %self), !dbg !63 +// CHECK:STDOUT: ret ptr %1, !dbg !64 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #3 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.ce205433e72b0023"(ptr %self) #0 !dbg !61 { -// CHECK:STDOUT: %1 = call ptr @_CSome.Optional.Core.ce205433e72b0023(ptr %self), !dbg !64 -// CHECK:STDOUT: ret ptr %1, !dbg !65 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.ce205433e72b0023"(ptr %self) #0 !dbg !65 { +// CHECK:STDOUT: %1 = call ptr @_CSome.Optional.Core.ce205433e72b0023(ptr %self), !dbg !68 +// CHECK:STDOUT: ret ptr %1, !dbg !69 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.ce205433e72b0023(ptr %value) #0 !dbg !66 { -// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e"(ptr %value), !dbg !69 -// CHECK:STDOUT: ret ptr %1, !dbg !70 +// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.ce205433e72b0023(ptr %value) #0 !dbg !70 { +// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e"(ptr %value), !dbg !73 +// CHECK:STDOUT: ret ptr %1, !dbg !74 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e"(ptr %self) #0 !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.0eaa291c18f0461d:core.Destroy.Core"(ptr %1), !dbg !74 -// CHECK:STDOUT: ret ptr %2, !dbg !77 +// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e"(ptr %self) #0 !dbg !75 { +// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !78 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !78 +// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !78 +// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !79 +// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !80 +// CHECK:STDOUT: call void @"_COp.0eaa291c18f0461d:core.Destroy.Core"(ptr %1), !dbg !78 +// CHECK:STDOUT: ret ptr %2, !dbg !81 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z16TakePtrWithThunkP1Ci(ptr noundef, i32 noundef) #1 @@ -366,60 +372,64 @@ fn Convert() { // CHECK:STDOUT: !21 = !DILocation(line: 22, column: 15, scope: !18) // CHECK:STDOUT: !22 = !DILocation(line: 22, column: 3, scope: !18) // CHECK:STDOUT: !23 = !DILocation(line: 19, column: 1, scope: !18) -// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0eaa291c18f0461d:core.Destroy.Core", scope: null, file: !6, line: 22, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !25) +// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b66d38b36d1f26ac:core.Destroy.Core", scope: null, file: !6, line: 22, 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: 22, column: 15, scope: !24) -// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f38d07f92d84f295:core.Destroy.Core", scope: null, file: !6, line: 22, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !29) +// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0eaa291c18f0461d:core.Destroy.Core", scope: null, file: !6, line: 22, 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: 22, column: 15, scope: !28) -// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "ReturnPtr", linkageName: "_CReturnPtr.Main", scope: null, file: !6, line: 25, type: !33, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !33 = !DISubroutineType(types: !34) -// CHECK:STDOUT: !34 = !{!14} -// CHECK:STDOUT: !35 = !DILocation(line: 26, column: 10, scope: !32) -// CHECK:STDOUT: !36 = !DILocation(line: 26, column: 3, scope: !32) -// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "PassPtrWithThunk", linkageName: "_CPassPtrWithThunk.Main", scope: null, file: !6, line: 29, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !38) -// CHECK:STDOUT: !38 = !{!39} -// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !37, type: !14) -// CHECK:STDOUT: !40 = !DILocation(line: 29, column: 1, scope: !37) -// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "PassNonnullPtrWithThunk", linkageName: "_CPassNonnullPtrWithThunk.Main", scope: null, file: !6, line: 34, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !42) +// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f38d07f92d84f295:core.Destroy.Core", scope: null, file: !6, line: 22, 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: 22, column: 15, scope: !32) +// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "ReturnPtr", linkageName: "_CReturnPtr.Main", scope: null, file: !6, line: 25, type: !37, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !37 = !DISubroutineType(types: !38) +// CHECK:STDOUT: !38 = !{!14} +// CHECK:STDOUT: !39 = !DILocation(line: 26, column: 10, scope: !36) +// CHECK:STDOUT: !40 = !DILocation(line: 26, column: 3, scope: !36) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "PassPtrWithThunk", linkageName: "_CPassPtrWithThunk.Main", scope: null, file: !6, line: 29, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !42) // CHECK:STDOUT: !42 = !{!43} // CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !41, type: !14) -// CHECK:STDOUT: !44 = !DILocation(line: 35, column: 24, scope: !41) -// CHECK:STDOUT: !45 = !DILocation(line: 35, column: 3, scope: !41) -// CHECK:STDOUT: !46 = !DILocation(line: 34, column: 1, scope: !41) -// CHECK:STDOUT: !47 = !{!48, !48, i64 0} -// CHECK:STDOUT: !48 = !{!"p1 _ZTS1C", !49, i64 0} -// CHECK:STDOUT: !49 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "ReturnPtrWithThunk", linkageName: "_CReturnPtrWithThunk.Main", scope: null, file: !6, line: 38, type: !33, 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.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.0df7ee04ac3e2bca", scope: null, file: !54, line: 105, 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 = !{!14, !14} -// CHECK:STDOUT: !57 = !{!58} -// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !53, type: !14) -// CHECK:STDOUT: !59 = !DILocation(line: 106, column: 12, scope: !53) -// CHECK:STDOUT: !60 = !DILocation(line: 106, column: 5, scope: !53) -// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.ce205433e72b0023", scope: null, file: !54, line: 80, type: !55, 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: 81, column: 12, scope: !61) -// CHECK:STDOUT: !65 = !DILocation(line: 81, column: 5, scope: !61) -// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.ce205433e72b0023", scope: null, file: !54, line: 33, type: !55, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !67) -// CHECK:STDOUT: !67 = !{!68} -// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !66, type: !14) -// CHECK:STDOUT: !69 = !DILocation(line: 34, column: 12, scope: !66) -// CHECK:STDOUT: !70 = !DILocation(line: 34, column: 5, scope: !66) -// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e", scope: null, file: !54, line: 166, type: !55, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !72) -// CHECK:STDOUT: !72 = !{!73} -// CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !71, type: !14) -// CHECK:STDOUT: !74 = !DILocation(line: 167, column: 14, scope: !71) -// CHECK:STDOUT: !75 = !DILocation(line: 169, column: 5, scope: !71) -// CHECK:STDOUT: !76 = !DILocation(line: 167, column: 18, scope: !71) -// CHECK:STDOUT: !77 = !DILocation(line: 170, column: 5, scope: !71) +// CHECK:STDOUT: !44 = !DILocation(line: 29, column: 1, scope: !41) +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "PassNonnullPtrWithThunk", linkageName: "_CPassNonnullPtrWithThunk.Main", scope: null, file: !6, line: 34, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !46) +// CHECK:STDOUT: !46 = !{!47} +// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !45, type: !14) +// CHECK:STDOUT: !48 = !DILocation(line: 35, column: 24, scope: !45) +// CHECK:STDOUT: !49 = !DILocation(line: 35, column: 3, scope: !45) +// CHECK:STDOUT: !50 = !DILocation(line: 34, column: 1, scope: !45) +// CHECK:STDOUT: !51 = !{!52, !52, i64 0} +// CHECK:STDOUT: !52 = !{!"p1 _ZTS1C", !53, i64 0} +// CHECK:STDOUT: !53 = !{!"any pointer", !9, i64 0} +// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "ReturnPtrWithThunk", linkageName: "_CReturnPtrWithThunk.Main", scope: null, file: !6, line: 38, type: !37, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !55 = !DILocation(line: 39, column: 10, scope: !54) +// CHECK:STDOUT: !56 = !DILocation(line: 39, column: 3, scope: !54) +// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.0df7ee04ac3e2bca", scope: null, file: !58, line: 105, type: !59, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !61) +// CHECK:STDOUT: !58 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !59 = !DISubroutineType(types: !60) +// CHECK:STDOUT: !60 = !{!14, !14} +// CHECK:STDOUT: !61 = !{!62} +// CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !57, type: !14) +// CHECK:STDOUT: !63 = !DILocation(line: 106, column: 12, scope: !57) +// CHECK:STDOUT: !64 = !DILocation(line: 106, column: 5, scope: !57) +// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.ce205433e72b0023", scope: null, file: !58, line: 80, type: !59, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !66) +// CHECK:STDOUT: !66 = !{!67} +// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !65, type: !14) +// CHECK:STDOUT: !68 = !DILocation(line: 81, column: 12, scope: !65) +// CHECK:STDOUT: !69 = !DILocation(line: 81, column: 5, scope: !65) +// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.ce205433e72b0023", scope: null, file: !58, line: 33, type: !59, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !71) +// CHECK:STDOUT: !71 = !{!72} +// CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !70, type: !14) +// CHECK:STDOUT: !73 = !DILocation(line: 34, column: 12, scope: !70) +// CHECK:STDOUT: !74 = !DILocation(line: 34, column: 5, scope: !70) +// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e", scope: null, file: !58, line: 166, type: !59, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !76) +// CHECK:STDOUT: !76 = !{!77} +// CHECK:STDOUT: !77 = !DILocalVariable(arg: 1, scope: !75, type: !14) +// CHECK:STDOUT: !78 = !DILocation(line: 167, column: 14, scope: !75) +// CHECK:STDOUT: !79 = !DILocation(line: 169, column: 5, scope: !75) +// CHECK:STDOUT: !80 = !DILocation(line: 167, column: 18, scope: !75) +// CHECK:STDOUT: !81 = !DILocation(line: 170, column: 5, scope: !75) // CHECK:STDOUT: ; ModuleID = 'add_const.carbon' // CHECK:STDOUT: source_filename = "add_const.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" @@ -449,105 +459,117 @@ fn Convert() { // CHECK:STDOUT: declare void @_Z4takePK1C(ptr noundef) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.95d54adfec6e2c8e:core.Destroy.Core"(ptr %self) #0 !dbg !17 { +// CHECK:STDOUT: define weak_odr void @"_COp.4a199b7f45343bf7:core.Destroy.Core"(ptr %self) #0 !dbg !17 { // 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.4713799e8769f265:core.Destroy.Core"(ptr %self) #0 !dbg !24 { +// CHECK:STDOUT: define weak_odr void @"_COp.95d54adfec6e2c8e: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 weak_odr void @"_COp.0eaa291c18f0461d:core.Destroy.Core"(ptr %self) #0 !dbg !28 { +// CHECK:STDOUT: define weak_odr void @"_COp.4713799e8769f265: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: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.2b115399396a8344:core.Destroy.Core"(ptr %self) #0 !dbg !32 { +// CHECK:STDOUT: define weak_odr void @"_COp.b66d38b36d1f26ac: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.0eaa291c18f0461d: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.2b115399396a8344: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 nosync nounwind willreturn memory(argmem: readwrite) // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.26284956f90c5004"(ptr %self) #0 !dbg !36 { -// CHECK:STDOUT: %1 = call ptr @"_CConvert.Optional.c661605f12aa337a.Core:OptionalAs.1dac4564233fecd1.Core.ba0bf13f1b5bc657"(ptr %self), !dbg !42 -// CHECK:STDOUT: ret ptr %1, !dbg !43 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.26284956f90c5004"(ptr %self) #0 !dbg !44 { +// CHECK:STDOUT: %1 = call ptr @"_CConvert.Optional.c661605f12aa337a.Core:OptionalAs.1dac4564233fecd1.Core.ba0bf13f1b5bc657"(ptr %self), !dbg !50 +// CHECK:STDOUT: ret ptr %1, !dbg !51 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.Optional.c661605f12aa337a.Core:OptionalAs.1dac4564233fecd1.Core.ba0bf13f1b5bc657"(ptr %self) #0 !dbg !44 { -// CHECK:STDOUT: %temp = alloca ptr, align 8, !dbg !47 -// CHECK:STDOUT: %temp1 = alloca ptr, align 8, !dbg !47 -// CHECK:STDOUT: %1 = call i1 @_CHasValue.Optional.Core.0d555305d9583d05(ptr %self), !dbg !48 -// CHECK:STDOUT: br i1 %1, label %2, label %7, !dbg !49 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.Optional.c661605f12aa337a.Core:OptionalAs.1dac4564233fecd1.Core.ba0bf13f1b5bc657"(ptr %self) #0 !dbg !52 { +// CHECK:STDOUT: %temp = alloca ptr, align 8, !dbg !55 +// CHECK:STDOUT: %temp1 = alloca ptr, align 8, !dbg !55 +// CHECK:STDOUT: %1 = call i1 @_CHasValue.Optional.Core.0d555305d9583d05(ptr %self), !dbg !56 +// CHECK:STDOUT: br i1 %1, label %2, label %7, !dbg !57 // CHECK:STDOUT: // CHECK:STDOUT: 2: ; preds = %0 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !47 -// CHECK:STDOUT: %3 = call ptr @_CGet.Optional.Core.0d555305d9583d05(ptr %self), !dbg !47 -// CHECK:STDOUT: store ptr %3, ptr %temp, align 8, !dbg !47 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp1), !dbg !47 -// CHECK:STDOUT: %4 = load ptr, ptr %temp, align 8, !dbg !47 -// CHECK:STDOUT: store ptr %4, ptr %temp1, align 8, !dbg !47 -// CHECK:STDOUT: %5 = load ptr, ptr %temp1, align 8, !dbg !47 -// CHECK:STDOUT: %6 = call ptr @_CSome.Optional.Core.deb37f08ddf50b30(ptr %5), !dbg !50 -// CHECK:STDOUT: ret ptr %6, !dbg !51 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !55 +// CHECK:STDOUT: %3 = call ptr @_CGet.Optional.Core.0d555305d9583d05(ptr %self), !dbg !55 +// CHECK:STDOUT: store ptr %3, ptr %temp, align 8, !dbg !55 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp1), !dbg !55 +// CHECK:STDOUT: %4 = load ptr, ptr %temp, align 8, !dbg !55 +// CHECK:STDOUT: store ptr %4, ptr %temp1, align 8, !dbg !55 +// CHECK:STDOUT: %5 = load ptr, ptr %temp1, align 8, !dbg !55 +// CHECK:STDOUT: %6 = call ptr @_CSome.Optional.Core.deb37f08ddf50b30(ptr %5), !dbg !58 +// CHECK:STDOUT: ret ptr %6, !dbg !59 // CHECK:STDOUT: // CHECK:STDOUT: 7: ; preds = %0 -// CHECK:STDOUT: %8 = call ptr @_CNone.Optional.Core.deb37f08ddf50b30(), !dbg !52 -// CHECK:STDOUT: ret ptr %8, !dbg !53 +// CHECK:STDOUT: %8 = call ptr @_CNone.Optional.Core.deb37f08ddf50b30(), !dbg !60 +// CHECK:STDOUT: ret ptr %8, !dbg !61 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.0d555305d9583d05(ptr %self) #0 !dbg !54 { -// CHECK:STDOUT: %1 = call i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e"(ptr %self), !dbg !57 -// CHECK:STDOUT: ret i1 %1, !dbg !58 +// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.0d555305d9583d05(ptr %self) #0 !dbg !62 { +// CHECK:STDOUT: %1 = call i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e"(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 ptr @_CGet.Optional.Core.0d555305d9583d05(ptr %self) #0 !dbg !59 { -// CHECK:STDOUT: %1 = call ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e"(ptr %self), !dbg !62 -// CHECK:STDOUT: ret ptr %1, !dbg !63 +// CHECK:STDOUT: define linkonce_odr ptr @_CGet.Optional.Core.0d555305d9583d05(ptr %self) #0 !dbg !67 { +// CHECK:STDOUT: %1 = call ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e"(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 @_CSome.Optional.Core.deb37f08ddf50b30(ptr %value) #0 !dbg !64 { -// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8753681fdb639539"(ptr %value), !dbg !67 -// CHECK:STDOUT: ret ptr %1, !dbg !68 +// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.deb37f08ddf50b30(ptr %value) #0 !dbg !72 { +// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8753681fdb639539"(ptr %value), !dbg !75 +// CHECK:STDOUT: ret ptr %1, !dbg !76 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CNone.Optional.Core.deb37f08ddf50b30() #0 !dbg !69 { -// CHECK:STDOUT: ret ptr null, !dbg !72 +// CHECK:STDOUT: define linkonce_odr ptr @_CNone.Optional.Core.deb37f08ddf50b30() #0 !dbg !77 { +// CHECK:STDOUT: ret ptr null, !dbg !80 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e"(ptr %value) #0 !dbg !73 { -// CHECK:STDOUT: %1 = icmp eq ptr %value, null, !dbg !76 -// CHECK:STDOUT: %2 = xor i1 %1, true, !dbg !77 -// CHECK:STDOUT: ret i1 %2, !dbg !78 +// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e"(ptr %value) #0 !dbg !81 { +// CHECK:STDOUT: %1 = icmp eq ptr %value, null, !dbg !84 +// CHECK:STDOUT: %2 = xor i1 %1, true, !dbg !85 +// CHECK:STDOUT: ret i1 %2, !dbg !86 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e"(ptr %value) #0 !dbg !79 { -// CHECK:STDOUT: ret ptr %value, !dbg !82 +// CHECK:STDOUT: define linkonce_odr ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e"(ptr %value) #0 !dbg !87 { +// CHECK:STDOUT: ret ptr %value, !dbg !90 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8753681fdb639539"(ptr %self) #0 !dbg !83 { -// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !86 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !86 -// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !86 -// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !87 -// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !88 -// CHECK:STDOUT: call void @"_COp.95d54adfec6e2c8e:core.Destroy.Core"(ptr %1), !dbg !86 -// CHECK:STDOUT: ret ptr %2, !dbg !89 +// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8753681fdb639539"(ptr %self) #0 !dbg !91 { +// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !94 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !94 +// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !94 +// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !95 +// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !96 +// CHECK:STDOUT: call void @"_COp.95d54adfec6e2c8e:core.Destroy.Core"(ptr %1), !dbg !94 +// CHECK:STDOUT: ret ptr %2, !dbg !97 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -578,76 +600,84 @@ fn Convert() { // CHECK:STDOUT: !14 = !DILocation(line: 9, column: 12, scope: !11) // CHECK:STDOUT: !15 = !DILocation(line: 9, column: 3, scope: !11) // CHECK:STDOUT: !16 = !DILocation(line: 8, column: 1, scope: !11) -// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "Op", linkageName: "_COp.95d54adfec6e2c8e:core.Destroy.Core", scope: null, file: !6, line: 9, type: !18, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !21) +// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "Op", linkageName: "_COp.4a199b7f45343bf7:core.Destroy.Core", scope: null, file: !6, line: 9, type: !18, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !21) // CHECK:STDOUT: !18 = !DISubroutineType(types: !19) // CHECK:STDOUT: !19 = !{null, !20} // CHECK:STDOUT: !20 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !21 = !{!22} // CHECK:STDOUT: !22 = !DILocalVariable(arg: 1, scope: !17, type: !20) // CHECK:STDOUT: !23 = !DILocation(line: 9, column: 12, scope: !17) -// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "Op", linkageName: "_COp.4713799e8769f265:core.Destroy.Core", scope: null, file: !6, line: 9, type: !18, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !25) +// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "Op", linkageName: "_COp.95d54adfec6e2c8e:core.Destroy.Core", scope: null, file: !6, line: 9, type: !18, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !25) // CHECK:STDOUT: !25 = !{!26} // CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !24, type: !20) // CHECK:STDOUT: !27 = !DILocation(line: 9, column: 12, scope: !24) -// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0eaa291c18f0461d:core.Destroy.Core", scope: null, file: !6, line: 9, type: !18, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !29) +// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "Op", linkageName: "_COp.4713799e8769f265:core.Destroy.Core", scope: null, file: !6, line: 9, type: !18, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !29) // CHECK:STDOUT: !29 = !{!30} // CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !28, type: !20) // CHECK:STDOUT: !31 = !DILocation(line: 9, column: 12, scope: !28) -// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "Op", linkageName: "_COp.2b115399396a8344:core.Destroy.Core", scope: null, file: !6, line: 9, type: !18, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !33) +// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b66d38b36d1f26ac:core.Destroy.Core", scope: null, file: !6, line: 9, type: !18, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !33) // CHECK:STDOUT: !33 = !{!34} // CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !32, type: !20) // CHECK:STDOUT: !35 = !DILocation(line: 9, column: 12, scope: !32) -// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.26284956f90c5004", scope: null, file: !37, line: 105, type: !38, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !40) -// CHECK:STDOUT: !37 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !38 = !DISubroutineType(types: !39) -// CHECK:STDOUT: !39 = !{!20, !20} -// CHECK:STDOUT: !40 = !{!41} -// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !36, type: !20) -// CHECK:STDOUT: !42 = !DILocation(line: 106, column: 12, scope: !36) -// CHECK:STDOUT: !43 = !DILocation(line: 106, column: 5, scope: !36) -// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Optional.c661605f12aa337a.Core:OptionalAs.1dac4564233fecd1.Core.ba0bf13f1b5bc657", scope: null, file: !37, line: 95, type: !38, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !45) -// CHECK:STDOUT: !45 = !{!46} -// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !44, type: !20) -// CHECK:STDOUT: !47 = !DILocation(line: 97, column: 31, scope: !44) -// CHECK:STDOUT: !48 = !DILocation(line: 96, column: 9, scope: !44) -// CHECK:STDOUT: !49 = !DILocation(line: 96, column: 8, scope: !44) -// CHECK:STDOUT: !50 = !DILocation(line: 97, column: 14, scope: !44) -// CHECK:STDOUT: !51 = !DILocation(line: 97, column: 7, scope: !44) -// CHECK:STDOUT: !52 = !DILocation(line: 99, column: 12, scope: !44) -// CHECK:STDOUT: !53 = !DILocation(line: 99, column: 5, scope: !44) -// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.0d555305d9583d05", scope: null, file: !37, line: 36, type: !38, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !55) -// CHECK:STDOUT: !55 = !{!56} -// CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !54, type: !20) -// CHECK:STDOUT: !57 = !DILocation(line: 37, column: 12, scope: !54) -// CHECK:STDOUT: !58 = !DILocation(line: 37, column: 5, scope: !54) -// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.0d555305d9583d05", scope: null, file: !37, line: 39, type: !38, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !60) -// CHECK:STDOUT: !60 = !{!61} -// CHECK:STDOUT: !61 = !DILocalVariable(arg: 1, scope: !59, type: !20) -// CHECK:STDOUT: !62 = !DILocation(line: 40, column: 12, scope: !59) -// CHECK:STDOUT: !63 = !DILocation(line: 40, column: 5, scope: !59) -// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.deb37f08ddf50b30", scope: null, file: !37, line: 33, type: !38, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !65) -// CHECK:STDOUT: !65 = !{!66} -// CHECK:STDOUT: !66 = !DILocalVariable(arg: 1, scope: !64, type: !20) -// CHECK:STDOUT: !67 = !DILocation(line: 34, column: 12, scope: !64) -// CHECK:STDOUT: !68 = !DILocation(line: 34, column: 5, scope: !64) -// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.deb37f08ddf50b30", scope: null, file: !37, line: 30, type: !70, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !70 = !DISubroutineType(types: !71) -// CHECK:STDOUT: !71 = !{!20} -// CHECK:STDOUT: !72 = !DILocation(line: 31, column: 5, scope: !69) -// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e", scope: null, file: !37, line: 172, type: !38, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !74) -// CHECK:STDOUT: !74 = !{!75} -// CHECK:STDOUT: !75 = !DILocalVariable(arg: 1, scope: !73, type: !20) -// CHECK:STDOUT: !76 = !DILocation(line: 173, column: 16, scope: !73) -// CHECK:STDOUT: !77 = !DILocation(line: 173, column: 12, scope: !73) -// CHECK:STDOUT: !78 = !DILocation(line: 173, column: 5, scope: !73) -// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e", scope: null, file: !37, line: 175, type: !38, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !80) -// CHECK:STDOUT: !80 = !{!81} -// CHECK:STDOUT: !81 = !DILocalVariable(arg: 1, scope: !79, type: !20) -// CHECK:STDOUT: !82 = !DILocation(line: 176, column: 5, scope: !79) -// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8753681fdb639539", scope: null, file: !37, line: 166, type: !38, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !84) -// CHECK:STDOUT: !84 = !{!85} -// CHECK:STDOUT: !85 = !DILocalVariable(arg: 1, scope: !83, type: !20) -// CHECK:STDOUT: !86 = !DILocation(line: 167, column: 14, scope: !83) -// CHECK:STDOUT: !87 = !DILocation(line: 169, column: 5, scope: !83) -// CHECK:STDOUT: !88 = !DILocation(line: 167, column: 18, scope: !83) -// CHECK:STDOUT: !89 = !DILocation(line: 170, column: 5, scope: !83) +// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0eaa291c18f0461d:core.Destroy.Core", scope: null, file: !6, line: 9, type: !18, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !37) +// CHECK:STDOUT: !37 = !{!38} +// CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !36, type: !20) +// CHECK:STDOUT: !39 = !DILocation(line: 9, column: 12, scope: !36) +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "Op", linkageName: "_COp.2b115399396a8344:core.Destroy.Core", scope: null, file: !6, line: 9, type: !18, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !41) +// CHECK:STDOUT: !41 = !{!42} +// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !40, type: !20) +// CHECK:STDOUT: !43 = !DILocation(line: 9, column: 12, scope: !40) +// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.26284956f90c5004", scope: null, file: !45, line: 105, type: !46, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !48) +// CHECK:STDOUT: !45 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !46 = !DISubroutineType(types: !47) +// CHECK:STDOUT: !47 = !{!20, !20} +// CHECK:STDOUT: !48 = !{!49} +// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !44, type: !20) +// CHECK:STDOUT: !50 = !DILocation(line: 106, column: 12, scope: !44) +// CHECK:STDOUT: !51 = !DILocation(line: 106, column: 5, scope: !44) +// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Optional.c661605f12aa337a.Core:OptionalAs.1dac4564233fecd1.Core.ba0bf13f1b5bc657", scope: null, file: !45, line: 95, type: !46, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !53) +// CHECK:STDOUT: !53 = !{!54} +// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !52, type: !20) +// CHECK:STDOUT: !55 = !DILocation(line: 97, column: 31, scope: !52) +// CHECK:STDOUT: !56 = !DILocation(line: 96, column: 9, scope: !52) +// CHECK:STDOUT: !57 = !DILocation(line: 96, column: 8, scope: !52) +// CHECK:STDOUT: !58 = !DILocation(line: 97, column: 14, scope: !52) +// CHECK:STDOUT: !59 = !DILocation(line: 97, column: 7, scope: !52) +// CHECK:STDOUT: !60 = !DILocation(line: 99, column: 12, scope: !52) +// CHECK:STDOUT: !61 = !DILocation(line: 99, column: 5, scope: !52) +// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.0d555305d9583d05", scope: null, file: !45, line: 36, type: !46, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !63) +// CHECK:STDOUT: !63 = !{!64} +// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !62, type: !20) +// CHECK:STDOUT: !65 = !DILocation(line: 37, column: 12, scope: !62) +// CHECK:STDOUT: !66 = !DILocation(line: 37, column: 5, scope: !62) +// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.0d555305d9583d05", scope: null, file: !45, line: 39, type: !46, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !68) +// CHECK:STDOUT: !68 = !{!69} +// CHECK:STDOUT: !69 = !DILocalVariable(arg: 1, scope: !67, type: !20) +// CHECK:STDOUT: !70 = !DILocation(line: 40, column: 12, scope: !67) +// CHECK:STDOUT: !71 = !DILocation(line: 40, column: 5, scope: !67) +// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.deb37f08ddf50b30", scope: null, file: !45, line: 33, type: !46, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !73) +// CHECK:STDOUT: !73 = !{!74} +// CHECK:STDOUT: !74 = !DILocalVariable(arg: 1, scope: !72, type: !20) +// CHECK:STDOUT: !75 = !DILocation(line: 34, column: 12, scope: !72) +// CHECK:STDOUT: !76 = !DILocation(line: 34, column: 5, scope: !72) +// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.deb37f08ddf50b30", scope: null, file: !45, line: 30, type: !78, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !78 = !DISubroutineType(types: !79) +// CHECK:STDOUT: !79 = !{!20} +// CHECK:STDOUT: !80 = !DILocation(line: 31, column: 5, scope: !77) +// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e", scope: null, file: !45, line: 172, type: !46, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !82) +// CHECK:STDOUT: !82 = !{!83} +// CHECK:STDOUT: !83 = !DILocalVariable(arg: 1, scope: !81, type: !20) +// CHECK:STDOUT: !84 = !DILocation(line: 173, column: 16, scope: !81) +// CHECK:STDOUT: !85 = !DILocation(line: 173, column: 12, scope: !81) +// CHECK:STDOUT: !86 = !DILocation(line: 173, column: 5, scope: !81) +// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e", scope: null, file: !45, line: 175, type: !46, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !88) +// CHECK:STDOUT: !88 = !{!89} +// CHECK:STDOUT: !89 = !DILocalVariable(arg: 1, scope: !87, type: !20) +// CHECK:STDOUT: !90 = !DILocation(line: 176, column: 5, scope: !87) +// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8753681fdb639539", scope: null, file: !45, line: 166, type: !46, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !92) +// CHECK:STDOUT: !92 = !{!93} +// CHECK:STDOUT: !93 = !DILocalVariable(arg: 1, scope: !91, type: !20) +// CHECK:STDOUT: !94 = !DILocation(line: 167, column: 14, scope: !91) +// CHECK:STDOUT: !95 = !DILocation(line: 169, column: 5, scope: !91) +// CHECK:STDOUT: !96 = !DILocation(line: 167, column: 18, scope: !91) +// CHECK:STDOUT: !97 = !DILocation(line: 170, column: 5, scope: !91) diff --git a/toolchain/lower/testdata/interop/cpp/void.carbon b/toolchain/lower/testdata/interop/cpp/void.carbon index 88ac0d4fa321..58af68e31000 100644 --- a/toolchain/lower/testdata/interop/cpp/void.carbon +++ b/toolchain/lower/testdata/interop/cpp/void.carbon @@ -77,155 +77,167 @@ fn ConvertFromConstVoidPtr(p: const Cpp.void*) -> const i32* { // CHECK:STDOUT: declare void @_Z13take_void_ptrPv(ptr noundef) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.125695b29f2cf97c:core.Destroy.Core"(ptr %self) #0 !dbg !20 { +// CHECK:STDOUT: define weak_odr void @"_COp.fd39a15e7d61228d: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.801be0c493a24c71:core.Destroy.Core"(ptr %self) #0 !dbg !24 { +// CHECK:STDOUT: define weak_odr void @"_COp.125695b29f2cf97c: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 void @_CPassIntPtr.Main(ptr %a) #0 !dbg !28 { +// CHECK:STDOUT: define weak_odr void @"_COp.801be0c493a24c71:core.Destroy.Core"(ptr %self) #0 !dbg !28 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc11_21.2.temp = alloca ptr, align 8, !dbg !31 -// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.ed3bde3932287ced"(ptr %a), !dbg !31 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_21.2.temp), !dbg !31 -// CHECK:STDOUT: store ptr %U.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.801be0c493a24c71:core.Destroy.Core"(ptr %.loc11_21.2.temp), !dbg !31 -// CHECK:STDOUT: ret void, !dbg !33 +// CHECK:STDOUT: ret void, !dbg !31 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassIntPtrToConstVoidPtr.Main(ptr %a) #0 !dbg !34 { +// CHECK:STDOUT: define void @_CPassIntPtr.Main(ptr %a) #0 !dbg !32 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc15_27.2.temp = alloca ptr, align 8, !dbg !37 -// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.0dc2e35b064d71e9"(ptr %a), !dbg !37 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc15_27.2.temp), !dbg !37 -// CHECK:STDOUT: store ptr %U.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.d7b9c2d58a39f2df:core.Destroy.Core"(ptr %.loc15_27.2.temp), !dbg !37 -// CHECK:STDOUT: ret void, !dbg !39 +// CHECK:STDOUT: %.loc11_21.2.temp = alloca ptr, align 8, !dbg !35 +// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.ed3bde3932287ced"(ptr %a), !dbg !35 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_21.2.temp), !dbg !35 +// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc11_21.2.temp, align 8, !dbg !35 +// CHECK:STDOUT: %.loc11_21.4 = load ptr, ptr %.loc11_21.2.temp, align 8, !dbg !35 +// CHECK:STDOUT: call void @_Z13take_void_ptrPv(ptr %.loc11_21.4), !dbg !36 +// CHECK:STDOUT: call void @"_COp.801be0c493a24c71:core.Destroy.Core"(ptr %.loc11_21.2.temp), !dbg !35 +// CHECK:STDOUT: ret void, !dbg !37 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CPassIntPtrToConstVoidPtr.Main(ptr %a) #0 !dbg !38 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc15_27.2.temp = alloca ptr, align 8, !dbg !41 +// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.0dc2e35b064d71e9"(ptr %a), !dbg !41 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc15_27.2.temp), !dbg !41 +// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc15_27.2.temp, align 8, !dbg !41 +// CHECK:STDOUT: %.loc15_27.4 = load ptr, ptr %.loc15_27.2.temp, align 8, !dbg !41 +// CHECK:STDOUT: call void @_Z19take_const_void_ptrPKv(ptr %.loc15_27.4), !dbg !42 +// CHECK:STDOUT: call void @"_COp.d7b9c2d58a39f2df:core.Destroy.Core"(ptr %.loc15_27.2.temp), !dbg !41 +// CHECK:STDOUT: ret void, !dbg !43 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z19take_const_void_ptrPKv(ptr noundef) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.b8b38d4701ca7f8c: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.d7b9c2d58a39f2df:core.Destroy.Core"(ptr %self) #0 !dbg !44 { +// CHECK:STDOUT: define weak_odr void @"_COp.0aac4ce7c7765bae: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: define weak_odr void @"_COp.b8b38d4701ca7f8c:core.Destroy.Core"(ptr %self) #0 !dbg !48 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc19_27.2.temp = alloca ptr, align 8, !dbg !51 -// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.0dc2e35b064d71e9"(ptr %a), !dbg !51 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_27.2.temp), !dbg !51 -// CHECK:STDOUT: store ptr %U.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.d7b9c2d58a39f2df:core.Destroy.Core"(ptr %.loc19_27.2.temp), !dbg !51 -// CHECK:STDOUT: ret void, !dbg !53 +// CHECK:STDOUT: ret void, !dbg !51 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.52f71e11dc373f9a"(ptr %self) #0 !dbg !54 { -// CHECK:STDOUT: %1 = call ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.258ff42e9fd73c28"(ptr %self), !dbg !60 -// CHECK:STDOUT: ret ptr %1, !dbg !61 +// CHECK:STDOUT: define weak_odr void @"_COp.d7b9c2d58a39f2df:core.Destroy.Core"(ptr %self) #0 !dbg !52 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !55 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CPassConstIntPtrToConstVoidPtr.Main(ptr %a) #0 !dbg !56 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc19_27.2.temp = alloca ptr, align 8, !dbg !59 +// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.0dc2e35b064d71e9"(ptr %a), !dbg !59 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_27.2.temp), !dbg !59 +// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc19_27.2.temp, align 8, !dbg !59 +// CHECK:STDOUT: %.loc19_27.4 = load ptr, ptr %.loc19_27.2.temp, align 8, !dbg !59 +// CHECK:STDOUT: call void @_Z19take_const_void_ptrPKv(ptr %.loc19_27.4), !dbg !60 +// CHECK:STDOUT: call void @"_COp.d7b9c2d58a39f2df:core.Destroy.Core"(ptr %.loc19_27.2.temp), !dbg !59 +// CHECK:STDOUT: ret void, !dbg !61 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.52f71e11dc373f9a"(ptr %self) #0 !dbg !62 { +// CHECK:STDOUT: %1 = call ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.258ff42e9fd73c28"(ptr %self), !dbg !68 +// CHECK:STDOUT: ret ptr %1, !dbg !69 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.ed3bde3932287ced"(ptr %self) #0 !dbg !62 { -// CHECK:STDOUT: %1 = call ptr @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.ff6ab29b5872c34c"(ptr %self), !dbg !65 -// CHECK:STDOUT: ret ptr %1, !dbg !66 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.ed3bde3932287ced"(ptr %self) #0 !dbg !70 { +// CHECK:STDOUT: %1 = call ptr @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.ff6ab29b5872c34c"(ptr %self), !dbg !73 +// CHECK:STDOUT: ret ptr %1, !dbg !74 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.0dc2e35b064d71e9"(ptr %self) #0 !dbg !67 { -// CHECK:STDOUT: %1 = call ptr @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.e316e6328124c0b3"(ptr %self), !dbg !70 -// CHECK:STDOUT: ret ptr %1, !dbg !71 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.0dc2e35b064d71e9"(ptr %self) #0 !dbg !75 { +// CHECK:STDOUT: %1 = call ptr @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.e316e6328124c0b3"(ptr %self), !dbg !78 +// CHECK:STDOUT: ret ptr %1, !dbg !79 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.258ff42e9fd73c28"(ptr %self) #0 !dbg !72 { -// CHECK:STDOUT: %1 = call ptr @_CSome.Optional.Core.258ff42e9fd73c28(ptr %self), !dbg !75 -// CHECK:STDOUT: ret ptr %1, !dbg !76 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.258ff42e9fd73c28"(ptr %self) #0 !dbg !80 { +// CHECK:STDOUT: %1 = call ptr @_CSome.Optional.Core.258ff42e9fd73c28(ptr %self), !dbg !83 +// CHECK:STDOUT: ret ptr %1, !dbg !84 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.ff6ab29b5872c34c"(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.258ff42e9fd73c28(ptr %1), !dbg !81 -// CHECK:STDOUT: ret ptr %2, !dbg !82 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.ff6ab29b5872c34c"(ptr %self) #0 !dbg !85 { +// CHECK:STDOUT: %temp = alloca ptr, align 8, !dbg !88 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !88 +// CHECK:STDOUT: store ptr %self, ptr %temp, align 8, !dbg !88 +// CHECK:STDOUT: %1 = load ptr, ptr %temp, align 8, !dbg !88 +// CHECK:STDOUT: %2 = call ptr @_CSome.Optional.Core.258ff42e9fd73c28(ptr %1), !dbg !89 +// CHECK:STDOUT: ret ptr %2, !dbg !90 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.e316e6328124c0b3"(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:ImplicitAs.d035546bf1a99743.Core:e8f8f92d3d08d149:ImplicitAs.01c4a560c986e7d1.Core.84588f41d61dafba"(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.e5c5bc28e9d686cf(ptr %2), !dbg !87 -// CHECK:STDOUT: ret ptr %3, !dbg !88 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.e316e6328124c0b3"(ptr %self) #0 !dbg !91 { +// CHECK:STDOUT: %temp = alloca ptr, align 8, !dbg !94 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !94 +// CHECK:STDOUT: %1 = call ptr @"_CConvert:thunk:ImplicitAs.d035546bf1a99743.Core:e8f8f92d3d08d149:ImplicitAs.01c4a560c986e7d1.Core.84588f41d61dafba"(ptr %self), !dbg !94 +// CHECK:STDOUT: store ptr %1, ptr %temp, align 8, !dbg !94 +// CHECK:STDOUT: %2 = load ptr, ptr %temp, align 8, !dbg !94 +// CHECK:STDOUT: %3 = call ptr @_CSome.Optional.Core.e5c5bc28e9d686cf(ptr %2), !dbg !95 +// CHECK:STDOUT: ret ptr %3, !dbg !96 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.258ff42e9fd73c28(ptr %value) #0 !dbg !89 { -// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.7a595a06c724a271"(ptr %value), !dbg !92 -// CHECK:STDOUT: ret ptr %1, !dbg !93 +// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.258ff42e9fd73c28(ptr %value) #0 !dbg !97 { +// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.7a595a06c724a271"(ptr %value), !dbg !100 +// CHECK:STDOUT: ret ptr %1, !dbg !101 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert:thunk:ImplicitAs.d035546bf1a99743.Core:e8f8f92d3d08d149:ImplicitAs.01c4a560c986e7d1.Core.84588f41d61dafba"(ptr %self) #3 !dbg !94 { -// CHECK:STDOUT: ret ptr %self, !dbg !98 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert:thunk:ImplicitAs.d035546bf1a99743.Core:e8f8f92d3d08d149:ImplicitAs.01c4a560c986e7d1.Core.84588f41d61dafba"(ptr %self) #3 !dbg !102 { +// CHECK:STDOUT: ret ptr %self, !dbg !106 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.e5c5bc28e9d686cf(ptr %value) #0 !dbg !99 { -// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8f1054b47505c137"(ptr %value), !dbg !102 -// CHECK:STDOUT: ret ptr %1, !dbg !103 +// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.e5c5bc28e9d686cf(ptr %value) #0 !dbg !107 { +// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8f1054b47505c137"(ptr %value), !dbg !110 +// CHECK:STDOUT: ret ptr %1, !dbg !111 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.7a595a06c724a271"(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.125695b29f2cf97c:core.Destroy.Core"(ptr %1), !dbg !107 -// CHECK:STDOUT: ret ptr %2, !dbg !110 +// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.7a595a06c724a271"(ptr %self) #0 !dbg !112 { +// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !115 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !115 +// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !115 +// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !116 +// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !117 +// CHECK:STDOUT: call void @"_COp.125695b29f2cf97c:core.Destroy.Core"(ptr %1), !dbg !115 +// CHECK:STDOUT: ret ptr %2, !dbg !118 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8f1054b47505c137"(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.b8b38d4701ca7f8c:core.Destroy.Core"(ptr %1), !dbg !114 -// CHECK:STDOUT: ret ptr %2, !dbg !117 +// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8f1054b47505c137"(ptr %self) #0 !dbg !119 { +// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !122 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !122 +// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !122 +// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !123 +// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !124 +// CHECK:STDOUT: call void @"_COp.b8b38d4701ca7f8c:core.Destroy.Core"(ptr %1), !dbg !122 +// CHECK:STDOUT: ret ptr %2, !dbg !125 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -262,104 +274,112 @@ 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: "Op", linkageName: "_COp.125695b29f2cf97c:core.Destroy.Core", scope: null, file: !6, line: 7, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !21) +// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fd39a15e7d61228d: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: 7, column: 21, scope: !20) -// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "Op", linkageName: "_COp.801be0c493a24c71:core.Destroy.Core", scope: null, file: !6, line: 7, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !25) +// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "Op", linkageName: "_COp.125695b29f2cf97c: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: !28 = distinct !DISubprogram(name: "Op", linkageName: "_COp.801be0c493a24c71:core.Destroy.Core", scope: null, file: !6, line: 7, 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.b8b38d4701ca7f8c: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.d7b9c2d58a39f2df:core.Destroy.Core", scope: null, file: !6, line: 15, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !45) +// CHECK:STDOUT: !31 = !DILocation(line: 7, column: 21, scope: !28) +// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "PassIntPtr", linkageName: "_CPassIntPtr.Main", scope: null, file: !6, line: 10, 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: 11, column: 21, scope: !32) +// CHECK:STDOUT: !36 = !DILocation(line: 11, column: 3, scope: !32) +// CHECK:STDOUT: !37 = !DILocation(line: 10, column: 1, scope: !32) +// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "PassIntPtrToConstVoidPtr", linkageName: "_CPassIntPtrToConstVoidPtr.Main", scope: null, file: !6, line: 14, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !39) +// CHECK:STDOUT: !39 = !{!40} +// CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !38, type: !14) +// CHECK:STDOUT: !41 = !DILocation(line: 15, column: 27, scope: !38) +// CHECK:STDOUT: !42 = !DILocation(line: 15, column: 3, scope: !38) +// CHECK:STDOUT: !43 = !DILocation(line: 14, column: 1, scope: !38) +// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0aac4ce7c7765bae: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: !48 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b8b38d4701ca7f8c:core.Destroy.Core", scope: null, file: !6, line: 15, 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.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.52f71e11dc373f9a", scope: null, file: !55, line: 105, 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: 106, column: 12, scope: !54) -// CHECK:STDOUT: !61 = !DILocation(line: 106, column: 5, scope: !54) -// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.ed3bde3932287ced", scope: null, file: !55, line: 105, 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: 106, column: 12, scope: !62) -// CHECK:STDOUT: !66 = !DILocation(line: 106, column: 5, scope: !62) -// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.0dc2e35b064d71e9", scope: null, file: !55, line: 105, 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: 106, column: 12, scope: !67) -// CHECK:STDOUT: !71 = !DILocation(line: 106, column: 5, scope: !67) -// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.258ff42e9fd73c28", scope: null, file: !55, line: 80, 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: 81, column: 12, scope: !72) -// CHECK:STDOUT: !76 = !DILocation(line: 81, column: 5, scope: !72) -// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.ff6ab29b5872c34c", scope: null, file: !55, line: 87, 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: 88, column: 29, scope: !77) -// CHECK:STDOUT: !81 = !DILocation(line: 88, column: 12, scope: !77) -// CHECK:STDOUT: !82 = !DILocation(line: 88, column: 5, scope: !77) -// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.e316e6328124c0b3", scope: null, file: !55, line: 87, 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: 88, column: 29, scope: !83) -// CHECK:STDOUT: !87 = !DILocation(line: 88, column: 12, scope: !83) -// CHECK:STDOUT: !88 = !DILocation(line: 88, column: 5, scope: !83) -// CHECK:STDOUT: !89 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.258ff42e9fd73c28", scope: null, file: !55, line: 33, 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: 34, column: 12, scope: !89) -// CHECK:STDOUT: !93 = !DILocation(line: 34, column: 5, scope: !89) -// CHECK:STDOUT: !94 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert:thunk:ImplicitAs.d035546bf1a99743.Core:e8f8f92d3d08d149:ImplicitAs.01c4a560c986e7d1.Core.84588f41d61dafba", 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: !94, type: !14) -// CHECK:STDOUT: !98 = !DILocation(line: 40, column: 3, scope: !94) -// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.e5c5bc28e9d686cf", scope: null, file: !55, line: 33, 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: 34, column: 12, scope: !99) -// CHECK:STDOUT: !103 = !DILocation(line: 34, column: 5, scope: !99) -// CHECK:STDOUT: !104 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.7a595a06c724a271", scope: null, file: !55, line: 166, 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: 167, column: 14, scope: !104) -// CHECK:STDOUT: !108 = !DILocation(line: 169, column: 5, scope: !104) -// CHECK:STDOUT: !109 = !DILocation(line: 167, column: 18, scope: !104) -// CHECK:STDOUT: !110 = !DILocation(line: 170, column: 5, scope: !104) -// CHECK:STDOUT: !111 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8f1054b47505c137", scope: null, file: !55, line: 166, 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: 167, column: 14, scope: !111) -// CHECK:STDOUT: !115 = !DILocation(line: 169, column: 5, scope: !111) -// CHECK:STDOUT: !116 = !DILocation(line: 167, column: 18, scope: !111) -// CHECK:STDOUT: !117 = !DILocation(line: 170, column: 5, scope: !111) +// CHECK:STDOUT: !51 = !DILocation(line: 15, column: 27, scope: !48) +// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d7b9c2d58a39f2df:core.Destroy.Core", scope: null, file: !6, line: 15, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !53) +// CHECK:STDOUT: !53 = !{!54} +// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !52, type: !14) +// CHECK:STDOUT: !55 = !DILocation(line: 15, column: 27, scope: !52) +// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "PassConstIntPtrToConstVoidPtr", linkageName: "_CPassConstIntPtrToConstVoidPtr.Main", scope: null, file: !6, line: 18, type: !12, 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: 19, column: 27, scope: !56) +// CHECK:STDOUT: !60 = !DILocation(line: 19, column: 3, scope: !56) +// CHECK:STDOUT: !61 = !DILocation(line: 18, column: 1, scope: !56) +// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.52f71e11dc373f9a", scope: null, file: !63, line: 105, type: !64, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !66) +// CHECK:STDOUT: !63 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !64 = !DISubroutineType(types: !65) +// CHECK:STDOUT: !65 = !{!14, !14} +// CHECK:STDOUT: !66 = !{!67} +// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !62, type: !14) +// CHECK:STDOUT: !68 = !DILocation(line: 106, column: 12, scope: !62) +// CHECK:STDOUT: !69 = !DILocation(line: 106, column: 5, scope: !62) +// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.ed3bde3932287ced", scope: null, file: !63, line: 105, type: !64, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !71) +// CHECK:STDOUT: !71 = !{!72} +// CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !70, type: !14) +// CHECK:STDOUT: !73 = !DILocation(line: 106, column: 12, scope: !70) +// CHECK:STDOUT: !74 = !DILocation(line: 106, column: 5, scope: !70) +// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.0dc2e35b064d71e9", scope: null, file: !63, line: 105, type: !64, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !76) +// CHECK:STDOUT: !76 = !{!77} +// CHECK:STDOUT: !77 = !DILocalVariable(arg: 1, scope: !75, type: !14) +// CHECK:STDOUT: !78 = !DILocation(line: 106, column: 12, scope: !75) +// CHECK:STDOUT: !79 = !DILocation(line: 106, column: 5, scope: !75) +// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.258ff42e9fd73c28", scope: null, file: !63, line: 80, type: !64, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !81) +// CHECK:STDOUT: !81 = !{!82} +// CHECK:STDOUT: !82 = !DILocalVariable(arg: 1, scope: !80, type: !14) +// CHECK:STDOUT: !83 = !DILocation(line: 81, column: 12, scope: !80) +// CHECK:STDOUT: !84 = !DILocation(line: 81, column: 5, scope: !80) +// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.ff6ab29b5872c34c", scope: null, file: !63, line: 87, type: !64, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !86) +// CHECK:STDOUT: !86 = !{!87} +// CHECK:STDOUT: !87 = !DILocalVariable(arg: 1, scope: !85, type: !14) +// CHECK:STDOUT: !88 = !DILocation(line: 88, column: 29, scope: !85) +// CHECK:STDOUT: !89 = !DILocation(line: 88, column: 12, scope: !85) +// CHECK:STDOUT: !90 = !DILocation(line: 88, column: 5, scope: !85) +// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.e316e6328124c0b3", scope: null, file: !63, line: 87, type: !64, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !92) +// CHECK:STDOUT: !92 = !{!93} +// CHECK:STDOUT: !93 = !DILocalVariable(arg: 1, scope: !91, type: !14) +// CHECK:STDOUT: !94 = !DILocation(line: 88, column: 29, scope: !91) +// CHECK:STDOUT: !95 = !DILocation(line: 88, column: 12, scope: !91) +// CHECK:STDOUT: !96 = !DILocation(line: 88, column: 5, scope: !91) +// CHECK:STDOUT: !97 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.258ff42e9fd73c28", scope: null, file: !63, line: 33, type: !64, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !98) +// CHECK:STDOUT: !98 = !{!99} +// CHECK:STDOUT: !99 = !DILocalVariable(arg: 1, scope: !97, type: !14) +// CHECK:STDOUT: !100 = !DILocation(line: 34, column: 12, scope: !97) +// CHECK:STDOUT: !101 = !DILocation(line: 34, column: 5, scope: !97) +// CHECK:STDOUT: !102 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert:thunk:ImplicitAs.d035546bf1a99743.Core:e8f8f92d3d08d149:ImplicitAs.01c4a560c986e7d1.Core.84588f41d61dafba", scope: null, file: !103, line: 40, type: !64, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !104) +// CHECK:STDOUT: !103 = !DIFile(filename: "{{.*}}/prelude/types/cpp/void.carbon", directory: "") +// CHECK:STDOUT: !104 = !{!105} +// CHECK:STDOUT: !105 = !DILocalVariable(arg: 1, scope: !102, type: !14) +// CHECK:STDOUT: !106 = !DILocation(line: 40, column: 3, scope: !102) +// CHECK:STDOUT: !107 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.e5c5bc28e9d686cf", scope: null, file: !63, line: 33, type: !64, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !108) +// CHECK:STDOUT: !108 = !{!109} +// CHECK:STDOUT: !109 = !DILocalVariable(arg: 1, scope: !107, type: !14) +// CHECK:STDOUT: !110 = !DILocation(line: 34, column: 12, scope: !107) +// CHECK:STDOUT: !111 = !DILocation(line: 34, column: 5, scope: !107) +// CHECK:STDOUT: !112 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.7a595a06c724a271", scope: null, file: !63, line: 166, type: !64, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !113) +// CHECK:STDOUT: !113 = !{!114} +// CHECK:STDOUT: !114 = !DILocalVariable(arg: 1, scope: !112, type: !14) +// CHECK:STDOUT: !115 = !DILocation(line: 167, column: 14, scope: !112) +// CHECK:STDOUT: !116 = !DILocation(line: 169, column: 5, scope: !112) +// CHECK:STDOUT: !117 = !DILocation(line: 167, column: 18, scope: !112) +// CHECK:STDOUT: !118 = !DILocation(line: 170, column: 5, scope: !112) +// CHECK:STDOUT: !119 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8f1054b47505c137", scope: null, file: !63, line: 166, type: !64, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !120) +// CHECK:STDOUT: !120 = !{!121} +// CHECK:STDOUT: !121 = !DILocalVariable(arg: 1, scope: !119, type: !14) +// CHECK:STDOUT: !122 = !DILocation(line: 167, column: 14, scope: !119) +// CHECK:STDOUT: !123 = !DILocation(line: 169, column: 5, scope: !119) +// CHECK:STDOUT: !124 = !DILocation(line: 167, column: 18, scope: !119) +// CHECK:STDOUT: !125 = !DILocation(line: 170, column: 5, scope: !119) // 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/primitives/optional.carbon b/toolchain/lower/testdata/primitives/optional.carbon index 2f19703222e7..0856252c9103 100644 --- a/toolchain/lower/testdata/primitives/optional.carbon +++ b/toolchain/lower/testdata/primitives/optional.carbon @@ -128,222 +128,234 @@ fn F(c: Core.Optional(C*)) -> Core.Optional(C*) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.eb54d7735089d035:core.Destroy.Core"(ptr %self) #0 !dbg !45 { +// CHECK:STDOUT: define weak_odr void @"_COp.d4fdfc2912de527a: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 weak_odr void @"_COp.33aade76ef369ae0:core.Destroy.Core"(ptr %self) #0 !dbg !49 { +// CHECK:STDOUT: define weak_odr void @"_COp.eb54d7735089d035: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 weak_odr void @"_COp.4352d4717a4da3c5:core.Destroy.Core"(ptr %self) #0 !dbg !53 { +// CHECK:STDOUT: define weak_odr void @"_COp.33aade76ef369ae0: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.bc7b205814bb8542:core.Destroy.Core"(ptr %self) #0 !dbg !57 { +// CHECK:STDOUT: define weak_odr void @"_COp.4352d4717a4da3c5: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.56bc00fa6756ea9e:core.Destroy.Core"(ptr %self) #0 !dbg !61 { +// CHECK:STDOUT: define weak_odr void @"_COp.bc7b205814bb8542: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.0fc9634857315db2:core.Destroy.Core"(ptr %self) #0 !dbg !65 { +// CHECK:STDOUT: define weak_odr void @"_COp.56bc00fa6756ea9e: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.69700c1fc1b2744c:core.Destroy.Core"(ptr %self) #0 !dbg !69 { +// CHECK:STDOUT: define weak_odr void @"_COp.94ba1c30d421702e: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.36bd54c278c044c5:core.Destroy.Core"(ptr %self) #0 !dbg !73 { +// CHECK:STDOUT: define weak_odr void @"_COp.0fc9634857315db2: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.30688d383ae72bab:core.Destroy.Core"(ptr %self) #0 !dbg !77 { +// CHECK:STDOUT: define weak_odr void @"_COp.69700c1fc1b2744c: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.49575b3ccc332429:core.Destroy.Core"(ptr %self) #0 !dbg !81 { +// CHECK:STDOUT: define weak_odr void @"_COp.36bd54c278c044c5: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.b79ac2ab1b7701d6(ptr %self) #0 !dbg !85 { -// CHECK:STDOUT: %1 = call i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.84588f41d61dafba"(ptr %self), !dbg !89 -// CHECK:STDOUT: ret i1 %1, !dbg !90 +// CHECK:STDOUT: define weak_odr void @"_COp.30688d383ae72bab:core.Destroy.Core"(ptr %self) #0 !dbg !85 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !88 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CGet.Optional.Core.b79ac2ab1b7701d6(ptr %self) #0 !dbg !91 { -// CHECK:STDOUT: %1 = call ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.84588f41d61dafba"(ptr %self), !dbg !94 -// CHECK:STDOUT: ret ptr %1, !dbg !95 +// CHECK:STDOUT: define weak_odr void @"_COp.49575b3ccc332429:core.Destroy.Core"(ptr %self) #0 !dbg !89 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !92 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.a77ff6e8edaf9e8d"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !96 { -// CHECK:STDOUT: call void @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.70a0b54a75854b7a"(ptr %return, i32 %self), !dbg !101 -// CHECK:STDOUT: ret void, !dbg !102 +// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.b79ac2ab1b7701d6(ptr %self) #0 !dbg !93 { +// CHECK:STDOUT: %1 = call i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.84588f41d61dafba"(ptr %self), !dbg !97 +// CHECK:STDOUT: ret i1 %1, !dbg !98 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.70a0b54a75854b7a(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !103 { -// CHECK:STDOUT: call void @"_CNone.74becf39533834ee:OptionalStorage.Core.b99f4a084b13a83f"(ptr %return), !dbg !106 -// CHECK:STDOUT: ret void, !dbg !107 +// CHECK:STDOUT: define linkonce_odr ptr @_CGet.Optional.Core.b79ac2ab1b7701d6(ptr %self) #0 !dbg !99 { +// CHECK:STDOUT: %1 = call ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.84588f41d61dafba"(ptr %self), !dbg !102 +// CHECK:STDOUT: ret ptr %1, !dbg !103 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.a77ff6e8edaf9e8d"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !104 { +// CHECK:STDOUT: call void @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.70a0b54a75854b7a"(ptr %return, i32 %self), !dbg !109 +// CHECK:STDOUT: ret void, !dbg !110 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.70a0b54a75854b7a(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !111 { +// CHECK:STDOUT: call void @"_CNone.74becf39533834ee:OptionalStorage.Core.b99f4a084b13a83f"(ptr %return), !dbg !114 +// CHECK:STDOUT: ret void, !dbg !115 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.36d191ed69f42abb"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !108 { -// CHECK:STDOUT: call void @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.a77ff6e8edaf9e8d"(ptr %return, i32 %self), !dbg !112 -// CHECK:STDOUT: ret void, !dbg !113 +// CHECK:STDOUT: define linkonce_odr void @"_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.36d191ed69f42abb"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !116 { +// CHECK:STDOUT: call void @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.a77ff6e8edaf9e8d"(ptr %return, i32 %self), !dbg !120 +// CHECK:STDOUT: ret void, !dbg !121 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.6f97602f44c068f9"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !114 { -// CHECK:STDOUT: call void @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.04776faa19f4241b"(ptr %return, i32 %self), !dbg !117 -// CHECK:STDOUT: ret void, !dbg !118 +// CHECK:STDOUT: define linkonce_odr void @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.6f97602f44c068f9"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !122 { +// CHECK:STDOUT: call void @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.04776faa19f4241b"(ptr %return, i32 %self), !dbg !125 +// CHECK:STDOUT: ret void, !dbg !126 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.7e715d26c6bb9daa"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !119 { -// CHECK:STDOUT: call void @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.6f97602f44c068f9"(ptr %return, i32 %self), !dbg !122 -// CHECK:STDOUT: ret void, !dbg !123 +// CHECK:STDOUT: define linkonce_odr void @"_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.7e715d26c6bb9daa"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !127 { +// CHECK:STDOUT: call void @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.6f97602f44c068f9"(ptr %return, i32 %self), !dbg !130 +// CHECK:STDOUT: ret void, !dbg !131 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.36d191ed69f42abb"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !124 { -// CHECK:STDOUT: call void @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.a77ff6e8edaf9e8d"(ptr %return, i32 %self), !dbg !127 -// CHECK:STDOUT: ret void, !dbg !128 +// CHECK:STDOUT: define linkonce_odr void @"_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.36d191ed69f42abb"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !132 { +// CHECK:STDOUT: call void @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.a77ff6e8edaf9e8d"(ptr %return, i32 %self), !dbg !135 +// CHECK:STDOUT: ret void, !dbg !136 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.bd2b2818aef220bf"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !129 { -// CHECK:STDOUT: call void @"_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.36d191ed69f42abb"(ptr %return, i32 %self), !dbg !132 -// CHECK:STDOUT: ret void, !dbg !133 +// CHECK:STDOUT: define linkonce_odr void @"_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.bd2b2818aef220bf"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !137 { +// CHECK:STDOUT: call void @"_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.36d191ed69f42abb"(ptr %return, i32 %self), !dbg !140 +// CHECK:STDOUT: ret void, !dbg !141 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.7e715d26c6bb9daa"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !134 { -// CHECK:STDOUT: call void @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.6f97602f44c068f9"(ptr %return, i32 %self), !dbg !137 -// CHECK:STDOUT: ret void, !dbg !138 +// CHECK:STDOUT: define linkonce_odr void @"_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.7e715d26c6bb9daa"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !142 { +// CHECK:STDOUT: call void @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.6f97602f44c068f9"(ptr %return, i32 %self), !dbg !145 +// CHECK:STDOUT: ret void, !dbg !146 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.7f331ac9d2b85055"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !139 { -// CHECK:STDOUT: call void @"_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.7e715d26c6bb9daa"(ptr %return, i32 %self), !dbg !142 -// CHECK:STDOUT: ret void, !dbg !143 +// CHECK:STDOUT: define linkonce_odr void @"_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.7f331ac9d2b85055"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !147 { +// CHECK:STDOUT: call void @"_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.7e715d26c6bb9daa"(ptr %return, i32 %self), !dbg !150 +// CHECK:STDOUT: ret void, !dbg !151 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.84588f41d61dafba"(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: define linkonce_odr i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.84588f41d61dafba"(ptr %value) #0 !dbg !152 { +// CHECK:STDOUT: %1 = icmp eq ptr %value, null, !dbg !155 +// CHECK:STDOUT: %2 = xor i1 %1, true, !dbg !156 +// CHECK:STDOUT: ret i1 %2, !dbg !157 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.84588f41d61dafba"(ptr %value) #0 !dbg !150 { -// CHECK:STDOUT: ret ptr %value, !dbg !153 +// CHECK:STDOUT: define linkonce_odr ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.84588f41d61dafba"(ptr %value) #0 !dbg !158 { +// CHECK:STDOUT: ret ptr %value, !dbg !161 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.70a0b54a75854b7a"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !154 { -// CHECK:STDOUT: call void @_CSome.Optional.Core.70a0b54a75854b7a(ptr %return, i32 %self), !dbg !157 -// CHECK:STDOUT: ret void, !dbg !158 +// CHECK:STDOUT: define linkonce_odr void @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.70a0b54a75854b7a"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !162 { +// CHECK:STDOUT: call void @_CSome.Optional.Core.70a0b54a75854b7a(ptr %return, i32 %self), !dbg !165 +// CHECK:STDOUT: ret void, !dbg !166 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CNone.74becf39533834ee:OptionalStorage.Core.b99f4a084b13a83f"(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: define linkonce_odr void @"_CNone.74becf39533834ee:OptionalStorage.Core.b99f4a084b13a83f"(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !167 { +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !168 +// CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !168 +// CHECK:STDOUT: ret void, !dbg !169 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.04776faa19f4241b"(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.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.a1e92423fb5cda0f"(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.442ff502447e2586(ptr %return, i32 %2), !dbg !166 -// CHECK:STDOUT: call void @"_COp.05c48b3d4126597e:core.Destroy.Core"(ptr %temp), !dbg !165 -// CHECK:STDOUT: ret void, !dbg !167 +// CHECK:STDOUT: define linkonce_odr void @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.04776faa19f4241b"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !170 { +// CHECK:STDOUT: %temp = alloca i32, align 4, !dbg !173 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !173 +// CHECK:STDOUT: %1 = call i32 @"_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.a1e92423fb5cda0f"(i32 %self), !dbg !173 +// CHECK:STDOUT: store i32 %1, ptr %temp, align 4, !dbg !173 +// CHECK:STDOUT: %2 = load i32, ptr %temp, align 4, !dbg !173 +// CHECK:STDOUT: call void @_CSome.Optional.Core.442ff502447e2586(ptr %return, i32 %2), !dbg !174 +// CHECK:STDOUT: call void @"_COp.05c48b3d4126597e:core.Destroy.Core"(ptr %temp), !dbg !173 +// CHECK:STDOUT: ret void, !dbg !175 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.70a0b54a75854b7a(ptr sret(<{ i32, i1 }>) %return, i32 %value) #0 !dbg !168 { -// CHECK:STDOUT: call void @"_CSome.74becf39533834ee:OptionalStorage.Core.b99f4a084b13a83f"(ptr %return, i32 %value), !dbg !171 -// CHECK:STDOUT: ret void, !dbg !172 +// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.70a0b54a75854b7a(ptr sret(<{ i32, i1 }>) %return, i32 %value) #0 !dbg !176 { +// CHECK:STDOUT: call void @"_CSome.74becf39533834ee:OptionalStorage.Core.b99f4a084b13a83f"(ptr %return, i32 %value), !dbg !179 +// CHECK:STDOUT: ret void, !dbg !180 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.a1e92423fb5cda0f"(i32 %self) #0 !dbg !173 { -// CHECK:STDOUT: %1 = call i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.40372ba0ea03ef47"(i32 %self), !dbg !176 -// CHECK:STDOUT: ret i32 %1, !dbg !177 +// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.a1e92423fb5cda0f"(i32 %self) #0 !dbg !181 { +// CHECK:STDOUT: %1 = call i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.40372ba0ea03ef47"(i32 %self), !dbg !184 +// CHECK:STDOUT: ret i32 %1, !dbg !185 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.442ff502447e2586(ptr sret(<{ i32, i1 }>) %return, i32 %value) #0 !dbg !178 { -// CHECK:STDOUT: call void @"_CSome.74becf39533834ee:OptionalStorage.Core.9e376a14fbf8fb3d"(ptr %return, i32 %value), !dbg !181 -// CHECK:STDOUT: ret void, !dbg !182 +// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.442ff502447e2586(ptr sret(<{ i32, i1 }>) %return, i32 %value) #0 !dbg !186 { +// CHECK:STDOUT: call void @"_CSome.74becf39533834ee:OptionalStorage.Core.9e376a14fbf8fb3d"(ptr %return, i32 %value), !dbg !189 +// CHECK:STDOUT: ret void, !dbg !190 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CSome.74becf39533834ee:OptionalStorage.Core.b99f4a084b13a83f"(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: define linkonce_odr void @"_CSome.74becf39533834ee:OptionalStorage.Core.b99f4a084b13a83f"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !191 { +// CHECK:STDOUT: %value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 0, !dbg !194 +// CHECK:STDOUT: store i32 %self, ptr %value, align 4, !dbg !194 +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !195 +// CHECK:STDOUT: store i8 1, ptr %has_value, align 1, !dbg !195 +// CHECK:STDOUT: ret void, !dbg !196 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.40372ba0ea03ef47"(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: define linkonce_odr i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.40372ba0ea03ef47"(i32 %self) #0 !dbg !197 { +// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !203 +// CHECK:STDOUT: ret i32 %1, !dbg !204 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CSome.74becf39533834ee:OptionalStorage.Core.9e376a14fbf8fb3d"(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.a7c16f707f533a23:Copy.Core.5bd8d5767580997a"(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: define linkonce_odr void @"_CSome.74becf39533834ee:OptionalStorage.Core.9e376a14fbf8fb3d"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !205 { +// CHECK:STDOUT: %value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 0, !dbg !208 +// CHECK:STDOUT: %1 = call i32 @"_COp.a7c16f707f533a23:Copy.Core.5bd8d5767580997a"(i32 %self), !dbg !209 +// CHECK:STDOUT: store i32 %1, ptr %value, align 4, !dbg !208 +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !210 +// CHECK:STDOUT: store i8 1, ptr %has_value, align 1, !dbg !210 +// CHECK:STDOUT: ret void, !dbg !211 // 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 !204 { -// CHECK:STDOUT: ret i32 %self, !dbg !207 +// CHECK:STDOUT: define linkonce_odr i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self) #0 !dbg !212 { +// CHECK:STDOUT: ret i32 %self, !dbg !215 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_COp.a7c16f707f533a23:Copy.Core.5bd8d5767580997a"(i32 %self) #0 !dbg !208 { -// CHECK:STDOUT: ret i32 %self, !dbg !212 +// CHECK:STDOUT: define linkonce_odr i32 @"_COp.a7c16f707f533a23:Copy.Core.5bd8d5767580997a"(i32 %self) #0 !dbg !216 { +// CHECK:STDOUT: ret i32 %self, !dbg !220 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -405,174 +417,182 @@ fn F(c: Core.Optional(C*)) -> Core.Optional(C*) { // CHECK:STDOUT: !42 = !{!43} // CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !39, type: !14) // CHECK:STDOUT: !44 = !DILocation(line: 13, column: 10, scope: !39) -// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Op", linkageName: "_COp.eb54d7735089d035:core.Destroy.Core", scope: null, file: !3, line: 18, type: !40, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !46) +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d4fdfc2912de527a:core.Destroy.Core", scope: null, file: !3, line: 18, 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: 18, column: 3, scope: !45) -// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "Op", linkageName: "_COp.33aade76ef369ae0:core.Destroy.Core", scope: null, file: !3, line: 18, type: !40, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !50) +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "Op", linkageName: "_COp.eb54d7735089d035:core.Destroy.Core", scope: null, file: !3, line: 18, 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: 18, column: 3, scope: !49) -// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "Op", linkageName: "_COp.4352d4717a4da3c5:core.Destroy.Core", scope: null, file: !3, line: 18, type: !40, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !54) +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "Op", linkageName: "_COp.33aade76ef369ae0:core.Destroy.Core", scope: null, file: !3, line: 18, 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: 18, column: 3, scope: !53) -// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "Op", linkageName: "_COp.bc7b205814bb8542:core.Destroy.Core", scope: null, file: !3, line: 18, type: !40, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !58) +// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "Op", linkageName: "_COp.4352d4717a4da3c5:core.Destroy.Core", scope: null, file: !3, line: 18, type: !40, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !58) // CHECK:STDOUT: !58 = !{!59} // CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !57, type: !14) // CHECK:STDOUT: !60 = !DILocation(line: 18, column: 3, scope: !57) -// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "Op", linkageName: "_COp.56bc00fa6756ea9e:core.Destroy.Core", scope: null, file: !3, line: 18, type: !40, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !62) +// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "Op", linkageName: "_COp.bc7b205814bb8542:core.Destroy.Core", scope: null, file: !3, line: 18, 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: 18, column: 3, scope: !61) -// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0fc9634857315db2:core.Destroy.Core", scope: null, file: !3, line: 16, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !66) +// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "Op", linkageName: "_COp.56bc00fa6756ea9e:core.Destroy.Core", scope: null, file: !3, line: 18, type: !40, 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: 16, column: 3, scope: !65) -// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "Op", linkageName: "_COp.69700c1fc1b2744c:core.Destroy.Core", scope: null, file: !3, line: 16, type: !40, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !70) +// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !65, type: !14) +// CHECK:STDOUT: !68 = !DILocation(line: 18, column: 3, scope: !65) +// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "Op", linkageName: "_COp.94ba1c30d421702e:core.Destroy.Core", scope: null, file: !3, line: 16, 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: 16, column: 3, scope: !69) -// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "Op", linkageName: "_COp.36bd54c278c044c5:core.Destroy.Core", scope: null, file: !3, line: 16, type: !40, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !74) +// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0fc9634857315db2:core.Destroy.Core", scope: null, file: !3, line: 16, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !74) // CHECK:STDOUT: !74 = !{!75} -// CHECK:STDOUT: !75 = !DILocalVariable(arg: 1, scope: !73, type: !14) +// CHECK:STDOUT: !75 = !DILocalVariable(arg: 1, scope: !73, type: !7) // CHECK:STDOUT: !76 = !DILocation(line: 16, column: 3, scope: !73) -// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "Op", linkageName: "_COp.30688d383ae72bab:core.Destroy.Core", scope: null, file: !3, line: 16, type: !40, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !78) +// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "Op", linkageName: "_COp.69700c1fc1b2744c:core.Destroy.Core", scope: null, file: !3, line: 16, type: !40, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !78) // CHECK:STDOUT: !78 = !{!79} // CHECK:STDOUT: !79 = !DILocalVariable(arg: 1, scope: !77, type: !14) // CHECK:STDOUT: !80 = !DILocation(line: 16, column: 3, scope: !77) -// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "Op", linkageName: "_COp.49575b3ccc332429:core.Destroy.Core", scope: null, file: !3, line: 16, type: !40, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !82) +// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "Op", linkageName: "_COp.36bd54c278c044c5:core.Destroy.Core", scope: null, file: !3, line: 16, 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: 16, column: 3, scope: !81) -// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.b79ac2ab1b7701d6", scope: null, file: !86, line: 36, 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: 37, column: 12, scope: !85) -// CHECK:STDOUT: !90 = !DILocation(line: 37, column: 5, scope: !85) -// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.b79ac2ab1b7701d6", scope: null, file: !86, line: 39, 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: 40, column: 12, scope: !91) -// CHECK:STDOUT: !95 = !DILocation(line: 40, column: 5, scope: !91) -// CHECK:STDOUT: !96 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.a77ff6e8edaf9e8d", scope: null, file: !86, line: 105, 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: !96, type: !7) -// CHECK:STDOUT: !101 = !DILocation(line: 106, column: 12, scope: !96) -// CHECK:STDOUT: !102 = !DILocation(line: 106, column: 5, scope: !96) -// CHECK:STDOUT: !103 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.70a0b54a75854b7a", scope: null, file: !86, line: 30, type: !104, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !104 = !DISubroutineType(types: !105) -// CHECK:STDOUT: !105 = !{!14} -// CHECK:STDOUT: !106 = !DILocation(line: 31, column: 12, scope: !103) -// CHECK:STDOUT: !107 = !DILocation(line: 31, column: 5, scope: !103) -// CHECK:STDOUT: !108 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.36d191ed69f42abb", scope: null, file: !109, line: 42, 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: 42, column: 45, scope: !108) -// CHECK:STDOUT: !113 = !DILocation(line: 42, column: 38, scope: !108) -// CHECK:STDOUT: !114 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.6f97602f44c068f9", scope: null, file: !86, line: 105, 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: 106, column: 12, scope: !114) -// CHECK:STDOUT: !118 = !DILocation(line: 106, column: 5, scope: !114) -// CHECK:STDOUT: !119 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.7e715d26c6bb9daa", scope: null, file: !109, line: 42, 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: 42, column: 45, scope: !119) -// CHECK:STDOUT: !123 = !DILocation(line: 42, column: 38, scope: !119) -// CHECK:STDOUT: !124 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.36d191ed69f42abb", scope: null, file: !109, line: 46, 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: 46, column: 45, scope: !124) -// CHECK:STDOUT: !128 = !DILocation(line: 46, column: 38, scope: !124) -// CHECK:STDOUT: !129 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.bd2b2818aef220bf", scope: null, file: !109, line: 46, 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: 46, column: 45, scope: !129) -// CHECK:STDOUT: !133 = !DILocation(line: 46, column: 38, scope: !129) -// CHECK:STDOUT: !134 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.7e715d26c6bb9daa", scope: null, file: !109, line: 46, 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: 46, column: 45, scope: !134) -// CHECK:STDOUT: !138 = !DILocation(line: 46, column: 38, scope: !134) -// CHECK:STDOUT: !139 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.7f331ac9d2b85055", scope: null, file: !109, line: 46, 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: 46, column: 45, scope: !139) -// CHECK:STDOUT: !143 = !DILocation(line: 46, column: 38, scope: !139) -// CHECK:STDOUT: !144 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.e8f8f92d3d08d149:OptionalStorage.Core.84588f41d61dafba", scope: null, file: !86, line: 172, 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: 173, column: 16, scope: !144) -// CHECK:STDOUT: !148 = !DILocation(line: 173, column: 12, scope: !144) -// CHECK:STDOUT: !149 = !DILocation(line: 173, column: 5, scope: !144) -// CHECK:STDOUT: !150 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.e8f8f92d3d08d149:OptionalStorage.Core.84588f41d61dafba", scope: null, file: !86, line: 175, 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: 176, column: 5, scope: !150) -// CHECK:STDOUT: !154 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.70a0b54a75854b7a", scope: null, file: !86, line: 80, 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: 81, column: 12, scope: !154) -// CHECK:STDOUT: !158 = !DILocation(line: 81, column: 5, scope: !154) -// CHECK:STDOUT: !159 = distinct !DISubprogram(name: "None", linkageName: "_CNone.74becf39533834ee:OptionalStorage.Core.b99f4a084b13a83f", scope: null, file: !86, line: 125, type: !104, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !160 = !DILocation(line: 128, column: 5, scope: !159) -// CHECK:STDOUT: !161 = !DILocation(line: 129, column: 5, scope: !159) -// CHECK:STDOUT: !162 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.04776faa19f4241b", scope: null, file: !86, line: 87, type: !97, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !163) +// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "Op", linkageName: "_COp.30688d383ae72bab:core.Destroy.Core", scope: null, file: !3, line: 16, type: !40, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !86) +// CHECK:STDOUT: !86 = !{!87} +// CHECK:STDOUT: !87 = !DILocalVariable(arg: 1, scope: !85, type: !14) +// CHECK:STDOUT: !88 = !DILocation(line: 16, column: 3, scope: !85) +// CHECK:STDOUT: !89 = distinct !DISubprogram(name: "Op", linkageName: "_COp.49575b3ccc332429:core.Destroy.Core", scope: null, file: !3, line: 16, type: !40, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !90) +// CHECK:STDOUT: !90 = !{!91} +// CHECK:STDOUT: !91 = !DILocalVariable(arg: 1, scope: !89, type: !14) +// CHECK:STDOUT: !92 = !DILocation(line: 16, column: 3, scope: !89) +// CHECK:STDOUT: !93 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.b79ac2ab1b7701d6", scope: null, file: !94, line: 36, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !95) +// CHECK:STDOUT: !94 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !95 = !{!96} +// CHECK:STDOUT: !96 = !DILocalVariable(arg: 1, scope: !93, type: !14) +// CHECK:STDOUT: !97 = !DILocation(line: 37, column: 12, scope: !93) +// CHECK:STDOUT: !98 = !DILocation(line: 37, column: 5, scope: !93) +// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.b79ac2ab1b7701d6", scope: null, file: !94, line: 39, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !100) +// CHECK:STDOUT: !100 = !{!101} +// CHECK:STDOUT: !101 = !DILocalVariable(arg: 1, scope: !99, type: !14) +// CHECK:STDOUT: !102 = !DILocation(line: 40, column: 12, scope: !99) +// CHECK:STDOUT: !103 = !DILocation(line: 40, column: 5, scope: !99) +// CHECK:STDOUT: !104 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.a77ff6e8edaf9e8d", scope: null, file: !94, line: 105, type: !105, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !107) +// CHECK:STDOUT: !105 = !DISubroutineType(types: !106) +// CHECK:STDOUT: !106 = !{!14, !7} +// CHECK:STDOUT: !107 = !{!108} +// CHECK:STDOUT: !108 = !DILocalVariable(arg: 1, scope: !104, type: !7) +// CHECK:STDOUT: !109 = !DILocation(line: 106, column: 12, scope: !104) +// CHECK:STDOUT: !110 = !DILocation(line: 106, column: 5, scope: !104) +// CHECK:STDOUT: !111 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.70a0b54a75854b7a", scope: null, file: !94, line: 30, type: !112, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !112 = !DISubroutineType(types: !113) +// CHECK:STDOUT: !113 = !{!14} +// CHECK:STDOUT: !114 = !DILocation(line: 31, column: 12, scope: !111) +// CHECK:STDOUT: !115 = !DILocation(line: 31, column: 5, scope: !111) +// CHECK:STDOUT: !116 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.36d191ed69f42abb", scope: null, file: !117, line: 42, type: !105, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !118) +// CHECK:STDOUT: !117 = !DIFile(filename: "{{.*}}/prelude/operators/as.carbon", directory: "") +// CHECK:STDOUT: !118 = !{!119} +// CHECK:STDOUT: !119 = !DILocalVariable(arg: 1, scope: !116, type: !7) +// CHECK:STDOUT: !120 = !DILocation(line: 42, column: 45, scope: !116) +// CHECK:STDOUT: !121 = !DILocation(line: 42, column: 38, scope: !116) +// CHECK:STDOUT: !122 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.6f97602f44c068f9", scope: null, file: !94, line: 105, type: !105, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !123) +// CHECK:STDOUT: !123 = !{!124} +// CHECK:STDOUT: !124 = !DILocalVariable(arg: 1, scope: !122, type: !7) +// CHECK:STDOUT: !125 = !DILocation(line: 106, column: 12, scope: !122) +// CHECK:STDOUT: !126 = !DILocation(line: 106, column: 5, scope: !122) +// CHECK:STDOUT: !127 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.7e715d26c6bb9daa", scope: null, file: !117, line: 42, type: !105, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !128) +// CHECK:STDOUT: !128 = !{!129} +// CHECK:STDOUT: !129 = !DILocalVariable(arg: 1, scope: !127, type: !7) +// CHECK:STDOUT: !130 = !DILocation(line: 42, column: 45, scope: !127) +// CHECK:STDOUT: !131 = !DILocation(line: 42, column: 38, scope: !127) +// CHECK:STDOUT: !132 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.36d191ed69f42abb", scope: null, file: !117, line: 46, type: !105, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !133) +// CHECK:STDOUT: !133 = !{!134} +// CHECK:STDOUT: !134 = !DILocalVariable(arg: 1, scope: !132, type: !7) +// CHECK:STDOUT: !135 = !DILocation(line: 46, column: 45, scope: !132) +// CHECK:STDOUT: !136 = !DILocation(line: 46, column: 38, scope: !132) +// CHECK:STDOUT: !137 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.bd2b2818aef220bf", scope: null, file: !117, line: 46, type: !105, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !138) +// CHECK:STDOUT: !138 = !{!139} +// CHECK:STDOUT: !139 = !DILocalVariable(arg: 1, scope: !137, type: !7) +// CHECK:STDOUT: !140 = !DILocation(line: 46, column: 45, scope: !137) +// CHECK:STDOUT: !141 = !DILocation(line: 46, column: 38, scope: !137) +// CHECK:STDOUT: !142 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.7e715d26c6bb9daa", scope: null, file: !117, line: 46, type: !105, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !143) +// CHECK:STDOUT: !143 = !{!144} +// CHECK:STDOUT: !144 = !DILocalVariable(arg: 1, scope: !142, type: !7) +// CHECK:STDOUT: !145 = !DILocation(line: 46, column: 45, scope: !142) +// CHECK:STDOUT: !146 = !DILocation(line: 46, column: 38, scope: !142) +// CHECK:STDOUT: !147 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.7f331ac9d2b85055", scope: null, file: !117, line: 46, type: !105, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !148) +// CHECK:STDOUT: !148 = !{!149} +// CHECK:STDOUT: !149 = !DILocalVariable(arg: 1, scope: !147, type: !7) +// CHECK:STDOUT: !150 = !DILocation(line: 46, column: 45, scope: !147) +// CHECK:STDOUT: !151 = !DILocation(line: 46, column: 38, scope: !147) +// CHECK:STDOUT: !152 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.e8f8f92d3d08d149:OptionalStorage.Core.84588f41d61dafba", scope: null, file: !94, line: 172, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !153) +// CHECK:STDOUT: !153 = !{!154} +// CHECK:STDOUT: !154 = !DILocalVariable(arg: 1, scope: !152, type: !14) +// CHECK:STDOUT: !155 = !DILocation(line: 173, column: 16, scope: !152) +// CHECK:STDOUT: !156 = !DILocation(line: 173, column: 12, scope: !152) +// CHECK:STDOUT: !157 = !DILocation(line: 173, column: 5, scope: !152) +// CHECK:STDOUT: !158 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.e8f8f92d3d08d149:OptionalStorage.Core.84588f41d61dafba", scope: null, file: !94, line: 175, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !159) +// CHECK:STDOUT: !159 = !{!160} +// CHECK:STDOUT: !160 = !DILocalVariable(arg: 1, scope: !158, type: !14) +// CHECK:STDOUT: !161 = !DILocation(line: 176, column: 5, scope: !158) +// CHECK:STDOUT: !162 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.70a0b54a75854b7a", scope: null, file: !94, line: 80, type: !105, 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: 88, column: 29, scope: !162) -// CHECK:STDOUT: !166 = !DILocation(line: 88, column: 12, scope: !162) -// CHECK:STDOUT: !167 = !DILocation(line: 88, column: 5, scope: !162) -// CHECK:STDOUT: !168 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.70a0b54a75854b7a", scope: null, file: !86, line: 33, 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: 34, column: 12, scope: !168) -// CHECK:STDOUT: !172 = !DILocation(line: 34, column: 5, scope: !168) -// CHECK:STDOUT: !173 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.a1e92423fb5cda0f", scope: null, file: !109, line: 42, 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: 42, column: 45, scope: !173) -// CHECK:STDOUT: !177 = !DILocation(line: 42, column: 38, scope: !173) -// CHECK:STDOUT: !178 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.442ff502447e2586", scope: null, file: !86, line: 33, 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: 34, column: 12, scope: !178) -// CHECK:STDOUT: !182 = !DILocation(line: 34, column: 5, scope: !178) -// CHECK:STDOUT: !183 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.74becf39533834ee:OptionalStorage.Core.b99f4a084b13a83f", scope: null, file: !86, line: 131, 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: 137, column: 5, scope: !183) -// CHECK:STDOUT: !187 = !DILocation(line: 138, column: 5, scope: !183) -// CHECK:STDOUT: !188 = !DILocation(line: 139, column: 5, scope: !183) -// CHECK:STDOUT: !189 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.40372ba0ea03ef47", scope: null, file: !190, line: 63, 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: 65, column: 17, scope: !189) -// CHECK:STDOUT: !196 = !DILocation(line: 65, column: 5, scope: !189) -// CHECK:STDOUT: !197 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.74becf39533834ee:OptionalStorage.Core.9e376a14fbf8fb3d", scope: null, file: !86, line: 131, 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: 137, column: 5, scope: !197) -// CHECK:STDOUT: !201 = !DILocation(line: 137, column: 28, scope: !197) -// CHECK:STDOUT: !202 = !DILocation(line: 138, column: 5, scope: !197) -// CHECK:STDOUT: !203 = !DILocation(line: 139, column: 5, scope: !197) -// CHECK:STDOUT: !204 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !190, line: 58, 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: 58, column: 36, scope: !204) -// CHECK:STDOUT: !208 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a7c16f707f533a23:Copy.Core.5bd8d5767580997a", scope: null, file: !209, line: 23, 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: 23, column: 33, scope: !208) +// CHECK:STDOUT: !165 = !DILocation(line: 81, column: 12, scope: !162) +// CHECK:STDOUT: !166 = !DILocation(line: 81, column: 5, scope: !162) +// CHECK:STDOUT: !167 = distinct !DISubprogram(name: "None", linkageName: "_CNone.74becf39533834ee:OptionalStorage.Core.b99f4a084b13a83f", scope: null, file: !94, line: 125, type: !112, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !168 = !DILocation(line: 128, column: 5, scope: !167) +// CHECK:STDOUT: !169 = !DILocation(line: 129, column: 5, scope: !167) +// CHECK:STDOUT: !170 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.04776faa19f4241b", scope: null, file: !94, line: 87, type: !105, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !171) +// CHECK:STDOUT: !171 = !{!172} +// CHECK:STDOUT: !172 = !DILocalVariable(arg: 1, scope: !170, type: !7) +// CHECK:STDOUT: !173 = !DILocation(line: 88, column: 29, scope: !170) +// CHECK:STDOUT: !174 = !DILocation(line: 88, column: 12, scope: !170) +// CHECK:STDOUT: !175 = !DILocation(line: 88, column: 5, scope: !170) +// CHECK:STDOUT: !176 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.70a0b54a75854b7a", scope: null, file: !94, line: 33, type: !105, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !177) +// CHECK:STDOUT: !177 = !{!178} +// CHECK:STDOUT: !178 = !DILocalVariable(arg: 1, scope: !176, type: !7) +// CHECK:STDOUT: !179 = !DILocation(line: 34, column: 12, scope: !176) +// CHECK:STDOUT: !180 = !DILocation(line: 34, column: 5, scope: !176) +// CHECK:STDOUT: !181 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.a1e92423fb5cda0f", scope: null, file: !117, line: 42, type: !105, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !182) +// CHECK:STDOUT: !182 = !{!183} +// CHECK:STDOUT: !183 = !DILocalVariable(arg: 1, scope: !181, type: !7) +// CHECK:STDOUT: !184 = !DILocation(line: 42, column: 45, scope: !181) +// CHECK:STDOUT: !185 = !DILocation(line: 42, column: 38, scope: !181) +// CHECK:STDOUT: !186 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.442ff502447e2586", scope: null, file: !94, line: 33, type: !105, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !187) +// CHECK:STDOUT: !187 = !{!188} +// CHECK:STDOUT: !188 = !DILocalVariable(arg: 1, scope: !186, type: !7) +// CHECK:STDOUT: !189 = !DILocation(line: 34, column: 12, scope: !186) +// CHECK:STDOUT: !190 = !DILocation(line: 34, column: 5, scope: !186) +// CHECK:STDOUT: !191 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.74becf39533834ee:OptionalStorage.Core.b99f4a084b13a83f", scope: null, file: !94, line: 131, type: !105, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !192) +// CHECK:STDOUT: !192 = !{!193} +// CHECK:STDOUT: !193 = !DILocalVariable(arg: 1, scope: !191, type: !7) +// CHECK:STDOUT: !194 = !DILocation(line: 137, column: 5, scope: !191) +// CHECK:STDOUT: !195 = !DILocation(line: 138, column: 5, scope: !191) +// CHECK:STDOUT: !196 = !DILocation(line: 139, column: 5, scope: !191) +// CHECK:STDOUT: !197 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.40372ba0ea03ef47", scope: null, file: !198, line: 63, type: !199, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !201) +// CHECK:STDOUT: !198 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") +// CHECK:STDOUT: !199 = !DISubroutineType(types: !200) +// CHECK:STDOUT: !200 = !{!7, !7} +// CHECK:STDOUT: !201 = !{!202} +// CHECK:STDOUT: !202 = !DILocalVariable(arg: 1, scope: !197, type: !7) +// CHECK:STDOUT: !203 = !DILocation(line: 65, column: 17, scope: !197) +// CHECK:STDOUT: !204 = !DILocation(line: 65, column: 5, scope: !197) +// CHECK:STDOUT: !205 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.74becf39533834ee:OptionalStorage.Core.9e376a14fbf8fb3d", scope: null, file: !94, line: 131, type: !105, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !206) +// CHECK:STDOUT: !206 = !{!207} +// CHECK:STDOUT: !207 = !DILocalVariable(arg: 1, scope: !205, type: !7) +// CHECK:STDOUT: !208 = !DILocation(line: 137, column: 5, scope: !205) +// CHECK:STDOUT: !209 = !DILocation(line: 137, column: 28, scope: !205) +// CHECK:STDOUT: !210 = !DILocation(line: 138, column: 5, scope: !205) +// CHECK:STDOUT: !211 = !DILocation(line: 139, column: 5, scope: !205) +// CHECK:STDOUT: !212 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !198, line: 58, type: !199, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !213) +// CHECK:STDOUT: !213 = !{!214} +// CHECK:STDOUT: !214 = !DILocalVariable(arg: 1, scope: !212, type: !7) +// CHECK:STDOUT: !215 = !DILocation(line: 58, column: 36, scope: !212) +// CHECK:STDOUT: !216 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a7c16f707f533a23:Copy.Core.5bd8d5767580997a", scope: null, file: !217, line: 23, type: !105, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !218) +// CHECK:STDOUT: !217 = !DIFile(filename: "{{.*}}/prelude/copy.carbon", directory: "") +// CHECK:STDOUT: !218 = !{!219} +// CHECK:STDOUT: !219 = !DILocalVariable(arg: 1, scope: !216, type: !7) +// CHECK:STDOUT: !220 = !DILocation(line: 23, column: 33, scope: !216) // CHECK:STDOUT: ; ModuleID = 'copy.carbon' // CHECK:STDOUT: source_filename = "copy.carbon" // CHECK:STDOUT: