From 2e5b195813053e412adec73fe9307922ce19aa07 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 11 Mar 2026 13:21:21 -0700 Subject: [PATCH] Make `{} as Class` an initializing expression. (#6882) Previously we forced a temporary materialization, resulting in it being treated as an ephemeral reference expression. This change allows ```carbon var x: Class = {} as Class; ``` even when `Class` is not copyable. --- toolchain/check/convert.cpp | 32 +-- toolchain/check/testdata/alias/basics.carbon | 4 +- .../testdata/as/adapter_conversion.carbon | 27 +- toolchain/check/testdata/as/basics.carbon | 11 +- toolchain/check/testdata/choice/basic.carbon | 20 +- .../check/testdata/choice/generic.carbon | 4 +- .../testdata/class/abstract/abstract.carbon | 17 +- .../testdata/class/adapter/init_adapt.carbon | 8 +- .../class/fail_init_as_inplace.carbon | 33 --- .../class/generic/method_deduce.carbon | 8 +- .../testdata/class/generic/stringify.carbon | 12 +- .../class/inheritance/derived_to_base.carbon | 18 +- toolchain/check/testdata/class/init_as.carbon | 169 ++++++----- .../check/testdata/class/method/method.carbon | 14 +- toolchain/check/testdata/const/basics.carbon | 31 +- .../check/testdata/deduce/generic_type.carbon | 12 +- .../value_with_type_through_access.carbon | 94 +++---- .../facet/call_combined_impl_witness.carbon | 12 +- ...t_class_type_to_generic_facet_value.carbon | 12 +- ...rt_class_value_to_facet_value_value.carbon | 12 +- ..._value_to_generic_facet_value_value.carbon | 72 ++--- ...t_value_as_type_knows_original_type.carbon | 28 +- ..._value_to_generic_facet_value_value.carbon | 30 +- ...convert_facet_value_value_to_itself.carbon | 12 +- toolchain/check/testdata/for/basic.carbon | 26 +- .../testdata/function/generic/deduce.carbon | 8 +- .../impl/fail_extend_impl_scope.carbon | 8 +- .../testdata/impl/fail_impl_as_scope.carbon | 15 +- .../check/testdata/impl/import_thunk.carbon | 18 +- .../impl/lookup/canonical_query_self.carbon | 26 +- .../testdata/impl/use_assoc_entity.carbon | 12 +- .../interface/compound_member_access.carbon | 23 +- .../testdata/interface/generic_method.carbon | 16 +- .../interop/cpp/function/default_arg.carbon | 76 ++--- .../interop/cpp/function/overloads.carbon | 32 +-- .../interop/cpp/function/pointer.carbon | 14 +- .../interop/cpp/function/reference.carbon | 44 ++- .../cpp/template/class_template.carbon | 10 +- .../operators/overloaded/index.carbon | 8 +- .../overloaded/index_with_prelude.carbon | 16 +- .../testdata/packages/missing_prelude.carbon | 4 +- .../return/import_convert_function.carbon | 264 +++++++++--------- .../function/definition/destroy.carbon | 4 +- .../testdata/interop/cpp/reference.carbon | 8 +- .../testdata/interop/cpp/template.carbon | 8 +- 45 files changed, 592 insertions(+), 740 deletions(-) delete mode 100644 toolchain/check/testdata/class/fail_init_as_inplace.carbon diff --git a/toolchain/check/convert.cpp b/toolchain/check/convert.cpp index 750c13217bb0..8549d8c5b410 100644 --- a/toolchain/check/convert.cpp +++ b/toolchain/check/convert.cpp @@ -848,29 +848,18 @@ static auto ConvertStructToClass(Context& context, SemIR::StructType src_type, auto dest_struct_type = context.types().GetAs(object_repr_id); - // If we're trying to create a class value, form a temporary for the value to - // point to. - bool need_temporary = !target.is_initializer(); - if (need_temporary) { + // If we're trying to create a class value, form temporary storage to hold the + // initializer. + if (!target.is_initializer()) { target.kind = ConversionTarget::Initializing; target.storage_access_block = &target_block; target.storage_id = target_block.AddInst( SemIR::LocId(value_id), {.type_id = target.type_id}); } - auto result_id = ConvertStructToStructOrClass( + return ConvertStructToStructOrClass( context, src_type, dest_struct_type, value_id, target, is_partial ? nullptr : &dest_type); - - if (need_temporary) { - target_block.InsertHere(); - result_id = - AddInstWithCleanup(context, SemIR::LocId(value_id), - {.type_id = target.type_id, - .storage_id = target.storage_id, - .init_id = result_id}); - } - return result_id; } // An inheritance path is a sequence of `BaseDecl`s and corresponding base types @@ -1754,15 +1743,18 @@ auto CategoryConverter::DoStep(const SemIR::InstId expr_id, return Done{expr_id}; } - // Commit to using a temporary for this initializing expression. - // TODO: Don't create a temporary if the initializing representation - // is already a value representation. - // TODO: If the target is DurableRef, materialize a VarStorage instead of - // a TemporaryStorage to lifetime-extend. if (target_.kind == ConversionTarget::Discarded) { DiscardInitializer(context_, expr_id); return Done{SemIR::InstId::None}; + } else if (IsValidExprCategoryForConversionTarget(category, + target_.kind)) { + return Done{expr_id}; } else { + // Commit to using a temporary for this initializing expression. + // TODO: Don't create a temporary if the initializing representation is + // already a value representation. + // TODO: If the target is DurableRef, materialize a VarStorage instead + // of a TemporaryStorage to lifetime-extend. return NextStep{.expr_id = MaterializeTemporary(context_, expr_id), .category = SemIR::ExprCategory::EphemeralRef}; } diff --git a/toolchain/check/testdata/alias/basics.carbon b/toolchain/check/testdata/alias/basics.carbon index c5951a6c3e0d..1e808391f31e 100644 --- a/toolchain/check/testdata/alias/basics.carbon +++ b/toolchain/check/testdata/alias/basics.carbon @@ -186,8 +186,8 @@ extern alias C = Class; // CHECK:STDOUT: %c.ref: type = name_ref c, %c [concrete = constants.%C] // CHECK:STDOUT: %.loc10_13.1: ref %C = temporary_storage // CHECK:STDOUT: %.loc10_13.2: init %C to %.loc10_13.1 = class_init () [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc10_13.3: ref %C = temporary %.loc10_13.1, %.loc10_13.2 -// CHECK:STDOUT: %.loc10_13.4: ref %C = converted @__global_init.%.loc10, %.loc10_13.3 +// CHECK:STDOUT: %.loc10_13.3: init %C = converted @__global_init.%.loc10, %.loc10_13.2 [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc10_13.4: ref %C = temporary %.loc10_13.1, %.loc10_13.3 // CHECK:STDOUT: %.loc10_13.5: %C = acquire_value %.loc10_13.4 // CHECK:STDOUT: %d: %C = value_binding d, %.loc10_13.5 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/as/adapter_conversion.carbon b/toolchain/check/testdata/as/adapter_conversion.carbon index 5e0dcd14fe32..095c4d9975a5 100644 --- a/toolchain/check/testdata/as/adapter_conversion.carbon +++ b/toolchain/check/testdata/as/adapter_conversion.carbon @@ -82,7 +82,7 @@ class B { let b_value: B = ({.x = 1, .y = 2} as A) as B; //@dump-sem-ir-end -// --- fail_init_class_variable.carbon +// --- init_class_variable.carbon library "[[@TEST_NAME]]"; @@ -95,18 +95,6 @@ class B { adapt A; } -// TODO: Here, we treat `{.x = 1, .y = 2} as A` as a value expression, not an -// initializing expression, so `(...) as B` is a value expression too, requiring -// a copy to perform initialization. It's not clear whether that is the right -// behavior. - -// CHECK:STDERR: fail_init_class_variable.carbon:[[@LINE+7]]:17: error: cannot copy value of type `B` [CopyOfUncopyableType] -// CHECK:STDERR: var b_init: B = ({.x = 1, .y = 2} as A) as B; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_init_class_variable.carbon:[[@LINE+4]]:17: note: type `B` does not implement interface `Core.Copy` [MissingImplInMemberAccessInContext] -// CHECK:STDERR: var b_init: B = ({.x = 1, .y = 2} as A) as B; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: var b_init: B = ({.x = 1, .y = 2} as A) as B; // --- init_tuple_value.carbon @@ -365,6 +353,7 @@ var b: B = {.x = ()} as B; // CHECK:STDOUT: %bound_method.646: = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %A.val: %A = struct_value (%int_1.5d2, %int_2.ef8) [concrete] +// CHECK:STDOUT: %B.val: %B = struct_value (%int_1.5d2, %int_2.ef8) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -377,8 +366,9 @@ var b: B = {.x = ()} as B; // CHECK:STDOUT: %b_value.patt: %pattern_type.1f4 = value_binding_pattern b_value [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %B.ref: type = name_ref B, %B.decl [concrete = constants.%B] -// CHECK:STDOUT: %.loc14: %B = acquire_value @__global_init.%.loc14_42.2 -// CHECK:STDOUT: %b_value: %B = value_binding b_value, %.loc14 +// CHECK:STDOUT: %.loc14_42.1: ref %B = temporary @__global_init.%.loc14_34.3, @__global_init.%.loc14_42.2 +// CHECK:STDOUT: %.loc14_42.2: %B = acquire_value %.loc14_42.1 +// CHECK:STDOUT: %b_value: %B = value_binding b_value, %.loc14_42.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -405,11 +395,10 @@ var b: B = {.x = ()} as B; // CHECK:STDOUT: %.loc14_34.7: ref %i32 = class_element_access %.loc14_34.3, element1 // CHECK:STDOUT: %.loc14_34.8: init %i32 to %.loc14_34.7 = in_place_init %.loc14_34.6 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc14_34.9: init %A to %.loc14_34.3 = class_init (%.loc14_34.5, %.loc14_34.8) [concrete = constants.%A.val] -// CHECK:STDOUT: %.loc14_34.10: ref %A = temporary %.loc14_34.3, %.loc14_34.9 -// CHECK:STDOUT: %.loc14_36: ref %A = converted %.loc14_34.1, %.loc14_34.10 +// CHECK:STDOUT: %.loc14_36: init %A = converted %.loc14_34.1, %.loc14_34.9 [concrete = constants.%A.val] // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B] -// CHECK:STDOUT: %.loc14_42.1: ref %B = as_compatible %.loc14_36 -// CHECK:STDOUT: %.loc14_42.2: ref %B = converted %.loc14_36, %.loc14_42.1 +// CHECK:STDOUT: %.loc14_42.1: init %B = as_compatible %.loc14_36 [concrete = constants.%B.val] +// CHECK:STDOUT: %.loc14_42.2: init %B = converted %.loc14_36, %.loc14_42.1 [concrete = constants.%B.val] // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/as/basics.carbon b/toolchain/check/testdata/as/basics.carbon index 8522ca8bcfbf..6ae49a7b0a76 100644 --- a/toolchain/check/testdata/as/basics.carbon +++ b/toolchain/check/testdata/as/basics.carbon @@ -370,6 +370,7 @@ let n: {.x: ()} = {.x = ()} as {.x = ()}; // CHECK:STDOUT: %As.facet.c03: %As.type.d1e = facet_value %X, (%As.impl_witness.e92) [concrete] // CHECK:STDOUT: %As.WithSelf.Convert.type.edc: type = fn_type @As.WithSelf.Convert, @As.WithSelf(%Y, %As.facet.c03) [concrete] // CHECK:STDOUT: %.84a: type = fn_type_with_self_type %As.WithSelf.Convert.type.edc, %As.facet.c03 [concrete] +// CHECK:STDOUT: %X.as.As.impl.Convert.bound: = bound_method %X.val, %X.as.As.impl.Convert [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -392,14 +393,14 @@ let n: {.x: ()} = {.x = ()} as {.x = ()}; // CHECK:STDOUT: %.loc19_20.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc19_21.4: init %empty_tuple.type = converted %.loc19_20.1, %.loc19_20.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc19_21.5: init %X to %.loc19_21.2 = class_init (%.loc19_21.4) [concrete = constants.%X.val] -// CHECK:STDOUT: %.loc19_21.6: ref %X = temporary %.loc19_21.2, %.loc19_21.5 -// CHECK:STDOUT: %.loc19_23.1: ref %X = converted %.loc19_21.1, %.loc19_21.6 +// CHECK:STDOUT: %.loc19_23.1: init %X = converted %.loc19_21.1, %.loc19_21.5 [concrete = constants.%X.val] // CHECK:STDOUT: %Y.ref: type = name_ref Y, file.%Y.decl [concrete = constants.%Y] // CHECK:STDOUT: %impl.elem0: %.84a = impl_witness_access constants.%As.impl_witness.e92, element0 [concrete = constants.%X.as.As.impl.Convert] -// CHECK:STDOUT: %bound_method: = bound_method %.loc19_23.1, %impl.elem0 +// CHECK:STDOUT: %bound_method: = bound_method %.loc19_23.1, %impl.elem0 [concrete = constants.%X.as.As.impl.Convert.bound] // CHECK:STDOUT: %.loc19_29.1: ref %Y = temporary_storage -// CHECK:STDOUT: %.loc19_23.2: %X = acquire_value %.loc19_23.1 -// CHECK:STDOUT: %X.as.As.impl.Convert.call: init %Y to %.loc19_29.1 = call %bound_method(%.loc19_23.2) +// CHECK:STDOUT: %.loc19_23.2: ref %X = temporary %.loc19_21.2, %.loc19_23.1 +// CHECK:STDOUT: %.loc19_23.3: %X = acquire_value %.loc19_23.2 +// CHECK:STDOUT: %X.as.As.impl.Convert.call: init %Y to %.loc19_29.1 = call %bound_method(%.loc19_23.3) // CHECK:STDOUT: %.loc19_29.2: init %Y = converted %.loc19_23.1, %X.as.As.impl.Convert.call // CHECK:STDOUT: // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/choice/basic.carbon b/toolchain/check/testdata/choice/basic.carbon index a4a8056cedea..527013c72cbf 100644 --- a/toolchain/check/testdata/choice/basic.carbon +++ b/toolchain/check/testdata/choice/basic.carbon @@ -111,8 +111,8 @@ let never: Never = {}; // CHECK:STDOUT: %.loc6_1.6: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_1.7: init %empty_tuple.type = converted %.loc6_1.2, %.loc6_1.6 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_1.8: init %Always to %.loc6_1.4 = class_init (%.loc6_1.7) [concrete = constants.%Always.val] -// CHECK:STDOUT: %.loc6_1.9: ref %Always = temporary %.loc6_1.4, %.loc6_1.8 -// CHECK:STDOUT: %.loc6_1.10: ref %Always = converted %.loc6_1.3, %.loc6_1.9 +// CHECK:STDOUT: %.loc6_1.9: init %Always = converted %.loc6_1.3, %.loc6_1.8 [concrete = constants.%Always.val] +// CHECK:STDOUT: %.loc6_1.10: ref %Always = temporary %.loc6_1.4, %.loc6_1.9 // CHECK:STDOUT: %.loc6_1.11: %Always = acquire_value %.loc6_1.10 // CHECK:STDOUT: %Sunny: %Always = value_binding Sunny, %.loc6_1.11 // CHECK:STDOUT: complete_type_witness = %complete_type @@ -244,8 +244,8 @@ let never: Never = {}; // CHECK:STDOUT: %.loc5_7.5: ref %u2 = class_element_access %.loc5_7.4, element0 // CHECK:STDOUT: %.loc5_7.6: init %u2 to %.loc5_7.5 = in_place_init %UInt.as.Copy.impl.Op.call.loc5 [concrete = constants.%int_0.9fd] // CHECK:STDOUT: %.loc5_7.7: init %Ordering to %.loc5_7.4 = class_init (%.loc5_7.6) [concrete = constants.%Ordering.val.9ea] -// CHECK:STDOUT: %.loc5_7.8: ref %Ordering = temporary %.loc5_7.4, %.loc5_7.7 -// CHECK:STDOUT: %.loc5_7.9: ref %Ordering = converted %.loc5_7.3, %.loc5_7.8 +// CHECK:STDOUT: %.loc5_7.8: init %Ordering = converted %.loc5_7.3, %.loc5_7.7 [concrete = constants.%Ordering.val.9ea] +// CHECK:STDOUT: %.loc5_7.9: ref %Ordering = temporary %.loc5_7.4, %.loc5_7.8 // CHECK:STDOUT: %.loc5_7.10: %Ordering = acquire_value %.loc5_7.9 // CHECK:STDOUT: %Less: %Ordering = value_binding Less, %.loc5_7.10 // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] @@ -266,8 +266,8 @@ let never: Never = {}; // CHECK:STDOUT: %.loc6_13.5: ref %u2 = class_element_access %.loc6_13.4, element0 // CHECK:STDOUT: %.loc6_13.6: init %u2 to %.loc6_13.5 = in_place_init %UInt.as.Copy.impl.Op.call.loc6 [concrete = constants.%int_1.b2c] // CHECK:STDOUT: %.loc6_13.7: init %Ordering to %.loc6_13.4 = class_init (%.loc6_13.6) [concrete = constants.%Ordering.val.d41] -// CHECK:STDOUT: %.loc6_13.8: ref %Ordering = temporary %.loc6_13.4, %.loc6_13.7 -// CHECK:STDOUT: %.loc6_13.9: ref %Ordering = converted %.loc6_13.3, %.loc6_13.8 +// CHECK:STDOUT: %.loc6_13.8: init %Ordering = converted %.loc6_13.3, %.loc6_13.7 [concrete = constants.%Ordering.val.d41] +// CHECK:STDOUT: %.loc6_13.9: ref %Ordering = temporary %.loc6_13.4, %.loc6_13.8 // CHECK:STDOUT: %.loc6_13.10: %Ordering = acquire_value %.loc6_13.9 // CHECK:STDOUT: %Equivalent: %Ordering = value_binding Equivalent, %.loc6_13.10 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] @@ -288,8 +288,8 @@ let never: Never = {}; // CHECK:STDOUT: %.loc7_10.5: ref %u2 = class_element_access %.loc7_10.4, element0 // CHECK:STDOUT: %.loc7_10.6: init %u2 to %.loc7_10.5 = in_place_init %UInt.as.Copy.impl.Op.call.loc7 [concrete = constants.%int_2.788] // CHECK:STDOUT: %.loc7_10.7: init %Ordering to %.loc7_10.4 = class_init (%.loc7_10.6) [concrete = constants.%Ordering.val.e86] -// CHECK:STDOUT: %.loc7_10.8: ref %Ordering = temporary %.loc7_10.4, %.loc7_10.7 -// CHECK:STDOUT: %.loc7_10.9: ref %Ordering = converted %.loc7_10.3, %.loc7_10.8 +// CHECK:STDOUT: %.loc7_10.8: init %Ordering = converted %.loc7_10.3, %.loc7_10.7 [concrete = constants.%Ordering.val.e86] +// CHECK:STDOUT: %.loc7_10.9: ref %Ordering = temporary %.loc7_10.4, %.loc7_10.8 // CHECK:STDOUT: %.loc7_10.10: %Ordering = acquire_value %.loc7_10.9 // CHECK:STDOUT: %Greater: %Ordering = value_binding Greater, %.loc7_10.10 // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] @@ -310,8 +310,8 @@ let never: Never = {}; // CHECK:STDOUT: %.loc9_1.5: ref %u2 = class_element_access %.loc9_1.4, element0 // CHECK:STDOUT: %.loc9_1.6: init %u2 to %.loc9_1.5 = in_place_init %UInt.as.Copy.impl.Op.call.loc9 [concrete = constants.%int_3.975] // CHECK:STDOUT: %.loc9_1.7: init %Ordering to %.loc9_1.4 = class_init (%.loc9_1.6) [concrete = constants.%Ordering.val.a17] -// CHECK:STDOUT: %.loc9_1.8: ref %Ordering = temporary %.loc9_1.4, %.loc9_1.7 -// CHECK:STDOUT: %.loc9_1.9: ref %Ordering = converted %.loc9_1.3, %.loc9_1.8 +// CHECK:STDOUT: %.loc9_1.8: init %Ordering = converted %.loc9_1.3, %.loc9_1.7 [concrete = constants.%Ordering.val.a17] +// CHECK:STDOUT: %.loc9_1.9: ref %Ordering = temporary %.loc9_1.4, %.loc9_1.8 // CHECK:STDOUT: %.loc9_1.10: %Ordering = acquire_value %.loc9_1.9 // CHECK:STDOUT: %Incomparable: %Ordering = value_binding Incomparable, %.loc9_1.10 // CHECK:STDOUT: complete_type_witness = %complete_type diff --git a/toolchain/check/testdata/choice/generic.carbon b/toolchain/check/testdata/choice/generic.carbon index c8afa03840c3..b874c89a7473 100644 --- a/toolchain/check/testdata/choice/generic.carbon +++ b/toolchain/check/testdata/choice/generic.carbon @@ -64,8 +64,8 @@ choice Always(T:! type) { // CHECK:STDOUT: %.loc16_1.6: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc16_1.7: init %empty_tuple.type = converted %.loc16_1.2, %.loc16_1.6 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc16_1.8: init @Always.%Always (%Always) to %.loc16_1.4 = class_init (%.loc16_1.7) [symbolic = %Always.val (constants.%Always.val)] -// CHECK:STDOUT: %.loc16_1.9: ref @Always.%Always (%Always) = temporary %.loc16_1.4, %.loc16_1.8 -// CHECK:STDOUT: %.loc16_1.10: ref @Always.%Always (%Always) = converted %.loc16_1.3, %.loc16_1.9 +// CHECK:STDOUT: %.loc16_1.9: init @Always.%Always (%Always) = converted %.loc16_1.3, %.loc16_1.8 [symbolic = %Always.val (constants.%Always.val)] +// CHECK:STDOUT: %.loc16_1.10: ref @Always.%Always (%Always) = temporary %.loc16_1.4, %.loc16_1.9 // CHECK:STDOUT: %.loc16_1.11: @Always.%Always (%Always) = acquire_value %.loc16_1.10 // CHECK:STDOUT: %Sunny: @Always.%Always (%Always) = value_binding Sunny, %.loc16_1.11 // CHECK:STDOUT: complete_type_witness = %complete_type diff --git a/toolchain/check/testdata/class/abstract/abstract.carbon b/toolchain/check/testdata/class/abstract/abstract.carbon index d91c25ab300e..7bbaa9453308 100644 --- a/toolchain/check/testdata/class/abstract/abstract.carbon +++ b/toolchain/check/testdata/class/abstract/abstract.carbon @@ -885,13 +885,12 @@ fn CallReturnAbstract() { // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %Derived: type = class_type @Derived [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Derived.elem: type = unbound_element_type %Derived, %Abstract [concrete] // CHECK:STDOUT: %struct_type.base.709: type = struct_type {.base: %Abstract} [concrete] // CHECK:STDOUT: %complete_type.907: = complete_type_witness %struct_type.base.709 [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] -// CHECK:STDOUT: %pattern_type.a2e: type = pattern_type %Abstract [concrete] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Abstract [concrete] // CHECK:STDOUT: %empty_struct.a40: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: %struct_type.base.f5e: type = struct_type {.base: %empty_struct_type} [concrete] // CHECK:STDOUT: %struct: %struct_type.base.f5e = struct_value (%empty_struct.a40) [concrete] @@ -899,18 +898,13 @@ fn CallReturnAbstract() { // CHECK:STDOUT: %empty_struct.8eb: %.ec6 = struct_value () [concrete] // CHECK:STDOUT: %Abstract.val: %Abstract = struct_value () [concrete] // CHECK:STDOUT: %Derived.val: %Derived = struct_value (%Abstract.val) [concrete] -// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { -// CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -950,7 +944,7 @@ fn CallReturnAbstract() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %l.patt: %pattern_type.a2e = value_binding_pattern l [concrete] +// CHECK:STDOUT: %l.patt: %pattern_type = value_binding_pattern l [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc22_38.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct.a40] // CHECK:STDOUT: %.loc22_39.1: %struct_type.base.f5e = struct_literal (%.loc22_38.1) [concrete = constants.%struct] @@ -961,17 +955,12 @@ fn CallReturnAbstract() { // CHECK:STDOUT: %.loc22_39.4: init %.ec6 = converted %.loc22_38.1, %.loc22_38.2 [concrete = constants.%empty_struct.8eb] // CHECK:STDOUT: %.loc22_39.5: init %Abstract = as_compatible %.loc22_39.4 [concrete = constants.%Abstract.val] // CHECK:STDOUT: %.loc22_39.6: init %Derived to %.loc22_39.2 = class_init (%.loc22_39.5) [concrete = constants.%Derived.val] -// CHECK:STDOUT: %.loc22_39.7: ref %Derived = temporary %.loc22_39.2, %.loc22_39.6 -// CHECK:STDOUT: %.loc22_41: ref %Derived = converted %.loc22_39.1, %.loc22_39.7 +// CHECK:STDOUT: %.loc22_41: init %Derived = converted %.loc22_39.1, %.loc22_39.6 [concrete = constants.%Derived.val] // CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [concrete = constants.%Abstract] // CHECK:STDOUT: %l: %Abstract = value_binding l, [concrete = ] -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc22_39.7, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc22_39.7) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Derived) = "no_op"; -// CHECK:STDOUT: // CHECK:STDOUT: --- fail_call_abstract_return.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { diff --git a/toolchain/check/testdata/class/adapter/init_adapt.carbon b/toolchain/check/testdata/class/adapter/init_adapt.carbon index c36f707d6a6f..cd187a1fdf36 100644 --- a/toolchain/check/testdata/class/adapter/init_adapt.carbon +++ b/toolchain/check/testdata/class/adapter/init_adapt.carbon @@ -193,8 +193,8 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %.loc13_27.6: ref %i32 = class_element_access %.loc13_27.2, element1 // CHECK:STDOUT: %.loc13_27.7: init %i32 to %.loc13_27.6 = in_place_init %.loc13_27.5 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_27.8: init %C to %.loc13_27.2 = class_init (%.loc13_27.4, %.loc13_27.7) [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc13_27.9: ref %C = temporary %.loc13_27.2, %.loc13_27.8 -// CHECK:STDOUT: %.loc13_27.10: ref %C = converted @__global_init.%.loc13, %.loc13_27.9 +// CHECK:STDOUT: %.loc13_27.9: init %C = converted @__global_init.%.loc13, %.loc13_27.8 [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc13_27.10: ref %C = temporary %.loc13_27.2, %.loc13_27.9 // CHECK:STDOUT: %.loc13_27.11: %C = acquire_value %.loc13_27.10 // CHECK:STDOUT: %a: %C = value_binding a, %.loc13_27.11 // CHECK:STDOUT: name_binding_decl { @@ -397,8 +397,8 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %.loc13_27.6: ref %i32 = class_element_access %.loc13_27.2, element1 // CHECK:STDOUT: %.loc13_27.7: init %i32 to %.loc13_27.6 = in_place_init %.loc13_27.5 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_27.8: init %C to %.loc13_27.2 = class_init (%.loc13_27.4, %.loc13_27.7) [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc13_27.9: ref %C = temporary %.loc13_27.2, %.loc13_27.8 -// CHECK:STDOUT: %.loc13_27.10: ref %C = converted @__global_init.%.loc13, %.loc13_27.9 +// CHECK:STDOUT: %.loc13_27.9: init %C = converted @__global_init.%.loc13, %.loc13_27.8 [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc13_27.10: ref %C = temporary %.loc13_27.2, %.loc13_27.9 // CHECK:STDOUT: %.loc13_27.11: %C = acquire_value %.loc13_27.10 // CHECK:STDOUT: %a: %C = value_binding a, %.loc13_27.11 // CHECK:STDOUT: name_binding_decl { diff --git a/toolchain/check/testdata/class/fail_init_as_inplace.carbon b/toolchain/check/testdata/class/fail_init_as_inplace.carbon deleted file mode 100644 index a052e77faeae..000000000000 --- a/toolchain/check/testdata/class/fail_init_as_inplace.carbon +++ /dev/null @@ -1,33 +0,0 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM -// Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/int.carbon -// -// AUTOUPDATE -// TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/fail_init_as_inplace.carbon -// TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/fail_init_as_inplace.carbon - -class Class { - var a: i32; - var b: i32; -} - -fn G(p: Class*); - -fn F() { - // TODO: This case should presumably work: `{...} as Class` should be an - // initializing expression, not a value expression. - // - // CHECK:STDERR: fail_init_as_inplace.carbon:[[@LINE+7]]:18: error: cannot copy value of type `Class` [CopyOfUncopyableType] - // CHECK:STDERR: var c: Class = {.a = 1, .b = 2} as Class; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_init_as_inplace.carbon:[[@LINE+4]]:18: note: type `Class` does not implement interface `Core.Copy` [MissingImplInMemberAccessInContext] - // CHECK:STDERR: var c: Class = {.a = 1, .b = 2} as Class; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: - var c: Class = {.a = 1, .b = 2} as Class; - G(&c); -} diff --git a/toolchain/check/testdata/class/generic/method_deduce.carbon b/toolchain/check/testdata/class/generic/method_deduce.carbon index b86887e7fc65..ce23f2d501f2 100644 --- a/toolchain/check/testdata/class/generic/method_deduce.carbon +++ b/toolchain/check/testdata/class/generic/method_deduce.carbon @@ -313,12 +313,12 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %.loc27_62.1: ref %tuple.type.e87 = splice_block %return.param {} // CHECK:STDOUT: %.loc28_25.2: ref %A = temporary_storage // CHECK:STDOUT: %.loc28_25.3: init %A to %.loc28_25.2 = class_init () [concrete = constants.%A.val] -// CHECK:STDOUT: %.loc28_25.4: ref %A = temporary %.loc28_25.2, %.loc28_25.3 -// CHECK:STDOUT: %.loc28_25.5: ref %A = converted %.loc28_25.1, %.loc28_25.4 +// CHECK:STDOUT: %.loc28_25.4: init %A = converted %.loc28_25.1, %.loc28_25.3 [concrete = constants.%A.val] +// CHECK:STDOUT: %.loc28_25.5: ref %A = temporary %.loc28_25.2, %.loc28_25.4 // CHECK:STDOUT: %.loc28_25.6: %A = acquire_value %.loc28_25.5 // CHECK:STDOUT: %Class.GetNoDeduce.call: init %tuple.type.e87 to %.loc27_62.1 = call %Class.GetNoDeduce.specific_fn(%.loc28_25.6) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc28_25.4, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc28_25.4) +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc28_25.5, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc28_25.5) // CHECK:STDOUT: return %Class.GetNoDeduce.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/stringify.carbon b/toolchain/check/testdata/class/generic/stringify.carbon index d34f8530f74d..821e9f6a3e3d 100644 --- a/toolchain/check/testdata/class/generic/stringify.carbon +++ b/toolchain/check/testdata/class/generic/stringify.carbon @@ -572,9 +572,9 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %.loc25_25.7: ref %i32 = class_element_access %.loc25_25.3, element1 // CHECK:STDOUT: %.loc25_25.8: init %i32 to %.loc25_25.7 = in_place_init %.loc25_25.6 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc25_25.9: init %D to %.loc25_25.3 = class_init (%.loc25_25.5, %.loc25_25.8) [concrete = constants.%D.val.525] -// CHECK:STDOUT: %.loc25_25.10: ref %D = temporary %.loc25_25.3, %.loc25_25.9 -// CHECK:STDOUT: %.loc25_26.1: ref %D = converted %.loc25_25.1, %.loc25_25.10 -// CHECK:STDOUT: %.loc25_26.2: %D = acquire_value %.loc25_26.1 +// CHECK:STDOUT: %.loc25_26.1: init %D = converted %.loc25_25.1, %.loc25_25.9 [concrete = constants.%D.val.525] +// CHECK:STDOUT: %.loc25_26.2: ref %D = temporary %.loc25_25.3, %.loc25_26.1 +// CHECK:STDOUT: %.loc25_26.3: %D = acquire_value %.loc25_26.2 // CHECK:STDOUT: } // CHECK:STDOUT: %g: ref = ref_binding g, [concrete = ] // CHECK:STDOUT: } @@ -633,9 +633,9 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %.loc25_53.7: ref %i32 = class_element_access %.loc25_53.3, element1 // CHECK:STDOUT: %.loc25_53.8: init %i32 to %.loc25_53.7 = in_place_init %.loc25_53.6 [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc25_53.9: init %D to %.loc25_53.3 = class_init (%.loc25_53.5, %.loc25_53.8) [concrete = constants.%D.val.659] -// CHECK:STDOUT: %.loc25_53.10: ref %D = temporary %.loc25_53.3, %.loc25_53.9 -// CHECK:STDOUT: %.loc25_55.1: ref %D = converted %.loc25_53.1, %.loc25_53.10 -// CHECK:STDOUT: %.loc25_55.2: %D = acquire_value %.loc25_55.1 +// CHECK:STDOUT: %.loc25_55.1: init %D = converted %.loc25_53.1, %.loc25_53.9 [concrete = constants.%D.val.659] +// CHECK:STDOUT: %.loc25_55.2: ref %D = temporary %.loc25_53.3, %.loc25_55.1 +// CHECK:STDOUT: %.loc25_55.3: %D = acquire_value %.loc25_55.2 // CHECK:STDOUT: assign file.%g.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/inheritance/derived_to_base.carbon b/toolchain/check/testdata/class/inheritance/derived_to_base.carbon index 456b9888725b..8583c24d68a1 100644 --- a/toolchain/check/testdata/class/inheritance/derived_to_base.carbon +++ b/toolchain/check/testdata/class/inheritance/derived_to_base.carbon @@ -420,16 +420,16 @@ fn PassConstB(p: const B) { // CHECK:STDOUT: %.loc32_64.7: ref %i32 = class_element_access %.loc32_64.2, element1 // CHECK:STDOUT: %.loc32_64.8: init %i32 to %.loc32_64.7 = in_place_init %.loc32_64.6 [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc32_64.9: init %C to %.loc32_64.2 = class_init (%.loc32_64.5, %.loc32_64.8) [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc32_64.10: ref %C = temporary %.loc32_64.2, %.loc32_64.9 -// CHECK:STDOUT: %.loc32_66.1: ref %C = converted %.loc32_64.1, %.loc32_64.10 +// CHECK:STDOUT: %.loc32_66.1: init %C = converted %.loc32_64.1, %.loc32_64.9 [concrete = constants.%C.val] // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A] -// CHECK:STDOUT: %.loc32_66.2: ref %B = class_element_access %.loc32_66.1, element0 -// CHECK:STDOUT: %.loc32_66.3: ref %A = class_element_access %.loc32_66.2, element0 -// CHECK:STDOUT: %.loc32_66.4: ref %A = converted %.loc32_66.1, %.loc32_66.3 -// CHECK:STDOUT: %.loc32_66.5: %A = acquire_value %.loc32_66.4 -// CHECK:STDOUT: %a: %A = value_binding a, %.loc32_66.5 -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc32_64.10, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc32_64.10) +// CHECK:STDOUT: %.loc32_66.2: ref %C = temporary %.loc32_64.2, %.loc32_66.1 +// CHECK:STDOUT: %.loc32_66.3: ref %B = class_element_access %.loc32_66.2, element0 +// CHECK:STDOUT: %.loc32_66.4: ref %A = class_element_access %.loc32_66.3, element0 +// CHECK:STDOUT: %.loc32_66.5: ref %A = converted %.loc32_66.1, %.loc32_66.4 +// CHECK:STDOUT: %.loc32_66.6: %A = acquire_value %.loc32_66.5 +// CHECK:STDOUT: %a: %A = value_binding a, %.loc32_66.6 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc32_66.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc32_66.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/init_as.carbon b/toolchain/check/testdata/class/init_as.carbon index 14d4acb2dd5d..28300a1c6dde 100644 --- a/toolchain/check/testdata/class/init_as.carbon +++ b/toolchain/check/testdata/class/init_as.carbon @@ -3,8 +3,6 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/int.carbon -// TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: @@ -18,7 +16,16 @@ class Class { } fn F() -> i32 { + //@dump-sem-ir-begin return ({.a = 1, .b = 2} as Class).a; + //@dump-sem-ir-end +} + +fn G() -> i32 { + //@dump-sem-ir-begin + var v: Class = {.a = 1, .b = 2} as Class; + //@dump-sem-ir-end + return v.a; } // CHECK:STDOUT: --- init_as.carbon @@ -26,24 +33,14 @@ fn F() -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [concrete] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] -// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] -// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %i32 [concrete] -// CHECK:STDOUT: %struct_type.a.b.501: type = struct_type {.a: %i32, .b: %i32} [concrete] -// CHECK:STDOUT: %complete_type.705: = complete_type_witness %struct_type.a.b.501 [concrete] -// CHECK:STDOUT: %.ff5: Core.Form = init_form %i32 [concrete] -// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] -// CHECK:STDOUT: %F.type: type = fn_type @F [concrete] -// CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %struct_type.a.b.cfd: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [concrete] // CHECK:STDOUT: %struct: %struct_type.a.b.cfd = struct_value (%int_1.5b8, %int_2.ecc) [concrete] -// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] -// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] // CHECK:STDOUT: %ImplicitAs.type.e8c: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete] // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic] @@ -72,101 +69,95 @@ fn F() -> i32 { // CHECK:STDOUT: %Copy.WithSelf.Op.type.081: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet) [concrete] // CHECK:STDOUT: %.8e2: type = fn_type_with_self_type %Copy.WithSelf.Op.type.081, %Copy.facet [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.664, @Int.as.Copy.impl.Op(%int_32) [concrete] -// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.904: type = pattern_type %Class [concrete] // CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] // CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { -// CHECK:STDOUT: .Int = %Core.Int -// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs -// CHECK:STDOUT: .Copy = %Core.Copy -// CHECK:STDOUT: .Destroy = %Core.Destroy -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: %Core.import_ref.42d: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.74f = impl_witness_table (%Core.import_ref.42d), @Core.IntLiteral.as.ImplicitAs.impl [concrete] -// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] // CHECK:STDOUT: %Core.import_ref.18d: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.824) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.9b9)] // CHECK:STDOUT: %Copy.impl_witness_table.e76 = impl_witness_table (%Core.import_ref.18d), @Int.as.Copy.impl [concrete] -// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Class.decl: type = class_decl @Class [concrete = constants.%Class] {} {} -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { -// CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete] -// CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] -// CHECK:STDOUT: %.loc20: Core.Form = init_form %i32 [concrete = constants.%.ff5] -// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param0 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %i32.loc16: type = type_literal constants.%i32 [concrete = constants.%i32] -// CHECK:STDOUT: %.loc16: %Class.elem = field_decl a, element0 [concrete] -// CHECK:STDOUT: %i32.loc17: type = type_literal constants.%i32 [concrete = constants.%i32] -// CHECK:STDOUT: %.loc17: %Class.elem = field_decl b, element1 [concrete] -// CHECK:STDOUT: %complete_type: = complete_type_witness constants.%struct_type.a.b.501 [concrete = constants.%complete_type.705] -// CHECK:STDOUT: complete_type_witness = %complete_type -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%Class -// CHECK:STDOUT: .a = %.loc16 -// CHECK:STDOUT: .b = %.loc17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> out %return.param: %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] -// CHECK:STDOUT: %.loc21_26.1: %struct_type.a.b.cfd = struct_literal (%int_1, %int_2) [concrete = constants.%struct] +// CHECK:STDOUT: %.loc20_26.1: %struct_type.a.b.cfd = struct_literal (%int_1, %int_2) [concrete = constants.%struct] // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [concrete = constants.%Class] -// CHECK:STDOUT: %impl.elem0.loc21_26.1: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc21_26.1: = bound_method %int_1, %impl.elem0.loc21_26.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215] -// CHECK:STDOUT: %specific_fn.loc21_26.1: = specific_function %impl.elem0.loc21_26.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc21_26.2: = bound_method %int_1, %specific_fn.loc21_26.1 [concrete = constants.%bound_method.38b] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21_26.1: init %i32 = call %bound_method.loc21_26.2(%int_1) [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc21_26.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21_26.1 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc21_26.3: ref %Class = temporary_storage -// CHECK:STDOUT: %.loc21_26.4: ref %i32 = class_element_access %.loc21_26.3, element0 -// CHECK:STDOUT: %.loc21_26.5: init %i32 to %.loc21_26.4 = in_place_init %.loc21_26.2 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %impl.elem0.loc21_26.2: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc21_26.3: = bound_method %int_2, %impl.elem0.loc21_26.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] -// CHECK:STDOUT: %specific_fn.loc21_26.2: = specific_function %impl.elem0.loc21_26.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc21_26.4: = bound_method %int_2, %specific_fn.loc21_26.2 [concrete = constants.%bound_method.646] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21_26.2: init %i32 = call %bound_method.loc21_26.4(%int_2) [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc21_26.6: init %i32 = converted %int_2, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21_26.2 [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc21_26.7: ref %i32 = class_element_access %.loc21_26.3, element1 -// CHECK:STDOUT: %.loc21_26.8: init %i32 to %.loc21_26.7 = in_place_init %.loc21_26.6 [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc21_26.9: init %Class to %.loc21_26.3 = class_init (%.loc21_26.5, %.loc21_26.8) [concrete = constants.%Class.val] -// CHECK:STDOUT: %.loc21_26.10: ref %Class = temporary %.loc21_26.3, %.loc21_26.9 -// CHECK:STDOUT: %.loc21_28: ref %Class = converted %.loc21_26.1, %.loc21_26.10 -// CHECK:STDOUT: %a.ref: %Class.elem = name_ref a, @Class.%.loc16 [concrete = @Class.%.loc16] -// CHECK:STDOUT: %.loc21_37.1: ref %i32 = class_element_access %.loc21_28, element0 -// CHECK:STDOUT: %.loc21_37.2: %i32 = acquire_value %.loc21_37.1 -// CHECK:STDOUT: %impl.elem0.loc21_37: %.8e2 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] -// CHECK:STDOUT: %bound_method.loc21_37.1: = bound_method %.loc21_37.2, %impl.elem0.loc21_37 -// CHECK:STDOUT: %specific_fn.loc21_37: = specific_function %impl.elem0.loc21_37, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc21_37.2: = bound_method %.loc21_37.2, %specific_fn.loc21_37 -// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc21_37.2(%.loc21_37.2) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc21_26.10, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc21_26.10) +// CHECK:STDOUT: %impl.elem0.loc20_26.1: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] +// CHECK:STDOUT: %bound_method.loc20_26.1: = bound_method %int_1, %impl.elem0.loc20_26.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215] +// CHECK:STDOUT: %specific_fn.loc20_26.1: = specific_function %impl.elem0.loc20_26.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc20_26.2: = bound_method %int_1, %specific_fn.loc20_26.1 [concrete = constants.%bound_method.38b] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc20_26.1: init %i32 = call %bound_method.loc20_26.2(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc20_26.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc20_26.1 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc20_26.3: ref %Class = temporary_storage +// CHECK:STDOUT: %.loc20_26.4: ref %i32 = class_element_access %.loc20_26.3, element0 +// CHECK:STDOUT: %.loc20_26.5: init %i32 to %.loc20_26.4 = in_place_init %.loc20_26.2 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc20_26.2: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] +// CHECK:STDOUT: %bound_method.loc20_26.3: = bound_method %int_2, %impl.elem0.loc20_26.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] +// CHECK:STDOUT: %specific_fn.loc20_26.2: = specific_function %impl.elem0.loc20_26.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc20_26.4: = bound_method %int_2, %specific_fn.loc20_26.2 [concrete = constants.%bound_method.646] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc20_26.2: init %i32 = call %bound_method.loc20_26.4(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc20_26.6: init %i32 = converted %int_2, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc20_26.2 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc20_26.7: ref %i32 = class_element_access %.loc20_26.3, element1 +// CHECK:STDOUT: %.loc20_26.8: init %i32 to %.loc20_26.7 = in_place_init %.loc20_26.6 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc20_26.9: init %Class to %.loc20_26.3 = class_init (%.loc20_26.5, %.loc20_26.8) [concrete = constants.%Class.val] +// CHECK:STDOUT: %.loc20_28.1: init %Class = converted %.loc20_26.1, %.loc20_26.9 [concrete = constants.%Class.val] +// CHECK:STDOUT: %.loc20_28.2: ref %Class = temporary %.loc20_26.3, %.loc20_28.1 +// CHECK:STDOUT: %a.ref: %Class.elem = name_ref a, @Class.%.loc14 [concrete = @Class.%.loc14] +// CHECK:STDOUT: %.loc20_37.1: ref %i32 = class_element_access %.loc20_28.2, element0 +// CHECK:STDOUT: %.loc20_37.2: %i32 = acquire_value %.loc20_37.1 +// CHECK:STDOUT: %impl.elem0.loc20_37: %.8e2 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] +// CHECK:STDOUT: %bound_method.loc20_37.1: = bound_method %.loc20_37.2, %impl.elem0.loc20_37 +// CHECK:STDOUT: %specific_fn.loc20_37: = specific_function %impl.elem0.loc20_37, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc20_37.2: = bound_method %.loc20_37.2, %specific_fn.loc20_37 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc20_37.2(%.loc20_37.2) +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc20_28.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc20_28.2) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Class) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @G() -> out %return.param: %i32 { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %v.patt: %pattern_type.904 = ref_binding_pattern v [concrete] +// CHECK:STDOUT: %v.var_patt: %pattern_type.904 = var_pattern %v.patt [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %v.var: ref %Class = var %v.var_patt +// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] +// CHECK:STDOUT: %.loc26_33.1: %struct_type.a.b.cfd = struct_literal (%int_1, %int_2) [concrete = constants.%struct] +// CHECK:STDOUT: %Class.ref.loc26_38: type = name_ref Class, file.%Class.decl [concrete = constants.%Class] +// CHECK:STDOUT: %impl.elem0.loc26_33.1: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] +// CHECK:STDOUT: %bound_method.loc26_33.1: = bound_method %int_1, %impl.elem0.loc26_33.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215] +// CHECK:STDOUT: %specific_fn.loc26_33.1: = specific_function %impl.elem0.loc26_33.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc26_33.2: = bound_method %int_1, %specific_fn.loc26_33.1 [concrete = constants.%bound_method.38b] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc26_33.1: init %i32 = call %bound_method.loc26_33.2(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc26_33.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc26_33.1 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc26_3: ref %Class = splice_block %v.var {} +// CHECK:STDOUT: %.loc26_33.3: ref %i32 = class_element_access %.loc26_3, element0 +// CHECK:STDOUT: %.loc26_33.4: init %i32 to %.loc26_33.3 = in_place_init %.loc26_33.2 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc26_33.2: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] +// CHECK:STDOUT: %bound_method.loc26_33.3: = bound_method %int_2, %impl.elem0.loc26_33.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] +// CHECK:STDOUT: %specific_fn.loc26_33.2: = specific_function %impl.elem0.loc26_33.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc26_33.4: = bound_method %int_2, %specific_fn.loc26_33.2 [concrete = constants.%bound_method.646] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc26_33.2: init %i32 = call %bound_method.loc26_33.4(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc26_33.5: init %i32 = converted %int_2, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc26_33.2 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc26_33.6: ref %i32 = class_element_access %.loc26_3, element1 +// CHECK:STDOUT: %.loc26_33.7: init %i32 to %.loc26_33.6 = in_place_init %.loc26_33.5 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc26_33.8: init %Class to %.loc26_3 = class_init (%.loc26_33.4, %.loc26_33.7) [concrete = constants.%Class.val] +// CHECK:STDOUT: %.loc26_35: init %Class = converted %.loc26_33.1, %.loc26_33.8 [concrete = constants.%Class.val] +// CHECK:STDOUT: assign %v.var, %.loc26_35 +// CHECK:STDOUT: %Class.ref.loc26_10: type = name_ref Class, file.%Class.decl [concrete = constants.%Class] +// CHECK:STDOUT: %v: ref %Class = ref_binding v, %v.var +// CHECK:STDOUT: +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %v.var, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%v.var) +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/method/method.carbon b/toolchain/check/testdata/class/method/method.carbon index 448a70a6336f..ecd27c74febe 100644 --- a/toolchain/check/testdata/class/method/method.carbon +++ b/toolchain/check/testdata/class/method/method.carbon @@ -389,14 +389,14 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %.loc39_18.4: ref %i32 = class_element_access %.loc39_18.3, element0 // CHECK:STDOUT: %.loc39_18.5: init %i32 to %.loc39_18.4 = in_place_init %.loc39_18.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc39_18.6: init %Class to %.loc39_18.3 = class_init (%.loc39_18.5) [concrete = constants.%Class.val] -// CHECK:STDOUT: %.loc39_18.7: ref %Class = temporary %.loc39_18.3, %.loc39_18.6 -// CHECK:STDOUT: %.loc39_20.1: ref %Class = converted %.loc39_18.1, %.loc39_18.7 +// CHECK:STDOUT: %.loc39_20.1: init %Class = converted %.loc39_18.1, %.loc39_18.6 [concrete = constants.%Class.val] +// CHECK:STDOUT: %.loc39_20.2: ref %Class = temporary %.loc39_18.3, %.loc39_20.1 // CHECK:STDOUT: %F.ref: %Class.F.type = name_ref F, @Class.%Class.F.decl [concrete = constants.%Class.F] -// CHECK:STDOUT: %Class.F.bound: = bound_method %.loc39_20.1, %F.ref -// CHECK:STDOUT: %.loc39_20.2: %Class = acquire_value %.loc39_20.1 -// CHECK:STDOUT: %Class.F.call: init %i32 = call %Class.F.bound(%.loc39_20.2) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc39_18.7, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc39_18.7) +// CHECK:STDOUT: %Class.F.bound: = bound_method %.loc39_20.2, %F.ref +// CHECK:STDOUT: %.loc39_20.3: %Class = acquire_value %.loc39_20.2 +// CHECK:STDOUT: %Class.F.call: init %i32 = call %Class.F.bound(%.loc39_20.3) +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc39_20.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc39_20.2) // CHECK:STDOUT: return %Class.F.call // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/const/basics.carbon b/toolchain/check/testdata/const/basics.carbon index 1d41596d6cd4..b8edd378e062 100644 --- a/toolchain/check/testdata/const/basics.carbon +++ b/toolchain/check/testdata/const/basics.carbon @@ -85,43 +85,14 @@ fn PassReferenceToConstValue(p: X*) { TakeConstValue(*p); } -// --- fail_todo_add_or_remove_while_initializing.carbon +// --- add_or_remove_while_initializing.carbon library "[[@TEST_NAME]]"; class X {} -// TODO: None of these should require `X` to be copyable. -// CHECK:STDERR: fail_todo_add_or_remove_while_initializing.carbon:[[@LINE+7]]:40: error: cannot copy value of type `X` [CopyOfUncopyableType] -// CHECK:STDERR: var init_non_const_from_non_const: X = {} as X; -// CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_todo_add_or_remove_while_initializing.carbon:[[@LINE+4]]:40: note: type `X` does not implement interface `Core.Copy` [MissingImplInMemberAccessInContext] -// CHECK:STDERR: var init_non_const_from_non_const: X = {} as X; -// CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: var init_non_const_from_non_const: X = {} as X; -// CHECK:STDERR: fail_todo_add_or_remove_while_initializing.carbon:[[@LINE+7]]:1: error: cannot copy value of type `X` [CopyOfUncopyableType] -// CHECK:STDERR: var init_non_const_from_const: X = ({} as X) as const X; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_todo_add_or_remove_while_initializing.carbon:[[@LINE+4]]:1: note: type `X` does not implement interface `Core.Copy` [MissingImplInMemberAccessInContext] -// CHECK:STDERR: var init_non_const_from_const: X = ({} as X) as const X; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: var init_non_const_from_const: X = ({} as X) as const X; -// CHECK:STDERR: fail_todo_add_or_remove_while_initializing.carbon:[[@LINE+7]]:1: error: cannot copy value of type `const X` [CopyOfUncopyableType] -// CHECK:STDERR: var init_const_from_non_const: const X = {} as X; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_todo_add_or_remove_while_initializing.carbon:[[@LINE+4]]:1: note: type `const X` does not implement interface `Core.Copy` [MissingImplInMemberAccessInContext] -// CHECK:STDERR: var init_const_from_non_const: const X = {} as X; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: var init_const_from_non_const: const X = {} as X; -// CHECK:STDERR: fail_todo_add_or_remove_while_initializing.carbon:[[@LINE+7]]:38: error: cannot copy value of type `const X` [CopyOfUncopyableType] -// CHECK:STDERR: var init_const_from_const: const X = ({} as X) as const X; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_todo_add_or_remove_while_initializing.carbon:[[@LINE+4]]:38: note: type `const X` does not implement interface `Core.Copy` [MissingImplInMemberAccessInContext] -// CHECK:STDERR: var init_const_from_const: const X = ({} as X) as const X; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: var init_const_from_const: const X = ({} as X) as const X; // --- add_while_forming_reference.carbon diff --git a/toolchain/check/testdata/deduce/generic_type.carbon b/toolchain/check/testdata/deduce/generic_type.carbon index 0bef2c03c34c..d991046b7b72 100644 --- a/toolchain/check/testdata/deduce/generic_type.carbon +++ b/toolchain/check/testdata/deduce/generic_type.carbon @@ -933,13 +933,13 @@ fn G() -> i32 { // CHECK:STDOUT: %WithNontype: type = class_type @WithNontype, @WithNontype(constants.%int_0.6a9) [concrete = constants.%WithNontype.6bb] // CHECK:STDOUT: %.loc9_13.2: ref %WithNontype.6bb = temporary_storage // CHECK:STDOUT: %.loc9_13.3: init %WithNontype.6bb to %.loc9_13.2 = class_init () [concrete = constants.%WithNontype.val] -// CHECK:STDOUT: %.loc9_13.4: ref %WithNontype.6bb = temporary %.loc9_13.2, %.loc9_13.3 -// CHECK:STDOUT: %.loc9_15.1: ref %WithNontype.6bb = converted %.loc9_13.1, %.loc9_13.4 +// CHECK:STDOUT: %.loc9_15.1: init %WithNontype.6bb = converted %.loc9_13.1, %.loc9_13.3 [concrete = constants.%WithNontype.val] // CHECK:STDOUT: %F.specific_fn: = specific_function %F.ref, @F(constants.%int_0.6a9) [concrete = constants.%F.specific_fn] -// CHECK:STDOUT: %.loc9_15.2: %WithNontype.6bb = acquire_value %.loc9_15.1 -// CHECK:STDOUT: %F.call: init %i32 = call %F.specific_fn(%.loc9_15.2) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc9_13.4, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc9_13.4) +// CHECK:STDOUT: %.loc9_15.2: ref %WithNontype.6bb = temporary %.loc9_13.2, %.loc9_15.1 +// CHECK:STDOUT: %.loc9_15.3: %WithNontype.6bb = acquire_value %.loc9_15.2 +// CHECK:STDOUT: %F.call: init %i32 = call %F.specific_fn(%.loc9_15.3) +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc9_15.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc9_15.2) // CHECK:STDOUT: return %F.call // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/deduce/value_with_type_through_access.carbon b/toolchain/check/testdata/deduce/value_with_type_through_access.carbon index 76615ef83670..eddb70be5f96 100644 --- a/toolchain/check/testdata/deduce/value_with_type_through_access.carbon +++ b/toolchain/check/testdata/deduce/value_with_type_through_access.carbon @@ -149,7 +149,7 @@ fn G() { // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc13_30 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc13_6 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc13_8 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -266,27 +266,27 @@ fn G() { // CHECK:STDOUT: %HoldsType: type = class_type @HoldsType, @HoldsType(constants.%tuple.1f1) [concrete = constants.%HoldsType.a31] // CHECK:STDOUT: %.loc13_6.2: ref %HoldsType.a31 = temporary_storage // CHECK:STDOUT: %.loc13_6.3: init %HoldsType.a31 to %.loc13_6.2 = class_init () [concrete = constants.%HoldsType.val] -// CHECK:STDOUT: %.loc13_6.4: ref %HoldsType.a31 = temporary %.loc13_6.2, %.loc13_6.3 -// CHECK:STDOUT: %.loc13_8.1: ref %HoldsType.a31 = converted %.loc13_6.1, %.loc13_6.4 +// CHECK:STDOUT: %.loc13_8.1: init %HoldsType.a31 = converted %.loc13_6.1, %.loc13_6.3 [concrete = constants.%HoldsType.val] // CHECK:STDOUT: %.loc13_30.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %F.specific_fn: = specific_function %F.ref, @F(constants.%tuple.1f1) [concrete = constants.%F.specific_fn] -// CHECK:STDOUT: %.loc13_8.2: %HoldsType.a31 = acquire_value %.loc13_8.1 +// CHECK:STDOUT: %.loc13_8.2: ref %HoldsType.a31 = temporary %.loc13_6.2, %.loc13_8.1 +// CHECK:STDOUT: %.loc13_8.3: %HoldsType.a31 = acquire_value %.loc13_8.2 // CHECK:STDOUT: %.loc13_30.2: ref %C = temporary_storage // CHECK:STDOUT: %.loc13_30.3: init %C to %.loc13_30.2 = class_init () [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc13_30.4: ref %C = temporary %.loc13_30.2, %.loc13_30.3 -// CHECK:STDOUT: %.loc13_30.5: ref %C = converted %.loc13_30.1, %.loc13_30.4 +// CHECK:STDOUT: %.loc13_30.4: init %C = converted %.loc13_30.1, %.loc13_30.3 [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc13_30.5: ref %C = temporary %.loc13_30.2, %.loc13_30.4 // CHECK:STDOUT: %.loc13_30.6: %C = acquire_value %.loc13_30.5 -// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn(%.loc13_8.2, %.loc13_30.6) -// CHECK:STDOUT: %Destroy.Op.bound.loc13_30: = bound_method %.loc13_30.4, constants.%Destroy.Op.651ba6.1 -// CHECK:STDOUT: %Destroy.Op.call.loc13_30: init %empty_tuple.type = call %Destroy.Op.bound.loc13_30(%.loc13_30.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc13_6: = bound_method %.loc13_6.4, constants.%Destroy.Op.651ba6.2 -// CHECK:STDOUT: %Destroy.Op.call.loc13_6: init %empty_tuple.type = call %Destroy.Op.bound.loc13_6(%.loc13_6.4) +// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn(%.loc13_8.3, %.loc13_30.6) +// CHECK:STDOUT: %Destroy.Op.bound.loc13_30: = bound_method %.loc13_30.5, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.call.loc13_30: init %empty_tuple.type = call %Destroy.Op.bound.loc13_30(%.loc13_30.5) +// CHECK:STDOUT: %Destroy.Op.bound.loc13_8: = bound_method %.loc13_8.2, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.call.loc13_8: init %empty_tuple.type = call %Destroy.Op.bound.loc13_8(%.loc13_8.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.Op.loc13_30(%self.param: ref %C) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc13_6(%self.param: ref %HoldsType.a31) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc13_8(%self.param: ref %HoldsType.a31) = "no_op"; // CHECK:STDOUT: // CHECK:STDOUT: specific @HoldsType(constants.%T) { // CHECK:STDOUT: %T.loc4_17.1 => constants.%T @@ -355,7 +355,7 @@ fn G() { // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc13_33 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc13_6 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc13_8 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -469,27 +469,27 @@ fn G() { // CHECK:STDOUT: %HoldsType: type = class_type @HoldsType, @HoldsType(constants.%struct) [concrete = constants.%HoldsType.673] // CHECK:STDOUT: %.loc13_6.2: ref %HoldsType.673 = temporary_storage // CHECK:STDOUT: %.loc13_6.3: init %HoldsType.673 to %.loc13_6.2 = class_init () [concrete = constants.%HoldsType.val] -// CHECK:STDOUT: %.loc13_6.4: ref %HoldsType.673 = temporary %.loc13_6.2, %.loc13_6.3 -// CHECK:STDOUT: %.loc13_8.1: ref %HoldsType.673 = converted %.loc13_6.1, %.loc13_6.4 +// CHECK:STDOUT: %.loc13_8.1: init %HoldsType.673 = converted %.loc13_6.1, %.loc13_6.3 [concrete = constants.%HoldsType.val] // CHECK:STDOUT: %.loc13_33.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %F.specific_fn: = specific_function %F.ref, @F(constants.%struct) [concrete = constants.%F.specific_fn] -// CHECK:STDOUT: %.loc13_8.2: %HoldsType.673 = acquire_value %.loc13_8.1 +// CHECK:STDOUT: %.loc13_8.2: ref %HoldsType.673 = temporary %.loc13_6.2, %.loc13_8.1 +// CHECK:STDOUT: %.loc13_8.3: %HoldsType.673 = acquire_value %.loc13_8.2 // CHECK:STDOUT: %.loc13_33.2: ref %C = temporary_storage // CHECK:STDOUT: %.loc13_33.3: init %C to %.loc13_33.2 = class_init () [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc13_33.4: ref %C = temporary %.loc13_33.2, %.loc13_33.3 -// CHECK:STDOUT: %.loc13_33.5: ref %C = converted %.loc13_33.1, %.loc13_33.4 +// CHECK:STDOUT: %.loc13_33.4: init %C = converted %.loc13_33.1, %.loc13_33.3 [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc13_33.5: ref %C = temporary %.loc13_33.2, %.loc13_33.4 // CHECK:STDOUT: %.loc13_33.6: %C = acquire_value %.loc13_33.5 -// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn(%.loc13_8.2, %.loc13_33.6) -// CHECK:STDOUT: %Destroy.Op.bound.loc13_33: = bound_method %.loc13_33.4, constants.%Destroy.Op.651ba6.1 -// CHECK:STDOUT: %Destroy.Op.call.loc13_33: init %empty_tuple.type = call %Destroy.Op.bound.loc13_33(%.loc13_33.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc13_6: = bound_method %.loc13_6.4, constants.%Destroy.Op.651ba6.2 -// CHECK:STDOUT: %Destroy.Op.call.loc13_6: init %empty_tuple.type = call %Destroy.Op.bound.loc13_6(%.loc13_6.4) +// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn(%.loc13_8.3, %.loc13_33.6) +// CHECK:STDOUT: %Destroy.Op.bound.loc13_33: = bound_method %.loc13_33.5, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.call.loc13_33: init %empty_tuple.type = call %Destroy.Op.bound.loc13_33(%.loc13_33.5) +// CHECK:STDOUT: %Destroy.Op.bound.loc13_8: = bound_method %.loc13_8.2, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.call.loc13_8: init %empty_tuple.type = call %Destroy.Op.bound.loc13_8(%.loc13_8.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.Op.loc13_33(%self.param: ref %C) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc13_6(%self.param: ref %HoldsType.673) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc13_8(%self.param: ref %HoldsType.673) = "no_op"; // CHECK:STDOUT: // CHECK:STDOUT: specific @HoldsType(constants.%T) { // CHECK:STDOUT: %T.loc4_17.1 => constants.%T @@ -540,7 +540,7 @@ fn G() { // CHECK:STDOUT: %HoldsType.47b504.1: type = class_type @HoldsType, @HoldsType(%T.d7d) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %pattern_type.3b8c03.1: type = pattern_type %HoldsType.47b504.1 [symbolic] +// CHECK:STDOUT: %pattern_type.3b8: type = pattern_type %HoldsType.47b504.1 [symbolic] // CHECK:STDOUT: %.208: ref type = class_element_access %T.d7d, element0 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] @@ -553,13 +553,6 @@ fn G() { // CHECK:STDOUT: %HoldsType.47b504.2: type = class_type @HoldsType, @HoldsType(%c) [symbolic] // CHECK:STDOUT: %require_complete.9b8c71.2: = require_complete_type %HoldsType.47b504.2 [symbolic] // CHECK:STDOUT: %HoldsType.val: %HoldsType.47b504.2 = struct_value () [symbolic] -// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %HoldsType.47b504.2, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.facet.278: %Destroy.type = facet_value %HoldsType.47b504.2, (%Destroy.lookup_impl_witness) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.055: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.278) [symbolic] -// CHECK:STDOUT: %.b9b: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.055, %Destroy.facet.278 [symbolic] -// CHECK:STDOUT: %impl.elem0.909: %.b9b = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.2d3: = specific_impl_function %impl.elem0.909, @Destroy.WithSelf.Op(%Destroy.facet.278) [symbolic] // CHECK:STDOUT: %H.type: type = fn_type @H [concrete] // CHECK:STDOUT: %H: %H.type = struct_value () [concrete] // CHECK:STDOUT: %struct: %struct_type.t = struct_value (%C) [concrete] @@ -572,21 +565,22 @@ fn G() { // CHECK:STDOUT: %type.as.Copy.impl.Op: %type.as.Copy.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: %type.as.Copy.impl.Op.bound: = bound_method %C, %type.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %Class.val: %Class = struct_value (%C) [concrete] +// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] // CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { -// CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: .Copy = %Core.Copy +// CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] // CHECK:STDOUT: %Core.import_ref.1a7: %type.as.Copy.impl.Op.type = import_ref Core//prelude/parts/copy, loc{{\d+_\d+}}, loaded [concrete = constants.%type.as.Copy.impl.Op] // CHECK:STDOUT: %Copy.impl_witness_table.b1c = impl_witness_table (%Core.import_ref.1a7), @type.as.Copy.impl [concrete] +// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -612,8 +606,8 @@ fn G() { // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { // CHECK:STDOUT: %T.patt: %pattern_type.904 = symbolic_binding_pattern T, 0 [concrete] -// CHECK:STDOUT: %x.patt: @F.%pattern_type (%pattern_type.3b8c03.1) = value_binding_pattern x [concrete] -// CHECK:STDOUT: %x.param_patt: @F.%pattern_type (%pattern_type.3b8c03.1) = value_param_pattern %x.patt [concrete] +// CHECK:STDOUT: %x.patt: @F.%pattern_type (%pattern_type.3b8) = value_binding_pattern x [concrete] +// CHECK:STDOUT: %x.param_patt: @F.%pattern_type (%pattern_type.3b8) = value_param_pattern %x.patt [concrete] // CHECK:STDOUT: %a.patt: = value_binding_pattern a [concrete] // CHECK:STDOUT: %a.param_patt: = value_param_pattern %a.patt [concrete] // CHECK:STDOUT: } { @@ -687,7 +681,7 @@ fn G() { // CHECK:STDOUT: generic fn @F(%T.loc21_6.2: %Class) { // CHECK:STDOUT: %T.loc21_6.1: %Class = symbolic_binding T, 0 [symbolic = %T.loc21_6.1 (constants.%T.d7d)] // CHECK:STDOUT: %HoldsType.loc21_38.1: type = class_type @HoldsType, @HoldsType(%T.loc21_6.1) [symbolic = %HoldsType.loc21_38.1 (constants.%HoldsType.47b504.1)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %HoldsType.loc21_38.1 [symbolic = %pattern_type (constants.%pattern_type.3b8c03.1)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %HoldsType.loc21_38.1 [symbolic = %pattern_type (constants.%pattern_type.3b8)] // CHECK:STDOUT: %.loc21_52.1: ref type = class_element_access %T.loc21_6.1, element0 [symbolic = %.loc21_52.1 (constants.%.208)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -706,12 +700,6 @@ fn G() { // CHECK:STDOUT: %HoldsType.loc26_22.2: type = class_type @HoldsType, @HoldsType(%c.loc25_6.1) [symbolic = %HoldsType.loc26_22.2 (constants.%HoldsType.47b504.2)] // CHECK:STDOUT: %require_complete: = require_complete_type %HoldsType.loc26_22.2 [symbolic = %require_complete (constants.%require_complete.9b8c71.2)] // CHECK:STDOUT: %HoldsType.val: @G.%HoldsType.loc26_22.2 (%HoldsType.47b504.2) = struct_value () [symbolic = %HoldsType.val (constants.%HoldsType.val)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %HoldsType.loc26_22.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %HoldsType.loc26_22.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.278)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.055)] -// CHECK:STDOUT: %.loc26_6.5: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet [symbolic = %.loc26_6.5 (constants.%.b9b)] -// CHECK:STDOUT: %impl.elem0.loc26_6.2: @G.%.loc26_6.5 (%.b9b) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc26_6.2 (constants.%impl.elem0.909)] -// CHECK:STDOUT: %specific_impl_fn.loc26_6.2: = specific_impl_function %impl.elem0.loc26_6.2, @Destroy.WithSelf.Op(%Destroy.facet) [symbolic = %specific_impl_fn.loc26_6.2 (constants.%specific_impl_fn.2d3)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: @@ -722,14 +710,8 @@ fn G() { // CHECK:STDOUT: %HoldsType.loc26_22.1: type = class_type @HoldsType, @HoldsType(constants.%c) [symbolic = %HoldsType.loc26_22.2 (constants.%HoldsType.47b504.2)] // CHECK:STDOUT: %.loc26_6.2: ref @G.%HoldsType.loc26_22.2 (%HoldsType.47b504.2) = temporary_storage // CHECK:STDOUT: %.loc26_6.3: init @G.%HoldsType.loc26_22.2 (%HoldsType.47b504.2) to %.loc26_6.2 = class_init () [symbolic = %HoldsType.val (constants.%HoldsType.val)] -// CHECK:STDOUT: %.loc26_6.4: ref @G.%HoldsType.loc26_22.2 (%HoldsType.47b504.2) = temporary %.loc26_6.2, %.loc26_6.3 -// CHECK:STDOUT: %.loc26_8: ref @G.%HoldsType.loc26_22.2 (%HoldsType.47b504.2) = converted %.loc26_6.1, %.loc26_6.4 +// CHECK:STDOUT: %.loc26_8: init @G.%HoldsType.loc26_22.2 (%HoldsType.47b504.2) = converted %.loc26_6.1, %.loc26_6.3 [symbolic = %HoldsType.val (constants.%HoldsType.val)] // CHECK:STDOUT: %.loc26_26: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %impl.elem0.loc26_6.1: @G.%.loc26_6.5 (%.b9b) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc26_6.2 (constants.%impl.elem0.909)] -// CHECK:STDOUT: %bound_method.loc26_6.1: = bound_method %.loc26_6.4, %impl.elem0.loc26_6.1 -// CHECK:STDOUT: %specific_impl_fn.loc26_6.1: = specific_impl_function %impl.elem0.loc26_6.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.278) [symbolic = %specific_impl_fn.loc26_6.2 (constants.%specific_impl_fn.2d3)] -// CHECK:STDOUT: %bound_method.loc26_6.2: = bound_method %.loc26_6.4, %specific_impl_fn.loc26_6.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc26_6.2(%.loc26_6.4) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -746,11 +728,11 @@ fn G() { // CHECK:STDOUT: %.loc37_12.3: ref type = class_element_access %.loc37_12.2, element0 // CHECK:STDOUT: %.loc37_12.4: init type to %.loc37_12.3 = in_place_init %type.as.Copy.impl.Op.call [concrete = constants.%C] // CHECK:STDOUT: %.loc37_12.5: init %Class to %.loc37_12.2 = class_init (%.loc37_12.4) [concrete = constants.%Class.val] -// CHECK:STDOUT: %.loc37_12.6: ref %Class = temporary %.loc37_12.2, %.loc37_12.5 -// CHECK:STDOUT: %.loc37_13.1: ref %Class = converted %.loc37_12.1, %.loc37_12.6 -// CHECK:STDOUT: %.loc37_13.2: %Class = acquire_value %.loc37_13.1 -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc37_12.6, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc37_12.6) +// CHECK:STDOUT: %.loc37_13.1: init %Class = converted %.loc37_12.1, %.loc37_12.5 [concrete = constants.%Class.val] +// CHECK:STDOUT: %.loc37_13.2: ref %Class = temporary %.loc37_12.2, %.loc37_13.1 +// CHECK:STDOUT: %.loc37_13.3: %Class = acquire_value %.loc37_13.2 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc37_13.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc37_13.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -765,7 +747,7 @@ fn G() { // CHECK:STDOUT: specific @F(constants.%T.d7d) { // CHECK:STDOUT: %T.loc21_6.1 => constants.%T.d7d // CHECK:STDOUT: %HoldsType.loc21_38.1 => constants.%HoldsType.47b504.1 -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.3b8c03.1 +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.3b8 // CHECK:STDOUT: %.loc21_52.1 => constants.%.208 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/facet/call_combined_impl_witness.carbon b/toolchain/check/testdata/facet/call_combined_impl_witness.carbon index 931fefca87e2..5f923971e957 100644 --- a/toolchain/check/testdata/facet/call_combined_impl_witness.carbon +++ b/toolchain/check/testdata/facet/call_combined_impl_witness.carbon @@ -383,15 +383,15 @@ fn F() { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %.loc45_6.2: ref %C = temporary_storage // CHECK:STDOUT: %.loc45_6.3: init %C to %.loc45_6.2 = class_init () [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc45_6.4: ref %C = temporary %.loc45_6.2, %.loc45_6.3 -// CHECK:STDOUT: %.loc45_8.1: ref %C = converted %.loc45_6.1, %.loc45_6.4 +// CHECK:STDOUT: %.loc45_8.1: init %C = converted %.loc45_6.1, %.loc45_6.3 [concrete = constants.%C.val] // CHECK:STDOUT: %facet_value: %facet_type.dc7 = facet_value constants.%C, (constants.%Empty.impl_witness, constants.%A.impl_witness, constants.%B.impl_witness) [concrete = constants.%facet_value] // CHECK:STDOUT: %.loc45_12: %facet_type.dc7 = converted constants.%C, %facet_value [concrete = constants.%facet_value] // CHECK:STDOUT: %G.specific_fn: = specific_function %G.ref, @G(constants.%facet_value) [concrete = constants.%G.specific_fn] -// CHECK:STDOUT: %.loc45_8.2: %C = acquire_value %.loc45_8.1 -// CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.specific_fn(%.loc45_8.2) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc45_6.4, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc45_6.4) +// CHECK:STDOUT: %.loc45_8.2: ref %C = temporary %.loc45_6.2, %.loc45_8.1 +// CHECK:STDOUT: %.loc45_8.3: %C = acquire_value %.loc45_8.2 +// CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.specific_fn(%.loc45_8.3) +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc45_8.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc45_8.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/facet/convert_class_type_to_generic_facet_value.carbon b/toolchain/check/testdata/facet/convert_class_type_to_generic_facet_value.carbon index 5e4edd08f92d..b4976592928c 100644 --- a/toolchain/check/testdata/facet/convert_class_type_to_generic_facet_value.carbon +++ b/toolchain/check/testdata/facet/convert_class_type_to_generic_facet_value.carbon @@ -606,15 +606,15 @@ fn G() { // CHECK:STDOUT: %GenericParam.ref: type = name_ref GenericParam, file.%GenericParam.decl [concrete = constants.%GenericParam] // CHECK:STDOUT: %.loc18_36.2: ref %GenericParam = temporary_storage // CHECK:STDOUT: %.loc18_36.3: init %GenericParam to %.loc18_36.2 = class_init () [concrete = constants.%GenericParam.val] -// CHECK:STDOUT: %.loc18_36.4: ref %GenericParam = temporary %.loc18_36.2, %.loc18_36.3 -// CHECK:STDOUT: %.loc18_38.1: ref %GenericParam = converted %.loc18_36.1, %.loc18_36.4 +// CHECK:STDOUT: %.loc18_38.1: init %GenericParam = converted %.loc18_36.1, %.loc18_36.3 [concrete = constants.%GenericParam.val] // CHECK:STDOUT: %Generic.facet: %Generic.type.498 = facet_value constants.%ImplsGeneric, (constants.%Generic.impl_witness) [concrete = constants.%Generic.facet] // CHECK:STDOUT: %.loc18_53: %Generic.type.498 = converted constants.%ImplsGeneric, %Generic.facet [concrete = constants.%Generic.facet] // CHECK:STDOUT: %CallGenericMethod.specific_fn: = specific_function %CallGenericMethod.ref, @CallGenericMethod(constants.%GenericParam, constants.%Generic.facet) [concrete = constants.%CallGenericMethod.specific_fn] -// CHECK:STDOUT: %.loc18_38.2: %GenericParam = acquire_value %.loc18_38.1 -// CHECK:STDOUT: %CallGenericMethod.call: init %empty_tuple.type = call %CallGenericMethod.specific_fn(%.loc18_38.2) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc18_36.4, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc18_36.4) +// CHECK:STDOUT: %.loc18_38.2: ref %GenericParam = temporary %.loc18_36.2, %.loc18_38.1 +// CHECK:STDOUT: %.loc18_38.3: %GenericParam = acquire_value %.loc18_38.2 +// CHECK:STDOUT: %CallGenericMethod.call: init %empty_tuple.type = call %CallGenericMethod.specific_fn(%.loc18_38.3) +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc18_38.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc18_38.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/facet/convert_class_value_to_facet_value_value.carbon b/toolchain/check/testdata/facet/convert_class_value_to_facet_value_value.carbon index b539f1716690..1141cae0eaff 100644 --- a/toolchain/check/testdata/facet/convert_class_value_to_facet_value_value.carbon +++ b/toolchain/check/testdata/facet/convert_class_value_to_facet_value_value.carbon @@ -147,15 +147,15 @@ fn F() { // CHECK:STDOUT: %Goat.ref: type = name_ref Goat, file.%Goat.decl [concrete = constants.%Goat] // CHECK:STDOUT: %.loc23_15.2: ref %Goat = temporary_storage // CHECK:STDOUT: %.loc23_15.3: init %Goat to %.loc23_15.2 = class_init () [concrete = constants.%Goat.val] -// CHECK:STDOUT: %.loc23_15.4: ref %Goat = temporary %.loc23_15.2, %.loc23_15.3 -// CHECK:STDOUT: %.loc23_17.1: ref %Goat = converted %.loc23_15.1, %.loc23_15.4 +// CHECK:STDOUT: %.loc23_17.1: init %Goat = converted %.loc23_15.1, %.loc23_15.3 [concrete = constants.%Goat.val] // CHECK:STDOUT: %Animal.facet: %Animal.type = facet_value constants.%Goat, (constants.%Animal.impl_witness) [concrete = constants.%Animal.facet] // CHECK:STDOUT: %.loc23_24: %Animal.type = converted constants.%Goat, %Animal.facet [concrete = constants.%Animal.facet] // CHECK:STDOUT: %WalkAnimal.specific_fn: = specific_function %WalkAnimal.ref, @WalkAnimal(constants.%Animal.facet) [concrete = constants.%WalkAnimal.specific_fn] -// CHECK:STDOUT: %.loc23_17.2: %Goat = acquire_value %.loc23_17.1 -// CHECK:STDOUT: %WalkAnimal.call: init %empty_tuple.type = call %WalkAnimal.specific_fn(%.loc23_17.2) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc23_15.4, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc23_15.4) +// CHECK:STDOUT: %.loc23_17.2: ref %Goat = temporary %.loc23_15.2, %.loc23_17.1 +// CHECK:STDOUT: %.loc23_17.3: %Goat = acquire_value %.loc23_17.2 +// CHECK:STDOUT: %WalkAnimal.call: init %empty_tuple.type = call %WalkAnimal.specific_fn(%.loc23_17.3) +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc23_17.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc23_17.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/facet/convert_class_value_to_generic_facet_value_value.carbon b/toolchain/check/testdata/facet/convert_class_value_to_generic_facet_value_value.carbon index 797c5a84039b..d85eb6826848 100644 --- a/toolchain/check/testdata/facet/convert_class_value_to_generic_facet_value_value.carbon +++ b/toolchain/check/testdata/facet/convert_class_value_to_generic_facet_value_value.carbon @@ -159,9 +159,9 @@ fn B() { // CHECK:STDOUT: %pattern_type.27a: type = pattern_type %GenericParam [concrete] // CHECK:STDOUT: %CallGenericMethod.specific_fn: = specific_function %CallGenericMethod, @CallGenericMethod(%GenericParam, %Generic.facet) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc20_42 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc20_44 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc20_22 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc20_24 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: %complete_type.57a: = complete_type_witness %Generic.type.498 [concrete] // CHECK:STDOUT: %.fcf: type = fn_type_with_self_type %Generic.WithSelf.F.type.c86, %Generic.facet [concrete] @@ -338,30 +338,30 @@ fn B() { // CHECK:STDOUT: %ImplsGeneric.ref: type = name_ref ImplsGeneric, file.%ImplsGeneric.decl [concrete = constants.%ImplsGeneric] // CHECK:STDOUT: %.loc20_22.2: ref %ImplsGeneric = temporary_storage // CHECK:STDOUT: %.loc20_22.3: init %ImplsGeneric to %.loc20_22.2 = class_init () [concrete = constants.%ImplsGeneric.val] -// CHECK:STDOUT: %.loc20_22.4: ref %ImplsGeneric = temporary %.loc20_22.2, %.loc20_22.3 -// CHECK:STDOUT: %.loc20_24.1: ref %ImplsGeneric = converted %.loc20_22.1, %.loc20_22.4 +// CHECK:STDOUT: %.loc20_24.1: init %ImplsGeneric = converted %.loc20_22.1, %.loc20_22.3 [concrete = constants.%ImplsGeneric.val] // CHECK:STDOUT: %.loc20_42.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %GenericParam.ref: type = name_ref GenericParam, file.%GenericParam.decl [concrete = constants.%GenericParam] // CHECK:STDOUT: %.loc20_42.2: ref %GenericParam = temporary_storage // CHECK:STDOUT: %.loc20_42.3: init %GenericParam to %.loc20_42.2 = class_init () [concrete = constants.%GenericParam.val] -// CHECK:STDOUT: %.loc20_42.4: ref %GenericParam = temporary %.loc20_42.2, %.loc20_42.3 -// CHECK:STDOUT: %.loc20_44.1: ref %GenericParam = converted %.loc20_42.1, %.loc20_42.4 +// CHECK:STDOUT: %.loc20_44.1: init %GenericParam = converted %.loc20_42.1, %.loc20_42.3 [concrete = constants.%GenericParam.val] // CHECK:STDOUT: %Generic.facet: %Generic.type.498 = facet_value constants.%ImplsGeneric, (constants.%Generic.impl_witness) [concrete = constants.%Generic.facet] // CHECK:STDOUT: %.loc20_59: %Generic.type.498 = converted constants.%ImplsGeneric, %Generic.facet [concrete = constants.%Generic.facet] // CHECK:STDOUT: %CallGenericMethod.specific_fn: = specific_function %CallGenericMethod.ref, @CallGenericMethod(constants.%GenericParam, constants.%Generic.facet) [concrete = constants.%CallGenericMethod.specific_fn] -// CHECK:STDOUT: %.loc20_24.2: %ImplsGeneric = acquire_value %.loc20_24.1 -// CHECK:STDOUT: %.loc20_44.2: %GenericParam = acquire_value %.loc20_44.1 -// CHECK:STDOUT: %CallGenericMethod.call: init %empty_tuple.type = call %CallGenericMethod.specific_fn(%.loc20_24.2, %.loc20_44.2) -// CHECK:STDOUT: %Destroy.Op.bound.loc20_42: = bound_method %.loc20_42.4, constants.%Destroy.Op.651ba6.1 -// CHECK:STDOUT: %Destroy.Op.call.loc20_42: init %empty_tuple.type = call %Destroy.Op.bound.loc20_42(%.loc20_42.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc20_22: = bound_method %.loc20_22.4, constants.%Destroy.Op.651ba6.2 -// CHECK:STDOUT: %Destroy.Op.call.loc20_22: init %empty_tuple.type = call %Destroy.Op.bound.loc20_22(%.loc20_22.4) +// CHECK:STDOUT: %.loc20_24.2: ref %ImplsGeneric = temporary %.loc20_22.2, %.loc20_24.1 +// CHECK:STDOUT: %.loc20_24.3: %ImplsGeneric = acquire_value %.loc20_24.2 +// CHECK:STDOUT: %.loc20_44.2: ref %GenericParam = temporary %.loc20_42.2, %.loc20_44.1 +// CHECK:STDOUT: %.loc20_44.3: %GenericParam = acquire_value %.loc20_44.2 +// CHECK:STDOUT: %CallGenericMethod.call: init %empty_tuple.type = call %CallGenericMethod.specific_fn(%.loc20_24.3, %.loc20_44.3) +// CHECK:STDOUT: %Destroy.Op.bound.loc20_44: = bound_method %.loc20_44.2, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.call.loc20_44: init %empty_tuple.type = call %Destroy.Op.bound.loc20_44(%.loc20_44.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc20_24: = bound_method %.loc20_24.2, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.call.loc20_24: init %empty_tuple.type = call %Destroy.Op.bound.loc20_24(%.loc20_24.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc20_42(%self.param: ref %GenericParam) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc20_44(%self.param: ref %GenericParam) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc20_22(%self.param: ref %ImplsGeneric) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc20_24(%self.param: ref %ImplsGeneric) = "no_op"; // CHECK:STDOUT: // CHECK:STDOUT: specific @Generic(constants.%Scalar) { // CHECK:STDOUT: %Scalar.loc4_19.1 => constants.%Scalar @@ -654,15 +654,15 @@ fn B() { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %.loc12_6.2: ref %C = temporary_storage // CHECK:STDOUT: %.loc12_6.3: init %C to %.loc12_6.2 = class_init () [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc12_6.4: ref %C = temporary %.loc12_6.2, %.loc12_6.3 -// CHECK:STDOUT: %.loc12_8.1: ref %C = converted %.loc12_6.1, %.loc12_6.4 +// CHECK:STDOUT: %.loc12_8.1: init %C = converted %.loc12_6.1, %.loc12_6.3 [concrete = constants.%C.val] // CHECK:STDOUT: %I.facet: %I.type.5f7 = facet_value constants.%C, (constants.%I.impl_witness.1c4) [concrete = constants.%I.facet.0e1] // CHECK:STDOUT: %.loc12_12: %I.type.5f7 = converted constants.%C, %I.facet [concrete = constants.%I.facet.0e1] // CHECK:STDOUT: %A.specific_fn: = specific_function %A.ref, @A(constants.%I.facet.0e1) [concrete = constants.%A.specific_fn] -// CHECK:STDOUT: %.loc12_8.2: %C = acquire_value %.loc12_8.1 -// CHECK:STDOUT: %A.call: init %empty_tuple.type = call %A.specific_fn(%.loc12_8.2) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc12_6.4, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc12_6.4) +// CHECK:STDOUT: %.loc12_8.2: ref %C = temporary %.loc12_6.2, %.loc12_8.1 +// CHECK:STDOUT: %.loc12_8.3: %C = acquire_value %.loc12_8.2 +// CHECK:STDOUT: %A.call: init %empty_tuple.type = call %A.specific_fn(%.loc12_8.3) +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc12_8.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc12_8.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -771,18 +771,13 @@ fn B() { // CHECK:STDOUT: %B.type: type = fn_type @B [concrete] // CHECK:STDOUT: %B: %B.type = struct_value () [concrete] // CHECK:STDOUT: %C.val: %C = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { -// CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -917,15 +912,10 @@ fn B() { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %.loc19_6.2: ref %C = temporary_storage // CHECK:STDOUT: %.loc19_6.3: init %C to %.loc19_6.2 = class_init () [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc19_6.4: ref %C = temporary %.loc19_6.2, %.loc19_6.3 -// CHECK:STDOUT: %.loc19_8: ref %C = converted %.loc19_6.1, %.loc19_6.4 -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc19_6.4, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc19_6.4) +// CHECK:STDOUT: %.loc19_8: init %C = converted %.loc19_6.1, %.loc19_6.3 [concrete = constants.%C.val] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %C) = "no_op"; -// CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%V, constants.%W) { // CHECK:STDOUT: %V.loc3_13.1 => constants.%V // CHECK:STDOUT: %W.loc3_23.1 => constants.%W @@ -979,7 +969,7 @@ fn B() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete] -// CHECK:STDOUT: %Self.ab9: %I.type = symbolic_binding Self, 0 [symbolic] +// CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic] // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %V: type = symbolic_binding V, 0 [symbolic] @@ -1008,18 +998,13 @@ fn B() { // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: %C.9f1: type = class_type @C, @C(%empty_struct_type, %empty_struct_type) [concrete] // CHECK:STDOUT: %C.val: %C.9f1 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { -// CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1084,7 +1069,7 @@ fn B() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { -// CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = constants.%Self.ab9] +// CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = constants.%Self] // CHECK:STDOUT: %I.WithSelf.decl = interface_with_self_decl @I [concrete] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -1151,16 +1136,11 @@ fn B() { // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%empty_struct_type, constants.%empty_struct_type) [concrete = constants.%C.9f1] // CHECK:STDOUT: %.loc19_6.2: ref %C.9f1 = temporary_storage // CHECK:STDOUT: %.loc19_6.3: init %C.9f1 to %.loc19_6.2 = class_init () [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc19_6.4: ref %C.9f1 = temporary %.loc19_6.2, %.loc19_6.3 -// CHECK:STDOUT: %.loc19_8: ref %C.9f1 = converted %.loc19_6.1, %.loc19_6.4 -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc19_6.4, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc19_6.4) +// CHECK:STDOUT: %.loc19_8: init %C.9f1 = converted %.loc19_6.1, %.loc19_6.3 [concrete = constants.%C.val] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %C.9f1) = "no_op"; -// CHECK:STDOUT: -// CHECK:STDOUT: specific @I.WithSelf(constants.%Self.ab9) { +// CHECK:STDOUT: specific @I.WithSelf(constants.%Self) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/facet/convert_facet_value_as_type_knows_original_type.carbon b/toolchain/check/testdata/facet/convert_facet_value_as_type_knows_original_type.carbon index ea29224d8a56..34c1c23072d3 100644 --- a/toolchain/check/testdata/facet/convert_facet_value_as_type_knows_original_type.carbon +++ b/toolchain/check/testdata/facet/convert_facet_value_as_type_knows_original_type.carbon @@ -160,8 +160,7 @@ fn F[A:! J, B:! A](x: C(A, B)) { // CHECK:STDOUT: %Goat.ref.loc22_33: type = name_ref Goat, file.%Goat.decl [concrete = constants.%Goat] // CHECK:STDOUT: %.loc22_28.2: ref %Goat = temporary_storage // CHECK:STDOUT: %.loc22_28.3: init %Goat to %.loc22_28.2 = class_init () [concrete = constants.%Goat.val] -// CHECK:STDOUT: %.loc22_28.4: ref %Goat = temporary %.loc22_28.2, %.loc22_28.3 -// CHECK:STDOUT: %.loc22_30.1: ref %Goat = converted %.loc22_28.1, %.loc22_28.4 +// CHECK:STDOUT: %.loc22_30.1: init %Goat = converted %.loc22_28.1, %.loc22_28.3 [concrete = constants.%Goat.val] // CHECK:STDOUT: %.loc22_15.1: type = splice_block %.loc22_15.3 [concrete = constants.%Goat] { // CHECK:STDOUT: %Goat.ref.loc22_10: type = name_ref Goat, file.%Goat.decl [concrete = constants.%Goat] // CHECK:STDOUT: %Animal.ref.loc22: type = name_ref Animal, file.%Animal.decl [concrete = constants.%Animal.type] @@ -170,8 +169,9 @@ fn F[A:! J, B:! A](x: C(A, B)) { // CHECK:STDOUT: %as_type.loc22: type = facet_access_type %.loc22_15.2 [concrete = constants.%Goat] // CHECK:STDOUT: %.loc22_15.3: type = converted %.loc22_15.2, %as_type.loc22 [concrete = constants.%Goat] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc22_30.2: %Goat = acquire_value %.loc22_30.1 -// CHECK:STDOUT: %x: %Goat = value_binding x, %.loc22_30.2 +// CHECK:STDOUT: %.loc22_30.2: ref %Goat = temporary %.loc22_28.2, %.loc22_30.1 +// CHECK:STDOUT: %.loc22_30.3: %Goat = acquire_value %.loc22_30.2 +// CHECK:STDOUT: %x: %Goat = value_binding x, %.loc22_30.3 // CHECK:STDOUT: %x.ref.loc23: %Goat = name_ref x, %x // CHECK:STDOUT: %Bleet.ref.loc23: %Goat.Bleet.type = name_ref Bleet, @Goat.%Goat.Bleet.decl [concrete = constants.%Goat.Bleet] // CHECK:STDOUT: %Goat.Bleet.call.loc23: init %empty_tuple.type = call %Bleet.ref.loc23() @@ -183,37 +183,37 @@ fn F[A:! J, B:! A](x: C(A, B)) { // CHECK:STDOUT: %Goat.ref.loc26_11: type = name_ref Goat, file.%Goat.decl [concrete = constants.%Goat] // CHECK:STDOUT: %.loc26_6.2: ref %Goat = temporary_storage // CHECK:STDOUT: %.loc26_6.3: init %Goat to %.loc26_6.2 = class_init () [concrete = constants.%Goat.val] -// CHECK:STDOUT: %.loc26_6.4: ref %Goat = temporary %.loc26_6.2, %.loc26_6.3 -// CHECK:STDOUT: %.loc26_8: ref %Goat = converted %.loc26_6.1, %.loc26_6.4 +// CHECK:STDOUT: %.loc26_8.1: init %Goat = converted %.loc26_6.1, %.loc26_6.3 [concrete = constants.%Goat.val] // CHECK:STDOUT: %Goat.ref.loc26_21: type = name_ref Goat, file.%Goat.decl [concrete = constants.%Goat] // CHECK:STDOUT: %Animal.ref.loc26: type = name_ref Animal, file.%Animal.decl [concrete = constants.%Animal.type] // CHECK:STDOUT: %Animal.facet.loc26: %Animal.type = facet_value %Goat.ref.loc26_21, (constants.%Animal.impl_witness) [concrete = constants.%Animal.facet] // CHECK:STDOUT: %.loc26_26: %Animal.type = converted %Goat.ref.loc26_21, %Animal.facet.loc26 [concrete = constants.%Animal.facet] // CHECK:STDOUT: %as_type.loc26: type = facet_access_type %.loc26_26 [concrete = constants.%Goat] // CHECK:STDOUT: %.loc26_35: type = converted %.loc26_26, %as_type.loc26 [concrete = constants.%Goat] +// CHECK:STDOUT: %.loc26_8.2: ref %Goat = temporary %.loc26_6.2, %.loc26_8.1 // CHECK:STDOUT: %Bleet.ref.loc26: %Goat.Bleet.type = name_ref Bleet, @Goat.%Goat.Bleet.decl [concrete = constants.%Goat.Bleet] // CHECK:STDOUT: %Goat.Bleet.call.loc26: init %empty_tuple.type = call %Bleet.ref.loc26() // CHECK:STDOUT: %.loc27_6.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %Goat.ref.loc27_11: type = name_ref Goat, file.%Goat.decl [concrete = constants.%Goat] // CHECK:STDOUT: %.loc27_6.2: ref %Goat = temporary_storage // CHECK:STDOUT: %.loc27_6.3: init %Goat to %.loc27_6.2 = class_init () [concrete = constants.%Goat.val] -// CHECK:STDOUT: %.loc27_6.4: ref %Goat = temporary %.loc27_6.2, %.loc27_6.3 -// CHECK:STDOUT: %.loc27_8: ref %Goat = converted %.loc27_6.1, %.loc27_6.4 +// CHECK:STDOUT: %.loc27_8.1: init %Goat = converted %.loc27_6.1, %.loc27_6.3 [concrete = constants.%Goat.val] // CHECK:STDOUT: %Goat.ref.loc27_21: type = name_ref Goat, file.%Goat.decl [concrete = constants.%Goat] // CHECK:STDOUT: %Animal.ref.loc27: type = name_ref Animal, file.%Animal.decl [concrete = constants.%Animal.type] // CHECK:STDOUT: %Animal.facet.loc27: %Animal.type = facet_value %Goat.ref.loc27_21, (constants.%Animal.impl_witness) [concrete = constants.%Animal.facet] // CHECK:STDOUT: %.loc27_26: %Animal.type = converted %Goat.ref.loc27_21, %Animal.facet.loc27 [concrete = constants.%Animal.facet] // CHECK:STDOUT: %as_type.loc27: type = facet_access_type %.loc27_26 [concrete = constants.%Goat] // CHECK:STDOUT: %.loc27_35: type = converted %.loc27_26, %as_type.loc27 [concrete = constants.%Goat] +// CHECK:STDOUT: %.loc27_8.2: ref %Goat = temporary %.loc27_6.2, %.loc27_8.1 // CHECK:STDOUT: %Eat.ref.loc27: %Eats.assoc_type = name_ref Eat, @Eats.WithSelf.%assoc0 [concrete = constants.%assoc0.083] // CHECK:STDOUT: %impl.elem0.loc27: %.35f = impl_witness_access constants.%Eats.impl_witness, element0 [concrete = constants.%Goat.as.Eats.impl.Eat] // CHECK:STDOUT: %Goat.as.Eats.impl.Eat.call.loc27: init %empty_tuple.type = call %impl.elem0.loc27() -// CHECK:STDOUT: %Destroy.Op.bound.loc27: = bound_method %.loc27_6.4, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call.loc27: init %empty_tuple.type = call %Destroy.Op.bound.loc27(%.loc27_6.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc26: = bound_method %.loc26_6.4, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call.loc26: init %empty_tuple.type = call %Destroy.Op.bound.loc26(%.loc26_6.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc22: = bound_method %.loc22_28.4, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call.loc22: init %empty_tuple.type = call %Destroy.Op.bound.loc22(%.loc22_28.4) +// CHECK:STDOUT: %Destroy.Op.bound.loc27: = bound_method %.loc27_8.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.call.loc27: init %empty_tuple.type = call %Destroy.Op.bound.loc27(%.loc27_8.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc26: = bound_method %.loc26_8.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.call.loc26: init %empty_tuple.type = call %Destroy.Op.bound.loc26(%.loc26_8.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc22: = bound_method %.loc22_30.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.call.loc22: init %empty_tuple.type = call %Destroy.Op.bound.loc22(%.loc22_30.2) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/facet/convert_facet_value_value_to_generic_facet_value_value.carbon b/toolchain/check/testdata/facet/convert_facet_value_value_to_generic_facet_value_value.carbon index af9f6a4cf1c6..4d0003df5792 100644 --- a/toolchain/check/testdata/facet/convert_facet_value_value_to_generic_facet_value_value.carbon +++ b/toolchain/check/testdata/facet/convert_facet_value_value_to_generic_facet_value_value.carbon @@ -110,9 +110,9 @@ fn F() { // CHECK:STDOUT: %pattern_type.df6: type = pattern_type %Grass [concrete] // CHECK:STDOUT: %HandleAnimal.specific_fn: = specific_function %HandleAnimal, @HandleAnimal(%Animal.facet, %Edible.facet) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc35_29 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc35_31 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc35_17 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc35_19 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: %Eats.type.8c2: type = facet_type <@Eats, @Eats(%Grass)> [concrete] // CHECK:STDOUT: %Eats.impl_witness.f54: = impl_witness @T.binding.as_type.as.Eats.impl.%Eats.impl_witness_table, @T.binding.as_type.as.Eats.impl(%Animal.facet, %Edible.facet) [concrete] @@ -414,32 +414,32 @@ fn F() { // CHECK:STDOUT: %Goat.ref: type = name_ref Goat, file.%Goat.decl [concrete = constants.%Goat] // CHECK:STDOUT: %.loc35_17.2: ref %Goat = temporary_storage // CHECK:STDOUT: %.loc35_17.3: init %Goat to %.loc35_17.2 = class_init () [concrete = constants.%Goat.val] -// CHECK:STDOUT: %.loc35_17.4: ref %Goat = temporary %.loc35_17.2, %.loc35_17.3 -// CHECK:STDOUT: %.loc35_19.1: ref %Goat = converted %.loc35_17.1, %.loc35_17.4 +// CHECK:STDOUT: %.loc35_19.1: init %Goat = converted %.loc35_17.1, %.loc35_17.3 [concrete = constants.%Goat.val] // CHECK:STDOUT: %.loc35_29.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %Grass.ref: type = name_ref Grass, file.%Grass.decl [concrete = constants.%Grass] // CHECK:STDOUT: %.loc35_29.2: ref %Grass = temporary_storage // CHECK:STDOUT: %.loc35_29.3: init %Grass to %.loc35_29.2 = class_init () [concrete = constants.%Grass.val] -// CHECK:STDOUT: %.loc35_29.4: ref %Grass = temporary %.loc35_29.2, %.loc35_29.3 -// CHECK:STDOUT: %.loc35_31.1: ref %Grass = converted %.loc35_29.1, %.loc35_29.4 +// CHECK:STDOUT: %.loc35_31.1: init %Grass = converted %.loc35_29.1, %.loc35_29.3 [concrete = constants.%Grass.val] // CHECK:STDOUT: %Animal.facet: %Animal.type = facet_value constants.%Goat, (constants.%Animal.impl_witness) [concrete = constants.%Animal.facet] // CHECK:STDOUT: %.loc35_39.1: %Animal.type = converted constants.%Goat, %Animal.facet [concrete = constants.%Animal.facet] // CHECK:STDOUT: %Edible.facet: %Edible.type = facet_value constants.%Grass, (constants.%Edible.impl_witness) [concrete = constants.%Edible.facet] // CHECK:STDOUT: %.loc35_39.2: %Edible.type = converted constants.%Grass, %Edible.facet [concrete = constants.%Edible.facet] // CHECK:STDOUT: %HandleAnimal.specific_fn: = specific_function %HandleAnimal.ref, @HandleAnimal(constants.%Animal.facet, constants.%Edible.facet) [concrete = constants.%HandleAnimal.specific_fn] -// CHECK:STDOUT: %.loc35_19.2: %Goat = acquire_value %.loc35_19.1 -// CHECK:STDOUT: %.loc35_31.2: %Grass = acquire_value %.loc35_31.1 -// CHECK:STDOUT: %HandleAnimal.call: init %empty_tuple.type = call %HandleAnimal.specific_fn(%.loc35_19.2, %.loc35_31.2) -// CHECK:STDOUT: %Destroy.Op.bound.loc35_29: = bound_method %.loc35_29.4, constants.%Destroy.Op.651ba6.1 -// CHECK:STDOUT: %Destroy.Op.call.loc35_29: init %empty_tuple.type = call %Destroy.Op.bound.loc35_29(%.loc35_29.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc35_17: = bound_method %.loc35_17.4, constants.%Destroy.Op.651ba6.2 -// CHECK:STDOUT: %Destroy.Op.call.loc35_17: init %empty_tuple.type = call %Destroy.Op.bound.loc35_17(%.loc35_17.4) +// CHECK:STDOUT: %.loc35_19.2: ref %Goat = temporary %.loc35_17.2, %.loc35_19.1 +// CHECK:STDOUT: %.loc35_19.3: %Goat = acquire_value %.loc35_19.2 +// CHECK:STDOUT: %.loc35_31.2: ref %Grass = temporary %.loc35_29.2, %.loc35_31.1 +// CHECK:STDOUT: %.loc35_31.3: %Grass = acquire_value %.loc35_31.2 +// CHECK:STDOUT: %HandleAnimal.call: init %empty_tuple.type = call %HandleAnimal.specific_fn(%.loc35_19.3, %.loc35_31.3) +// CHECK:STDOUT: %Destroy.Op.bound.loc35_31: = bound_method %.loc35_31.2, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.call.loc35_31: init %empty_tuple.type = call %Destroy.Op.bound.loc35_31(%.loc35_31.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc35_19: = bound_method %.loc35_19.2, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.call.loc35_19: init %empty_tuple.type = call %Destroy.Op.bound.loc35_19(%.loc35_19.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc35_29(%self.param: ref %Grass) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc35_31(%self.param: ref %Grass) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc35_17(%self.param: ref %Goat) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc35_19(%self.param: ref %Goat) = "no_op"; // CHECK:STDOUT: // CHECK:STDOUT: specific @Edible.WithSelf(constants.%Self.461) { // CHECK:STDOUT: !definition: diff --git a/toolchain/check/testdata/facet/convert_facet_value_value_to_itself.carbon b/toolchain/check/testdata/facet/convert_facet_value_value_to_itself.carbon index 31e3739790e7..4ba994ffa77f 100644 --- a/toolchain/check/testdata/facet/convert_facet_value_value_to_itself.carbon +++ b/toolchain/check/testdata/facet/convert_facet_value_value_to_itself.carbon @@ -192,15 +192,15 @@ fn F() { // CHECK:STDOUT: %Goat.ref: type = name_ref Goat, file.%Goat.decl [concrete = constants.%Goat] // CHECK:STDOUT: %.loc25_17.2: ref %Goat = temporary_storage // CHECK:STDOUT: %.loc25_17.3: init %Goat to %.loc25_17.2 = class_init () [concrete = constants.%Goat.val] -// CHECK:STDOUT: %.loc25_17.4: ref %Goat = temporary %.loc25_17.2, %.loc25_17.3 -// CHECK:STDOUT: %.loc25_19.1: ref %Goat = converted %.loc25_17.1, %.loc25_17.4 +// CHECK:STDOUT: %.loc25_19.1: init %Goat = converted %.loc25_17.1, %.loc25_17.3 [concrete = constants.%Goat.val] // CHECK:STDOUT: %Animal.facet: %Animal.type = facet_value constants.%Goat, (constants.%Animal.impl_witness) [concrete = constants.%Animal.facet] // CHECK:STDOUT: %.loc25_26: %Animal.type = converted constants.%Goat, %Animal.facet [concrete = constants.%Animal.facet] // CHECK:STDOUT: %HandleAnimal.specific_fn: = specific_function %HandleAnimal.ref, @HandleAnimal(constants.%Animal.facet) [concrete = constants.%HandleAnimal.specific_fn] -// CHECK:STDOUT: %.loc25_19.2: %Goat = acquire_value %.loc25_19.1 -// CHECK:STDOUT: %HandleAnimal.call: init %empty_tuple.type = call %HandleAnimal.specific_fn(%.loc25_19.2) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc25_17.4, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc25_17.4) +// CHECK:STDOUT: %.loc25_19.2: ref %Goat = temporary %.loc25_17.2, %.loc25_19.1 +// CHECK:STDOUT: %.loc25_19.3: %Goat = acquire_value %.loc25_19.2 +// CHECK:STDOUT: %HandleAnimal.call: init %empty_tuple.type = call %HandleAnimal.specific_fn(%.loc25_19.3) +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc25_19.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc25_19.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/for/basic.carbon b/toolchain/check/testdata/for/basic.carbon index 6bc63dc4377d..c28c982b0565 100644 --- a/toolchain/check/testdata/for/basic.carbon +++ b/toolchain/check/testdata/for/basic.carbon @@ -100,7 +100,7 @@ fn Run() { // CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc18_35.2 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc18_18 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc18_20 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: %empty_tuple.type.as.Copy.impl.Op.type: type = fn_type @empty_tuple.type.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %empty_tuple.type.as.Copy.impl.Op: %empty_tuple.type.as.Copy.impl.Op.type = struct_value () [concrete] @@ -122,14 +122,14 @@ fn Run() { // CHECK:STDOUT: %TrivialRange.ref: type = name_ref TrivialRange, file.%TrivialRange.decl [concrete = constants.%TrivialRange] // CHECK:STDOUT: %.loc18_18.2: ref %TrivialRange = temporary_storage // CHECK:STDOUT: %.loc18_18.3: init %TrivialRange to %.loc18_18.2 = class_init () [concrete = constants.%TrivialRange.val] -// CHECK:STDOUT: %.loc18_18.4: ref %TrivialRange = temporary %.loc18_18.2, %.loc18_18.3 -// CHECK:STDOUT: %.loc18_20.1: ref %TrivialRange = converted %.loc18_18.1, %.loc18_18.4 +// CHECK:STDOUT: %.loc18_20.1: init %TrivialRange = converted %.loc18_18.1, %.loc18_18.3 [concrete = constants.%TrivialRange.val] +// CHECK:STDOUT: %.loc18_20.2: ref %TrivialRange = temporary %.loc18_18.2, %.loc18_20.1 // CHECK:STDOUT: %impl.elem2: %.ccd = impl_witness_access constants.%Iterate.impl_witness, element2 [concrete = constants.%TrivialRange.as.Iterate.impl.NewCursor.c71f42.2] -// CHECK:STDOUT: %bound_method.loc18_35.1: = bound_method %.loc18_20.1, %impl.elem2 -// CHECK:STDOUT: %.loc18_20.2: %TrivialRange = acquire_value %.loc18_20.1 +// CHECK:STDOUT: %bound_method.loc18_35.1: = bound_method %.loc18_20.2, %impl.elem2 +// CHECK:STDOUT: %.loc18_20.3: %TrivialRange = acquire_value %.loc18_20.2 // CHECK:STDOUT: %NewCursor.ref: %TrivialRange.as.Iterate.impl.NewCursor.type.408fa8.1 = name_ref NewCursor, @TrivialRange.as.Iterate.impl.%TrivialRange.as.Iterate.impl.NewCursor.decl.loc6_39.1 [concrete = constants.%TrivialRange.as.Iterate.impl.NewCursor.c71f42.1] -// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.bound: = bound_method %.loc18_20.2, %NewCursor.ref -// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.call: init %empty_tuple.type = call %TrivialRange.as.Iterate.impl.NewCursor.bound(%.loc18_20.2) +// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.bound: = bound_method %.loc18_20.3, %NewCursor.ref +// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.call: init %empty_tuple.type = call %TrivialRange.as.Iterate.impl.NewCursor.bound(%.loc18_20.3) // CHECK:STDOUT: %var: ref %empty_tuple.type = var invalid // CHECK:STDOUT: assign %var, %TrivialRange.as.Iterate.impl.NewCursor.call // CHECK:STDOUT: br !for.next @@ -137,10 +137,10 @@ fn Run() { // CHECK:STDOUT: !for.next: // CHECK:STDOUT: %addr: %ptr.843 = addr_of %var // CHECK:STDOUT: %impl.elem3: %.827 = impl_witness_access constants.%Iterate.impl_witness, element3 [concrete = constants.%TrivialRange.as.Iterate.impl.Next] -// CHECK:STDOUT: %bound_method.loc18_35.2: = bound_method %.loc18_20.1, %impl.elem3 +// CHECK:STDOUT: %bound_method.loc18_35.2: = bound_method %.loc18_20.2, %impl.elem3 // CHECK:STDOUT: %.loc18_35.1: ref %Optional.311 = temporary_storage -// CHECK:STDOUT: %.loc18_20.3: %TrivialRange = acquire_value %.loc18_20.1 -// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.Next.call: init %Optional.311 to %.loc18_35.1 = call %bound_method.loc18_35.2(%.loc18_20.3, %addr) +// CHECK:STDOUT: %.loc18_20.4: %TrivialRange = acquire_value %.loc18_20.2 +// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.Next.call: init %Optional.311 to %.loc18_35.1 = call %bound_method.loc18_35.2(%.loc18_20.4, %addr) // CHECK:STDOUT: %.loc18_35.2: ref %Optional.311 = temporary %.loc18_35.1, %TrivialRange.as.Iterate.impl.Next.call // CHECK:STDOUT: %.loc18_35.3: %Optional.HasValue.type.4db = specific_constant imports.%Core.import_ref.228, @Optional(constants.%Copy.facet) [concrete = constants.%Optional.HasValue.4fc] // CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.4db = name_ref HasValue, %.loc18_35.3 [concrete = constants.%Optional.HasValue.4fc] @@ -183,8 +183,8 @@ fn Run() { // CHECK:STDOUT: %Destroy.Op.call.loc18_35.2: init %empty_tuple.type = call %Destroy.Op.bound.loc18_35.2(%.loc18_35.2) // CHECK:STDOUT: %Destroy.Op.bound.loc18_35.3: = bound_method %var, constants.%Destroy.Op.651ba6.1 // CHECK:STDOUT: %Destroy.Op.call.loc18_35.3: init %empty_tuple.type = call %Destroy.Op.bound.loc18_35.3(%var) -// CHECK:STDOUT: %Destroy.Op.bound.loc18_18: = bound_method %.loc18_18.4, constants.%Destroy.Op.651ba6.3 -// CHECK:STDOUT: %Destroy.Op.call.loc18_18: init %empty_tuple.type = call %Destroy.Op.bound.loc18_18(%.loc18_18.4) +// CHECK:STDOUT: %Destroy.Op.bound.loc18_20: = bound_method %.loc18_20.2, constants.%Destroy.Op.651ba6.3 +// CHECK:STDOUT: %Destroy.Op.call.loc18_20: init %empty_tuple.type = call %Destroy.Op.bound.loc18_20(%.loc18_20.2) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -192,5 +192,5 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.Op.loc18_35.2(%self.param: ref %Optional.311) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc18_18(%self.param: ref %TrivialRange) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc18_20(%self.param: ref %TrivialRange) = "no_op"; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/generic/deduce.carbon b/toolchain/check/testdata/function/generic/deduce.carbon index e94f8da9113e..014b976aeef3 100644 --- a/toolchain/check/testdata/function/generic/deduce.carbon +++ b/toolchain/check/testdata/function/generic/deduce.carbon @@ -657,12 +657,12 @@ fn F() { // CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn: = specific_function %ExplicitAndAlsoDeduced.ref, @ExplicitAndAlsoDeduced(constants.%A) [concrete = constants.%ExplicitAndAlsoDeduced.specific_fn.1f3] // CHECK:STDOUT: %.loc11_37.2: ref %A = temporary_storage // CHECK:STDOUT: %.loc11_37.3: init %A to %.loc11_37.2 = class_init () [concrete = constants.%A.val] -// CHECK:STDOUT: %.loc11_37.4: ref %A = temporary %.loc11_37.2, %.loc11_37.3 -// CHECK:STDOUT: %.loc11_37.5: ref %A = converted %.loc11_37.1, %.loc11_37.4 +// CHECK:STDOUT: %.loc11_37.4: init %A = converted %.loc11_37.1, %.loc11_37.3 [concrete = constants.%A.val] +// CHECK:STDOUT: %.loc11_37.5: ref %A = temporary %.loc11_37.2, %.loc11_37.4 // CHECK:STDOUT: %.loc11_37.6: %A = acquire_value %.loc11_37.5 // CHECK:STDOUT: %ExplicitAndAlsoDeduced.call: init %ptr.643 = call %ExplicitAndAlsoDeduced.specific_fn(%.loc11_37.6) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc11_37.4, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc11_37.4) +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc11_37.5, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc11_37.5) // CHECK:STDOUT: return %ExplicitAndAlsoDeduced.call // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon b/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon index 2383aecef98c..5f5537884f47 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon @@ -319,13 +319,13 @@ fn F() { // CHECK:STDOUT: %Point.ref: type = name_ref Point, file.%Point.decl [concrete = constants.%Point] // CHECK:STDOUT: %.loc25_5.2: ref %Point = temporary_storage // CHECK:STDOUT: %.loc25_5.3: init %Point to %.loc25_5.2 = class_init () [concrete = constants.%Point.val] -// CHECK:STDOUT: %.loc25_5.4: ref %Point = temporary %.loc25_5.2, %.loc25_5.3 -// CHECK:STDOUT: %.loc25_7: ref %Point = converted %.loc25_5.1, %.loc25_5.4 +// CHECK:STDOUT: %.loc25_7.1: init %Point = converted %.loc25_5.1, %.loc25_5.3 [concrete = constants.%Point.val] +// CHECK:STDOUT: %.loc25_7.2: ref %Point = temporary %.loc25_5.2, %.loc25_7.1 // CHECK:STDOUT: %Zero.ref: %Z.assoc_type = name_ref Zero, @Z.WithSelf.%assoc0 [concrete = constants.%assoc0.cc0] // CHECK:STDOUT: %impl.elem0: %.c1b = impl_witness_access constants.%Z.impl_witness, element0 [concrete = constants.%Point.as.Z.impl.Zero] // CHECK:STDOUT: %Point.as.Z.impl.Zero.call: init %empty_tuple.type = call %impl.elem0() -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc25_5.4, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc25_5.4) +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc25_7.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc25_7.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_impl_as_scope.carbon b/toolchain/check/testdata/impl/fail_impl_as_scope.carbon index f696b2bfdbaa..ace7b0bf6078 100644 --- a/toolchain/check/testdata/impl/fail_impl_as_scope.carbon +++ b/toolchain/check/testdata/impl/fail_impl_as_scope.carbon @@ -269,6 +269,7 @@ class X { // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: %Point.val: %Point = struct_value () [concrete] // CHECK:STDOUT: %.429: type = fn_type_with_self_type %Z.WithSelf.Method.type.707, %Z.facet [concrete] +// CHECK:STDOUT: %Point.as.Z.impl.Method.bound: = bound_method %Point.val, %Point.as.Z.impl.Method [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] // CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] @@ -451,16 +452,16 @@ class X { // CHECK:STDOUT: %Point.ref.loc29: type = name_ref Point, file.%Point.decl [concrete = constants.%Point] // CHECK:STDOUT: %.loc29_5.2: ref %Point = temporary_storage // CHECK:STDOUT: %.loc29_5.3: init %Point to %.loc29_5.2 = class_init () [concrete = constants.%Point.val] -// CHECK:STDOUT: %.loc29_5.4: ref %Point = temporary %.loc29_5.2, %.loc29_5.3 -// CHECK:STDOUT: %.loc29_7.1: ref %Point = converted %.loc29_5.1, %.loc29_5.4 +// CHECK:STDOUT: %.loc29_7.1: init %Point = converted %.loc29_5.1, %.loc29_5.3 [concrete = constants.%Point.val] // CHECK:STDOUT: %Z.ref.loc29: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type] // CHECK:STDOUT: %Method.ref: %Z.assoc_type = name_ref Method, @Z.WithSelf.%assoc1 [concrete = constants.%assoc1] // CHECK:STDOUT: %impl.elem1: %.429 = impl_witness_access constants.%Z.impl_witness, element1 [concrete = constants.%Point.as.Z.impl.Method] -// CHECK:STDOUT: %bound_method: = bound_method %.loc29_7.1, %impl.elem1 -// CHECK:STDOUT: %.loc29_7.2: %Point = acquire_value %.loc29_7.1 -// CHECK:STDOUT: %Point.as.Z.impl.Method.call: init %empty_tuple.type = call %bound_method(%.loc29_7.2) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc29_5.4, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc29_5.4) +// CHECK:STDOUT: %bound_method: = bound_method %.loc29_7.1, %impl.elem1 [concrete = constants.%Point.as.Z.impl.Method.bound] +// CHECK:STDOUT: %.loc29_7.2: ref %Point = temporary %.loc29_5.2, %.loc29_7.1 +// CHECK:STDOUT: %.loc29_7.3: %Point = acquire_value %.loc29_7.2 +// CHECK:STDOUT: %Point.as.Z.impl.Method.call: init %empty_tuple.type = call %bound_method(%.loc29_7.3) +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc29_7.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc29_7.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/import_thunk.carbon b/toolchain/check/testdata/impl/import_thunk.carbon index 44cf704e088d..7e44da7fd591 100644 --- a/toolchain/check/testdata/impl/import_thunk.carbon +++ b/toolchain/check/testdata/impl/import_thunk.carbon @@ -309,16 +309,16 @@ fn G() { // CHECK:STDOUT: %C.as.I.impl.F.specific_fn.loc8_24.1: = specific_function %F.ref, @C.as.I.impl.F.loc8_24.1(constants.%Y) [symbolic = %C.as.I.impl.F.specific_fn.loc8_24.2 (constants.%C.as.I.impl.F.specific_fn)] // CHECK:STDOUT: %.1: ref @C.as.I.impl.F.loc8_24.2.%C (%C.c8540f.2) = temporary_storage // CHECK:STDOUT: %.2: init @C.as.I.impl.F.loc8_24.2.%C (%C.c8540f.2) to %.1 = class_init () [symbolic = %C.val (constants.%C.val)] -// CHECK:STDOUT: %.3: ref @C.as.I.impl.F.loc8_24.2.%C (%C.c8540f.2) = temporary %.1, %.2 -// CHECK:STDOUT: %.4: ref @C.as.I.impl.F.loc8_24.2.%C (%C.c8540f.2) = converted %x.ref, %.3 +// CHECK:STDOUT: %.3: init @C.as.I.impl.F.loc8_24.2.%C (%C.c8540f.2) = converted %x.ref, %.2 [symbolic = %C.val (constants.%C.val)] +// CHECK:STDOUT: %.4: ref @C.as.I.impl.F.loc8_24.2.%C (%C.c8540f.2) = temporary %.1, %.3 // CHECK:STDOUT: %.5: @C.as.I.impl.F.loc8_24.2.%C (%C.c8540f.2) = acquire_value %.4 // CHECK:STDOUT: %C.as.I.impl.F.call: init %empty_tuple.type = call %C.as.I.impl.F.specific_fn.loc8_24.1(%.5) // CHECK:STDOUT: %Op.ref: %Destroy.assoc_type = name_ref Op, imports.%Core.import_ref.06b [concrete = constants.%assoc0] // CHECK:STDOUT: %impl.elem0.1: @C.as.I.impl.F.loc8_24.2.%.6 (%.371) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %bound_method.1: = bound_method %.3, %impl.elem0.1 +// CHECK:STDOUT: %bound_method.1: = bound_method %.4, %impl.elem0.1 // CHECK:STDOUT: %specific_impl_fn.1: = specific_impl_function %impl.elem0.1, @Destroy.WithSelf.Op(constants.%Destroy.facet) [symbolic = %specific_impl_fn.2 (constants.%specific_impl_fn)] -// CHECK:STDOUT: %bound_method.2: = bound_method %.3, %specific_impl_fn.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.2(%.3) +// CHECK:STDOUT: %bound_method.2: = bound_method %.4, %specific_impl_fn.1 +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.2(%.4) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -535,12 +535,12 @@ fn G() { // CHECK:STDOUT: %C.as.I.impl.F.specific_fn: = specific_function %F.ref.loc7_17, @C.as.I.impl.F.2(constants.%empty_tuple) [concrete = constants.%C.as.I.impl.F.specific_fn.a77113.2] // CHECK:STDOUT: %.loc7_16.3: ref %C.387 = temporary_storage // CHECK:STDOUT: %.loc7_16.4: init %C.387 to %.loc7_16.3 = class_init () [concrete = constants.%C.val.135] -// CHECK:STDOUT: %.loc7_16.5: ref %C.387 = temporary %.loc7_16.3, %.loc7_16.4 -// CHECK:STDOUT: %.loc7_16.6: ref %C.387 = converted %.loc7_16.2, %.loc7_16.5 +// CHECK:STDOUT: %.loc7_16.5: init %C.387 = converted %.loc7_16.2, %.loc7_16.4 [concrete = constants.%C.val.135] +// CHECK:STDOUT: %.loc7_16.6: ref %C.387 = temporary %.loc7_16.3, %.loc7_16.5 // CHECK:STDOUT: %.loc7_16.7: %C.387 = acquire_value %.loc7_16.6 // CHECK:STDOUT: %C.as.I.impl.F.call: init %empty_tuple.type = call %C.as.I.impl.F.specific_fn(%.loc7_16.7) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc7_16.5, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc7_16.5) +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc7_16.6, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc7_16.6) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/lookup/canonical_query_self.carbon b/toolchain/check/testdata/impl/lookup/canonical_query_self.carbon index a7210e988124..6b587ac6d852 100644 --- a/toolchain/check/testdata/impl/lookup/canonical_query_self.carbon +++ b/toolchain/check/testdata/impl/lookup/canonical_query_self.carbon @@ -371,8 +371,7 @@ fn G() { // CHECK:STDOUT: %C.ref.loc40_11: type = name_ref C, %C.decl [concrete = constants.%C] // CHECK:STDOUT: %.loc40_6.2: ref %C = temporary_storage // CHECK:STDOUT: %.loc40_6.3: init %C to %.loc40_6.2 = class_init () [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc40_6.4: ref %C = temporary %.loc40_6.2, %.loc40_6.3 -// CHECK:STDOUT: %.loc40_8.1: ref %C = converted %.loc40_6.1, %.loc40_6.4 +// CHECK:STDOUT: %.loc40_8.1: init %C = converted %.loc40_6.1, %.loc40_6.3 [concrete = constants.%C.val] // CHECK:STDOUT: %C.ref.loc40_24: type = name_ref C, %C.decl [concrete = constants.%C] // CHECK:STDOUT: %I.ref.loc40_29: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: %I.facet.loc40_26: %I.type = facet_value %C.ref.loc40_24, (constants.%I.impl_witness) [concrete = constants.%I.facet.cbf] @@ -397,30 +396,31 @@ fn G() { // CHECK:STDOUT: %.loc40_71: %J.type = converted %.loc40_62, %J.facet.loc40_71 [concrete = constants.%J.facet.fc3] // CHECK:STDOUT: %as_type.loc40_75: type = facet_access_type %.loc40_71 [concrete = constants.%C] // CHECK:STDOUT: %.loc40_75: type = converted %.loc40_71, %as_type.loc40_75 [concrete = constants.%C] +// CHECK:STDOUT: %.loc40_8.2: ref %C = temporary %.loc40_6.2, %.loc40_8.1 // CHECK:STDOUT: %JJ.ref: %J.assoc_type = name_ref JJ, @J.WithSelf.%assoc0 [concrete = constants.%assoc0.8f4] // CHECK:STDOUT: %impl.elem0: %.366 = impl_witness_access constants.%J.impl_witness, element0 [concrete = constants.%C.as.J.impl.JJ] -// CHECK:STDOUT: %bound_method: = bound_method %.loc40_8.1, %impl.elem0 -// CHECK:STDOUT: %.loc40_8.2: %C = acquire_value %.loc40_8.1 -// CHECK:STDOUT: %C.as.J.impl.JJ.call: init %empty_tuple.type = call %bound_method(%.loc40_8.2) +// CHECK:STDOUT: %bound_method: = bound_method %.loc40_8.2, %impl.elem0 +// CHECK:STDOUT: %.loc40_8.3: %C = acquire_value %.loc40_8.2 +// CHECK:STDOUT: %C.as.J.impl.JJ.call: init %empty_tuple.type = call %bound_method(%.loc40_8.3) // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] // CHECK:STDOUT: %C.ref.loc46_5: type = name_ref C, %C.decl [concrete = constants.%C] // CHECK:STDOUT: %.loc46_9.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %C.ref.loc46_14: type = name_ref C, %C.decl [concrete = constants.%C] // CHECK:STDOUT: %.loc46_9.2: ref %C = temporary_storage // CHECK:STDOUT: %.loc46_9.3: init %C to %.loc46_9.2 = class_init () [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc46_9.4: ref %C = temporary %.loc46_9.2, %.loc46_9.3 -// CHECK:STDOUT: %.loc46_11.1: ref %C = converted %.loc46_9.1, %.loc46_9.4 +// CHECK:STDOUT: %.loc46_11.1: init %C = converted %.loc46_9.1, %.loc46_9.3 [concrete = constants.%C.val] // CHECK:STDOUT: %facet_value.loc46_15.1: %facet_type = facet_value %C.ref.loc46_5, (constants.%I.impl_witness, constants.%J.impl_witness) [concrete = constants.%facet_value] // CHECK:STDOUT: %.loc46_15.1: %facet_type = converted %C.ref.loc46_5, %facet_value.loc46_15.1 [concrete = constants.%facet_value] // CHECK:STDOUT: %facet_value.loc46_15.2: %facet_type = facet_value constants.%C, (constants.%I.impl_witness, constants.%J.impl_witness) [concrete = constants.%facet_value] // CHECK:STDOUT: %.loc46_15.2: %facet_type = converted constants.%C, %facet_value.loc46_15.2 [concrete = constants.%facet_value] // CHECK:STDOUT: %F.specific_fn: = specific_function %F.ref, @F(constants.%facet_value) [concrete = constants.%F.specific_fn] -// CHECK:STDOUT: %.loc46_11.2: %C = acquire_value %.loc46_11.1 -// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn(%.loc46_11.2) -// CHECK:STDOUT: %Destroy.Op.bound.loc46: = bound_method %.loc46_9.4, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call.loc46: init %empty_tuple.type = call %Destroy.Op.bound.loc46(%.loc46_9.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc40: = bound_method %.loc40_6.4, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call.loc40: init %empty_tuple.type = call %Destroy.Op.bound.loc40(%.loc40_6.4) +// CHECK:STDOUT: %.loc46_11.2: ref %C = temporary %.loc46_9.2, %.loc46_11.1 +// CHECK:STDOUT: %.loc46_11.3: %C = acquire_value %.loc46_11.2 +// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn(%.loc46_11.3) +// CHECK:STDOUT: %Destroy.Op.bound.loc46: = bound_method %.loc46_11.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.call.loc46: init %empty_tuple.type = call %Destroy.Op.bound.loc46(%.loc46_11.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc40: = bound_method %.loc40_8.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.call.loc40: init %empty_tuple.type = call %Destroy.Op.bound.loc40(%.loc40_8.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/use_assoc_entity.carbon b/toolchain/check/testdata/impl/use_assoc_entity.carbon index 3daad29ef691..0c3e6aafce86 100644 --- a/toolchain/check/testdata/impl/use_assoc_entity.carbon +++ b/toolchain/check/testdata/impl/use_assoc_entity.carbon @@ -4727,8 +4727,7 @@ fn F() { // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%D) [concrete = constants.%C.302] // CHECK:STDOUT: %.loc12_28.2: ref %C.302 = temporary_storage // CHECK:STDOUT: %.loc12_28.3: init %C.302 to %.loc12_28.2 = class_init () [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc12_28.4: ref %C.302 = temporary %.loc12_28.2, %.loc12_28.3 -// CHECK:STDOUT: %.loc12_30.1: ref %C.302 = converted %.loc12_28.1, %.loc12_28.4 +// CHECK:STDOUT: %.loc12_30.1: init %C.302 = converted %.loc12_28.1, %.loc12_28.3 [concrete = constants.%C.val] // CHECK:STDOUT: %.loc12_18.1: type = splice_block %impl.elem0 [concrete = constants.%C.302] { // CHECK:STDOUT: %D.ref.loc12_17: type = name_ref D, file.%D.decl [concrete = constants.%D] // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type] @@ -4737,10 +4736,11 @@ fn F() { // CHECK:STDOUT: %.loc12_18.2: %Z.type = converted %D.ref.loc12_17, %Z.facet [concrete = constants.%Z.facet.59e] // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%Z.impl_witness.63b, element0 [concrete = constants.%C.302] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc12_30.2: %C.302 = acquire_value %.loc12_30.1 -// CHECK:STDOUT: %a: %C.302 = value_binding a, %.loc12_30.2 -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc12_28.4, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc12_28.4) +// CHECK:STDOUT: %.loc12_30.2: ref %C.302 = temporary %.loc12_28.2, %.loc12_30.1 +// CHECK:STDOUT: %.loc12_30.3: %C.302 = acquire_value %.loc12_30.2 +// CHECK:STDOUT: %a: %C.302 = value_binding a, %.loc12_30.3 +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc12_30.2, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc12_30.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/compound_member_access.carbon b/toolchain/check/testdata/interface/compound_member_access.carbon index 4dc20229db8c..3d84b9098e38 100644 --- a/toolchain/check/testdata/interface/compound_member_access.carbon +++ b/toolchain/check/testdata/interface/compound_member_access.carbon @@ -1296,7 +1296,6 @@ fn Works() { // CHECK:STDOUT: %A.type: type = facet_type <@A> [concrete] // CHECK:STDOUT: %Self.c51: %A.type = symbolic_binding Self, 0 [symbolic] // CHECK:STDOUT: %A.WithSelf.G.type.e1d: type = fn_type @A.WithSelf.G, @A.WithSelf(%Self.c51) [symbolic] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %A.WithSelf.G.552: %A.WithSelf.G.type.e1d = struct_value () [symbolic] // CHECK:STDOUT: %A.assoc_type: type = assoc_entity_type @A [concrete] // CHECK:STDOUT: %assoc0.eb1: %A.assoc_type = assoc_entity element0, @A.WithSelf.%A.WithSelf.G.decl [concrete] @@ -1325,16 +1324,12 @@ fn Works() { // CHECK:STDOUT: %type.as.BitAndWith.impl.Op.bound: = bound_method %A.type, %type.as.BitAndWith.impl.Op [concrete] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .BitAndWith = %Core.BitAndWith // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs -// CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -1342,7 +1337,6 @@ fn Works() { // CHECK:STDOUT: %Core.import_ref.8d3: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude/parts/as, loc{{\d+_\d+}}, loaded [concrete = constants.%type.as.BitAndWith.impl.Op] // CHECK:STDOUT: %BitAndWith.impl_witness_table = impl_witness_table (%Core.import_ref.8d3), @type.as.BitAndWith.impl [concrete] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1411,8 +1405,7 @@ fn Works() { // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %.loc22_5.2: ref %C = temporary_storage // CHECK:STDOUT: %.loc22_5.3: init %C to %.loc22_5.2 = class_init () [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc22_5.4: ref %C = temporary %.loc22_5.2, %.loc22_5.3 -// CHECK:STDOUT: %.loc22_7: ref %C = converted %.loc22_5.1, %.loc22_5.4 +// CHECK:STDOUT: %.loc22_7: init %C = converted %.loc22_5.1, %.loc22_5.3 [concrete = constants.%C.val] // CHECK:STDOUT: %A.ref.loc22_15: type = name_ref A, file.%A.decl [concrete = constants.%A.type] // CHECK:STDOUT: %A.ref.loc22_19: type = name_ref A, file.%A.decl [concrete = constants.%A.type] // CHECK:STDOUT: %impl.elem0.loc22: %.d15 = impl_witness_access constants.%BitAndWith.impl_witness, element0 [concrete = constants.%type.as.BitAndWith.impl.Op] @@ -1424,8 +1417,7 @@ fn Works() { // CHECK:STDOUT: %C.ref.loc30_11: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %.loc30_6.2: ref %C = temporary_storage // CHECK:STDOUT: %.loc30_6.3: init %C to %.loc30_6.2 = class_init () [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc30_6.4: ref %C = temporary %.loc30_6.2, %.loc30_6.3 -// CHECK:STDOUT: %.loc30_8: ref %C = converted %.loc30_6.1, %.loc30_6.4 +// CHECK:STDOUT: %.loc30_8: init %C = converted %.loc30_6.1, %.loc30_6.3 [concrete = constants.%C.val] // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %A.ref.loc30_24: type = name_ref A, file.%A.decl [concrete = constants.%A.type] // CHECK:STDOUT: %A.ref.loc30_28: type = name_ref A, file.%A.decl [concrete = constants.%A.type] @@ -1449,8 +1441,7 @@ fn Works() { // CHECK:STDOUT: %C.ref.loc38_11: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %.loc38_6.2: ref %C = temporary_storage // CHECK:STDOUT: %.loc38_6.3: init %C to %.loc38_6.2 = class_init () [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc38_6.4: ref %C = temporary %.loc38_6.2, %.loc38_6.3 -// CHECK:STDOUT: %.loc38_8: ref %C = converted %.loc38_6.1, %.loc38_6.4 +// CHECK:STDOUT: %.loc38_8: init %C = converted %.loc38_6.1, %.loc38_6.3 [concrete = constants.%C.val] // CHECK:STDOUT: %C.ref.loc38_18: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %A.ref.loc38_24: type = name_ref A, file.%A.decl [concrete = constants.%A.type] // CHECK:STDOUT: %A.ref.loc38_28: type = name_ref A, file.%A.decl [concrete = constants.%A.type] @@ -1466,17 +1457,9 @@ fn Works() { // CHECK:STDOUT: %A.ref.loc38_34: type = name_ref A, file.%A.decl [concrete = constants.%A.type] // CHECK:STDOUT: %G.ref.loc38: %A.assoc_type = name_ref G, @A.WithSelf.%assoc0 [concrete = constants.%assoc0.eb1] // CHECK:STDOUT: %.loc38_32: %A.type = converted %.loc38_8, [concrete = ] -// CHECK:STDOUT: %Destroy.Op.bound.loc38: = bound_method %.loc38_6.4, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call.loc38: init %empty_tuple.type = call %Destroy.Op.bound.loc38(%.loc38_6.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc30: = bound_method %.loc30_6.4, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call.loc30: init %empty_tuple.type = call %Destroy.Op.bound.loc30(%.loc30_6.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc22: = bound_method %.loc22_5.4, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call.loc22: init %empty_tuple.type = call %Destroy.Op.bound.loc22(%.loc22_5.4) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %C) = "no_op"; -// CHECK:STDOUT: // CHECK:STDOUT: specific @A.WithSelf(constants.%Self.c51) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Self => constants.%Self.c51 diff --git a/toolchain/check/testdata/interface/generic_method.carbon b/toolchain/check/testdata/interface/generic_method.carbon index fa4d991be093..0211234113a4 100644 --- a/toolchain/check/testdata/interface/generic_method.carbon +++ b/toolchain/check/testdata/interface/generic_method.carbon @@ -1128,15 +1128,15 @@ fn CallIndirect() { // CHECK:STDOUT: %.loc24_39.1: ref %tuple.type.65a = temporary_storage // CHECK:STDOUT: %.loc24_38.2: ref %Z = temporary_storage // CHECK:STDOUT: %.loc24_38.3: init %Z to %.loc24_38.2 = class_init () [concrete = constants.%Z.val] -// CHECK:STDOUT: %.loc24_38.4: ref %Z = temporary %.loc24_38.2, %.loc24_38.3 -// CHECK:STDOUT: %.loc24_38.5: ref %Z = converted %.loc24_38.1, %.loc24_38.4 +// CHECK:STDOUT: %.loc24_38.4: init %Z = converted %.loc24_38.1, %.loc24_38.3 [concrete = constants.%Z.val] +// CHECK:STDOUT: %.loc24_38.5: ref %Z = temporary %.loc24_38.2, %.loc24_38.4 // CHECK:STDOUT: %.loc24_38.6: %Z = acquire_value %.loc24_38.5 // CHECK:STDOUT: %tuple.type.as.A.impl.F.call: init %tuple.type.65a to %.loc24_39.1 = call %specific_fn(%.loc24_38.6) // CHECK:STDOUT: %.loc24_39.2: ref %tuple.type.65a = temporary %.loc24_39.1, %tuple.type.as.A.impl.F.call // CHECK:STDOUT: %Destroy.Op.bound.loc24_39: = bound_method %.loc24_39.2, constants.%Destroy.Op.651ba6.1 // CHECK:STDOUT: %Destroy.Op.call.loc24_39: init %empty_tuple.type = call %Destroy.Op.bound.loc24_39(%.loc24_39.2) -// CHECK:STDOUT: %Destroy.Op.bound.loc24_38: = bound_method %.loc24_38.4, constants.%Destroy.Op.651ba6.2 -// CHECK:STDOUT: %Destroy.Op.call.loc24_38: init %empty_tuple.type = call %Destroy.Op.bound.loc24_38(%.loc24_38.4) +// CHECK:STDOUT: %Destroy.Op.bound.loc24_38: = bound_method %.loc24_38.5, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.call.loc24_38: init %empty_tuple.type = call %Destroy.Op.bound.loc24_38(%.loc24_38.5) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1177,8 +1177,8 @@ fn CallIndirect() { // CHECK:STDOUT: %.loc28_12.1: ref @CallGeneric.%tuple.type (%tuple.type.856) = temporary_storage // CHECK:STDOUT: %.loc28_11.2: ref %Z = temporary_storage // CHECK:STDOUT: %.loc28_11.3: init %Z to %.loc28_11.2 = class_init () [concrete = constants.%Z.val] -// CHECK:STDOUT: %.loc28_11.4: ref %Z = temporary %.loc28_11.2, %.loc28_11.3 -// CHECK:STDOUT: %.loc28_11.5: ref %Z = converted %.loc28_11.1, %.loc28_11.4 +// CHECK:STDOUT: %.loc28_11.4: init %Z = converted %.loc28_11.1, %.loc28_11.3 [concrete = constants.%Z.val] +// CHECK:STDOUT: %.loc28_11.5: ref %Z = temporary %.loc28_11.2, %.loc28_11.4 // CHECK:STDOUT: %.loc28_11.6: %Z = acquire_value %.loc28_11.5 // CHECK:STDOUT: %A.WithSelf.F.call: init @CallGeneric.%tuple.type (%tuple.type.856) to %.loc28_12.1 = call %specific_impl_fn.loc28_4.1(%.loc28_11.6) // CHECK:STDOUT: %.loc28_12.2: ref @CallGeneric.%tuple.type (%tuple.type.856) = temporary %.loc28_12.1, %A.WithSelf.F.call @@ -1187,8 +1187,8 @@ fn CallIndirect() { // CHECK:STDOUT: %specific_impl_fn.loc28_12.1: = specific_impl_function %impl.elem0.loc28_12.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.a1c) [symbolic = %specific_impl_fn.loc28_12.2 (constants.%specific_impl_fn.56d)] // CHECK:STDOUT: %bound_method.loc28_12.2: = bound_method %.loc28_12.2, %specific_impl_fn.loc28_12.1 // CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc28_12.2(%.loc28_12.2) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc28_11.4, constants.%Destroy.Op.651ba6.2 -// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc28_11.4) +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc28_11.5, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc28_11.5) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interop/cpp/function/default_arg.carbon b/toolchain/check/testdata/interop/cpp/function/default_arg.carbon index 377f098db4be..039eb33ead3c 100644 --- a/toolchain/check/testdata/interop/cpp/function/default_arg.carbon +++ b/toolchain/check/testdata/interop/cpp/function/default_arg.carbon @@ -329,10 +329,10 @@ fn Call() { // CHECK:STDOUT: %X.ref.loc10: type = name_ref X, imports.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %.loc10_5.2: ref %X = temporary_storage // CHECK:STDOUT: %.loc10_5.3: init %X to %.loc10_5.2 = class_init () [concrete = constants.%X.val] -// CHECK:STDOUT: %.loc10_5.4: ref %X = temporary %.loc10_5.2, %.loc10_5.3 -// CHECK:STDOUT: %.loc10_7: ref %X = converted %.loc10_5.1, %.loc10_5.4 +// CHECK:STDOUT: %.loc10_7.1: init %X = converted %.loc10_5.1, %.loc10_5.3 [concrete = constants.%X.val] +// CHECK:STDOUT: %.loc10_7.2: ref %X = temporary %.loc10_5.2, %.loc10_7.1 // CHECK:STDOUT: %B.ref: %X.B.cpp_overload_set.type = name_ref B, imports.%X.B.cpp_overload_set.value [concrete = constants.%X.B.cpp_overload_set.value] -// CHECK:STDOUT: %bound_method.loc10_16: = bound_method %.loc10_7, %B.ref +// CHECK:STDOUT: %bound_method.loc10_16: = bound_method %.loc10_7.2, %B.ref // CHECK:STDOUT: %int_1.loc10: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %int_2.loc10: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %impl.elem0.loc10_19: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] @@ -349,7 +349,7 @@ fn Call() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc10_22: init %i32 = call %bound_method.loc10_22.2(%int_2.loc10) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc10_22.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc10_22 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc10_22.2: %i32 = converted %int_2.loc10, %.loc10_22.1 [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %X.B.call: init %empty_tuple.type = call imports.%X.B.decl(%.loc10_7, %.loc10_19.2, %.loc10_22.2) +// CHECK:STDOUT: %X.B.call: init %empty_tuple.type = call imports.%X.B.decl(%.loc10_7.2, %.loc10_19.2, %.loc10_22.2) // CHECK:STDOUT: %Cpp.ref.loc11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %X.ref.loc11: type = name_ref X, imports.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %C.ref: %X.C.cpp_overload_set.type = name_ref C, imports.%X.C.cpp_overload_set.value [concrete = constants.%X.C.cpp_overload_set.value] @@ -375,13 +375,13 @@ fn Call() { // CHECK:STDOUT: %X.ref.loc12: type = name_ref X, imports.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %.loc12_5.2: ref %X = temporary_storage // CHECK:STDOUT: %.loc12_5.3: init %X to %.loc12_5.2 = class_init () [concrete = constants.%X.val] -// CHECK:STDOUT: %.loc12_5.4: ref %X = temporary %.loc12_5.2, %.loc12_5.3 -// CHECK:STDOUT: %.loc12_7.1: ref %X = converted %.loc12_5.1, %.loc12_5.4 +// CHECK:STDOUT: %.loc12_7.1: init %X = converted %.loc12_5.1, %.loc12_5.3 [concrete = constants.%X.val] +// CHECK:STDOUT: %.loc12_7.2: ref %X = temporary %.loc12_5.2, %.loc12_7.1 // CHECK:STDOUT: %D.ref: %X.D.cpp_overload_set.type = name_ref D, imports.%X.D.cpp_overload_set.value [concrete = constants.%X.D.cpp_overload_set.value] -// CHECK:STDOUT: %bound_method.loc12_16: = bound_method %.loc12_7.1, %D.ref +// CHECK:STDOUT: %bound_method.loc12_16: = bound_method %.loc12_7.2, %D.ref // CHECK:STDOUT: %int_1.loc12: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %int_2.loc12: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] -// CHECK:STDOUT: %.loc12_7.2: %X = acquire_value %.loc12_7.1 +// CHECK:STDOUT: %.loc12_7.3: %X = acquire_value %.loc12_7.2 // CHECK:STDOUT: %impl.elem0.loc12_19: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc12_19.1: = bound_method %int_1.loc12, %impl.elem0.loc12_19 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215] // CHECK:STDOUT: %specific_fn.loc12_19: = specific_function %impl.elem0.loc12_19, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -396,13 +396,13 @@ fn Call() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc12_22: init %i32 = call %bound_method.loc12_22.2(%int_2.loc12) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc12_22.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc12_22 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc12_22.2: %i32 = converted %int_2.loc12, %.loc12_22.1 [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc12_7.3: ref %X = value_as_ref %.loc12_7.2 -// CHECK:STDOUT: %addr: %ptr.1f9 = addr_of %.loc12_7.3 +// CHECK:STDOUT: %.loc12_7.4: ref %X = value_as_ref %.loc12_7.3 +// CHECK:STDOUT: %addr: %ptr.1f9 = addr_of %.loc12_7.4 // CHECK:STDOUT: %D__carbon_thunk.call: init %empty_tuple.type = call imports.%D__carbon_thunk.decl(%addr, %.loc12_19.2, %.loc12_22.2) -// CHECK:STDOUT: %X.cpp_destructor.bound.loc12: = bound_method %.loc12_5.4, constants.%X.cpp_destructor -// CHECK:STDOUT: %X.cpp_destructor.call.loc12: init %empty_tuple.type = call %X.cpp_destructor.bound.loc12(%.loc12_5.4) -// CHECK:STDOUT: %X.cpp_destructor.bound.loc10: = bound_method %.loc10_5.4, constants.%X.cpp_destructor -// CHECK:STDOUT: %X.cpp_destructor.call.loc10: init %empty_tuple.type = call %X.cpp_destructor.bound.loc10(%.loc10_5.4) +// CHECK:STDOUT: %X.cpp_destructor.bound.loc12: = bound_method %.loc12_7.2, constants.%X.cpp_destructor +// CHECK:STDOUT: %X.cpp_destructor.call.loc12: init %empty_tuple.type = call %X.cpp_destructor.bound.loc12(%.loc12_7.2) +// CHECK:STDOUT: %X.cpp_destructor.bound.loc10: = bound_method %.loc10_7.2, constants.%X.cpp_destructor +// CHECK:STDOUT: %X.cpp_destructor.call.loc10: init %empty_tuple.type = call %X.cpp_destructor.bound.loc10(%.loc10_7.2) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -731,10 +731,10 @@ fn Call() { // CHECK:STDOUT: %X.ref.loc11: type = name_ref X, imports.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %.loc11_5.2: ref %X = temporary_storage // CHECK:STDOUT: %.loc11_5.3: init %X to %.loc11_5.2 = class_init () [concrete = constants.%X.val] -// CHECK:STDOUT: %.loc11_5.4: ref %X = temporary %.loc11_5.2, %.loc11_5.3 -// CHECK:STDOUT: %.loc11_7: ref %X = converted %.loc11_5.1, %.loc11_5.4 +// CHECK:STDOUT: %.loc11_7.1: init %X = converted %.loc11_5.1, %.loc11_5.3 [concrete = constants.%X.val] +// CHECK:STDOUT: %.loc11_7.2: ref %X = temporary %.loc11_5.2, %.loc11_7.1 // CHECK:STDOUT: %B.ref: %X.B.cpp_overload_set.type = name_ref B, imports.%X.B.cpp_overload_set.value [concrete = constants.%X.B.cpp_overload_set.value] -// CHECK:STDOUT: %bound_method.loc11_16: = bound_method %.loc11_7, %B.ref +// CHECK:STDOUT: %bound_method.loc11_16: = bound_method %.loc11_7.2, %B.ref // CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0.loc11: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc11_19.1: = bound_method %int_1.loc11, %impl.elem0.loc11 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215] @@ -743,7 +743,7 @@ fn Call() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc11: init %i32 = call %bound_method.loc11_19.2(%int_1.loc11) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_19.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc11 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_19.2: %i32 = converted %int_1.loc11, %.loc11_19.1 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %B__carbon_thunk.call: init %empty_tuple.type = call imports.%B__carbon_thunk.decl(%.loc11_7, %.loc11_19.2) +// CHECK:STDOUT: %B__carbon_thunk.call: init %empty_tuple.type = call imports.%B__carbon_thunk.decl(%.loc11_7.2, %.loc11_19.2) // CHECK:STDOUT: %Cpp.ref.loc12: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %X.ref.loc12: type = name_ref X, imports.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %C.ref: %X.C.cpp_overload_set.type = name_ref C, imports.%X.C.cpp_overload_set.value [concrete = constants.%X.C.cpp_overload_set.value] @@ -761,12 +761,12 @@ fn Call() { // CHECK:STDOUT: %X.ref.loc13: type = name_ref X, imports.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %.loc13_5.2: ref %X = temporary_storage // CHECK:STDOUT: %.loc13_5.3: init %X to %.loc13_5.2 = class_init () [concrete = constants.%X.val] -// CHECK:STDOUT: %.loc13_5.4: ref %X = temporary %.loc13_5.2, %.loc13_5.3 -// CHECK:STDOUT: %.loc13_7.1: ref %X = converted %.loc13_5.1, %.loc13_5.4 +// CHECK:STDOUT: %.loc13_7.1: init %X = converted %.loc13_5.1, %.loc13_5.3 [concrete = constants.%X.val] +// CHECK:STDOUT: %.loc13_7.2: ref %X = temporary %.loc13_5.2, %.loc13_7.1 // CHECK:STDOUT: %D.ref: %X.D.cpp_overload_set.type = name_ref D, imports.%X.D.cpp_overload_set.value [concrete = constants.%X.D.cpp_overload_set.value] -// CHECK:STDOUT: %bound_method.loc13_16: = bound_method %.loc13_7.1, %D.ref +// CHECK:STDOUT: %bound_method.loc13_16: = bound_method %.loc13_7.2, %D.ref // CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %.loc13_7.2: %X = acquire_value %.loc13_7.1 +// CHECK:STDOUT: %.loc13_7.3: %X = acquire_value %.loc13_7.2 // CHECK:STDOUT: %impl.elem0.loc13: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc13_19.1: = bound_method %int_1.loc13, %impl.elem0.loc13 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215] // CHECK:STDOUT: %specific_fn.loc13: = specific_function %impl.elem0.loc13, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -774,13 +774,13 @@ fn Call() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13: init %i32 = call %bound_method.loc13_19.2(%int_1.loc13) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_19.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_19.2: %i32 = converted %int_1.loc13, %.loc13_19.1 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc13_7.3: ref %X = value_as_ref %.loc13_7.2 -// CHECK:STDOUT: %addr: %ptr.1f9 = addr_of %.loc13_7.3 +// CHECK:STDOUT: %.loc13_7.4: ref %X = value_as_ref %.loc13_7.3 +// CHECK:STDOUT: %addr: %ptr.1f9 = addr_of %.loc13_7.4 // CHECK:STDOUT: %D__carbon_thunk.call: init %empty_tuple.type = call imports.%D__carbon_thunk.decl(%addr, %.loc13_19.2) -// CHECK:STDOUT: %X.cpp_destructor.bound.loc13: = bound_method %.loc13_5.4, constants.%X.cpp_destructor -// CHECK:STDOUT: %X.cpp_destructor.call.loc13: init %empty_tuple.type = call %X.cpp_destructor.bound.loc13(%.loc13_5.4) -// CHECK:STDOUT: %X.cpp_destructor.bound.loc11: = bound_method %.loc11_5.4, constants.%X.cpp_destructor -// CHECK:STDOUT: %X.cpp_destructor.call.loc11: init %empty_tuple.type = call %X.cpp_destructor.bound.loc11(%.loc11_5.4) +// CHECK:STDOUT: %X.cpp_destructor.bound.loc13: = bound_method %.loc13_7.2, constants.%X.cpp_destructor +// CHECK:STDOUT: %X.cpp_destructor.call.loc13: init %empty_tuple.type = call %X.cpp_destructor.bound.loc13(%.loc13_7.2) +// CHECK:STDOUT: %X.cpp_destructor.bound.loc11: = bound_method %.loc11_7.2, constants.%X.cpp_destructor +// CHECK:STDOUT: %X.cpp_destructor.call.loc11: init %empty_tuple.type = call %X.cpp_destructor.bound.loc11(%.loc11_7.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -865,10 +865,10 @@ fn Call() { // CHECK:STDOUT: %X.ref.loc56: type = name_ref X, imports.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %.loc56_5.2: ref %X = temporary_storage // CHECK:STDOUT: %.loc56_5.3: init %X to %.loc56_5.2 = class_init () [concrete = constants.%X.val] -// CHECK:STDOUT: %.loc56_5.4: ref %X = temporary %.loc56_5.2, %.loc56_5.3 -// CHECK:STDOUT: %.loc56_7: ref %X = converted %.loc56_5.1, %.loc56_5.4 +// CHECK:STDOUT: %.loc56_7.1: init %X = converted %.loc56_5.1, %.loc56_5.3 [concrete = constants.%X.val] +// CHECK:STDOUT: %.loc56_7.2: ref %X = temporary %.loc56_5.2, %.loc56_7.1 // CHECK:STDOUT: %B.ref: %X.B.cpp_overload_set.type = name_ref B, imports.%X.B.cpp_overload_set.value [concrete = constants.%X.B.cpp_overload_set.value] -// CHECK:STDOUT: %bound_method.loc56: = bound_method %.loc56_7, %B.ref +// CHECK:STDOUT: %bound_method.loc56: = bound_method %.loc56_7.2, %B.ref // CHECK:STDOUT: %Cpp.ref.loc66: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %X.ref.loc66: type = name_ref X, imports.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %C.ref: %X.C.cpp_overload_set.type = name_ref C, imports.%X.C.cpp_overload_set.value [concrete = constants.%X.C.cpp_overload_set.value] @@ -877,14 +877,14 @@ fn Call() { // CHECK:STDOUT: %X.ref.loc76: type = name_ref X, imports.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %.loc76_5.2: ref %X = temporary_storage // CHECK:STDOUT: %.loc76_5.3: init %X to %.loc76_5.2 = class_init () [concrete = constants.%X.val] -// CHECK:STDOUT: %.loc76_5.4: ref %X = temporary %.loc76_5.2, %.loc76_5.3 -// CHECK:STDOUT: %.loc76_7: ref %X = converted %.loc76_5.1, %.loc76_5.4 +// CHECK:STDOUT: %.loc76_7.1: init %X = converted %.loc76_5.1, %.loc76_5.3 [concrete = constants.%X.val] +// CHECK:STDOUT: %.loc76_7.2: ref %X = temporary %.loc76_5.2, %.loc76_7.1 // CHECK:STDOUT: %D.ref: %X.D.cpp_overload_set.type = name_ref D, imports.%X.D.cpp_overload_set.value [concrete = constants.%X.D.cpp_overload_set.value] -// CHECK:STDOUT: %bound_method.loc76: = bound_method %.loc76_7, %D.ref -// CHECK:STDOUT: %X.cpp_destructor.bound.loc76: = bound_method %.loc76_5.4, constants.%X.cpp_destructor -// CHECK:STDOUT: %X.cpp_destructor.call.loc76: init %empty_tuple.type = call %X.cpp_destructor.bound.loc76(%.loc76_5.4) -// CHECK:STDOUT: %X.cpp_destructor.bound.loc56: = bound_method %.loc56_5.4, constants.%X.cpp_destructor -// CHECK:STDOUT: %X.cpp_destructor.call.loc56: init %empty_tuple.type = call %X.cpp_destructor.bound.loc56(%.loc56_5.4) +// CHECK:STDOUT: %bound_method.loc76: = bound_method %.loc76_7.2, %D.ref +// CHECK:STDOUT: %X.cpp_destructor.bound.loc76: = bound_method %.loc76_7.2, constants.%X.cpp_destructor +// CHECK:STDOUT: %X.cpp_destructor.call.loc76: init %empty_tuple.type = call %X.cpp_destructor.bound.loc76(%.loc76_7.2) +// CHECK:STDOUT: %X.cpp_destructor.bound.loc56: = bound_method %.loc56_7.2, constants.%X.cpp_destructor +// CHECK:STDOUT: %X.cpp_destructor.call.loc56: init %empty_tuple.type = call %X.cpp_destructor.bound.loc56(%.loc56_7.2) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/overloads.carbon b/toolchain/check/testdata/interop/cpp/function/overloads.carbon index 4fe33b815064..9dfa8755164b 100644 --- a/toolchain/check/testdata/interop/cpp/function/overloads.carbon +++ b/toolchain/check/testdata/interop/cpp/function/overloads.carbon @@ -2453,8 +2453,8 @@ fn F() { // CHECK:STDOUT: %.loc9_21.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc9_21.2: ref %NoFields = temporary_storage // CHECK:STDOUT: %.loc9_21.3: init %NoFields to %.loc9_21.2 = class_init () [concrete = constants.%NoFields.val] -// CHECK:STDOUT: %.loc9_21.4: ref %NoFields = temporary %.loc9_21.2, %.loc9_21.3 -// CHECK:STDOUT: %.loc9_21.5: ref %NoFields = converted %.loc9_21.1, %.loc9_21.4 +// CHECK:STDOUT: %.loc9_21.4: init %NoFields = converted %.loc9_21.1, %.loc9_21.3 [concrete = constants.%NoFields.val] +// CHECK:STDOUT: %.loc9_21.5: ref %NoFields = temporary %.loc9_21.2, %.loc9_21.4 // CHECK:STDOUT: %.loc9_21.6: %NoFields = acquire_value %.loc9_21.5 // CHECK:STDOUT: %.loc9_21.7: ref %NoFields = value_as_ref %.loc9_21.6 // CHECK:STDOUT: %addr.loc9: %ptr.dd0 = addr_of %.loc9_21.7 @@ -2464,8 +2464,8 @@ fn F() { // CHECK:STDOUT: %value.ref: %empty_struct_type = name_ref value, %value // CHECK:STDOUT: %.loc11_20.1: ref %NoFields = temporary_storage // CHECK:STDOUT: %.loc11_20.2: init %NoFields to %.loc11_20.1 = class_init () [concrete = constants.%NoFields.val] -// CHECK:STDOUT: %.loc11_20.3: ref %NoFields = temporary %.loc11_20.1, %.loc11_20.2 -// CHECK:STDOUT: %.loc11_20.4: ref %NoFields = converted %value.ref, %.loc11_20.3 +// CHECK:STDOUT: %.loc11_20.3: init %NoFields = converted %value.ref, %.loc11_20.2 [concrete = constants.%NoFields.val] +// CHECK:STDOUT: %.loc11_20.4: ref %NoFields = temporary %.loc11_20.1, %.loc11_20.3 // CHECK:STDOUT: %.loc11_20.5: %NoFields = acquire_value %.loc11_20.4 // CHECK:STDOUT: %.loc11_20.6: ref %NoFields = value_as_ref %.loc11_20.5 // CHECK:STDOUT: %addr.loc11: %ptr.dd0 = addr_of %.loc11_20.6 @@ -2475,8 +2475,8 @@ fn F() { // CHECK:STDOUT: %reference.ref: ref %empty_struct_type = name_ref reference, %reference // CHECK:STDOUT: %.loc13_20.1: ref %NoFields = temporary_storage // CHECK:STDOUT: %.loc13_20.2: init %NoFields to %.loc13_20.1 = class_init () [concrete = constants.%NoFields.val] -// CHECK:STDOUT: %.loc13_20.3: ref %NoFields = temporary %.loc13_20.1, %.loc13_20.2 -// CHECK:STDOUT: %.loc13_20.4: ref %NoFields = converted %reference.ref, %.loc13_20.3 +// CHECK:STDOUT: %.loc13_20.3: init %NoFields = converted %reference.ref, %.loc13_20.2 [concrete = constants.%NoFields.val] +// CHECK:STDOUT: %.loc13_20.4: ref %NoFields = temporary %.loc13_20.1, %.loc13_20.3 // CHECK:STDOUT: %.loc13_20.5: %NoFields = acquire_value %.loc13_20.4 // CHECK:STDOUT: %.loc13_20.6: ref %NoFields = value_as_ref %.loc13_20.5 // CHECK:STDOUT: %addr.loc13: %ptr.dd0 = addr_of %.loc13_20.6 @@ -2489,22 +2489,22 @@ fn F() { // CHECK:STDOUT: %.loc15_30.2: ref %empty_struct_type = temporary %.loc15_30.1, %MakeEmpty.call // CHECK:STDOUT: %.loc15_30.3: ref %NoFields = temporary_storage // CHECK:STDOUT: %.loc15_30.4: init %NoFields to %.loc15_30.3 = class_init () [concrete = constants.%NoFields.val] -// CHECK:STDOUT: %.loc15_30.5: ref %NoFields = temporary %.loc15_30.3, %.loc15_30.4 -// CHECK:STDOUT: %.loc15_30.6: ref %NoFields = converted %MakeEmpty.call, %.loc15_30.5 +// CHECK:STDOUT: %.loc15_30.5: init %NoFields = converted %MakeEmpty.call, %.loc15_30.4 [concrete = constants.%NoFields.val] +// CHECK:STDOUT: %.loc15_30.6: ref %NoFields = temporary %.loc15_30.3, %.loc15_30.5 // CHECK:STDOUT: %.loc15_30.7: %NoFields = acquire_value %.loc15_30.6 // CHECK:STDOUT: %.loc15_30.8: ref %NoFields = value_as_ref %.loc15_30.7 // CHECK:STDOUT: %addr.loc15: %ptr.dd0 = addr_of %.loc15_30.8 // CHECK:STDOUT: %PassNoFields__carbon_thunk.call.loc15: init %empty_tuple.type = call imports.%PassNoFields__carbon_thunk.decl(%addr.loc15) -// CHECK:STDOUT: %NoFields.cpp_destructor.bound.loc15: = bound_method %.loc15_30.5, constants.%NoFields.cpp_destructor -// CHECK:STDOUT: %NoFields.cpp_destructor.call.loc15: init %empty_tuple.type = call %NoFields.cpp_destructor.bound.loc15(%.loc15_30.5) +// CHECK:STDOUT: %NoFields.cpp_destructor.bound.loc15: = bound_method %.loc15_30.6, constants.%NoFields.cpp_destructor +// CHECK:STDOUT: %NoFields.cpp_destructor.call.loc15: init %empty_tuple.type = call %NoFields.cpp_destructor.bound.loc15(%.loc15_30.6) // CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc15_30.2, constants.%Destroy.Op // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc15_30.2) -// CHECK:STDOUT: %NoFields.cpp_destructor.bound.loc13: = bound_method %.loc13_20.3, constants.%NoFields.cpp_destructor -// CHECK:STDOUT: %NoFields.cpp_destructor.call.loc13: init %empty_tuple.type = call %NoFields.cpp_destructor.bound.loc13(%.loc13_20.3) -// CHECK:STDOUT: %NoFields.cpp_destructor.bound.loc11: = bound_method %.loc11_20.3, constants.%NoFields.cpp_destructor -// CHECK:STDOUT: %NoFields.cpp_destructor.call.loc11: init %empty_tuple.type = call %NoFields.cpp_destructor.bound.loc11(%.loc11_20.3) -// CHECK:STDOUT: %NoFields.cpp_destructor.bound.loc9: = bound_method %.loc9_21.4, constants.%NoFields.cpp_destructor -// CHECK:STDOUT: %NoFields.cpp_destructor.call.loc9: init %empty_tuple.type = call %NoFields.cpp_destructor.bound.loc9(%.loc9_21.4) +// CHECK:STDOUT: %NoFields.cpp_destructor.bound.loc13: = bound_method %.loc13_20.4, constants.%NoFields.cpp_destructor +// CHECK:STDOUT: %NoFields.cpp_destructor.call.loc13: init %empty_tuple.type = call %NoFields.cpp_destructor.bound.loc13(%.loc13_20.4) +// CHECK:STDOUT: %NoFields.cpp_destructor.bound.loc11: = bound_method %.loc11_20.4, constants.%NoFields.cpp_destructor +// CHECK:STDOUT: %NoFields.cpp_destructor.call.loc11: init %empty_tuple.type = call %NoFields.cpp_destructor.bound.loc11(%.loc11_20.4) +// CHECK:STDOUT: %NoFields.cpp_destructor.bound.loc9: = bound_method %.loc9_21.5, constants.%NoFields.cpp_destructor +// CHECK:STDOUT: %NoFields.cpp_destructor.call.loc9: init %empty_tuple.type = call %NoFields.cpp_destructor.bound.loc9(%.loc9_21.5) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/pointer.carbon b/toolchain/check/testdata/interop/cpp/function/pointer.carbon index 01d21dd88d83..108487064761 100644 --- a/toolchain/check/testdata/interop/cpp/function/pointer.carbon +++ b/toolchain/check/testdata/interop/cpp/function/pointer.carbon @@ -1926,11 +1926,11 @@ fn F() { // CHECK:STDOUT: %S.ref.loc13_63: type = name_ref S, imports.%S.decl [concrete = constants.%S] // CHECK:STDOUT: %.loc13_55.2: ref %S = temporary_storage // CHECK:STDOUT: %.loc13_55.3: init %S to %.loc13_55.2 = class_init () [concrete = constants.%S.val] -// CHECK:STDOUT: %.loc13_55.4: ref %S = temporary %.loc13_55.2, %.loc13_55.3 -// CHECK:STDOUT: %.loc13_57.1: ref %S = converted %.loc13_55.1, %.loc13_55.4 -// CHECK:STDOUT: %.loc13_57.2: %S = acquire_value %.loc13_57.1 -// CHECK:STDOUT: %.loc13_57.3: ref %S = value_as_ref %.loc13_57.2 -// CHECK:STDOUT: %addr.loc13: %ptr.5c7 = addr_of %.loc13_57.3 +// CHECK:STDOUT: %.loc13_57.1: init %S = converted %.loc13_55.1, %.loc13_55.3 [concrete = constants.%S.val] +// CHECK:STDOUT: %.loc13_57.2: ref %S = temporary %.loc13_55.2, %.loc13_57.1 +// CHECK:STDOUT: %.loc13_57.3: %S = acquire_value %.loc13_57.2 +// CHECK:STDOUT: %.loc13_57.4: ref %S = value_as_ref %.loc13_57.3 +// CHECK:STDOUT: %addr.loc13: %ptr.5c7 = addr_of %.loc13_57.4 // CHECK:STDOUT: %Indirect__carbon_thunk.call: init %Optional.065 = call imports.%Indirect__carbon_thunk.decl(%addr.loc13) // CHECK:STDOUT: %.loc13_37.1: type = splice_block %Optional [concrete = constants.%Optional.065] { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] @@ -1948,8 +1948,8 @@ fn F() { // CHECK:STDOUT: %a: %Optional.065 = value_binding a, %.loc13_65.3 // CHECK:STDOUT: %Destroy.Op.bound.loc13: = bound_method %.loc13_65.2, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc13: init %empty_tuple.type = call %Destroy.Op.bound.loc13(%.loc13_65.2) -// CHECK:STDOUT: %S.cpp_destructor.bound.loc13: = bound_method %.loc13_55.4, constants.%S.cpp_destructor -// CHECK:STDOUT: %S.cpp_destructor.call.loc13: init %empty_tuple.type = call %S.cpp_destructor.bound.loc13(%.loc13_55.4) +// CHECK:STDOUT: %S.cpp_destructor.bound.loc13: = bound_method %.loc13_57.2, constants.%S.cpp_destructor +// CHECK:STDOUT: %S.cpp_destructor.call.loc13: init %empty_tuple.type = call %S.cpp_destructor.bound.loc13(%.loc13_57.2) // CHECK:STDOUT: %Destroy.Op.bound.loc11: = bound_method %.loc11_14.3, constants.%Destroy.Op.651ba6.2 // CHECK:STDOUT: %Destroy.Op.call.loc11: init %empty_tuple.type = call %Destroy.Op.bound.loc11(%.loc11_14.3) // CHECK:STDOUT: %S.cpp_destructor.bound.loc10: = bound_method %s.var, constants.%S.cpp_destructor diff --git a/toolchain/check/testdata/interop/cpp/function/reference.carbon b/toolchain/check/testdata/interop/cpp/function/reference.carbon index 9fd4480d5aa6..ee6c3aa0b729 100644 --- a/toolchain/check/testdata/interop/cpp/function/reference.carbon +++ b/toolchain/check/testdata/interop/cpp/function/reference.carbon @@ -517,14 +517,14 @@ fn F() { // CHECK:STDOUT: %S.ref: type = name_ref S, imports.%S.decl [concrete = constants.%S] // CHECK:STDOUT: %.loc8_20.2: ref %S = temporary_storage // CHECK:STDOUT: %.loc8_20.3: init %S to %.loc8_20.2 = class_init () [concrete = constants.%S.val] -// CHECK:STDOUT: %.loc8_20.4: ref %S = temporary %.loc8_20.2, %.loc8_20.3 -// CHECK:STDOUT: %.loc8_22.1: ref %S = converted %.loc8_20.1, %.loc8_20.4 -// CHECK:STDOUT: %.loc8_22.2: %S = acquire_value %.loc8_22.1 -// CHECK:STDOUT: %.loc8_22.3: ref %S = value_as_ref %.loc8_22.2 -// CHECK:STDOUT: %addr: %ptr.5c7 = addr_of %.loc8_22.3 +// CHECK:STDOUT: %.loc8_22.1: init %S = converted %.loc8_20.1, %.loc8_20.3 [concrete = constants.%S.val] +// CHECK:STDOUT: %.loc8_22.2: ref %S = temporary %.loc8_20.2, %.loc8_22.1 +// CHECK:STDOUT: %.loc8_22.3: %S = acquire_value %.loc8_22.2 +// CHECK:STDOUT: %.loc8_22.4: ref %S = value_as_ref %.loc8_22.3 +// CHECK:STDOUT: %addr: %ptr.5c7 = addr_of %.loc8_22.4 // CHECK:STDOUT: %TakesRValue__carbon_thunk.call: init %empty_tuple.type = call imports.%TakesRValue__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %S.cpp_destructor.bound: = bound_method %.loc8_20.4, constants.%S.cpp_destructor -// CHECK:STDOUT: %S.cpp_destructor.call: init %empty_tuple.type = call %S.cpp_destructor.bound(%.loc8_20.4) +// CHECK:STDOUT: %S.cpp_destructor.bound: = bound_method %.loc8_22.2, constants.%S.cpp_destructor +// CHECK:STDOUT: %S.cpp_destructor.call: init %empty_tuple.type = call %S.cpp_destructor.bound(%.loc8_22.2) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -539,13 +539,14 @@ fn F() { // CHECK:STDOUT: %TakesRValue.cpp_overload_set.value: %TakesRValue.cpp_overload_set.type = cpp_overload_set_value @TakesRValue.cpp_overload_set [concrete] // CHECK:STDOUT: %T: type = class_type @T [concrete] // CHECK:STDOUT: %pattern_type.e6b: type = pattern_type %T [concrete] -// CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] +// CHECK:STDOUT: %empty_struct.a40: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: %S.val: %S = struct_value () [concrete] // CHECK:STDOUT: %const: type = const_type %S [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: %empty_struct.6ef: %const = struct_value () [concrete] // CHECK:STDOUT: %T.cpp_destructor.type: type = fn_type @T.cpp_destructor [concrete] // CHECK:STDOUT: %T.cpp_destructor: %T.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %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: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -590,24 +591,21 @@ fn F() { // CHECK:STDOUT: %t.ref: ref %T = name_ref t, %t // CHECK:STDOUT: %Cpp.ref.loc38_3: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %TakesRValue.ref.loc38: %TakesRValue.cpp_overload_set.type = name_ref TakesRValue, imports.%TakesRValue.cpp_overload_set.value [concrete = constants.%TakesRValue.cpp_overload_set.value] -// CHECK:STDOUT: %.loc38_21.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc38_21.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct.a40] // CHECK:STDOUT: %Cpp.ref.loc38_26: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %S.ref.loc38_29: type = name_ref S, imports.%S.decl [concrete = constants.%S] // CHECK:STDOUT: %.loc38_21.2: ref %S = temporary_storage // CHECK:STDOUT: %.loc38_21.3: init %S to %.loc38_21.2 = class_init () [concrete = constants.%S.val] -// CHECK:STDOUT: %.loc38_21.4: ref %S = temporary %.loc38_21.2, %.loc38_21.3 -// CHECK:STDOUT: %.loc38_23: ref %S = converted %.loc38_21.1, %.loc38_21.4 +// CHECK:STDOUT: %.loc38_23: init %S = converted %.loc38_21.1, %.loc38_21.3 [concrete = constants.%S.val] // CHECK:STDOUT: %Cpp.ref.loc38_42: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %S.ref.loc38_45: type = name_ref S, imports.%S.decl [concrete = constants.%S] // CHECK:STDOUT: %const: type = const_type %S.ref.loc38_45 [concrete = constants.%const] -// CHECK:STDOUT: %.loc38_33.1: ref %const = as_compatible %.loc38_23 -// CHECK:STDOUT: %.loc38_33.2: ref %const = converted %.loc38_23, %.loc38_33.1 -// CHECK:STDOUT: %S.cpp_destructor.bound.loc38: = bound_method %.loc38_21.4, constants.%S.cpp_destructor -// CHECK:STDOUT: %S.cpp_destructor.call.loc38: init %empty_tuple.type = call %S.cpp_destructor.bound.loc38(%.loc38_21.4) +// CHECK:STDOUT: %.loc38_33.1: init %const = as_compatible %.loc38_23 [concrete = constants.%empty_struct.6ef] +// CHECK:STDOUT: %.loc38_33.2: init %const = converted %.loc38_23, %.loc38_33.1 [concrete = constants.%empty_struct.6ef] // CHECK:STDOUT: %T.cpp_destructor.bound: = bound_method %t.var, constants.%T.cpp_destructor // CHECK:STDOUT: %T.cpp_destructor.call: init %empty_tuple.type = call %T.cpp_destructor.bound(%t.var) -// CHECK:STDOUT: %S.cpp_destructor.bound.loc8: = bound_method %s.var, constants.%S.cpp_destructor -// CHECK:STDOUT: %S.cpp_destructor.call.loc8: init %empty_tuple.type = call %S.cpp_destructor.bound.loc8(%s.var) +// CHECK:STDOUT: %S.cpp_destructor.bound: = bound_method %s.var, constants.%S.cpp_destructor +// CHECK:STDOUT: %S.cpp_destructor.call: init %empty_tuple.type = call %S.cpp_destructor.bound(%s.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -739,8 +737,8 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %.loc8_19.2: ref %S = temporary_storage // CHECK:STDOUT: %.loc8_19.3: init %S to %.loc8_19.2 = class_init () [concrete = constants.%S.val] -// CHECK:STDOUT: %.loc8_19.4: ref %S = temporary %.loc8_19.2, %.loc8_19.3 -// CHECK:STDOUT: %.loc8_19.5: ref %S = converted %.loc8_19.1, %.loc8_19.4 +// CHECK:STDOUT: %.loc8_19.4: init %S = converted %.loc8_19.1, %.loc8_19.3 [concrete = constants.%S.val] +// CHECK:STDOUT: %.loc8_19.5: ref %S = temporary %.loc8_19.2, %.loc8_19.4 // CHECK:STDOUT: %.loc8_19.6: %S = acquire_value %.loc8_19.5 // CHECK:STDOUT: %s: %S = value_binding s, %.loc8_19.6 // CHECK:STDOUT: %Cpp.ref.loc9: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -766,8 +764,8 @@ fn F() { // CHECK:STDOUT: %.loc11_40.1: %ptr.ff5 = as_compatible %addr.loc11 // CHECK:STDOUT: %.loc11_40.2: %ptr.ff5 = converted %addr.loc11, %.loc11_40.1 // CHECK:STDOUT: %TakesConstLValue__carbon_thunk.call.loc11: init %empty_tuple.type = call imports.%TakesConstLValue__carbon_thunk.decl(%.loc11_40.2) -// CHECK:STDOUT: %S.cpp_destructor.bound: = bound_method %.loc8_19.4, constants.%S.cpp_destructor -// CHECK:STDOUT: %S.cpp_destructor.call: init %empty_tuple.type = call %S.cpp_destructor.bound(%.loc8_19.4) +// CHECK:STDOUT: %S.cpp_destructor.bound: = bound_method %.loc8_19.5, constants.%S.cpp_destructor +// CHECK:STDOUT: %S.cpp_destructor.call: init %empty_tuple.type = call %S.cpp_destructor.bound(%.loc8_19.5) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/template/class_template.carbon b/toolchain/check/testdata/interop/cpp/template/class_template.carbon index 7edfd967409a..bcda798a98b3 100644 --- a/toolchain/check/testdata/interop/cpp/template/class_template.carbon +++ b/toolchain/check/testdata/interop/cpp/template/class_template.carbon @@ -95,12 +95,12 @@ var a: Cpp.A = Cpp.X(Cpp.A, Cpp.B).f({} as Cpp.B); // CHECK:STDOUT: %B.ref.loc7_47: type = name_ref B, imports.%B.decl [concrete = constants.%B] // CHECK:STDOUT: %.loc7_39.2: ref %B = temporary_storage // CHECK:STDOUT: %.loc7_39.3: init %B to %.loc7_39.2 = class_init () [concrete = constants.%B.val] -// CHECK:STDOUT: %.loc7_39.4: ref %B = temporary %.loc7_39.2, %.loc7_39.3 -// CHECK:STDOUT: %.loc7_41.1: ref %B = converted %.loc7_39.1, %.loc7_39.4 +// CHECK:STDOUT: %.loc7_41.1: init %B = converted %.loc7_39.1, %.loc7_39.3 [concrete = constants.%B.val] // CHECK:STDOUT: %.loc7_1: ref %A = splice_block file.%a.var [concrete = file.%a.var] {} -// CHECK:STDOUT: %.loc7_41.2: %B = acquire_value %.loc7_41.1 -// CHECK:STDOUT: %.loc7_41.3: ref %B = value_as_ref %.loc7_41.2 -// CHECK:STDOUT: %addr.loc7_49.1: %ptr.a04 = addr_of %.loc7_41.3 +// CHECK:STDOUT: %.loc7_41.2: ref %B = temporary %.loc7_39.2, %.loc7_41.1 +// CHECK:STDOUT: %.loc7_41.3: %B = acquire_value %.loc7_41.2 +// CHECK:STDOUT: %.loc7_41.4: ref %B = value_as_ref %.loc7_41.3 +// CHECK:STDOUT: %addr.loc7_49.1: %ptr.a04 = addr_of %.loc7_41.4 // CHECK:STDOUT: %addr.loc7_49.2: %ptr.270 = addr_of %.loc7_1 // CHECK:STDOUT: %f__carbon_thunk.call: init %empty_tuple.type = call imports.%f__carbon_thunk.decl(%addr.loc7_49.1, %addr.loc7_49.2) // CHECK:STDOUT: %.loc7_49: init %A to %.loc7_1 = mark_in_place_init %f__carbon_thunk.call diff --git a/toolchain/check/testdata/operators/overloaded/index.carbon b/toolchain/check/testdata/operators/overloaded/index.carbon index 0cdd0fd3674e..76a3e40092ff 100644 --- a/toolchain/check/testdata/operators/overloaded/index.carbon +++ b/toolchain/check/testdata/operators/overloaded/index.carbon @@ -483,14 +483,14 @@ fn F() { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %.loc15_15.2: ref %C = temporary_storage // CHECK:STDOUT: %.loc15_15.3: init %C to %.loc15_15.2 = class_init () [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc15_15.4: ref %C = temporary %.loc15_15.2, %.loc15_15.3 -// CHECK:STDOUT: %.loc15_15.5: ref %C = converted %.loc15_15.1, %.loc15_15.4 +// CHECK:STDOUT: %.loc15_15.4: init %C = converted %.loc15_15.1, %.loc15_15.3 [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc15_15.5: ref %C = temporary %.loc15_15.2, %.loc15_15.4 // CHECK:STDOUT: %.loc15_15.6: %C = acquire_value %.loc15_15.5 // CHECK:STDOUT: %c: %C = value_binding c, %.loc15_15.6 // CHECK:STDOUT: %c.ref: %C = name_ref c, %c // CHECK:STDOUT: %.loc23: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc15_15.4, constants.%Destroy.Op -// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc15_15.4) +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc15_15.5, constants.%Destroy.Op +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc15_15.5) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/index_with_prelude.carbon b/toolchain/check/testdata/operators/overloaded/index_with_prelude.carbon index 527e22b1c03e..246c6cfdfebc 100644 --- a/toolchain/check/testdata/operators/overloaded/index_with_prelude.carbon +++ b/toolchain/check/testdata/operators/overloaded/index_with_prelude.carbon @@ -171,8 +171,8 @@ let x: i32 = c[0]; // CHECK:STDOUT: %SubscriptType.ref: type = name_ref SubscriptType, %SubscriptType.decl [concrete = constants.%SubscriptType.9ec] // CHECK:STDOUT: %.loc14_25.1: ref %SubscriptType.9ec = temporary_storage // CHECK:STDOUT: %.loc14_25.2: init %SubscriptType.9ec to %.loc14_25.1 = class_init () [concrete = constants.%SubscriptType.val] -// CHECK:STDOUT: %.loc14_25.3: ref %SubscriptType.9ec = temporary %.loc14_25.1, %.loc14_25.2 -// CHECK:STDOUT: %.loc14_25.4: ref %SubscriptType.9ec = converted @__global_init.%.loc14, %.loc14_25.3 +// CHECK:STDOUT: %.loc14_25.3: init %SubscriptType.9ec = converted @__global_init.%.loc14, %.loc14_25.2 [concrete = constants.%SubscriptType.val] +// CHECK:STDOUT: %.loc14_25.4: ref %SubscriptType.9ec = temporary %.loc14_25.1, %.loc14_25.3 // CHECK:STDOUT: %.loc14_25.5: %SubscriptType.9ec = acquire_value %.loc14_25.4 // CHECK:STDOUT: %s: %SubscriptType.9ec = value_binding s, %.loc14_25.5 // CHECK:STDOUT: name_binding_decl { @@ -181,8 +181,8 @@ let x: i32 = c[0]; // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [concrete = constants.%C] // CHECK:STDOUT: %.loc15_13.1: ref %C = temporary_storage // CHECK:STDOUT: %.loc15_13.2: init %C to %.loc15_13.1 = class_init () [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc15_13.3: ref %C = temporary %.loc15_13.1, %.loc15_13.2 -// CHECK:STDOUT: %.loc15_13.4: ref %C = converted @__global_init.%.loc15, %.loc15_13.3 +// CHECK:STDOUT: %.loc15_13.3: init %C = converted @__global_init.%.loc15, %.loc15_13.2 [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc15_13.4: ref %C = temporary %.loc15_13.1, %.loc15_13.3 // CHECK:STDOUT: %.loc15_13.5: %C = acquire_value %.loc15_13.4 // CHECK:STDOUT: %c: %C = value_binding c, %.loc15_13.5 // CHECK:STDOUT: name_binding_decl { @@ -550,8 +550,8 @@ let x: i32 = c[0]; // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [concrete = constants.%C] // CHECK:STDOUT: %.loc14_13.1: ref %C = temporary_storage // CHECK:STDOUT: %.loc14_13.2: init %C to %.loc14_13.1 = class_init () [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc14_13.3: ref %C = temporary %.loc14_13.1, %.loc14_13.2 -// CHECK:STDOUT: %.loc14_13.4: ref %C = converted @__global_init.%.loc14, %.loc14_13.3 +// CHECK:STDOUT: %.loc14_13.3: init %C = converted @__global_init.%.loc14, %.loc14_13.2 [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc14_13.4: ref %C = temporary %.loc14_13.1, %.loc14_13.3 // CHECK:STDOUT: %.loc14_13.5: %C = acquire_value %.loc14_13.4 // CHECK:STDOUT: %c: %C = value_binding c, %.loc14_13.5 // CHECK:STDOUT: name_binding_decl { @@ -677,8 +677,8 @@ let x: i32 = c[0]; // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [concrete = constants.%C] // CHECK:STDOUT: %.loc6_13.1: ref %C = temporary_storage // CHECK:STDOUT: %.loc6_13.2: init %C to %.loc6_13.1 = class_init () [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc6_13.3: ref %C = temporary %.loc6_13.1, %.loc6_13.2 -// CHECK:STDOUT: %.loc6_13.4: ref %C = converted @__global_init.%.loc6, %.loc6_13.3 +// CHECK:STDOUT: %.loc6_13.3: init %C = converted @__global_init.%.loc6, %.loc6_13.2 [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc6_13.4: ref %C = temporary %.loc6_13.1, %.loc6_13.3 // CHECK:STDOUT: %.loc6_13.5: %C = acquire_value %.loc6_13.4 // CHECK:STDOUT: %c: %C = value_binding c, %.loc6_13.5 // CHECK:STDOUT: name_binding_decl { diff --git a/toolchain/check/testdata/packages/missing_prelude.carbon b/toolchain/check/testdata/packages/missing_prelude.carbon index a9adfcf10ba1..c4026488e71f 100644 --- a/toolchain/check/testdata/packages/missing_prelude.carbon +++ b/toolchain/check/testdata/packages/missing_prelude.carbon @@ -594,8 +594,8 @@ let n: type = i32; // CHECK:STDOUT: %.loc8_8: type = type_literal constants.%Int.553 [concrete = constants.%Int.553] // CHECK:STDOUT: %.loc8_15.1: ref %Int.553 = temporary_storage // CHECK:STDOUT: %.loc8_15.2: init %Int.553 to %.loc8_15.1 = class_init () [concrete = constants.%Int.val] -// CHECK:STDOUT: %.loc8_15.3: ref %Int.553 = temporary %.loc8_15.1, %.loc8_15.2 -// CHECK:STDOUT: %.loc8_15.4: ref %Int.553 = converted @__global_init.%.loc8, %.loc8_15.3 +// CHECK:STDOUT: %.loc8_15.3: init %Int.553 = converted @__global_init.%.loc8, %.loc8_15.2 [concrete = constants.%Int.val] +// CHECK:STDOUT: %.loc8_15.4: ref %Int.553 = temporary %.loc8_15.1, %.loc8_15.3 // CHECK:STDOUT: %.loc8_15.5: %Int.553 = acquire_value %.loc8_15.4 // CHECK:STDOUT: %n: %Int.553 = value_binding n, %.loc8_15.5 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/return/import_convert_function.carbon b/toolchain/check/testdata/return/import_convert_function.carbon index e91af78fb51e..d9dcf3538cdb 100644 --- a/toolchain/check/testdata/return/import_convert_function.carbon +++ b/toolchain/check/testdata/return/import_convert_function.carbon @@ -765,6 +765,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %.866: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.a31, %ImplicitAs.facet.774 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.type.994: type = fn_type @C.as.ImplicitAs.impl.Convert.1 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.78d: %C.as.ImplicitAs.impl.Convert.type.994 = struct_value () [concrete] +// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.bound.cfc: = bound_method %C.val.452, %C.as.ImplicitAs.impl.Convert.78d [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc7 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete] @@ -778,6 +779,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %.86b: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.cbc, %ImplicitAs.facet.0f6 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.type.900: type = fn_type @C.as.ImplicitAs.impl.Convert.2 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.b44: %C.as.ImplicitAs.impl.Convert.type.900 = struct_value () [concrete] +// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.bound.530: = bound_method %C.val.678, %C.as.ImplicitAs.impl.Convert.b44 [concrete] // CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc8 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] @@ -790,6 +792,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %.bfa: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.308, %ImplicitAs.facet.53b [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.type.ae1: type = fn_type @C.as.ImplicitAs.impl.Convert.3 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.dd6: %C.as.ImplicitAs.impl.Convert.type.ae1 = struct_value () [concrete] +// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.bound.fc6: = bound_method %C.val.fb5, %C.as.ImplicitAs.impl.Convert.dd6 [concrete] // CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc9 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete] @@ -802,6 +805,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %.a2c: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.4d0, %ImplicitAs.facet.fe0 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.type.cbe: type = fn_type @C.as.ImplicitAs.impl.Convert.4 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.d1c: %C.as.ImplicitAs.impl.Convert.type.cbe = struct_value () [concrete] +// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.bound.ffe: = bound_method %C.val.fe7, %C.as.ImplicitAs.impl.Convert.d1c [concrete] // CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc10 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete] // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [concrete] @@ -814,6 +818,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %.c32: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.46a, %ImplicitAs.facet.fd8 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.type.876: type = fn_type @C.as.ImplicitAs.impl.Convert.5 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.db5: %C.as.ImplicitAs.impl.Convert.type.876 = struct_value () [concrete] +// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.bound.7cc: = bound_method %C.val.1dd, %C.as.ImplicitAs.impl.Convert.db5 [concrete] // CHECK:STDOUT: %Destroy.Op.type.bae255.5: type = fn_type @Destroy.Op.loc11 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.5: %Destroy.Op.type.bae255.5 = struct_value () [concrete] // CHECK:STDOUT: %int_5.64b: Core.IntLiteral = int_value 5 [concrete] @@ -826,6 +831,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %.df3: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.3d2, %ImplicitAs.facet.357 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.type.043: type = fn_type @C.as.ImplicitAs.impl.Convert.6 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.a63: %C.as.ImplicitAs.impl.Convert.type.043 = struct_value () [concrete] +// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.bound.4ca: = bound_method %C.val.a4a, %C.as.ImplicitAs.impl.Convert.a63 [concrete] // CHECK:STDOUT: %Destroy.Op.type.bae255.6: type = fn_type @Destroy.Op.loc12 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.6: %Destroy.Op.type.bae255.6 = struct_value () [concrete] // CHECK:STDOUT: %int_6.462: Core.IntLiteral = int_value 6 [concrete] @@ -838,6 +844,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %.4a2: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.a01, %ImplicitAs.facet.510 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.type.7be: type = fn_type @C.as.ImplicitAs.impl.Convert.7 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.e2f: %C.as.ImplicitAs.impl.Convert.type.7be = struct_value () [concrete] +// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.bound.f82: = bound_method %C.val.a4b, %C.as.ImplicitAs.impl.Convert.e2f [concrete] // CHECK:STDOUT: %Destroy.Op.type.bae255.7: type = fn_type @Destroy.Op.loc13 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.7: %Destroy.Op.type.bae255.7 = struct_value () [concrete] // CHECK:STDOUT: %int_7.29f: Core.IntLiteral = int_value 7 [concrete] @@ -850,6 +857,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %.ad8: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.063, %ImplicitAs.facet.965 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.type.c30: type = fn_type @C.as.ImplicitAs.impl.Convert.8 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.5ea: %C.as.ImplicitAs.impl.Convert.type.c30 = struct_value () [concrete] +// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.bound.622: = bound_method %C.val.f9f, %C.as.ImplicitAs.impl.Convert.5ea [concrete] // CHECK:STDOUT: %Destroy.Op.type.bae255.8: type = fn_type @Destroy.Op.loc14 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.8: %Destroy.Op.type.bae255.8 = struct_value () [concrete] // CHECK:STDOUT: %Make.type: type = fn_type @Make [concrete] @@ -1034,16 +1042,16 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %C.loc7: type = class_type @C, @C(constants.%int_0.6a9) [concrete = constants.%C.b00] // CHECK:STDOUT: %.loc7_24.2: ref %C.b00 = temporary_storage // CHECK:STDOUT: %.loc7_24.3: init %C.b00 to %.loc7_24.2 = class_init () [concrete = constants.%C.val.452] -// CHECK:STDOUT: %.loc7_24.4: ref %C.b00 = temporary %.loc7_24.2, %.loc7_24.3 -// CHECK:STDOUT: %.loc7_26.1: ref %C.b00 = converted %.loc7_24.1, %.loc7_24.4 +// CHECK:STDOUT: %.loc7_26.1: init %C.b00 = converted %.loc7_24.1, %.loc7_24.3 [concrete = constants.%C.val.452] // CHECK:STDOUT: %impl.elem0.loc7_35: %.866 = impl_witness_access constants.%ImplicitAs.impl_witness.01b, element0 [concrete = constants.%C.as.ImplicitAs.impl.Convert.78d] -// CHECK:STDOUT: %bound_method.loc7_35: = bound_method %.loc7_26.1, %impl.elem0.loc7_35 +// CHECK:STDOUT: %bound_method.loc7_35: = bound_method %.loc7_26.1, %impl.elem0.loc7_35 [concrete = constants.%C.as.ImplicitAs.impl.Convert.bound.cfc] // CHECK:STDOUT: %.loc6_26.1: ref %D = splice_block %return.param {} -// CHECK:STDOUT: %.loc7_26.2: %C.b00 = acquire_value %.loc7_26.1 -// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc7: init %D to %.loc6_26.1 = call %bound_method.loc7_35(%.loc7_26.2) +// CHECK:STDOUT: %.loc7_26.2: ref %C.b00 = temporary %.loc7_24.2, %.loc7_26.1 +// CHECK:STDOUT: %.loc7_26.3: %C.b00 = acquire_value %.loc7_26.2 +// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc7: init %D to %.loc6_26.1 = call %bound_method.loc7_35(%.loc7_26.3) // CHECK:STDOUT: %.loc7_35: init %D = converted %.loc7_26.1, %C.as.ImplicitAs.impl.Convert.call.loc7 -// CHECK:STDOUT: %Destroy.Op.bound.loc7_24.1: = bound_method %.loc7_24.4, constants.%Destroy.Op.651ba6.1 -// CHECK:STDOUT: %Destroy.Op.call.loc7_24.1: init %empty_tuple.type = call %Destroy.Op.bound.loc7_24.1(%.loc7_24.4) +// CHECK:STDOUT: %Destroy.Op.bound.loc7_26.1: = bound_method %.loc7_26.2, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.call.loc7_26.1: init %empty_tuple.type = call %Destroy.Op.bound.loc7_26.1(%.loc7_26.2) // CHECK:STDOUT: return %.loc7_35 to %return.param // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc7: @@ -1065,18 +1073,18 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %C.loc8: type = class_type @C, @C(constants.%int_1.5d2) [concrete = constants.%C.674] // CHECK:STDOUT: %.loc8_24.2: ref %C.674 = temporary_storage // CHECK:STDOUT: %.loc8_24.3: init %C.674 to %.loc8_24.2 = class_init () [concrete = constants.%C.val.678] -// CHECK:STDOUT: %.loc8_24.4: ref %C.674 = temporary %.loc8_24.2, %.loc8_24.3 -// CHECK:STDOUT: %.loc8_26.1: ref %C.674 = converted %.loc8_24.1, %.loc8_24.4 +// CHECK:STDOUT: %.loc8_26.1: init %C.674 = converted %.loc8_24.1, %.loc8_24.3 [concrete = constants.%C.val.678] // CHECK:STDOUT: %impl.elem0.loc8_35: %.86b = impl_witness_access constants.%ImplicitAs.impl_witness.638, element0 [concrete = constants.%C.as.ImplicitAs.impl.Convert.b44] -// CHECK:STDOUT: %bound_method.loc8_35: = bound_method %.loc8_26.1, %impl.elem0.loc8_35 +// CHECK:STDOUT: %bound_method.loc8_35: = bound_method %.loc8_26.1, %impl.elem0.loc8_35 [concrete = constants.%C.as.ImplicitAs.impl.Convert.bound.530] // CHECK:STDOUT: %.loc6_26.2: ref %D = splice_block %return.param {} -// CHECK:STDOUT: %.loc8_26.2: %C.674 = acquire_value %.loc8_26.1 -// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc8: init %D to %.loc6_26.2 = call %bound_method.loc8_35(%.loc8_26.2) +// CHECK:STDOUT: %.loc8_26.2: ref %C.674 = temporary %.loc8_24.2, %.loc8_26.1 +// CHECK:STDOUT: %.loc8_26.3: %C.674 = acquire_value %.loc8_26.2 +// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc8: init %D to %.loc6_26.2 = call %bound_method.loc8_35(%.loc8_26.3) // CHECK:STDOUT: %.loc8_35: init %D = converted %.loc8_26.1, %C.as.ImplicitAs.impl.Convert.call.loc8 -// CHECK:STDOUT: %Destroy.Op.bound.loc8_24.1: = bound_method %.loc8_24.4, constants.%Destroy.Op.651ba6.2 -// CHECK:STDOUT: %Destroy.Op.call.loc8_24.1: init %empty_tuple.type = call %Destroy.Op.bound.loc8_24.1(%.loc8_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc7_24.2: = bound_method %.loc7_24.4, constants.%Destroy.Op.651ba6.1 -// CHECK:STDOUT: %Destroy.Op.call.loc7_24.2: init %empty_tuple.type = call %Destroy.Op.bound.loc7_24.2(%.loc7_24.4) +// CHECK:STDOUT: %Destroy.Op.bound.loc8_26.1: = bound_method %.loc8_26.2, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.call.loc8_26.1: init %empty_tuple.type = call %Destroy.Op.bound.loc8_26.1(%.loc8_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc7_26.2: = bound_method %.loc7_26.2, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.call.loc7_26.2: init %empty_tuple.type = call %Destroy.Op.bound.loc7_26.2(%.loc7_26.2) // CHECK:STDOUT: return %.loc8_35 to %return.param // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc8: @@ -1098,20 +1106,20 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %C.loc9: type = class_type @C, @C(constants.%int_2.ef8) [concrete = constants.%C.681] // CHECK:STDOUT: %.loc9_24.2: ref %C.681 = temporary_storage // CHECK:STDOUT: %.loc9_24.3: init %C.681 to %.loc9_24.2 = class_init () [concrete = constants.%C.val.fb5] -// CHECK:STDOUT: %.loc9_24.4: ref %C.681 = temporary %.loc9_24.2, %.loc9_24.3 -// CHECK:STDOUT: %.loc9_26.1: ref %C.681 = converted %.loc9_24.1, %.loc9_24.4 +// CHECK:STDOUT: %.loc9_26.1: init %C.681 = converted %.loc9_24.1, %.loc9_24.3 [concrete = constants.%C.val.fb5] // CHECK:STDOUT: %impl.elem0.loc9_35: %.bfa = impl_witness_access constants.%ImplicitAs.impl_witness.a8d, element0 [concrete = constants.%C.as.ImplicitAs.impl.Convert.dd6] -// CHECK:STDOUT: %bound_method.loc9_35: = bound_method %.loc9_26.1, %impl.elem0.loc9_35 +// CHECK:STDOUT: %bound_method.loc9_35: = bound_method %.loc9_26.1, %impl.elem0.loc9_35 [concrete = constants.%C.as.ImplicitAs.impl.Convert.bound.fc6] // CHECK:STDOUT: %.loc6_26.3: ref %D = splice_block %return.param {} -// CHECK:STDOUT: %.loc9_26.2: %C.681 = acquire_value %.loc9_26.1 -// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc9: init %D to %.loc6_26.3 = call %bound_method.loc9_35(%.loc9_26.2) +// CHECK:STDOUT: %.loc9_26.2: ref %C.681 = temporary %.loc9_24.2, %.loc9_26.1 +// CHECK:STDOUT: %.loc9_26.3: %C.681 = acquire_value %.loc9_26.2 +// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc9: init %D to %.loc6_26.3 = call %bound_method.loc9_35(%.loc9_26.3) // CHECK:STDOUT: %.loc9_35: init %D = converted %.loc9_26.1, %C.as.ImplicitAs.impl.Convert.call.loc9 -// CHECK:STDOUT: %Destroy.Op.bound.loc9_24.1: = bound_method %.loc9_24.4, constants.%Destroy.Op.651ba6.3 -// CHECK:STDOUT: %Destroy.Op.call.loc9_24.1: init %empty_tuple.type = call %Destroy.Op.bound.loc9_24.1(%.loc9_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc8_24.2: = bound_method %.loc8_24.4, constants.%Destroy.Op.651ba6.2 -// CHECK:STDOUT: %Destroy.Op.call.loc8_24.2: init %empty_tuple.type = call %Destroy.Op.bound.loc8_24.2(%.loc8_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc7_24.3: = bound_method %.loc7_24.4, constants.%Destroy.Op.651ba6.1 -// CHECK:STDOUT: %Destroy.Op.call.loc7_24.3: init %empty_tuple.type = call %Destroy.Op.bound.loc7_24.3(%.loc7_24.4) +// CHECK:STDOUT: %Destroy.Op.bound.loc9_26.1: = bound_method %.loc9_26.2, constants.%Destroy.Op.651ba6.3 +// CHECK:STDOUT: %Destroy.Op.call.loc9_26.1: init %empty_tuple.type = call %Destroy.Op.bound.loc9_26.1(%.loc9_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc8_26.2: = bound_method %.loc8_26.2, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.call.loc8_26.2: init %empty_tuple.type = call %Destroy.Op.bound.loc8_26.2(%.loc8_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc7_26.3: = bound_method %.loc7_26.2, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.call.loc7_26.3: init %empty_tuple.type = call %Destroy.Op.bound.loc7_26.3(%.loc7_26.2) // CHECK:STDOUT: return %.loc9_35 to %return.param // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc9: @@ -1133,22 +1141,22 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %C.loc10: type = class_type @C, @C(constants.%int_3.822) [concrete = constants.%C.7ac] // CHECK:STDOUT: %.loc10_24.2: ref %C.7ac = temporary_storage // CHECK:STDOUT: %.loc10_24.3: init %C.7ac to %.loc10_24.2 = class_init () [concrete = constants.%C.val.fe7] -// CHECK:STDOUT: %.loc10_24.4: ref %C.7ac = temporary %.loc10_24.2, %.loc10_24.3 -// CHECK:STDOUT: %.loc10_26.1: ref %C.7ac = converted %.loc10_24.1, %.loc10_24.4 +// CHECK:STDOUT: %.loc10_26.1: init %C.7ac = converted %.loc10_24.1, %.loc10_24.3 [concrete = constants.%C.val.fe7] // CHECK:STDOUT: %impl.elem0.loc10_35: %.a2c = impl_witness_access constants.%ImplicitAs.impl_witness.56b, element0 [concrete = constants.%C.as.ImplicitAs.impl.Convert.d1c] -// CHECK:STDOUT: %bound_method.loc10_35: = bound_method %.loc10_26.1, %impl.elem0.loc10_35 +// CHECK:STDOUT: %bound_method.loc10_35: = bound_method %.loc10_26.1, %impl.elem0.loc10_35 [concrete = constants.%C.as.ImplicitAs.impl.Convert.bound.ffe] // CHECK:STDOUT: %.loc6_26.4: ref %D = splice_block %return.param {} -// CHECK:STDOUT: %.loc10_26.2: %C.7ac = acquire_value %.loc10_26.1 -// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc10: init %D to %.loc6_26.4 = call %bound_method.loc10_35(%.loc10_26.2) +// CHECK:STDOUT: %.loc10_26.2: ref %C.7ac = temporary %.loc10_24.2, %.loc10_26.1 +// CHECK:STDOUT: %.loc10_26.3: %C.7ac = acquire_value %.loc10_26.2 +// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc10: init %D to %.loc6_26.4 = call %bound_method.loc10_35(%.loc10_26.3) // CHECK:STDOUT: %.loc10_35: init %D = converted %.loc10_26.1, %C.as.ImplicitAs.impl.Convert.call.loc10 -// CHECK:STDOUT: %Destroy.Op.bound.loc10_24.1: = bound_method %.loc10_24.4, constants.%Destroy.Op.651ba6.4 -// CHECK:STDOUT: %Destroy.Op.call.loc10_24.1: init %empty_tuple.type = call %Destroy.Op.bound.loc10_24.1(%.loc10_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc9_24.2: = bound_method %.loc9_24.4, constants.%Destroy.Op.651ba6.3 -// CHECK:STDOUT: %Destroy.Op.call.loc9_24.2: init %empty_tuple.type = call %Destroy.Op.bound.loc9_24.2(%.loc9_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc8_24.3: = bound_method %.loc8_24.4, constants.%Destroy.Op.651ba6.2 -// CHECK:STDOUT: %Destroy.Op.call.loc8_24.3: init %empty_tuple.type = call %Destroy.Op.bound.loc8_24.3(%.loc8_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc7_24.4: = bound_method %.loc7_24.4, constants.%Destroy.Op.651ba6.1 -// CHECK:STDOUT: %Destroy.Op.call.loc7_24.4: init %empty_tuple.type = call %Destroy.Op.bound.loc7_24.4(%.loc7_24.4) +// CHECK:STDOUT: %Destroy.Op.bound.loc10_26.1: = bound_method %.loc10_26.2, constants.%Destroy.Op.651ba6.4 +// CHECK:STDOUT: %Destroy.Op.call.loc10_26.1: init %empty_tuple.type = call %Destroy.Op.bound.loc10_26.1(%.loc10_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc9_26.2: = bound_method %.loc9_26.2, constants.%Destroy.Op.651ba6.3 +// CHECK:STDOUT: %Destroy.Op.call.loc9_26.2: init %empty_tuple.type = call %Destroy.Op.bound.loc9_26.2(%.loc9_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc8_26.3: = bound_method %.loc8_26.2, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.call.loc8_26.3: init %empty_tuple.type = call %Destroy.Op.bound.loc8_26.3(%.loc8_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc7_26.4: = bound_method %.loc7_26.2, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.call.loc7_26.4: init %empty_tuple.type = call %Destroy.Op.bound.loc7_26.4(%.loc7_26.2) // CHECK:STDOUT: return %.loc10_35 to %return.param // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc10: @@ -1170,24 +1178,24 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %C.loc11: type = class_type @C, @C(constants.%int_4.940) [concrete = constants.%C.89d] // CHECK:STDOUT: %.loc11_24.2: ref %C.89d = temporary_storage // CHECK:STDOUT: %.loc11_24.3: init %C.89d to %.loc11_24.2 = class_init () [concrete = constants.%C.val.1dd] -// CHECK:STDOUT: %.loc11_24.4: ref %C.89d = temporary %.loc11_24.2, %.loc11_24.3 -// CHECK:STDOUT: %.loc11_26.1: ref %C.89d = converted %.loc11_24.1, %.loc11_24.4 +// CHECK:STDOUT: %.loc11_26.1: init %C.89d = converted %.loc11_24.1, %.loc11_24.3 [concrete = constants.%C.val.1dd] // CHECK:STDOUT: %impl.elem0.loc11_35: %.c32 = impl_witness_access constants.%ImplicitAs.impl_witness.e05, element0 [concrete = constants.%C.as.ImplicitAs.impl.Convert.db5] -// CHECK:STDOUT: %bound_method.loc11_35: = bound_method %.loc11_26.1, %impl.elem0.loc11_35 +// CHECK:STDOUT: %bound_method.loc11_35: = bound_method %.loc11_26.1, %impl.elem0.loc11_35 [concrete = constants.%C.as.ImplicitAs.impl.Convert.bound.7cc] // CHECK:STDOUT: %.loc6_26.5: ref %D = splice_block %return.param {} -// CHECK:STDOUT: %.loc11_26.2: %C.89d = acquire_value %.loc11_26.1 -// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc11: init %D to %.loc6_26.5 = call %bound_method.loc11_35(%.loc11_26.2) +// CHECK:STDOUT: %.loc11_26.2: ref %C.89d = temporary %.loc11_24.2, %.loc11_26.1 +// CHECK:STDOUT: %.loc11_26.3: %C.89d = acquire_value %.loc11_26.2 +// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc11: init %D to %.loc6_26.5 = call %bound_method.loc11_35(%.loc11_26.3) // CHECK:STDOUT: %.loc11_35: init %D = converted %.loc11_26.1, %C.as.ImplicitAs.impl.Convert.call.loc11 -// CHECK:STDOUT: %Destroy.Op.bound.loc11_24.1: = bound_method %.loc11_24.4, constants.%Destroy.Op.651ba6.5 -// CHECK:STDOUT: %Destroy.Op.call.loc11_24.1: init %empty_tuple.type = call %Destroy.Op.bound.loc11_24.1(%.loc11_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc10_24.2: = bound_method %.loc10_24.4, constants.%Destroy.Op.651ba6.4 -// CHECK:STDOUT: %Destroy.Op.call.loc10_24.2: init %empty_tuple.type = call %Destroy.Op.bound.loc10_24.2(%.loc10_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc9_24.3: = bound_method %.loc9_24.4, constants.%Destroy.Op.651ba6.3 -// CHECK:STDOUT: %Destroy.Op.call.loc9_24.3: init %empty_tuple.type = call %Destroy.Op.bound.loc9_24.3(%.loc9_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc8_24.4: = bound_method %.loc8_24.4, constants.%Destroy.Op.651ba6.2 -// CHECK:STDOUT: %Destroy.Op.call.loc8_24.4: init %empty_tuple.type = call %Destroy.Op.bound.loc8_24.4(%.loc8_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc7_24.5: = bound_method %.loc7_24.4, constants.%Destroy.Op.651ba6.1 -// CHECK:STDOUT: %Destroy.Op.call.loc7_24.5: init %empty_tuple.type = call %Destroy.Op.bound.loc7_24.5(%.loc7_24.4) +// CHECK:STDOUT: %Destroy.Op.bound.loc11_26.1: = bound_method %.loc11_26.2, constants.%Destroy.Op.651ba6.5 +// CHECK:STDOUT: %Destroy.Op.call.loc11_26.1: init %empty_tuple.type = call %Destroy.Op.bound.loc11_26.1(%.loc11_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc10_26.2: = bound_method %.loc10_26.2, constants.%Destroy.Op.651ba6.4 +// CHECK:STDOUT: %Destroy.Op.call.loc10_26.2: init %empty_tuple.type = call %Destroy.Op.bound.loc10_26.2(%.loc10_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc9_26.3: = bound_method %.loc9_26.2, constants.%Destroy.Op.651ba6.3 +// CHECK:STDOUT: %Destroy.Op.call.loc9_26.3: init %empty_tuple.type = call %Destroy.Op.bound.loc9_26.3(%.loc9_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc8_26.4: = bound_method %.loc8_26.2, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.call.loc8_26.4: init %empty_tuple.type = call %Destroy.Op.bound.loc8_26.4(%.loc8_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc7_26.5: = bound_method %.loc7_26.2, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.call.loc7_26.5: init %empty_tuple.type = call %Destroy.Op.bound.loc7_26.5(%.loc7_26.2) // CHECK:STDOUT: return %.loc11_35 to %return.param // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc11: @@ -1209,26 +1217,26 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %C.loc12: type = class_type @C, @C(constants.%int_5.0f6) [concrete = constants.%C.f0a] // CHECK:STDOUT: %.loc12_24.2: ref %C.f0a = temporary_storage // CHECK:STDOUT: %.loc12_24.3: init %C.f0a to %.loc12_24.2 = class_init () [concrete = constants.%C.val.a4a] -// CHECK:STDOUT: %.loc12_24.4: ref %C.f0a = temporary %.loc12_24.2, %.loc12_24.3 -// CHECK:STDOUT: %.loc12_26.1: ref %C.f0a = converted %.loc12_24.1, %.loc12_24.4 +// CHECK:STDOUT: %.loc12_26.1: init %C.f0a = converted %.loc12_24.1, %.loc12_24.3 [concrete = constants.%C.val.a4a] // CHECK:STDOUT: %impl.elem0.loc12_35: %.df3 = impl_witness_access constants.%ImplicitAs.impl_witness.262, element0 [concrete = constants.%C.as.ImplicitAs.impl.Convert.a63] -// CHECK:STDOUT: %bound_method.loc12_35: = bound_method %.loc12_26.1, %impl.elem0.loc12_35 +// CHECK:STDOUT: %bound_method.loc12_35: = bound_method %.loc12_26.1, %impl.elem0.loc12_35 [concrete = constants.%C.as.ImplicitAs.impl.Convert.bound.4ca] // CHECK:STDOUT: %.loc6_26.6: ref %D = splice_block %return.param {} -// CHECK:STDOUT: %.loc12_26.2: %C.f0a = acquire_value %.loc12_26.1 -// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc12: init %D to %.loc6_26.6 = call %bound_method.loc12_35(%.loc12_26.2) +// CHECK:STDOUT: %.loc12_26.2: ref %C.f0a = temporary %.loc12_24.2, %.loc12_26.1 +// CHECK:STDOUT: %.loc12_26.3: %C.f0a = acquire_value %.loc12_26.2 +// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc12: init %D to %.loc6_26.6 = call %bound_method.loc12_35(%.loc12_26.3) // CHECK:STDOUT: %.loc12_35: init %D = converted %.loc12_26.1, %C.as.ImplicitAs.impl.Convert.call.loc12 -// CHECK:STDOUT: %Destroy.Op.bound.loc12_24.1: = bound_method %.loc12_24.4, constants.%Destroy.Op.651ba6.6 -// CHECK:STDOUT: %Destroy.Op.call.loc12_24.1: init %empty_tuple.type = call %Destroy.Op.bound.loc12_24.1(%.loc12_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc11_24.2: = bound_method %.loc11_24.4, constants.%Destroy.Op.651ba6.5 -// CHECK:STDOUT: %Destroy.Op.call.loc11_24.2: init %empty_tuple.type = call %Destroy.Op.bound.loc11_24.2(%.loc11_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc10_24.3: = bound_method %.loc10_24.4, constants.%Destroy.Op.651ba6.4 -// CHECK:STDOUT: %Destroy.Op.call.loc10_24.3: init %empty_tuple.type = call %Destroy.Op.bound.loc10_24.3(%.loc10_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc9_24.4: = bound_method %.loc9_24.4, constants.%Destroy.Op.651ba6.3 -// CHECK:STDOUT: %Destroy.Op.call.loc9_24.4: init %empty_tuple.type = call %Destroy.Op.bound.loc9_24.4(%.loc9_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc8_24.5: = bound_method %.loc8_24.4, constants.%Destroy.Op.651ba6.2 -// CHECK:STDOUT: %Destroy.Op.call.loc8_24.5: init %empty_tuple.type = call %Destroy.Op.bound.loc8_24.5(%.loc8_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc7_24.6: = bound_method %.loc7_24.4, constants.%Destroy.Op.651ba6.1 -// CHECK:STDOUT: %Destroy.Op.call.loc7_24.6: init %empty_tuple.type = call %Destroy.Op.bound.loc7_24.6(%.loc7_24.4) +// CHECK:STDOUT: %Destroy.Op.bound.loc12_26.1: = bound_method %.loc12_26.2, constants.%Destroy.Op.651ba6.6 +// CHECK:STDOUT: %Destroy.Op.call.loc12_26.1: init %empty_tuple.type = call %Destroy.Op.bound.loc12_26.1(%.loc12_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc11_26.2: = bound_method %.loc11_26.2, constants.%Destroy.Op.651ba6.5 +// CHECK:STDOUT: %Destroy.Op.call.loc11_26.2: init %empty_tuple.type = call %Destroy.Op.bound.loc11_26.2(%.loc11_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc10_26.3: = bound_method %.loc10_26.2, constants.%Destroy.Op.651ba6.4 +// CHECK:STDOUT: %Destroy.Op.call.loc10_26.3: init %empty_tuple.type = call %Destroy.Op.bound.loc10_26.3(%.loc10_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc9_26.4: = bound_method %.loc9_26.2, constants.%Destroy.Op.651ba6.3 +// CHECK:STDOUT: %Destroy.Op.call.loc9_26.4: init %empty_tuple.type = call %Destroy.Op.bound.loc9_26.4(%.loc9_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc8_26.5: = bound_method %.loc8_26.2, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.call.loc8_26.5: init %empty_tuple.type = call %Destroy.Op.bound.loc8_26.5(%.loc8_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc7_26.6: = bound_method %.loc7_26.2, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.call.loc7_26.6: init %empty_tuple.type = call %Destroy.Op.bound.loc7_26.6(%.loc7_26.2) // CHECK:STDOUT: return %.loc12_35 to %return.param // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc12: @@ -1250,28 +1258,28 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %C.loc13: type = class_type @C, @C(constants.%int_6.e56) [concrete = constants.%C.c60] // CHECK:STDOUT: %.loc13_24.2: ref %C.c60 = temporary_storage // CHECK:STDOUT: %.loc13_24.3: init %C.c60 to %.loc13_24.2 = class_init () [concrete = constants.%C.val.a4b] -// CHECK:STDOUT: %.loc13_24.4: ref %C.c60 = temporary %.loc13_24.2, %.loc13_24.3 -// CHECK:STDOUT: %.loc13_26.1: ref %C.c60 = converted %.loc13_24.1, %.loc13_24.4 +// CHECK:STDOUT: %.loc13_26.1: init %C.c60 = converted %.loc13_24.1, %.loc13_24.3 [concrete = constants.%C.val.a4b] // CHECK:STDOUT: %impl.elem0.loc13_35: %.4a2 = impl_witness_access constants.%ImplicitAs.impl_witness.7d1, element0 [concrete = constants.%C.as.ImplicitAs.impl.Convert.e2f] -// CHECK:STDOUT: %bound_method.loc13_35: = bound_method %.loc13_26.1, %impl.elem0.loc13_35 +// CHECK:STDOUT: %bound_method.loc13_35: = bound_method %.loc13_26.1, %impl.elem0.loc13_35 [concrete = constants.%C.as.ImplicitAs.impl.Convert.bound.f82] // CHECK:STDOUT: %.loc6_26.7: ref %D = splice_block %return.param {} -// CHECK:STDOUT: %.loc13_26.2: %C.c60 = acquire_value %.loc13_26.1 -// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc13: init %D to %.loc6_26.7 = call %bound_method.loc13_35(%.loc13_26.2) +// CHECK:STDOUT: %.loc13_26.2: ref %C.c60 = temporary %.loc13_24.2, %.loc13_26.1 +// CHECK:STDOUT: %.loc13_26.3: %C.c60 = acquire_value %.loc13_26.2 +// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc13: init %D to %.loc6_26.7 = call %bound_method.loc13_35(%.loc13_26.3) // CHECK:STDOUT: %.loc13_35: init %D = converted %.loc13_26.1, %C.as.ImplicitAs.impl.Convert.call.loc13 -// CHECK:STDOUT: %Destroy.Op.bound.loc13_24.1: = bound_method %.loc13_24.4, constants.%Destroy.Op.651ba6.7 -// CHECK:STDOUT: %Destroy.Op.call.loc13_24.1: init %empty_tuple.type = call %Destroy.Op.bound.loc13_24.1(%.loc13_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc12_24.2: = bound_method %.loc12_24.4, constants.%Destroy.Op.651ba6.6 -// CHECK:STDOUT: %Destroy.Op.call.loc12_24.2: init %empty_tuple.type = call %Destroy.Op.bound.loc12_24.2(%.loc12_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc11_24.3: = bound_method %.loc11_24.4, constants.%Destroy.Op.651ba6.5 -// CHECK:STDOUT: %Destroy.Op.call.loc11_24.3: init %empty_tuple.type = call %Destroy.Op.bound.loc11_24.3(%.loc11_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc10_24.4: = bound_method %.loc10_24.4, constants.%Destroy.Op.651ba6.4 -// CHECK:STDOUT: %Destroy.Op.call.loc10_24.4: init %empty_tuple.type = call %Destroy.Op.bound.loc10_24.4(%.loc10_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc9_24.5: = bound_method %.loc9_24.4, constants.%Destroy.Op.651ba6.3 -// CHECK:STDOUT: %Destroy.Op.call.loc9_24.5: init %empty_tuple.type = call %Destroy.Op.bound.loc9_24.5(%.loc9_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc8_24.6: = bound_method %.loc8_24.4, constants.%Destroy.Op.651ba6.2 -// CHECK:STDOUT: %Destroy.Op.call.loc8_24.6: init %empty_tuple.type = call %Destroy.Op.bound.loc8_24.6(%.loc8_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc7_24.7: = bound_method %.loc7_24.4, constants.%Destroy.Op.651ba6.1 -// CHECK:STDOUT: %Destroy.Op.call.loc7_24.7: init %empty_tuple.type = call %Destroy.Op.bound.loc7_24.7(%.loc7_24.4) +// CHECK:STDOUT: %Destroy.Op.bound.loc13_26.1: = bound_method %.loc13_26.2, constants.%Destroy.Op.651ba6.7 +// CHECK:STDOUT: %Destroy.Op.call.loc13_26.1: init %empty_tuple.type = call %Destroy.Op.bound.loc13_26.1(%.loc13_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc12_26.2: = bound_method %.loc12_26.2, constants.%Destroy.Op.651ba6.6 +// CHECK:STDOUT: %Destroy.Op.call.loc12_26.2: init %empty_tuple.type = call %Destroy.Op.bound.loc12_26.2(%.loc12_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc11_26.3: = bound_method %.loc11_26.2, constants.%Destroy.Op.651ba6.5 +// CHECK:STDOUT: %Destroy.Op.call.loc11_26.3: init %empty_tuple.type = call %Destroy.Op.bound.loc11_26.3(%.loc11_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc10_26.4: = bound_method %.loc10_26.2, constants.%Destroy.Op.651ba6.4 +// CHECK:STDOUT: %Destroy.Op.call.loc10_26.4: init %empty_tuple.type = call %Destroy.Op.bound.loc10_26.4(%.loc10_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc9_26.5: = bound_method %.loc9_26.2, constants.%Destroy.Op.651ba6.3 +// CHECK:STDOUT: %Destroy.Op.call.loc9_26.5: init %empty_tuple.type = call %Destroy.Op.bound.loc9_26.5(%.loc9_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc8_26.6: = bound_method %.loc8_26.2, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.call.loc8_26.6: init %empty_tuple.type = call %Destroy.Op.bound.loc8_26.6(%.loc8_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc7_26.7: = bound_method %.loc7_26.2, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.call.loc7_26.7: init %empty_tuple.type = call %Destroy.Op.bound.loc7_26.7(%.loc7_26.2) // CHECK:STDOUT: return %.loc13_35 to %return.param // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc13: @@ -1293,30 +1301,30 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %C.loc14: type = class_type @C, @C(constants.%int_7.0b1) [concrete = constants.%C.304] // CHECK:STDOUT: %.loc14_24.2: ref %C.304 = temporary_storage // CHECK:STDOUT: %.loc14_24.3: init %C.304 to %.loc14_24.2 = class_init () [concrete = constants.%C.val.f9f] -// CHECK:STDOUT: %.loc14_24.4: ref %C.304 = temporary %.loc14_24.2, %.loc14_24.3 -// CHECK:STDOUT: %.loc14_26.1: ref %C.304 = converted %.loc14_24.1, %.loc14_24.4 +// CHECK:STDOUT: %.loc14_26.1: init %C.304 = converted %.loc14_24.1, %.loc14_24.3 [concrete = constants.%C.val.f9f] // CHECK:STDOUT: %impl.elem0.loc14_35: %.ad8 = impl_witness_access constants.%ImplicitAs.impl_witness.356, element0 [concrete = constants.%C.as.ImplicitAs.impl.Convert.5ea] -// CHECK:STDOUT: %bound_method.loc14_35: = bound_method %.loc14_26.1, %impl.elem0.loc14_35 +// CHECK:STDOUT: %bound_method.loc14_35: = bound_method %.loc14_26.1, %impl.elem0.loc14_35 [concrete = constants.%C.as.ImplicitAs.impl.Convert.bound.622] // CHECK:STDOUT: %.loc6_26.8: ref %D = splice_block %return.param {} -// CHECK:STDOUT: %.loc14_26.2: %C.304 = acquire_value %.loc14_26.1 -// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc14: init %D to %.loc6_26.8 = call %bound_method.loc14_35(%.loc14_26.2) +// CHECK:STDOUT: %.loc14_26.2: ref %C.304 = temporary %.loc14_24.2, %.loc14_26.1 +// CHECK:STDOUT: %.loc14_26.3: %C.304 = acquire_value %.loc14_26.2 +// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc14: init %D to %.loc6_26.8 = call %bound_method.loc14_35(%.loc14_26.3) // CHECK:STDOUT: %.loc14_35: init %D = converted %.loc14_26.1, %C.as.ImplicitAs.impl.Convert.call.loc14 -// CHECK:STDOUT: %Destroy.Op.bound.loc14_24.1: = bound_method %.loc14_24.4, constants.%Destroy.Op.651ba6.8 -// CHECK:STDOUT: %Destroy.Op.call.loc14_24.1: init %empty_tuple.type = call %Destroy.Op.bound.loc14_24.1(%.loc14_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc13_24.2: = bound_method %.loc13_24.4, constants.%Destroy.Op.651ba6.7 -// CHECK:STDOUT: %Destroy.Op.call.loc13_24.2: init %empty_tuple.type = call %Destroy.Op.bound.loc13_24.2(%.loc13_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc12_24.3: = bound_method %.loc12_24.4, constants.%Destroy.Op.651ba6.6 -// CHECK:STDOUT: %Destroy.Op.call.loc12_24.3: init %empty_tuple.type = call %Destroy.Op.bound.loc12_24.3(%.loc12_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc11_24.4: = bound_method %.loc11_24.4, constants.%Destroy.Op.651ba6.5 -// CHECK:STDOUT: %Destroy.Op.call.loc11_24.4: init %empty_tuple.type = call %Destroy.Op.bound.loc11_24.4(%.loc11_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc10_24.5: = bound_method %.loc10_24.4, constants.%Destroy.Op.651ba6.4 -// CHECK:STDOUT: %Destroy.Op.call.loc10_24.5: init %empty_tuple.type = call %Destroy.Op.bound.loc10_24.5(%.loc10_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc9_24.6: = bound_method %.loc9_24.4, constants.%Destroy.Op.651ba6.3 -// CHECK:STDOUT: %Destroy.Op.call.loc9_24.6: init %empty_tuple.type = call %Destroy.Op.bound.loc9_24.6(%.loc9_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc8_24.7: = bound_method %.loc8_24.4, constants.%Destroy.Op.651ba6.2 -// CHECK:STDOUT: %Destroy.Op.call.loc8_24.7: init %empty_tuple.type = call %Destroy.Op.bound.loc8_24.7(%.loc8_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc7_24.8: = bound_method %.loc7_24.4, constants.%Destroy.Op.651ba6.1 -// CHECK:STDOUT: %Destroy.Op.call.loc7_24.8: init %empty_tuple.type = call %Destroy.Op.bound.loc7_24.8(%.loc7_24.4) +// CHECK:STDOUT: %Destroy.Op.bound.loc14_26.1: = bound_method %.loc14_26.2, constants.%Destroy.Op.651ba6.8 +// CHECK:STDOUT: %Destroy.Op.call.loc14_26.1: init %empty_tuple.type = call %Destroy.Op.bound.loc14_26.1(%.loc14_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc13_26.2: = bound_method %.loc13_26.2, constants.%Destroy.Op.651ba6.7 +// CHECK:STDOUT: %Destroy.Op.call.loc13_26.2: init %empty_tuple.type = call %Destroy.Op.bound.loc13_26.2(%.loc13_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc12_26.3: = bound_method %.loc12_26.2, constants.%Destroy.Op.651ba6.6 +// CHECK:STDOUT: %Destroy.Op.call.loc12_26.3: init %empty_tuple.type = call %Destroy.Op.bound.loc12_26.3(%.loc12_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc11_26.4: = bound_method %.loc11_26.2, constants.%Destroy.Op.651ba6.5 +// CHECK:STDOUT: %Destroy.Op.call.loc11_26.4: init %empty_tuple.type = call %Destroy.Op.bound.loc11_26.4(%.loc11_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc10_26.5: = bound_method %.loc10_26.2, constants.%Destroy.Op.651ba6.4 +// CHECK:STDOUT: %Destroy.Op.call.loc10_26.5: init %empty_tuple.type = call %Destroy.Op.bound.loc10_26.5(%.loc10_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc9_26.6: = bound_method %.loc9_26.2, constants.%Destroy.Op.651ba6.3 +// CHECK:STDOUT: %Destroy.Op.call.loc9_26.6: init %empty_tuple.type = call %Destroy.Op.bound.loc9_26.6(%.loc9_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc8_26.7: = bound_method %.loc8_26.2, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.call.loc8_26.7: init %empty_tuple.type = call %Destroy.Op.bound.loc8_26.7(%.loc8_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc7_26.8: = bound_method %.loc7_26.2, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.call.loc7_26.8: init %empty_tuple.type = call %Destroy.Op.bound.loc7_26.8(%.loc7_26.2) // CHECK:STDOUT: return %.loc14_35 to %return.param // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc14: @@ -1324,22 +1332,22 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, imports.%P.Make [concrete = constants.%Make] // CHECK:STDOUT: %.loc6_26.9: ref %D = splice_block %return.param {} // CHECK:STDOUT: %Make.call: init %D to %.loc6_26.9 = call %Make.ref() -// CHECK:STDOUT: %Destroy.Op.bound.loc14_24.2: = bound_method %.loc14_24.4, constants.%Destroy.Op.651ba6.8 -// CHECK:STDOUT: %Destroy.Op.call.loc14_24.2: init %empty_tuple.type = call %Destroy.Op.bound.loc14_24.2(%.loc14_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc13_24.3: = bound_method %.loc13_24.4, constants.%Destroy.Op.651ba6.7 -// CHECK:STDOUT: %Destroy.Op.call.loc13_24.3: init %empty_tuple.type = call %Destroy.Op.bound.loc13_24.3(%.loc13_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc12_24.4: = bound_method %.loc12_24.4, constants.%Destroy.Op.651ba6.6 -// CHECK:STDOUT: %Destroy.Op.call.loc12_24.4: init %empty_tuple.type = call %Destroy.Op.bound.loc12_24.4(%.loc12_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc11_24.5: = bound_method %.loc11_24.4, constants.%Destroy.Op.651ba6.5 -// CHECK:STDOUT: %Destroy.Op.call.loc11_24.5: init %empty_tuple.type = call %Destroy.Op.bound.loc11_24.5(%.loc11_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc10_24.6: = bound_method %.loc10_24.4, constants.%Destroy.Op.651ba6.4 -// CHECK:STDOUT: %Destroy.Op.call.loc10_24.6: init %empty_tuple.type = call %Destroy.Op.bound.loc10_24.6(%.loc10_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc9_24.7: = bound_method %.loc9_24.4, constants.%Destroy.Op.651ba6.3 -// CHECK:STDOUT: %Destroy.Op.call.loc9_24.7: init %empty_tuple.type = call %Destroy.Op.bound.loc9_24.7(%.loc9_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc8_24.8: = bound_method %.loc8_24.4, constants.%Destroy.Op.651ba6.2 -// CHECK:STDOUT: %Destroy.Op.call.loc8_24.8: init %empty_tuple.type = call %Destroy.Op.bound.loc8_24.8(%.loc8_24.4) -// CHECK:STDOUT: %Destroy.Op.bound.loc7_24.9: = bound_method %.loc7_24.4, constants.%Destroy.Op.651ba6.1 -// CHECK:STDOUT: %Destroy.Op.call.loc7_24.9: init %empty_tuple.type = call %Destroy.Op.bound.loc7_24.9(%.loc7_24.4) +// CHECK:STDOUT: %Destroy.Op.bound.loc14_26.2: = bound_method %.loc14_26.2, constants.%Destroy.Op.651ba6.8 +// CHECK:STDOUT: %Destroy.Op.call.loc14_26.2: init %empty_tuple.type = call %Destroy.Op.bound.loc14_26.2(%.loc14_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc13_26.3: = bound_method %.loc13_26.2, constants.%Destroy.Op.651ba6.7 +// CHECK:STDOUT: %Destroy.Op.call.loc13_26.3: init %empty_tuple.type = call %Destroy.Op.bound.loc13_26.3(%.loc13_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc12_26.4: = bound_method %.loc12_26.2, constants.%Destroy.Op.651ba6.6 +// CHECK:STDOUT: %Destroy.Op.call.loc12_26.4: init %empty_tuple.type = call %Destroy.Op.bound.loc12_26.4(%.loc12_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc11_26.5: = bound_method %.loc11_26.2, constants.%Destroy.Op.651ba6.5 +// CHECK:STDOUT: %Destroy.Op.call.loc11_26.5: init %empty_tuple.type = call %Destroy.Op.bound.loc11_26.5(%.loc11_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc10_26.6: = bound_method %.loc10_26.2, constants.%Destroy.Op.651ba6.4 +// CHECK:STDOUT: %Destroy.Op.call.loc10_26.6: init %empty_tuple.type = call %Destroy.Op.bound.loc10_26.6(%.loc10_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc9_26.7: = bound_method %.loc9_26.2, constants.%Destroy.Op.651ba6.3 +// CHECK:STDOUT: %Destroy.Op.call.loc9_26.7: init %empty_tuple.type = call %Destroy.Op.bound.loc9_26.7(%.loc9_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc8_26.8: = bound_method %.loc8_26.2, constants.%Destroy.Op.651ba6.2 +// CHECK:STDOUT: %Destroy.Op.call.loc8_26.8: init %empty_tuple.type = call %Destroy.Op.bound.loc8_26.8(%.loc8_26.2) +// CHECK:STDOUT: %Destroy.Op.bound.loc7_26.9: = bound_method %.loc7_26.2, constants.%Destroy.Op.651ba6.1 +// CHECK:STDOUT: %Destroy.Op.call.loc7_26.9: init %empty_tuple.type = call %Destroy.Op.bound.loc7_26.9(%.loc7_26.2) // CHECK:STDOUT: return %Make.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/definition/destroy.carbon b/toolchain/lower/testdata/function/definition/destroy.carbon index e7bd4aeffecd..18398882f350 100644 --- a/toolchain/lower/testdata/function/definition/destroy.carbon +++ b/toolchain/lower/testdata/function/definition/destroy.carbon @@ -75,7 +75,7 @@ fn InitLet() { // CHECK:STDOUT: ; ModuleID = 'let_param.carbon' // CHECK:STDOUT: source_filename = "let_param.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: @C.val.loc12_6.3 = internal constant {} zeroinitializer +// CHECK:STDOUT: @C.val.loc12_6.4 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define void @_CF.Main(ptr %_) #0 !dbg !4 { @@ -90,7 +90,7 @@ fn InitLet() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc12_6.2.temp = alloca {}, align 8, !dbg !14 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_6.2.temp), !dbg !14 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %.loc12_6.2.temp, ptr align 1 @C.val.loc12_6.3, i64 0, i1 false), !dbg !14 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %.loc12_6.2.temp, ptr align 1 @C.val.loc12_6.4, i64 0, i1 false), !dbg !14 // CHECK:STDOUT: call void @_CF.Main(ptr %.loc12_6.2.temp), !dbg !15 // CHECK:STDOUT: call void @_CG.Main(), !dbg !16 // CHECK:STDOUT: ret void, !dbg !17 diff --git a/toolchain/lower/testdata/interop/cpp/reference.carbon b/toolchain/lower/testdata/interop/cpp/reference.carbon index a36c116fdb93..6453621f56d3 100644 --- a/toolchain/lower/testdata/interop/cpp/reference.carbon +++ b/toolchain/lower/testdata/interop/cpp/reference.carbon @@ -133,7 +133,7 @@ fn GetRefs() { // CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: -// CHECK:STDOUT: @C.val.loc19_18.3 = internal constant {} zeroinitializer +// CHECK:STDOUT: @C.val.loc19_20.1 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define dso_local void @_Z9TakeCRRefO1C.carbon_thunk(ptr noundef %0) #0 { @@ -194,7 +194,7 @@ fn GetRefs() { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !19 // CHECK:STDOUT: call void @_Z8TakeCRefR1C(ptr %c.var), !dbg !24 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_18.2.temp), !dbg !20 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %.loc19_18.2.temp, ptr align 1 @C.val.loc19_18.3, i64 0, i1 false), !dbg !20 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %.loc19_18.2.temp, ptr align 1 @C.val.loc19_20.1, i64 0, i1 false), !dbg !20 // CHECK:STDOUT: call void @_Z9TakeCRRefO1C.carbon_thunk(ptr %.loc19_18.2.temp), !dbg !25 // CHECK:STDOUT: call void @_Z13TakeConstCRefRK1C.carbon_thunk(ptr %c.var), !dbg !26 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !21 @@ -270,7 +270,7 @@ fn GetRefs() { // CHECK:STDOUT: // CHECK:STDOUT: %class.ForceThunk = type { i8 } // CHECK:STDOUT: -// CHECK:STDOUT: @C.val.loc20_18.3 = internal constant {} zeroinitializer +// CHECK:STDOUT: @C.val.loc20_20.1 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define dso_local void @_Z8TakeCRefR1C10ForceThunk.carbon_thunk1(ptr noundef nonnull align 1 dereferenceable(1) %0) #0 { @@ -361,7 +361,7 @@ fn GetRefs() { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !21 // CHECK:STDOUT: call void @_Z8TakeCRefR1C10ForceThunk.carbon_thunk1(ptr %c.var), !dbg !26 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_18.2.temp), !dbg !22 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %.loc20_18.2.temp, ptr align 1 @C.val.loc20_18.3, i64 0, i1 false), !dbg !22 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %.loc20_18.2.temp, ptr align 1 @C.val.loc20_20.1, i64 0, i1 false), !dbg !22 // CHECK:STDOUT: call void @_Z9TakeCRRefRK1C10ForceThunk.carbon_thunk1(ptr %.loc20_18.2.temp), !dbg !27 // CHECK:STDOUT: call void @_Z13TakeConstCRefRK1C10ForceThunk.carbon_thunk1(ptr %c.var), !dbg !28 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !23 diff --git a/toolchain/lower/testdata/interop/cpp/template.carbon b/toolchain/lower/testdata/interop/cpp/template.carbon index f1dd2dc7955f..7b56cb48558a 100644 --- a/toolchain/lower/testdata/interop/cpp/template.carbon +++ b/toolchain/lower/testdata/interop/cpp/template.carbon @@ -263,7 +263,7 @@ fn Call3() { // CHECK:STDOUT: // CHECK:STDOUT: %class.X = type { i8 } // CHECK:STDOUT: -// CHECK:STDOUT: @X.val.loc12_12.3 = internal constant {} zeroinitializer +// CHECK:STDOUT: @X.val.loc12_14.1 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define dso_local void @_Z3fooIJEEv1XDpT_.carbon_thunk(ptr noundef %0) #0 { @@ -318,7 +318,7 @@ fn Call3() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc12_12.2.temp = alloca {}, align 8, !dbg !17 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_12.2.temp), !dbg !17 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %.loc12_12.2.temp, ptr align 1 @X.val.loc12_12.3, i64 0, i1 false), !dbg !17 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %.loc12_12.2.temp, ptr align 1 @X.val.loc12_14.1, i64 0, i1 false), !dbg !17 // CHECK:STDOUT: call void @_Z3fooIJEEv1XDpT_.carbon_thunk(ptr %.loc12_12.2.temp), !dbg !18 // CHECK:STDOUT: ret void, !dbg !19 // CHECK:STDOUT: } @@ -328,7 +328,7 @@ fn Call3() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc18_12.2.temp = alloca {}, align 8, !dbg !21 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_12.2.temp), !dbg !21 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %.loc18_12.2.temp, ptr align 1 @X.val.loc12_12.3, i64 0, i1 false), !dbg !21 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %.loc18_12.2.temp, ptr align 1 @X.val.loc12_14.1, i64 0, i1 false), !dbg !21 // CHECK:STDOUT: call void @_Z3fooIJiEEv1XDpT_.carbon_thunk(ptr %.loc18_12.2.temp, i32 2), !dbg !22 // CHECK:STDOUT: ret void, !dbg !23 // CHECK:STDOUT: } @@ -338,7 +338,7 @@ fn Call3() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc24_12.2.temp = alloca {}, align 8, !dbg !25 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_12.2.temp), !dbg !25 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %.loc24_12.2.temp, ptr align 1 @X.val.loc12_12.3, i64 0, i1 false), !dbg !25 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %.loc24_12.2.temp, ptr align 1 @X.val.loc12_14.1, i64 0, i1 false), !dbg !25 // CHECK:STDOUT: call void @_Z3fooIJiiEEv1XDpT_.carbon_thunk(ptr %.loc24_12.2.temp, i32 2, i32 3), !dbg !26 // CHECK:STDOUT: ret void, !dbg !27 // CHECK:STDOUT: }