// 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/primitives.carbon // // AUTOUPDATE // TIP: To test this file alone, run: // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/eval/call.carbon // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/eval/call.carbon // --- call.carbon library "[[@TEST_NAME]]"; eval fn F() -> i32 { return 3; } var a: array(i32, F()) = (0, 1, 2); // --- fail_call_wrong_value.carbon library "[[@TEST_NAME]]"; eval fn F() -> i32 { return 3; } // Ensure we get an error about the over-sized initializer and aren't just // treating all `eval fn` calls as silent errors. // CHECK:STDERR: fail_call_wrong_value.carbon:[[@LINE+2]]:26-37: error: cannot initialize array of 3 elements from 4 initializers [ArrayInitFromLiteralArgCountMismatch] // CHECK:STDERR: var a: array(i32, F()) = (0, 1, 2, 3); // --- fail_call_fn_not_eval.carbon library "[[@TEST_NAME]]"; fn F() -> i32 { return 3; } // CHECK:STDERR: fail_call_fn_not_eval.carbon:[[@LINE+2]]:19-21: error: array bound is not a constant [InvalidArrayExpr] // CHECK:STDERR: var a: array(i32, F()) = (0, 1, 2); // --- fail_call_eval_fn_not_defined.carbon library "[[@TEST_NAME]]"; eval fn F() -> i32; // TODO: We should be able to diagnose this better. // CHECK:STDERR: fail_call_eval_fn_not_defined.carbon:[[@LINE+2]]:19-21: error: array bound is not a constant [InvalidArrayExpr] // CHECK:STDERR: var a: array(i32, F()) = (0, 1, 2); // --- param_and_return.carbon library "[[@TEST_NAME]]"; eval fn F(x: i32) -> i32 { return x; } var a: array(i32, F(3)) = (1, 2, 3); // --- dependent_call.carbon library "[[@TEST_NAME]]"; eval fn F(x: i32) -> i32 { return x; } fn G(generic N: i32) { var unused a: array(i32, F(N)) = (0, 1, 2); } fn H() { G(3); } // --- dependent_call_type.carbon library "[[@TEST_NAME]]"; class C {} eval fn F(_: i32) -> type { return C; } //@dump-sem-ir-begin fn UseFGenerically(generic X: i32) { var unused v: F(X) = {}; } //@dump-sem-ir-end fn UseFSpecifically() { UseFGenerically(3); } // --- return_in_place_discarded.carbon library "[[@TEST_NAME]]"; eval fn F() -> (i32, i32, i32) { return (1, 2, 3); } fn G() { //@dump-sem-ir-begin F(); //@dump-sem-ir-end } // --- return_in_place_init.carbon library "[[@TEST_NAME]]"; eval fn F() -> (i32, i32, i32) { return (1, 2, 3); } fn G() { //@dump-sem-ir-begin var unused a: (i32, i32, i32) = F(); //@dump-sem-ir-end } // --- fail_todo_return_in_place_tuple.carbon library "[[@TEST_NAME]]"; //@dump-sem-ir-begin eval fn F() -> (i32, i32, i32) { return (1, 2, 3); } //@dump-sem-ir-end eval fn G(v: (i32, i32, i32)) -> i32 { return v.1; } fn H() { // TODO: The call to the function is a constant, but the `temporary` instruction wrapping it is not. //@dump-sem-ir-begin // CHECK:STDERR: fail_todo_return_in_place_tuple.carbon:[[@LINE+2]]:28-33: error: array bound is not a constant [InvalidArrayExpr] // CHECK:STDERR: var unused a: array(i32, G(F())) = (1, 2); //@dump-sem-ir-end } // --- return_in_place_class.carbon library "[[@TEST_NAME]]"; class C {} //@dump-sem-ir-begin eval fn F() -> C { return {}; } //@dump-sem-ir-end fn G(generic _: C) {} fn H() { //@dump-sem-ir-begin G(F()); //@dump-sem-ir-end } // CHECK:STDOUT: --- dependent_call_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: type: type = facet_type [concrete] // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %pattern_type.d94: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %X.patt: %pattern_type.d94 = symbolic_binding_pattern X, 0 [symbolic] // CHECK:STDOUT: %X: %i32 = symbolic_binding X, 0 [symbolic] // CHECK:STDOUT: %UseFGenerically.type: type = fn_type @UseFGenerically [concrete] // CHECK:STDOUT: %UseFGenerically: %UseFGenerically.type = struct_value () [concrete] // CHECK:STDOUT: %F.call: init type = call %F(%X) [template] // CHECK:STDOUT: %require_complete.ea6: = require_complete_type %F.call [template] // CHECK:STDOUT: %pattern_type.c72: type = pattern_type %F.call [template] // CHECK:STDOUT: %v.patt.6d8: %pattern_type.c72 = ref_binding_pattern v [template] // CHECK:STDOUT: %v.var_patt.e1f: %pattern_type.c72 = var_pattern %v.patt.6d8 [template] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: %tuple.type.f7a: type = tuple_type () [concrete] // CHECK:STDOUT: %.9e9: %F.call = splice_inst @UseFGenerically.%tuple.elem0 [template] // CHECK:STDOUT: %SelfDestruct.type: type = fn_type @SelfDestruct [concrete] // CHECK:STDOUT: %SelfDestruct: %SelfDestruct.type = struct_value () [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %SubobjectDestroy.type: type = facet_type <@SubobjectDestroy> [concrete] // CHECK:STDOUT: %.3ea: type = type_of_inst @UseFGenerically.%.loc11_3.6 [template] // CHECK:STDOUT: %.4ec: %.3ea = splice_inst @UseFGenerically.%.loc11_3.6 [template] // CHECK:STDOUT: %int_3.9f3: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %pattern_type.98b: type = pattern_type %C [concrete] // CHECK:STDOUT: %v.patt.5c6: %pattern_type.98b = ref_binding_pattern v [concrete] // CHECK:STDOUT: %v.var_patt.a6f: %pattern_type.98b = var_pattern %v.patt.5c6 [concrete] // CHECK:STDOUT: %C.val: %C = struct_value () [concrete] // CHECK:STDOUT: %inst.splice_block.426619.1: = inst_value [concrete] { // CHECK:STDOUT: %.dbd: init %C = splice_block %.b84 [concrete = %C.val] { // CHECK:STDOUT: %.ddc4c9.2: ref %C = specific_inst @UseFGenerically.%v.var, @UseFGenerically(%int_3.9f3) // CHECK:STDOUT: %.b84: init %C to %.ddc4c9.2 = class_init () [concrete = %C.val] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: %tuple.242: %tuple.type.f7a = tuple_value (%inst.splice_block.426619.1) [concrete] // CHECK:STDOUT: %T.09f: %SubobjectDestroy.type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %T.as_type.as.DestroyImpl.impl.Op.type.dea: type = fn_type @T.as_type.as.DestroyImpl.impl.Op, @T.as_type.as.DestroyImpl.impl(%T.09f) [symbolic] // CHECK:STDOUT: %T.as_type.as.DestroyImpl.impl.Op.6e5: %T.as_type.as.DestroyImpl.impl.Op.type.dea = struct_value () [symbolic] // CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.2: type = fn_type @SubobjectDestroy.WithSelf.Op.loc11_3.2 [concrete] // CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.30f1ee.2: %SubobjectDestroy.WithSelf.Op.type.6870fd.2 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.b80ef6.2: = custom_witness (%SubobjectDestroy.WithSelf.Op.30f1ee.2), @SubobjectDestroy [concrete] // CHECK:STDOUT: %SubobjectDestroy.facet.978: %SubobjectDestroy.type = facet_value %C, (%custom_witness.b80ef6.2) [concrete] // CHECK:STDOUT: %DestroyImpl.impl_witness.1e5: = impl_witness imports.%DestroyImpl.impl_witness_table, @T.as_type.as.DestroyImpl.impl(%SubobjectDestroy.facet.978) [concrete] // CHECK:STDOUT: %Destroy.facet.eb2c56.1: %Destroy.type = facet_value %C, (%DestroyImpl.impl_witness.1e5, %custom_witness.b80ef6.2) [concrete] // CHECK:STDOUT: %inst.splice_block.426619.2: = inst_value [concrete] { // CHECK:STDOUT: %.353: init %empty_tuple.type = splice_block %SelfDestruct.call { // CHECK:STDOUT: %.ddc4c9.1: ref %C = specific_inst @UseFGenerically.%v.var, @UseFGenerically(%int_3.9f3) // CHECK:STDOUT: %Destroy.facet.eb2c56.2: %Destroy.type = facet_value %C, (%DestroyImpl.impl_witness.1e5, %custom_witness.b80ef6.2) [concrete = %Destroy.facet.eb2c56.1] // CHECK:STDOUT: %.227372.1: %Destroy.type = converted %C, %Destroy.facet.eb2c56.2 [concrete = %Destroy.facet.eb2c56.1] // CHECK:STDOUT: %Destroy.facet.eb2c56.3: %Destroy.type = facet_value %C, (%DestroyImpl.impl_witness.1e5, %custom_witness.b80ef6.2) [concrete = %Destroy.facet.eb2c56.1] // CHECK:STDOUT: %.227372.2: %Destroy.type = converted %C, %Destroy.facet.eb2c56.3 [concrete = %Destroy.facet.eb2c56.1] // CHECK:STDOUT: // CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn.8ca4ee.2(%.ddc4c9.1) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core.import_ref.74d: @T.as_type.as.DestroyImpl.impl.%T.as_type.as.DestroyImpl.impl.Op.type (%T.as_type.as.DestroyImpl.impl.Op.type.dea) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @T.as_type.as.DestroyImpl.impl.%T.as_type.as.DestroyImpl.impl.Op (constants.%T.as_type.as.DestroyImpl.impl.Op.6e5)] // CHECK:STDOUT: %DestroyImpl.impl_witness_table = impl_witness_table (%Core.import_ref.74d), @T.as_type.as.DestroyImpl.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %UseFGenerically.decl: %UseFGenerically.type = fn_decl @UseFGenerically [concrete = constants.%UseFGenerically] { // CHECK:STDOUT: %X.patt.loc10_29.1: %pattern_type.d94 = symbolic_binding_pattern X, 0 [symbolic = %X.patt.loc10_29.2 (constants.%X.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc10: type = splice_block %i32 [concrete = constants.%i32] { // CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen] // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %X.loc10_29.2: %i32 = symbolic_binding X, 0 [symbolic = %X.loc10_29.1 (constants.%X)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @UseFGenerically(%X.loc10_29.2: %i32) { // CHECK:STDOUT: %X.patt.loc10_29.2: %pattern_type.d94 = symbolic_binding_pattern X, 0 [symbolic = %X.patt.loc10_29.2 (constants.%X.patt)] // CHECK:STDOUT: %X.loc10_29.1: %i32 = symbolic_binding X, 0 [symbolic = %X.loc10_29.1 (constants.%X)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.call.loc11_20.2: init type = call constants.%F(%X.loc10_29.1) [template = %F.call.loc11_20.2 (constants.%F.call)] // CHECK:STDOUT: %require_complete: = require_complete_type %F.call.loc11_20.2 [template = %require_complete (constants.%require_complete.ea6)] // CHECK:STDOUT: %pattern_type: type = pattern_type %F.call.loc11_20.2 [template = %pattern_type (constants.%pattern_type.c72)] // CHECK:STDOUT: %v.patt.loc11_15.2: @UseFGenerically.%pattern_type (%pattern_type.c72) = ref_binding_pattern v [template = %v.patt.loc11_15.2 (constants.%v.patt.6d8)] // CHECK:STDOUT: %v.var_patt.loc11_3.2: @UseFGenerically.%pattern_type (%pattern_type.c72) = var_pattern %v.patt.loc11_15.2 [template = %v.var_patt.loc11_3.2 (constants.%v.var_patt.e1f)] // CHECK:STDOUT: %.loc11_3.4: %tuple.type.f7a = initialize_action %.loc11_25, %F.call.loc11_20.2, %v.var, none, false [template] // CHECK:STDOUT: %tuple.elem0: = tuple_access %.loc11_3.4, element0 [template] // CHECK:STDOUT: %.loc11_3.5: @UseFGenerically.%F.call.loc11_20.2 (%F.call) = splice_inst %tuple.elem0 [template = %.loc11_3.5 (constants.%.9e9)] // CHECK:STDOUT: %.loc11_3.6: = call_action (constants.%SelfDestruct, %v.var), true [template] // CHECK:STDOUT: %.loc11_3.7: type = type_of_inst %.loc11_3.6 [template = %.loc11_3.7 (constants.%.3ea)] // CHECK:STDOUT: %.loc11_3.8: @UseFGenerically.%.loc11_3.7 (%.3ea) = splice_inst %.loc11_3.6 [template = %.loc11_3.8 (constants.%.4ec)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %v.var: ref @UseFGenerically.%F.call.loc11_20.2 (%F.call) = var_storage %v.var_patt.loc11_3.1 // CHECK:STDOUT: %.loc11_25: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc11_3.1: @UseFGenerically.%F.call.loc11_20.2 (%F.call) = splice_inst %tuple.elem0 [template = %.loc11_3.5 (constants.%.9e9)] // CHECK:STDOUT: assign %v.var, %.loc11_3.1 // CHECK:STDOUT: %.loc11_20.1: type = splice_block %.loc11_20.3 [template = %F.call.loc11_20.2 (constants.%F.call)] { // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] // CHECK:STDOUT: %X.ref: %i32 = name_ref X, %X.loc10_29.2 [symbolic = %X.loc10_29.1 (constants.%X)] // CHECK:STDOUT: %F.call.loc11_20.1: init type = call %F.ref(%X.ref) [template = %F.call.loc11_20.2 (constants.%F.call)] // CHECK:STDOUT: %.loc11_20.2: type = value_of_initializer %F.call.loc11_20.1 [template = %F.call.loc11_20.2 (constants.%F.call)] // CHECK:STDOUT: %.loc11_20.3: type = converted %F.call.loc11_20.1, %.loc11_20.2 [template = %F.call.loc11_20.2 (constants.%F.call)] // CHECK:STDOUT: } // CHECK:STDOUT: %v: ref @UseFGenerically.%F.call.loc11_20.2 (%F.call) = wrapper_binding v, %v.var // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %v.patt.loc11_15.1: @UseFGenerically.%pattern_type (%pattern_type.c72) = ref_binding_pattern v [template = %v.patt.loc11_15.2 (constants.%v.patt.6d8)] // CHECK:STDOUT: %v.var_patt.loc11_3.1: @UseFGenerically.%pattern_type (%pattern_type.c72) = var_pattern %v.patt.loc11_15.1 [template = %v.var_patt.loc11_3.2 (constants.%v.var_patt.e1f)] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc11_3.2: type = type_of_inst %.loc11_3.6 [template = %.loc11_3.7 (constants.%.3ea)] // CHECK:STDOUT: %.loc11_3.3: @UseFGenerically.%.loc11_3.7 (%.3ea) = splice_inst %.loc11_3.6 [template = %.loc11_3.8 (constants.%.4ec)] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc11_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: // CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc11_3.2(%self.param: ref %C) = "no_op"; // CHECK:STDOUT: // CHECK:STDOUT: specific @UseFGenerically(constants.%X) { // CHECK:STDOUT: %X.patt.loc10_29.2 => constants.%X.patt // CHECK:STDOUT: %X.loc10_29.1 => constants.%X // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @UseFGenerically(constants.%int_3.9f3) { // CHECK:STDOUT: %X.patt.loc10_29.2 => constants.%X.patt // CHECK:STDOUT: %X.loc10_29.1 => constants.%int_3.9f3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.call.loc11_20.2 => constants.%C // CHECK:STDOUT: %require_complete => constants.%complete_type.357 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.98b // CHECK:STDOUT: %v.patt.loc11_15.2 => constants.%v.patt.5c6 // CHECK:STDOUT: %v.var_patt.loc11_3.2 => constants.%v.var_patt.a6f // CHECK:STDOUT: %.loc11_3.4 => constants.%tuple.242 // CHECK:STDOUT: %tuple.elem0 => constants.%inst.splice_block.426619.1 // CHECK:STDOUT: %.loc11_3.5 => constants.%C.val // CHECK:STDOUT: %.loc11_3.6 => constants.%inst.splice_block.426619.2 // CHECK:STDOUT: %.loc11_3.7 => constants.%empty_tuple.type // CHECK:STDOUT: %.loc11_3.8 => // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- return_in_place_discarded.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: type: type = facet_type [concrete] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %tuple.type.abc: type = tuple_type (%i32, %i32, %i32) [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %int_1.68a: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %int_2.2e0: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %int_3.9f3: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %tuple.80e: %tuple.type.abc = tuple_value (%int_1.68a, %int_2.2e0, %int_3.9f3) [concrete] // CHECK:STDOUT: %.a35: ref %tuple.type.abc = temporary invalid, %tuple.80e [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %SubobjectDestroy.type: type = facet_type <@SubobjectDestroy> [concrete] // CHECK:STDOUT: %T.09f: %SubobjectDestroy.type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %T.as_type.as.DestroyImpl.impl.Op.type.dea: type = fn_type @T.as_type.as.DestroyImpl.impl.Op, @T.as_type.as.DestroyImpl.impl(%T.09f) [symbolic] // CHECK:STDOUT: %T.as_type.as.DestroyImpl.impl.Op.6e5: %T.as_type.as.DestroyImpl.impl.Op.type.dea = struct_value () [symbolic] // CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.1: type = fn_type @SubobjectDestroy.WithSelf.Op.loc8_5.1 [concrete] // CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.30f1ee.1: %SubobjectDestroy.WithSelf.Op.type.6870fd.1 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.b80ef6.1: = custom_witness (%SubobjectDestroy.WithSelf.Op.30f1ee.1), @SubobjectDestroy [concrete] // CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.2: type = fn_type @SubobjectDestroy.WithSelf.Op.loc8_5.2 [concrete] // CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.30f1ee.2: %SubobjectDestroy.WithSelf.Op.type.6870fd.2 = struct_value () [concrete] // CHECK:STDOUT: %SubobjectDestroy.facet.49a: %SubobjectDestroy.type = facet_value %i32, (%custom_witness.b80ef6.1) [concrete] // CHECK:STDOUT: %DestroyImpl.impl_witness.077: = impl_witness imports.%DestroyImpl.impl_witness_table, @T.as_type.as.DestroyImpl.impl(%SubobjectDestroy.facet.49a) [concrete] // CHECK:STDOUT: %Destroy.facet.c2b: %Destroy.type = facet_value %i32, (%DestroyImpl.impl_witness.077, %custom_witness.b80ef6.1) [concrete] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %custom_witness.b80ef6.2: = custom_witness (%SubobjectDestroy.WithSelf.Op.30f1ee.2), @SubobjectDestroy [concrete] // CHECK:STDOUT: %SubobjectDestroy.facet.2e8: %SubobjectDestroy.type = facet_value %tuple.type.abc, (%custom_witness.b80ef6.2) [concrete] // CHECK:STDOUT: %DestroyImpl.impl_witness.62e: = impl_witness imports.%DestroyImpl.impl_witness_table, @T.as_type.as.DestroyImpl.impl(%SubobjectDestroy.facet.2e8) [concrete] // CHECK:STDOUT: %Destroy.facet.c1b: %Destroy.type = facet_value %tuple.type.abc, (%DestroyImpl.impl_witness.62e, %custom_witness.b80ef6.2) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core.import_ref.74d: @T.as_type.as.DestroyImpl.impl.%T.as_type.as.DestroyImpl.impl.Op.type (%T.as_type.as.DestroyImpl.impl.Op.type.dea) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @T.as_type.as.DestroyImpl.impl.%T.as_type.as.DestroyImpl.impl.Op (constants.%T.as_type.as.DestroyImpl.impl.Op.6e5)] // CHECK:STDOUT: %DestroyImpl.impl_witness_table = impl_witness_table (%Core.import_ref.74d), @T.as_type.as.DestroyImpl.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] // CHECK:STDOUT: %.loc8_5.1: ref %tuple.type.abc = temporary_storage // CHECK:STDOUT: %F.call: init %tuple.type.abc to %.loc8_5.1 = call %F.ref() [concrete = constants.%tuple.80e] // CHECK:STDOUT: %.loc8_5.2: ref %tuple.type.abc = temporary %.loc8_5.1, %F.call [concrete = constants.%.a35] // CHECK:STDOUT: %Destroy.facet.loc8_5.1: %Destroy.type = facet_value constants.%tuple.type.abc, (constants.%DestroyImpl.impl_witness.62e, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.c1b] // CHECK:STDOUT: %.loc8_5.3: %Destroy.type = converted constants.%tuple.type.abc, %Destroy.facet.loc8_5.1 [concrete = constants.%Destroy.facet.c1b] // CHECK:STDOUT: %Destroy.facet.loc8_5.2: %Destroy.type = facet_value constants.%tuple.type.abc, (constants.%DestroyImpl.impl_witness.62e, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.c1b] // CHECK:STDOUT: %.loc8_5.4: %Destroy.type = converted constants.%tuple.type.abc, %Destroy.facet.loc8_5.2 [concrete = constants.%Destroy.facet.c1b] // CHECK:STDOUT: // CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc8_5.2) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc8_5.1(%self.param: ref %i32) = "no_op"; // CHECK:STDOUT: // CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc8_5.2(%self.param: ref %tuple.type.abc) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %tuple.elem2: ref %i32 = tuple_access %self.param, element2 // CHECK:STDOUT: %Destroy.facet.loc8_5.1: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: %.loc8_5.1: %Destroy.type = converted constants.%i32, %Destroy.facet.loc8_5.1 [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: %Destroy.facet.loc8_5.2: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: %.loc8_5.2: %Destroy.type = converted constants.%i32, %Destroy.facet.loc8_5.2 [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: // CHECK:STDOUT: %SelfDestruct.call.loc8_5.1: init %empty_tuple.type = call %SelfDestruct.specific_fn.1(%tuple.elem2) // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access %self.param, element1 // CHECK:STDOUT: %Destroy.facet.loc8_5.3: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: %.loc8_5.3: %Destroy.type = converted constants.%i32, %Destroy.facet.loc8_5.3 [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: %Destroy.facet.loc8_5.4: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: %.loc8_5.4: %Destroy.type = converted constants.%i32, %Destroy.facet.loc8_5.4 [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: // CHECK:STDOUT: %SelfDestruct.call.loc8_5.2: init %empty_tuple.type = call %SelfDestruct.specific_fn.2(%tuple.elem1) // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %self.param, element0 // CHECK:STDOUT: %Destroy.facet.loc8_5.5: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: %.loc8_5.5: %Destroy.type = converted constants.%i32, %Destroy.facet.loc8_5.5 [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: %Destroy.facet.loc8_5.6: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: %.loc8_5.6: %Destroy.type = converted constants.%i32, %Destroy.facet.loc8_5.6 [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: // CHECK:STDOUT: %SelfDestruct.call.loc8_5.3: init %empty_tuple.type = call %SelfDestruct.specific_fn.3(%tuple.elem0) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- return_in_place_init.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: type: type = facet_type [concrete] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %tuple.type.531: type = tuple_type (type, type, type) [concrete] // CHECK:STDOUT: %tuple.0a8: %tuple.type.531 = tuple_value (%i32, %i32, %i32) [concrete] // CHECK:STDOUT: %tuple.type.abc: type = tuple_type (%i32, %i32, %i32) [concrete] // CHECK:STDOUT: %pattern_type.c97: type = pattern_type %tuple.type.abc [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: %int_1.68a: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %int_2.2e0: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %int_3.9f3: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %tuple.80e: %tuple.type.abc = tuple_value (%int_1.68a, %int_2.2e0, %int_3.9f3) [concrete] // CHECK:STDOUT: %a.patt: %pattern_type.c97 = ref_binding_pattern a [concrete] // CHECK:STDOUT: %a.var_patt: %pattern_type.c97 = var_pattern %a.patt [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %SubobjectDestroy.type: type = facet_type <@SubobjectDestroy> [concrete] // CHECK:STDOUT: %T.09f: %SubobjectDestroy.type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %T.as_type.as.DestroyImpl.impl.Op.type.dea: type = fn_type @T.as_type.as.DestroyImpl.impl.Op, @T.as_type.as.DestroyImpl.impl(%T.09f) [symbolic] // CHECK:STDOUT: %T.as_type.as.DestroyImpl.impl.Op.6e5: %T.as_type.as.DestroyImpl.impl.Op.type.dea = struct_value () [symbolic] // CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.1: type = fn_type @SubobjectDestroy.WithSelf.Op.loc8_3.1 [concrete] // CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.30f1ee.1: %SubobjectDestroy.WithSelf.Op.type.6870fd.1 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.b80ef6.1: = custom_witness (%SubobjectDestroy.WithSelf.Op.30f1ee.1), @SubobjectDestroy [concrete] // CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.2: type = fn_type @SubobjectDestroy.WithSelf.Op.loc8_3.2 [concrete] // CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.30f1ee.2: %SubobjectDestroy.WithSelf.Op.type.6870fd.2 = struct_value () [concrete] // CHECK:STDOUT: %SubobjectDestroy.facet.49a: %SubobjectDestroy.type = facet_value %i32, (%custom_witness.b80ef6.1) [concrete] // CHECK:STDOUT: %DestroyImpl.impl_witness.077: = impl_witness imports.%DestroyImpl.impl_witness_table, @T.as_type.as.DestroyImpl.impl(%SubobjectDestroy.facet.49a) [concrete] // CHECK:STDOUT: %Destroy.facet.c2b: %Destroy.type = facet_value %i32, (%DestroyImpl.impl_witness.077, %custom_witness.b80ef6.1) [concrete] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %custom_witness.b80ef6.2: = custom_witness (%SubobjectDestroy.WithSelf.Op.30f1ee.2), @SubobjectDestroy [concrete] // CHECK:STDOUT: %SubobjectDestroy.facet.2e8: %SubobjectDestroy.type = facet_value %tuple.type.abc, (%custom_witness.b80ef6.2) [concrete] // CHECK:STDOUT: %DestroyImpl.impl_witness.62e: = impl_witness imports.%DestroyImpl.impl_witness_table, @T.as_type.as.DestroyImpl.impl(%SubobjectDestroy.facet.2e8) [concrete] // CHECK:STDOUT: %Destroy.facet.c1b: %Destroy.type = facet_value %tuple.type.abc, (%DestroyImpl.impl_witness.62e, %custom_witness.b80ef6.2) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core.import_ref.74d: @T.as_type.as.DestroyImpl.impl.%T.as_type.as.DestroyImpl.impl.Op.type (%T.as_type.as.DestroyImpl.impl.Op.type.dea) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @T.as_type.as.DestroyImpl.impl.%T.as_type.as.DestroyImpl.impl.Op (constants.%T.as_type.as.DestroyImpl.impl.Op.6e5)] // CHECK:STDOUT: %DestroyImpl.impl_witness_table = impl_witness_table (%Core.import_ref.74d), @T.as_type.as.DestroyImpl.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.var: ref %tuple.type.abc = var_storage %a.var_patt // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] // CHECK:STDOUT: %.loc8_3.1: ref %tuple.type.abc = splice_block %a.var {} // CHECK:STDOUT: %F.call: init %tuple.type.abc to %.loc8_3.1 = call %F.ref() [concrete = constants.%tuple.80e] // CHECK:STDOUT: assign %a.var, %F.call // CHECK:STDOUT: %.loc8_31.1: type = splice_block %.loc8_31.3 [concrete = constants.%tuple.type.abc] { // CHECK:STDOUT: %i32.loc8_18: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %i32.loc8_23: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %i32.loc8_28: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %.loc8_31.2: %tuple.type.531 = tuple_literal (%i32.loc8_18, %i32.loc8_23, %i32.loc8_28) [concrete = constants.%tuple.0a8] // CHECK:STDOUT: %.loc8_31.3: type = converted %.loc8_31.2, constants.%tuple.type.abc [concrete = constants.%tuple.type.abc] // CHECK:STDOUT: } // CHECK:STDOUT: %a: ref %tuple.type.abc = wrapper_binding a, %a.var // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %a.patt: %pattern_type.c97 = ref_binding_pattern a [concrete = constants.%a.patt] // CHECK:STDOUT: %a.var_patt: %pattern_type.c97 = var_pattern %a.patt [concrete = constants.%a.var_patt] // CHECK:STDOUT: } // CHECK:STDOUT: %Destroy.facet.loc8_3.1: %Destroy.type = facet_value constants.%tuple.type.abc, (constants.%DestroyImpl.impl_witness.62e, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.c1b] // CHECK:STDOUT: %.loc8_3.2: %Destroy.type = converted constants.%tuple.type.abc, %Destroy.facet.loc8_3.1 [concrete = constants.%Destroy.facet.c1b] // CHECK:STDOUT: %Destroy.facet.loc8_3.2: %Destroy.type = facet_value constants.%tuple.type.abc, (constants.%DestroyImpl.impl_witness.62e, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.c1b] // CHECK:STDOUT: %.loc8_3.3: %Destroy.type = converted constants.%tuple.type.abc, %Destroy.facet.loc8_3.2 [concrete = constants.%Destroy.facet.c1b] // CHECK:STDOUT: // CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc8_3.1(%self.param: ref %i32) = "no_op"; // CHECK:STDOUT: // CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc8_3.2(%self.param: ref %tuple.type.abc) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %tuple.elem2: ref %i32 = tuple_access %self.param, element2 // CHECK:STDOUT: %Destroy.facet.loc8_3.1: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: %.loc8_3.1: %Destroy.type = converted constants.%i32, %Destroy.facet.loc8_3.1 [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: %Destroy.facet.loc8_3.2: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: %.loc8_3.2: %Destroy.type = converted constants.%i32, %Destroy.facet.loc8_3.2 [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: // CHECK:STDOUT: %SelfDestruct.call.loc8_3.1: init %empty_tuple.type = call %SelfDestruct.specific_fn.1(%tuple.elem2) // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access %self.param, element1 // CHECK:STDOUT: %Destroy.facet.loc8_3.3: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: %.loc8_3.3: %Destroy.type = converted constants.%i32, %Destroy.facet.loc8_3.3 [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: %Destroy.facet.loc8_3.4: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: %.loc8_3.4: %Destroy.type = converted constants.%i32, %Destroy.facet.loc8_3.4 [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: // CHECK:STDOUT: %SelfDestruct.call.loc8_3.2: init %empty_tuple.type = call %SelfDestruct.specific_fn.2(%tuple.elem1) // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %self.param, element0 // CHECK:STDOUT: %Destroy.facet.loc8_3.5: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: %.loc8_3.5: %Destroy.type = converted constants.%i32, %Destroy.facet.loc8_3.5 [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: %Destroy.facet.loc8_3.6: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: %.loc8_3.6: %Destroy.type = converted constants.%i32, %Destroy.facet.loc8_3.6 [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: // CHECK:STDOUT: %SelfDestruct.call.loc8_3.3: init %empty_tuple.type = call %SelfDestruct.specific_fn.3(%tuple.elem0) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_return_in_place_tuple.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: type: type = facet_type [concrete] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %tuple.type.531: type = tuple_type (type, type, type) [concrete] // CHECK:STDOUT: %tuple.0a8: %tuple.type.531 = tuple_value (%i32, %i32, %i32) [concrete] // CHECK:STDOUT: %tuple.type.abc: type = tuple_type (%i32, %i32, %i32) [concrete] // CHECK:STDOUT: %.e17: Core.Form = init_form %tuple.type.abc [concrete] // CHECK:STDOUT: %pattern_type.c97: type = pattern_type %tuple.type.abc [concrete] // CHECK:STDOUT: %return.param_patt.848: %pattern_type.c97 = out_param_pattern [concrete] // CHECK:STDOUT: %return.patt.27c: %pattern_type.c97 = return_slot_pattern %return.param_patt.848, %tuple.type.abc [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: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete] // CHECK:STDOUT: %tuple.type.37f: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [concrete] // CHECK:STDOUT: %tuple.2d5: %tuple.type.37f = tuple_value (%int_1.5b8, %int_2.ecc, %int_3.1ba) [concrete] // CHECK:STDOUT: %ImplicitAs.type.6b0: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete] // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.3c6: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.6f2: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.3c6 = struct_value () [symbolic] // CHECK:STDOUT: %ImplicitAs.impl_witness.d73: = impl_witness imports.%ImplicitAs.impl_witness_table.f53, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete] // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.6b0 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.d73) [concrete] // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.58f: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%i32, %ImplicitAs.facet) [concrete] // CHECK:STDOUT: %.33a: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.58f, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.766: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.f60: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.766 = struct_value () [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.282: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.f60 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.f60, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method.3bd: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.68a: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.8a6: = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.f60 [concrete] // CHECK:STDOUT: %bound_method.a55: = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.2e0: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.b3c: = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.f60 [concrete] // CHECK:STDOUT: %bound_method.fb0: = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.9f3: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %tuple.80e: %tuple.type.abc = tuple_value (%int_1.68a, %int_2.2e0, %int_3.9f3) [concrete] // CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete] // CHECK:STDOUT: %tuple.ad8: %tuple.type.f94 = tuple_value (%int_1.5b8, %int_2.ecc) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %SubobjectDestroy.type: type = facet_type <@SubobjectDestroy> [concrete] // CHECK:STDOUT: %T.09f: %SubobjectDestroy.type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %T.as_type.as.DestroyImpl.impl.Op.type.dea: type = fn_type @T.as_type.as.DestroyImpl.impl.Op, @T.as_type.as.DestroyImpl.impl(%T.09f) [symbolic] // CHECK:STDOUT: %T.as_type.as.DestroyImpl.impl.Op.6e5: %T.as_type.as.DestroyImpl.impl.Op.type.dea = struct_value () [symbolic] // CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.1: type = fn_type @SubobjectDestroy.WithSelf.Op.loc15_32.1 [concrete] // CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.30f1ee.1: %SubobjectDestroy.WithSelf.Op.type.6870fd.1 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.b80ef6.1: = custom_witness (%SubobjectDestroy.WithSelf.Op.30f1ee.1), @SubobjectDestroy [concrete] // CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.2: type = fn_type @SubobjectDestroy.WithSelf.Op.loc15_32.2 [concrete] // CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.30f1ee.2: %SubobjectDestroy.WithSelf.Op.type.6870fd.2 = struct_value () [concrete] // CHECK:STDOUT: %SubobjectDestroy.facet.49a: %SubobjectDestroy.type = facet_value %i32, (%custom_witness.b80ef6.1) [concrete] // CHECK:STDOUT: %DestroyImpl.impl_witness.077: = impl_witness imports.%DestroyImpl.impl_witness_table, @T.as_type.as.DestroyImpl.impl(%SubobjectDestroy.facet.49a) [concrete] // CHECK:STDOUT: %Destroy.facet.c2b: %Destroy.type = facet_value %i32, (%DestroyImpl.impl_witness.077, %custom_witness.b80ef6.1) [concrete] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %custom_witness.b80ef6.2: = custom_witness (%SubobjectDestroy.WithSelf.Op.30f1ee.2), @SubobjectDestroy [concrete] // CHECK:STDOUT: %SubobjectDestroy.facet.2e8: %SubobjectDestroy.type = facet_value %tuple.type.abc, (%custom_witness.b80ef6.2) [concrete] // CHECK:STDOUT: %DestroyImpl.impl_witness.62e: = impl_witness imports.%DestroyImpl.impl_witness_table, @T.as_type.as.DestroyImpl.impl(%SubobjectDestroy.facet.2e8) [concrete] // CHECK:STDOUT: %Destroy.facet.c1b: %Destroy.type = facet_value %tuple.type.abc, (%DestroyImpl.impl_witness.62e, %custom_witness.b80ef6.2) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core.import_ref.e47: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.3c6) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.6f2)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.f53 = impl_witness_table (%Core.import_ref.e47), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.import_ref.74d: @T.as_type.as.DestroyImpl.impl.%T.as_type.as.DestroyImpl.impl.Op.type (%T.as_type.as.DestroyImpl.impl.Op.type.dea) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @T.as_type.as.DestroyImpl.impl.%T.as_type.as.DestroyImpl.impl.Op (constants.%T.as_type.as.DestroyImpl.impl.Op.6e5)] // CHECK:STDOUT: %DestroyImpl.impl_witness_table = impl_witness_table (%Core.import_ref.74d), @T.as_type.as.DestroyImpl.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { // CHECK:STDOUT: %return.param_patt: %pattern_type.c97 = out_param_pattern [concrete = constants.%return.param_patt.848] // CHECK:STDOUT: %return.patt: %pattern_type.c97 = return_slot_pattern %return.param_patt, %.loc5_30.2 [concrete = constants.%return.patt.27c] // CHECK:STDOUT: } { // CHECK:STDOUT: %i32.loc5_17: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %i32.loc5_22: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %i32.loc5_27: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %.loc5_30.1: %tuple.type.531 = tuple_literal (%i32.loc5_17, %i32.loc5_22, %i32.loc5_27) [concrete = constants.%tuple.0a8] // CHECK:STDOUT: %.loc5_30.2: type = converted %.loc5_30.1, constants.%tuple.type.abc [concrete = constants.%tuple.type.abc] // CHECK:STDOUT: %.loc5_30.3: Core.Form = init_form %.loc5_30.2 [concrete = constants.%.e17] // CHECK:STDOUT: %return.param: ref %tuple.type.abc = out_param call_param0 // CHECK:STDOUT: %return: ref %tuple.type.abc = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> out %return.param: %tuple.type.abc { // 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: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %.loc5_49.1: %tuple.type.37f = tuple_literal (%int_1, %int_2, %int_3) [concrete = constants.%tuple.2d5] // CHECK:STDOUT: %impl.elem0.loc5_49.1: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60] // CHECK:STDOUT: %bound_method.loc5_49.1: = bound_method %int_1, %impl.elem0.loc5_49.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.282] // CHECK:STDOUT: %specific_fn.loc5_49.1: = specific_function %impl.elem0.loc5_49.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] // CHECK:STDOUT: %bound_method.loc5_49.2: = bound_method %int_1, %specific_fn.loc5_49.1 [concrete = constants.%bound_method.3bd] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc5_49.1: init %i32 = call %bound_method.loc5_49.2(%int_1) [concrete = constants.%int_1.68a] // CHECK:STDOUT: %.loc5_49.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc5_49.1 [concrete = constants.%int_1.68a] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %return.param, element0 // CHECK:STDOUT: %.loc5_49.3: init %i32 to %tuple.elem0 = in_place_init %.loc5_49.2 [concrete = constants.%int_1.68a] // CHECK:STDOUT: %impl.elem0.loc5_49.2: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60] // CHECK:STDOUT: %bound_method.loc5_49.3: = bound_method %int_2, %impl.elem0.loc5_49.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.8a6] // CHECK:STDOUT: %specific_fn.loc5_49.2: = specific_function %impl.elem0.loc5_49.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] // CHECK:STDOUT: %bound_method.loc5_49.4: = bound_method %int_2, %specific_fn.loc5_49.2 [concrete = constants.%bound_method.a55] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc5_49.2: init %i32 = call %bound_method.loc5_49.4(%int_2) [concrete = constants.%int_2.2e0] // CHECK:STDOUT: %.loc5_49.4: init %i32 = converted %int_2, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc5_49.2 [concrete = constants.%int_2.2e0] // CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access %return.param, element1 // CHECK:STDOUT: %.loc5_49.5: init %i32 to %tuple.elem1 = in_place_init %.loc5_49.4 [concrete = constants.%int_2.2e0] // CHECK:STDOUT: %impl.elem0.loc5_49.3: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60] // CHECK:STDOUT: %bound_method.loc5_49.5: = bound_method %int_3, %impl.elem0.loc5_49.3 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.b3c] // CHECK:STDOUT: %specific_fn.loc5_49.3: = specific_function %impl.elem0.loc5_49.3, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] // CHECK:STDOUT: %bound_method.loc5_49.6: = bound_method %int_3, %specific_fn.loc5_49.3 [concrete = constants.%bound_method.fb0] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc5_49.3: init %i32 = call %bound_method.loc5_49.6(%int_3) [concrete = constants.%int_3.9f3] // CHECK:STDOUT: %.loc5_49.6: init %i32 = converted %int_3, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc5_49.3 [concrete = constants.%int_3.9f3] // CHECK:STDOUT: %tuple.elem2: ref %i32 = tuple_access %return.param, element2 // CHECK:STDOUT: %.loc5_49.7: init %i32 to %tuple.elem2 = in_place_init %.loc5_49.6 [concrete = constants.%int_3.9f3] // CHECK:STDOUT: %.loc5_49.8: init %tuple.type.abc to %return.param = tuple_init (%.loc5_49.3, %.loc5_49.5, %.loc5_49.7) [concrete = constants.%tuple.80e] // CHECK:STDOUT: %.loc5_50: init %tuple.type.abc = converted %.loc5_49.1, %.loc5_49.8 [concrete = constants.%tuple.80e] // CHECK:STDOUT: return %.loc5_50 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @H() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.var: ref = var_storage %a.var_patt [concrete = ] // 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: %.loc15_43: %tuple.type.f94 = tuple_literal (%int_1, %int_2) [concrete = constants.%tuple.ad8] // CHECK:STDOUT: assign %a.var, // CHECK:STDOUT: // CHECK:STDOUT: %a: = wrapper_binding a, [concrete = ] // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %a.patt: = ref_binding_pattern a [concrete = ] // CHECK:STDOUT: %a.var_patt: = var_pattern %a.patt [concrete = ] // CHECK:STDOUT: } // CHECK:STDOUT: %Destroy.facet.loc15_32.1: %Destroy.type = facet_value constants.%tuple.type.abc, (constants.%DestroyImpl.impl_witness.62e, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.c1b] // CHECK:STDOUT: %.loc15_32.1: %Destroy.type = converted constants.%tuple.type.abc, %Destroy.facet.loc15_32.1 [concrete = constants.%Destroy.facet.c1b] // CHECK:STDOUT: %Destroy.facet.loc15_32.2: %Destroy.type = facet_value constants.%tuple.type.abc, (constants.%DestroyImpl.impl_witness.62e, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.c1b] // CHECK:STDOUT: %.loc15_32.2: %Destroy.type = converted constants.%tuple.type.abc, %Destroy.facet.loc15_32.2 [concrete = constants.%Destroy.facet.c1b] // CHECK:STDOUT: // CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc15_32.4) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc15_32.1(%self.param: ref %i32) = "no_op"; // CHECK:STDOUT: // CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc15_32.2(%self.param: ref %tuple.type.abc) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %tuple.elem2: ref %i32 = tuple_access %self.param, element2 // CHECK:STDOUT: %Destroy.facet.loc15_32.1: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: %.loc15_32.1: %Destroy.type = converted constants.%i32, %Destroy.facet.loc15_32.1 [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: %Destroy.facet.loc15_32.2: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: %.loc15_32.2: %Destroy.type = converted constants.%i32, %Destroy.facet.loc15_32.2 [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: // CHECK:STDOUT: %SelfDestruct.call.loc15_32.1: init %empty_tuple.type = call %SelfDestruct.specific_fn.1(%tuple.elem2) // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access %self.param, element1 // CHECK:STDOUT: %Destroy.facet.loc15_32.3: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: %.loc15_32.3: %Destroy.type = converted constants.%i32, %Destroy.facet.loc15_32.3 [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: %Destroy.facet.loc15_32.4: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: %.loc15_32.4: %Destroy.type = converted constants.%i32, %Destroy.facet.loc15_32.4 [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: // CHECK:STDOUT: %SelfDestruct.call.loc15_32.2: init %empty_tuple.type = call %SelfDestruct.specific_fn.2(%tuple.elem1) // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %self.param, element0 // CHECK:STDOUT: %Destroy.facet.loc15_32.5: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: %.loc15_32.5: %Destroy.type = converted constants.%i32, %Destroy.facet.loc15_32.5 [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: %Destroy.facet.loc15_32.6: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: %.loc15_32.6: %Destroy.type = converted constants.%i32, %Destroy.facet.loc15_32.6 [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: // CHECK:STDOUT: %SelfDestruct.call.loc15_32.3: init %empty_tuple.type = call %SelfDestruct.specific_fn.3(%tuple.elem0) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- return_in_place_class.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: type: type = facet_type [concrete] // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %.a44: Core.Form = init_form %C [concrete] // CHECK:STDOUT: %pattern_type.98b: type = pattern_type %C [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.98b = out_param_pattern [concrete] // CHECK:STDOUT: %return.patt: %pattern_type.98b = return_slot_pattern %return.param_patt, %C [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: %C.val: %C = struct_value () [concrete] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %.115: ref %C = temporary invalid, %C.val [concrete] // CHECK:STDOUT: %G.specific_fn: = specific_function %G, @G(%C.val) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %SubobjectDestroy.type: type = facet_type <@SubobjectDestroy> [concrete] // CHECK:STDOUT: %T.09f: %SubobjectDestroy.type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %T.as_type.as.DestroyImpl.impl.Op.type.dea: type = fn_type @T.as_type.as.DestroyImpl.impl.Op, @T.as_type.as.DestroyImpl.impl(%T.09f) [symbolic] // CHECK:STDOUT: %T.as_type.as.DestroyImpl.impl.Op.6e5: %T.as_type.as.DestroyImpl.impl.Op.type.dea = struct_value () [symbolic] // CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.2: type = fn_type @SubobjectDestroy.WithSelf.Op.loc13_7.2 [concrete] // CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.30f1ee.2: %SubobjectDestroy.WithSelf.Op.type.6870fd.2 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.b80ef6.2: = custom_witness (%SubobjectDestroy.WithSelf.Op.30f1ee.2), @SubobjectDestroy [concrete] // CHECK:STDOUT: %SubobjectDestroy.facet.978: %SubobjectDestroy.type = facet_value %C, (%custom_witness.b80ef6.2) [concrete] // CHECK:STDOUT: %DestroyImpl.impl_witness.1e5: = impl_witness imports.%DestroyImpl.impl_witness_table, @T.as_type.as.DestroyImpl.impl(%SubobjectDestroy.facet.978) [concrete] // CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %C, (%DestroyImpl.impl_witness.1e5, %custom_witness.b80ef6.2) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core.import_ref.74d: @T.as_type.as.DestroyImpl.impl.%T.as_type.as.DestroyImpl.impl.Op.type (%T.as_type.as.DestroyImpl.impl.Op.type.dea) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @T.as_type.as.DestroyImpl.impl.%T.as_type.as.DestroyImpl.impl.Op (constants.%T.as_type.as.DestroyImpl.impl.Op.6e5)] // CHECK:STDOUT: %DestroyImpl.impl_witness_table = impl_witness_table (%Core.import_ref.74d), @T.as_type.as.DestroyImpl.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { // CHECK:STDOUT: %return.param_patt: %pattern_type.98b = out_param_pattern [concrete = constants.%return.param_patt] // CHECK:STDOUT: %return.patt: %pattern_type.98b = return_slot_pattern %return.param_patt, %C.ref [concrete = constants.%return.patt] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %.loc6_16: Core.Form = init_form %C.ref [concrete = constants.%.a44] // CHECK:STDOUT: %return.param: ref %C = out_param call_param0 // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> out %return.param: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc6_28.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc6_28.2: init %C to %return.param = class_init () [concrete = constants.%C.val] // CHECK:STDOUT: %.loc6_29: init %C = converted %.loc6_28.1, %.loc6_28.2 [concrete = constants.%C.val] // CHECK:STDOUT: return %.loc6_29 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @H() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [concrete = constants.%G] // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] // CHECK:STDOUT: %.loc13_7.1: ref %C = temporary_storage // CHECK:STDOUT: %F.call: init %C to %.loc13_7.1 = call %F.ref() [concrete = constants.%C.val] // CHECK:STDOUT: %.loc13_7.2: ref %C = temporary %.loc13_7.1, %F.call [concrete = constants.%.115] // CHECK:STDOUT: %.loc13_7.3: %C = acquire_value %.loc13_7.2 [concrete = constants.%C.val] // CHECK:STDOUT: %G.specific_fn: = specific_function %G.ref, @G(constants.%C.val) [concrete = constants.%G.specific_fn] // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.specific_fn() // CHECK:STDOUT: %Destroy.facet.loc13_7.1: %Destroy.type = facet_value constants.%C, (constants.%DestroyImpl.impl_witness.1e5, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet] // CHECK:STDOUT: %.loc13_7.4: %Destroy.type = converted constants.%C, %Destroy.facet.loc13_7.1 [concrete = constants.%Destroy.facet] // CHECK:STDOUT: %Destroy.facet.loc13_7.2: %Destroy.type = facet_value constants.%C, (constants.%DestroyImpl.impl_witness.1e5, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet] // CHECK:STDOUT: %.loc13_7.5: %Destroy.type = converted constants.%C, %Destroy.facet.loc13_7.2 [concrete = constants.%Destroy.facet] // CHECK:STDOUT: // CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc13_7.2) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc13_7.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: // CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc13_7.2(%self.param: ref %C) = "no_op"; // CHECK:STDOUT: