diff --git a/toolchain/check/call.cpp b/toolchain/check/call.cpp index db1f7334c4c8..a7299af67f1c 100644 --- a/toolchain/check/call.cpp +++ b/toolchain/check/call.cpp @@ -10,6 +10,7 @@ #include "toolchain/check/deduce.h" #include "toolchain/check/facet_type.h" #include "toolchain/check/function.h" +#include "toolchain/check/inst.h" #include "toolchain/check/type.h" #include "toolchain/diagnostics/format_providers.h" #include "toolchain/sem_ir/builtin_function_kind.h" @@ -164,19 +165,38 @@ auto PerformCall(Context& context, SemIR::LocId loc_id, SemIR::InstId callee_id, if (!callee_specific_id) { return SemIR::ErrorInst::SingletonInstId; } + if (callee_specific_id->has_value()) { - callee_id = GetOrAddInst( - context, context.insts().GetLocId(callee_id), - SemIR::SpecificFunction{ - .type_id = GetSingletonType( - context, SemIR::SpecificFunctionType::SingletonInstId), - .callee_id = callee_id, - .specific_id = *callee_specific_id}); + auto inner_callee_id = callee_id; + if (auto bound_method = + context.insts().TryGetAs(callee_id)) { + inner_callee_id = GetOrAddInst( + context, context.insts().GetLocId(bound_method->function_decl_id), + SemIR::SpecificFunction{ + .type_id = GetSingletonType( + context, SemIR::SpecificFunctionType::SingletonInstId), + .callee_id = bound_method->function_decl_id, + .specific_id = *callee_specific_id}); + callee_id = GetOrAddInst( + context, loc_id, + {.type_id = bound_method->type_id, + .object_id = bound_method->object_id, + .function_decl_id = inner_callee_id}); + } else { + callee_id = GetOrAddInst( + context, context.insts().GetLocId(callee_id), + SemIR::SpecificFunction{ + .type_id = GetSingletonType( + context, SemIR::SpecificFunctionType::SingletonInstId), + .callee_id = callee_id, + .specific_id = *callee_specific_id}); + inner_callee_id = callee_id; + } if (callee_function.self_type_id.has_value()) { // This is an associated function, and will be required to be defined as // part of checking that the impl is complete. } else { - context.definitions_required().push_back(callee_id); + context.definitions_required().push_back(inner_callee_id); } } diff --git a/toolchain/check/testdata/array/array_vs_tuple.carbon b/toolchain/check/testdata/array/array_vs_tuple.carbon index bbaab0be051f..e2e7fe571814 100644 --- a/toolchain/check/testdata/array/array_vs_tuple.carbon +++ b/toolchain/check/testdata/array/array_vs_tuple.carbon @@ -35,13 +35,14 @@ fn G() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %Convert.bound.b30: = bound_method %int_3.1ba, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.b42: = specific_function %Convert.bound.b30, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.047: = bound_method %int_3.1ba, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_1.5d2, %int_2.ef8, %int_3.822) [concrete] // CHECK:STDOUT: %tuple.type.ff9: type = tuple_type (type, type, type) [concrete] @@ -80,24 +81,27 @@ fn G() { // CHECK:STDOUT: %.loc13_34.1: %tuple.type.37f = tuple_literal (%int_1.loc13_27, %int_2.loc13_30, %int_3.loc13_33) // CHECK:STDOUT: %impl.elem0.loc13_34.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc13_34.1: = bound_method %int_1.loc13_27, %impl.elem0.loc13_34.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc13_34.1: = specific_function %bound_method.loc13_34.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc13_34.1: init %i32 = call %specific_fn.loc13_34.1(%int_1.loc13_27) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc13_34.1: = specific_function %impl.elem0.loc13_34.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_34.2: = bound_method %int_1.loc13_27, %specific_fn.loc13_34.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc13_34.1: init %i32 = call %bound_method.loc13_34.2(%int_1.loc13_27) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_34.2: init %i32 = converted %int_1.loc13_27, %int.convert_checked.loc13_34.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc13_34.3: ref %i32 = array_index %a.var, %int_0 // CHECK:STDOUT: %.loc13_34.4: init %i32 = initialize_from %.loc13_34.2 to %.loc13_34.3 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc13_34.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc13_34.2: = bound_method %int_2.loc13_30, %impl.elem0.loc13_34.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc13_34.2: = specific_function %bound_method.loc13_34.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc13_34.2: init %i32 = call %specific_fn.loc13_34.2(%int_2.loc13_30) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc13_34.3: = bound_method %int_2.loc13_30, %impl.elem0.loc13_34.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc13_34.2: = specific_function %impl.elem0.loc13_34.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_34.4: = bound_method %int_2.loc13_30, %specific_fn.loc13_34.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc13_34.2: init %i32 = call %bound_method.loc13_34.4(%int_2.loc13_30) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_34.5: init %i32 = converted %int_2.loc13_30, %int.convert_checked.loc13_34.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %int_1.loc13_34: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc13_34.6: ref %i32 = array_index %a.var, %int_1.loc13_34 // CHECK:STDOUT: %.loc13_34.7: init %i32 = initialize_from %.loc13_34.5 to %.loc13_34.6 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %impl.elem0.loc13_34.3: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc13_34.3: = bound_method %int_3.loc13_33, %impl.elem0.loc13_34.3 [concrete = constants.%Convert.bound.b30] -// CHECK:STDOUT: %specific_fn.loc13_34.3: = specific_function %bound_method.loc13_34.3, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc13_34.3: init %i32 = call %specific_fn.loc13_34.3(%int_3.loc13_33) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %bound_method.loc13_34.5: = bound_method %int_3.loc13_33, %impl.elem0.loc13_34.3 [concrete = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc13_34.3: = specific_function %impl.elem0.loc13_34.3, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_34.6: = bound_method %int_3.loc13_33, %specific_fn.loc13_34.3 [concrete = constants.%bound_method.047] +// CHECK:STDOUT: %int.convert_checked.loc13_34.3: init %i32 = call %bound_method.loc13_34.6(%int_3.loc13_33) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc13_34.8: init %i32 = converted %int_3.loc13_33, %int.convert_checked.loc13_34.3 [concrete = constants.%int_3.822] // CHECK:STDOUT: %int_2.loc13_34: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %.loc13_34.9: ref %i32 = array_index %a.var, %int_2.loc13_34 @@ -123,22 +127,25 @@ fn G() { // CHECK:STDOUT: %.loc14_36.1: %tuple.type.37f = tuple_literal (%int_1.loc14, %int_2.loc14, %int_3.loc14) // CHECK:STDOUT: %impl.elem0.loc14_36.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc14_36.1: = bound_method %int_1.loc14, %impl.elem0.loc14_36.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc14_36.1: = specific_function %bound_method.loc14_36.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc14_36.1: init %i32 = call %specific_fn.loc14_36.1(%int_1.loc14) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc14_36.1: = specific_function %impl.elem0.loc14_36.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_36.2: = bound_method %int_1.loc14, %specific_fn.loc14_36.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc14_36.1: init %i32 = call %bound_method.loc14_36.2(%int_1.loc14) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_36.2: init %i32 = converted %int_1.loc14, %int.convert_checked.loc14_36.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %b.var, element0 // CHECK:STDOUT: %.loc14_36.3: init %i32 = initialize_from %.loc14_36.2 to %tuple.elem0 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc14_36.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc14_36.2: = bound_method %int_2.loc14, %impl.elem0.loc14_36.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc14_36.2: = specific_function %bound_method.loc14_36.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc14_36.2: init %i32 = call %specific_fn.loc14_36.2(%int_2.loc14) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc14_36.3: = bound_method %int_2.loc14, %impl.elem0.loc14_36.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc14_36.2: = specific_function %impl.elem0.loc14_36.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_36.4: = bound_method %int_2.loc14, %specific_fn.loc14_36.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc14_36.2: init %i32 = call %bound_method.loc14_36.4(%int_2.loc14) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc14_36.4: init %i32 = converted %int_2.loc14, %int.convert_checked.loc14_36.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access %b.var, element1 // CHECK:STDOUT: %.loc14_36.5: init %i32 = initialize_from %.loc14_36.4 to %tuple.elem1 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %impl.elem0.loc14_36.3: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc14_36.3: = bound_method %int_3.loc14, %impl.elem0.loc14_36.3 [concrete = constants.%Convert.bound.b30] -// CHECK:STDOUT: %specific_fn.loc14_36.3: = specific_function %bound_method.loc14_36.3, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc14_36.3: init %i32 = call %specific_fn.loc14_36.3(%int_3.loc14) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %bound_method.loc14_36.5: = bound_method %int_3.loc14, %impl.elem0.loc14_36.3 [concrete = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc14_36.3: = specific_function %impl.elem0.loc14_36.3, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_36.6: = bound_method %int_3.loc14, %specific_fn.loc14_36.3 [concrete = constants.%bound_method.047] +// CHECK:STDOUT: %int.convert_checked.loc14_36.3: init %i32 = call %bound_method.loc14_36.6(%int_3.loc14) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc14_36.6: init %i32 = converted %int_3.loc14, %int.convert_checked.loc14_36.3 [concrete = constants.%int_3.822] // CHECK:STDOUT: %tuple.elem2: ref %i32 = tuple_access %b.var, element2 // CHECK:STDOUT: %.loc14_36.7: init %i32 = initialize_from %.loc14_36.6 to %tuple.elem2 [concrete = constants.%int_3.822] diff --git a/toolchain/check/testdata/array/assign_return_value.carbon b/toolchain/check/testdata/array/assign_return_value.carbon index 0b0d2b7e5508..d95f749ebee4 100644 --- a/toolchain/check/testdata/array/assign_return_value.carbon +++ b/toolchain/check/testdata/array/assign_return_value.carbon @@ -33,7 +33,8 @@ fn Run() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%int_0.6a9) [concrete] // CHECK:STDOUT: %Run.type: type = fn_type @Run [concrete] @@ -77,9 +78,10 @@ fn Run() { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %.loc11_30.1: %tuple.type.985 = tuple_literal (%int_0) // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc11_30.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_30.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc11_30.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc11_30.2: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc11_30.3: %i32 = converted %int_0, %.loc11_30.2 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%.loc11_30.3) [concrete = constants.%tuple] diff --git a/toolchain/check/testdata/array/assign_var.carbon b/toolchain/check/testdata/array/assign_var.carbon index 518c701a2efe..6b26e07fc9ab 100644 --- a/toolchain/check/testdata/array/assign_var.carbon +++ b/toolchain/check/testdata/array/assign_var.carbon @@ -30,13 +30,14 @@ var b: array(i32, 3) = a; // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %Convert.bound.b30: = bound_method %int_3.1ba, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.b42: = specific_function %Convert.bound.b30, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.047: = bound_method %int_3.1ba, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %tuple: %tuple.type.189 = tuple_value (%int_1.5d2, %int_2.ef8, %int_3.822) [concrete] // CHECK:STDOUT: %array_type: type = array_type %int_3.1ba, %i32 [concrete] @@ -97,22 +98,25 @@ var b: array(i32, 3) = a; // CHECK:STDOUT: %.loc11_34.1: %tuple.type.37f = tuple_literal (%int_1.loc11, %int_2.loc11, %int_3) // CHECK:STDOUT: %impl.elem0.loc11_34.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc11_34.1: = bound_method %int_1.loc11, %impl.elem0.loc11_34.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc11_34.1: = specific_function %bound_method.loc11_34.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc11_34.1: init %i32 = call %specific_fn.loc11_34.1(%int_1.loc11) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc11_34.1: = specific_function %impl.elem0.loc11_34.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_34.2: = bound_method %int_1.loc11, %specific_fn.loc11_34.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc11_34.1: init %i32 = call %bound_method.loc11_34.2(%int_1.loc11) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_34.2: init %i32 = converted %int_1.loc11, %int.convert_checked.loc11_34.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %tuple.elem0.loc11: ref %i32 = tuple_access file.%a.var, element0 // CHECK:STDOUT: %.loc11_34.3: init %i32 = initialize_from %.loc11_34.2 to %tuple.elem0.loc11 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc11_34.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11_34.2: = bound_method %int_2.loc11, %impl.elem0.loc11_34.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc11_34.2: = specific_function %bound_method.loc11_34.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc11_34.2: init %i32 = call %specific_fn.loc11_34.2(%int_2.loc11) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc11_34.3: = bound_method %int_2.loc11, %impl.elem0.loc11_34.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc11_34.2: = specific_function %impl.elem0.loc11_34.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_34.4: = bound_method %int_2.loc11, %specific_fn.loc11_34.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc11_34.2: init %i32 = call %bound_method.loc11_34.4(%int_2.loc11) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc11_34.4: init %i32 = converted %int_2.loc11, %int.convert_checked.loc11_34.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %tuple.elem1.loc11: ref %i32 = tuple_access file.%a.var, element1 // CHECK:STDOUT: %.loc11_34.5: init %i32 = initialize_from %.loc11_34.4 to %tuple.elem1.loc11 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %impl.elem0.loc11_34.3: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11_34.3: = bound_method %int_3, %impl.elem0.loc11_34.3 [concrete = constants.%Convert.bound.b30] -// CHECK:STDOUT: %specific_fn.loc11_34.3: = specific_function %bound_method.loc11_34.3, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc11_34.3: init %i32 = call %specific_fn.loc11_34.3(%int_3) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %bound_method.loc11_34.5: = bound_method %int_3, %impl.elem0.loc11_34.3 [concrete = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc11_34.3: = specific_function %impl.elem0.loc11_34.3, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_34.6: = bound_method %int_3, %specific_fn.loc11_34.3 [concrete = constants.%bound_method.047] +// CHECK:STDOUT: %int.convert_checked.loc11_34.3: init %i32 = call %bound_method.loc11_34.6(%int_3) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc11_34.6: init %i32 = converted %int_3, %int.convert_checked.loc11_34.3 [concrete = constants.%int_3.822] // CHECK:STDOUT: %tuple.elem2.loc11: ref %i32 = tuple_access file.%a.var, element2 // CHECK:STDOUT: %.loc11_34.7: init %i32 = initialize_from %.loc11_34.6 to %tuple.elem2.loc11 [concrete = constants.%int_3.822] diff --git a/toolchain/check/testdata/array/base.carbon b/toolchain/check/testdata/array/base.carbon index a3ba80fd15c6..ae221e1e3fdb 100644 --- a/toolchain/check/testdata/array/base.carbon +++ b/toolchain/check/testdata/array/base.carbon @@ -30,7 +30,8 @@ var c: array((), 5) = ((), (), (), (), (),); // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %array.237: %array_type.0cb = tuple_value (%int_1.5d2) [concrete] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete] @@ -114,9 +115,10 @@ var c: array((), 5) = ((), (), (), (), (),); // CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc11_27.1: %tuple.type.985 = tuple_literal (%int_1.loc11) // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_1.loc11, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1.loc11) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc11_27.1: = bound_method %int_1.loc11, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_27.2: = bound_method %int_1.loc11, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc11_27.2(%int_1.loc11) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_1.loc11, %int.convert_checked [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %int_0.loc11: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc11_27.3: ref %i32 = array_index file.%a.var, %int_0.loc11 diff --git a/toolchain/check/testdata/array/canonicalize_index.carbon b/toolchain/check/testdata/array/canonicalize_index.carbon index 6e99ad937c0b..fac92a130d8f 100644 --- a/toolchain/check/testdata/array/canonicalize_index.carbon +++ b/toolchain/check/testdata/array/canonicalize_index.carbon @@ -37,10 +37,11 @@ let c: array(i32, ConvertToU32(3))* = &a; // CHECK:STDOUT: %ImplicitAs.facet.f7f: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet.f7f [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn.b6f: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn.b6f [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn.b6f [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %impl_witness.023: = impl_witness (imports.%Core.import_ref.85c), @impl.971(%int_32) [concrete] @@ -49,14 +50,15 @@ let c: array(i32, ConvertToU32(3))* = &a; // CHECK:STDOUT: %ImplicitAs.facet.e25: %ImplicitAs.type.2fd = facet_value %i32, %impl_witness.023 [concrete] // CHECK:STDOUT: %.10e: type = fn_type_with_self_type %Convert.type.71e, %ImplicitAs.facet.e25 [concrete] // CHECK:STDOUT: %Convert.bound.2d6: = bound_method %int_3.822, %Convert.960 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.377: = specific_function %Convert.bound.2d6, @Convert.3(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn.8a8: = specific_function %Convert.960, @Convert.3(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.c6f: = bound_method %int_3.822, %Convert.specific_fn.8a8 [concrete] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete] // CHECK:STDOUT: %array_type: type = array_type %int_3.1ba, %i32 [concrete] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [concrete] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [concrete] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %Convert.bound.b30: = bound_method %int_3.1ba, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.b42: = specific_function %Convert.bound.b30, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.047: = bound_method %int_3.1ba, %Convert.specific_fn.b6f [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_1.5d2, %int_2.ef8, %int_3.822) [concrete] // CHECK:STDOUT: %int_3.d14: %u32 = int_value 3 [concrete] // CHECK:STDOUT: %impl_witness.8da2: = impl_witness (imports.%Core.import_ref.823), @impl.750(%int_32) [concrete] @@ -65,7 +67,8 @@ let c: array(i32, ConvertToU32(3))* = &a; // CHECK:STDOUT: %ImplicitAs.facet.84b: %ImplicitAs.type.2fd = facet_value %u32, %impl_witness.8da2 [concrete] // CHECK:STDOUT: %.88a: type = fn_type_with_self_type %Convert.type.71e, %ImplicitAs.facet.84b [concrete] // CHECK:STDOUT: %Convert.bound.258: = bound_method %int_3.d14, %Convert.47f [concrete] -// CHECK:STDOUT: %Convert.specific_fn.d14: = specific_function %Convert.bound.258, @Convert.9(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn.2eb: = specific_function %Convert.47f, @Convert.9(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.3a6: = bound_method %int_3.d14, %Convert.specific_fn.2eb [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -142,24 +145,27 @@ let c: array(i32, ConvertToU32(3))* = &a; // 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: %impl.elem0.loc14_23: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc14_23: = bound_method %int_1, %impl.elem0.loc14_23 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc14_23: = specific_function %bound_method.loc14_23, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc14_23: init %i32 = call %specific_fn.loc14_23(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc14_23.1: = bound_method %int_1, %impl.elem0.loc14_23 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc14_23: = specific_function %impl.elem0.loc14_23, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b6f] +// CHECK:STDOUT: %bound_method.loc14_23.2: = bound_method %int_1, %specific_fn.loc14_23 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc14_23: init %i32 = call %bound_method.loc14_23.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_23.1: %i32 = value_of_initializer %int.convert_checked.loc14_23 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_23.2: %i32 = converted %int_1, %.loc14_23.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc14_26: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc14_26: = bound_method %int_2, %impl.elem0.loc14_26 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc14_26: = specific_function %bound_method.loc14_26, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc14_26: init %i32 = call %specific_fn.loc14_26(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc14_26.1: = bound_method %int_2, %impl.elem0.loc14_26 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc14_26: = specific_function %impl.elem0.loc14_26, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b6f] +// CHECK:STDOUT: %bound_method.loc14_26.2: = bound_method %int_2, %specific_fn.loc14_26 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc14_26: init %i32 = call %bound_method.loc14_26.2(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc14_26.1: %i32 = value_of_initializer %int.convert_checked.loc14_26 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc14_26.2: %i32 = converted %int_2, %.loc14_26.1 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %int.sadd: init %i32 = call %Add.ref(%.loc14_23.2, %.loc14_26.2) [concrete = constants.%int_3.822] // CHECK:STDOUT: %impl.elem0.loc14_27: %.10e = impl_witness_access constants.%impl_witness.023, element0 [concrete = constants.%Convert.960] -// CHECK:STDOUT: %bound_method.loc14_27: = bound_method %int.sadd, %impl.elem0.loc14_27 [concrete = constants.%Convert.bound.2d6] -// CHECK:STDOUT: %specific_fn.loc14_27: = specific_function %bound_method.loc14_27, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn.377] +// CHECK:STDOUT: %bound_method.loc14_27.1: = bound_method %int.sadd, %impl.elem0.loc14_27 [concrete = constants.%Convert.bound.2d6] +// CHECK:STDOUT: %specific_fn.loc14_27: = specific_function %impl.elem0.loc14_27, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn.8a8] +// CHECK:STDOUT: %bound_method.loc14_27.2: = bound_method %int.sadd, %specific_fn.loc14_27 [concrete = constants.%bound_method.c6f] // CHECK:STDOUT: %.loc14_27.1: %i32 = value_of_initializer %int.sadd [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc14_27.2: %i32 = converted %int.sadd, %.loc14_27.1 [concrete = constants.%int_3.822] -// CHECK:STDOUT: %int.convert_checked.loc14_27: init Core.IntLiteral = call %specific_fn.loc14_27(%.loc14_27.2) [concrete = constants.%int_3.1ba] +// CHECK:STDOUT: %int.convert_checked.loc14_27: init Core.IntLiteral = call %bound_method.loc14_27.2(%.loc14_27.2) [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %.loc14_27.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc14_27 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %.loc14_27.4: Core.IntLiteral = converted %int.sadd, %.loc14_27.3 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %array_type.loc14: type = array_type %.loc14_27.4, %i32 [concrete = constants.%array_type] @@ -185,18 +191,20 @@ let c: array(i32, ConvertToU32(3))* = &a; // CHECK:STDOUT: %ConvertToU32.ref: %ConvertToU32.type = name_ref ConvertToU32, %ConvertToU32.decl [concrete = constants.%ConvertToU32] // CHECK:STDOUT: %int_3.loc16: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %impl.elem0.loc16_32: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc16_32: = bound_method %int_3.loc16, %impl.elem0.loc16_32 [concrete = constants.%Convert.bound.b30] -// CHECK:STDOUT: %specific_fn.loc16_32: = specific_function %bound_method.loc16_32, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc16_32: init %i32 = call %specific_fn.loc16_32(%int_3.loc16) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %bound_method.loc16_32.1: = bound_method %int_3.loc16, %impl.elem0.loc16_32 [concrete = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc16_32: = specific_function %impl.elem0.loc16_32, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b6f] +// CHECK:STDOUT: %bound_method.loc16_32.2: = bound_method %int_3.loc16, %specific_fn.loc16_32 [concrete = constants.%bound_method.047] +// CHECK:STDOUT: %int.convert_checked.loc16_32: init %i32 = call %bound_method.loc16_32.2(%int_3.loc16) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc16_32.1: %i32 = value_of_initializer %int.convert_checked.loc16_32 [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc16_32.2: %i32 = converted %int_3.loc16, %.loc16_32.1 [concrete = constants.%int_3.822] // CHECK:STDOUT: %int.convert_checked.loc16_33.1: init %u32 = call %ConvertToU32.ref(%.loc16_32.2) [concrete = constants.%int_3.d14] // CHECK:STDOUT: %impl.elem0.loc16_33: %.88a = impl_witness_access constants.%impl_witness.8da2, element0 [concrete = constants.%Convert.47f] -// CHECK:STDOUT: %bound_method.loc16_33: = bound_method %int.convert_checked.loc16_33.1, %impl.elem0.loc16_33 [concrete = constants.%Convert.bound.258] -// CHECK:STDOUT: %specific_fn.loc16_33: = specific_function %bound_method.loc16_33, @Convert.9(constants.%int_32) [concrete = constants.%Convert.specific_fn.d14] +// CHECK:STDOUT: %bound_method.loc16_33.1: = bound_method %int.convert_checked.loc16_33.1, %impl.elem0.loc16_33 [concrete = constants.%Convert.bound.258] +// CHECK:STDOUT: %specific_fn.loc16_33: = specific_function %impl.elem0.loc16_33, @Convert.9(constants.%int_32) [concrete = constants.%Convert.specific_fn.2eb] +// CHECK:STDOUT: %bound_method.loc16_33.2: = bound_method %int.convert_checked.loc16_33.1, %specific_fn.loc16_33 [concrete = constants.%bound_method.3a6] // CHECK:STDOUT: %.loc16_33.1: %u32 = value_of_initializer %int.convert_checked.loc16_33.1 [concrete = constants.%int_3.d14] // CHECK:STDOUT: %.loc16_33.2: %u32 = converted %int.convert_checked.loc16_33.1, %.loc16_33.1 [concrete = constants.%int_3.d14] -// CHECK:STDOUT: %int.convert_checked.loc16_33.2: init Core.IntLiteral = call %specific_fn.loc16_33(%.loc16_33.2) [concrete = constants.%int_3.1ba] +// CHECK:STDOUT: %int.convert_checked.loc16_33.2: init Core.IntLiteral = call %bound_method.loc16_33.2(%.loc16_33.2) [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %.loc16_33.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc16_33.2 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %.loc16_33.4: Core.IntLiteral = converted %int.convert_checked.loc16_33.1, %.loc16_33.3 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %array_type.loc16: type = array_type %.loc16_33.4, %i32 [concrete = constants.%array_type] @@ -217,24 +225,27 @@ let c: array(i32, ConvertToU32(3))* = &a; // CHECK:STDOUT: %.loc14_40.1: %tuple.type = tuple_literal (%int_1.loc14_33, %int_2.loc14_36, %int_3) // CHECK:STDOUT: %impl.elem0.loc14_40.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc14_40.1: = bound_method %int_1.loc14_33, %impl.elem0.loc14_40.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc14_40.1: = specific_function %bound_method.loc14_40.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc14_40.1: init %i32 = call %specific_fn.loc14_40.1(%int_1.loc14_33) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc14_40.1: = specific_function %impl.elem0.loc14_40.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b6f] +// CHECK:STDOUT: %bound_method.loc14_40.2: = bound_method %int_1.loc14_33, %specific_fn.loc14_40.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc14_40.1: init %i32 = call %bound_method.loc14_40.2(%int_1.loc14_33) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_40.2: init %i32 = converted %int_1.loc14_33, %int.convert_checked.loc14_40.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc14_40.3: ref %i32 = array_index file.%a.var, %int_0 // CHECK:STDOUT: %.loc14_40.4: init %i32 = initialize_from %.loc14_40.2 to %.loc14_40.3 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc14_40.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc14_40.2: = bound_method %int_2.loc14_36, %impl.elem0.loc14_40.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc14_40.2: = specific_function %bound_method.loc14_40.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc14_40.2: init %i32 = call %specific_fn.loc14_40.2(%int_2.loc14_36) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc14_40.3: = bound_method %int_2.loc14_36, %impl.elem0.loc14_40.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc14_40.2: = specific_function %impl.elem0.loc14_40.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b6f] +// CHECK:STDOUT: %bound_method.loc14_40.4: = bound_method %int_2.loc14_36, %specific_fn.loc14_40.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc14_40.2: init %i32 = call %bound_method.loc14_40.4(%int_2.loc14_36) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc14_40.5: init %i32 = converted %int_2.loc14_36, %int.convert_checked.loc14_40.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %int_1.loc14_40: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc14_40.6: ref %i32 = array_index file.%a.var, %int_1.loc14_40 // CHECK:STDOUT: %.loc14_40.7: init %i32 = initialize_from %.loc14_40.5 to %.loc14_40.6 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %impl.elem0.loc14_40.3: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc14_40.3: = bound_method %int_3, %impl.elem0.loc14_40.3 [concrete = constants.%Convert.bound.b30] -// CHECK:STDOUT: %specific_fn.loc14_40.3: = specific_function %bound_method.loc14_40.3, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc14_40.3: init %i32 = call %specific_fn.loc14_40.3(%int_3) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %bound_method.loc14_40.5: = bound_method %int_3, %impl.elem0.loc14_40.3 [concrete = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc14_40.3: = specific_function %impl.elem0.loc14_40.3, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b6f] +// CHECK:STDOUT: %bound_method.loc14_40.6: = bound_method %int_3, %specific_fn.loc14_40.3 [concrete = constants.%bound_method.047] +// CHECK:STDOUT: %int.convert_checked.loc14_40.3: init %i32 = call %bound_method.loc14_40.6(%int_3) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc14_40.8: init %i32 = converted %int_3, %int.convert_checked.loc14_40.3 [concrete = constants.%int_3.822] // CHECK:STDOUT: %int_2.loc14_40: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %.loc14_40.9: ref %i32 = array_index file.%a.var, %int_2.loc14_40 diff --git a/toolchain/check/testdata/array/fail_bound_negative.carbon b/toolchain/check/testdata/array/fail_bound_negative.carbon index 63a2cf11437b..6260d6b7f3ce 100644 --- a/toolchain/check/testdata/array/fail_bound_negative.carbon +++ b/toolchain/check/testdata/array/fail_bound_negative.carbon @@ -34,7 +34,8 @@ var a: array(i32, Negate(1)); // CHECK:STDOUT: %ImplicitAs.facet.f7f: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet.f7f [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn.b6f: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn.b6f [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %int_-1.251: %i32 = int_value -1 [concrete] // CHECK:STDOUT: %impl_witness.023: = impl_witness (imports.%Core.import_ref.85c), @impl.971(%int_32) [concrete] @@ -43,7 +44,8 @@ var a: array(i32, Negate(1)); // CHECK:STDOUT: %ImplicitAs.facet.e25: %ImplicitAs.type.2fd = facet_value %i32, %impl_witness.023 [concrete] // CHECK:STDOUT: %.10e: type = fn_type_with_self_type %Convert.type.71e, %ImplicitAs.facet.e25 [concrete] // CHECK:STDOUT: %Convert.bound.75d: = bound_method %int_-1.251, %Convert.960 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.4af: = specific_function %Convert.bound.75d, @Convert.3(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn.8a8: = specific_function %Convert.960, @Convert.3(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.245: = bound_method %int_-1.251, %Convert.specific_fn.8a8 [concrete] // CHECK:STDOUT: %int_-1.638: Core.IntLiteral = int_value -1 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -91,18 +93,20 @@ var a: array(i32, Negate(1)); // CHECK:STDOUT: %Negate.ref: %Negate.type.15b = name_ref Negate, %Negate.decl [concrete = constants.%Negate] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0.loc17_26: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc17_26: = bound_method %int_1, %impl.elem0.loc17_26 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc17_26: = specific_function %bound_method.loc17_26, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc17_26: init %i32 = call %specific_fn.loc17_26(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc17_26.1: = bound_method %int_1, %impl.elem0.loc17_26 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc17_26: = specific_function %impl.elem0.loc17_26, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b6f] +// CHECK:STDOUT: %bound_method.loc17_26.2: = bound_method %int_1, %specific_fn.loc17_26 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc17_26: init %i32 = call %bound_method.loc17_26.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc17_26.1: %i32 = value_of_initializer %int.convert_checked.loc17_26 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc17_26.2: %i32 = converted %int_1, %.loc17_26.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %int.snegate: init %i32 = call %Negate.ref(%.loc17_26.2) [concrete = constants.%int_-1.251] // CHECK:STDOUT: %impl.elem0.loc17_27: %.10e = impl_witness_access constants.%impl_witness.023, element0 [concrete = constants.%Convert.960] -// CHECK:STDOUT: %bound_method.loc17_27: = bound_method %int.snegate, %impl.elem0.loc17_27 [concrete = constants.%Convert.bound.75d] -// CHECK:STDOUT: %specific_fn.loc17_27: = specific_function %bound_method.loc17_27, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn.4af] +// CHECK:STDOUT: %bound_method.loc17_27.1: = bound_method %int.snegate, %impl.elem0.loc17_27 [concrete = constants.%Convert.bound.75d] +// CHECK:STDOUT: %specific_fn.loc17_27: = specific_function %impl.elem0.loc17_27, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn.8a8] +// CHECK:STDOUT: %bound_method.loc17_27.2: = bound_method %int.snegate, %specific_fn.loc17_27 [concrete = constants.%bound_method.245] // CHECK:STDOUT: %.loc17_27.1: %i32 = value_of_initializer %int.snegate [concrete = constants.%int_-1.251] // CHECK:STDOUT: %.loc17_27.2: %i32 = converted %int.snegate, %.loc17_27.1 [concrete = constants.%int_-1.251] -// CHECK:STDOUT: %int.convert_checked.loc17_27: init Core.IntLiteral = call %specific_fn.loc17_27(%.loc17_27.2) [concrete = constants.%int_-1.638] +// CHECK:STDOUT: %int.convert_checked.loc17_27: init Core.IntLiteral = call %bound_method.loc17_27.2(%.loc17_27.2) [concrete = constants.%int_-1.638] // CHECK:STDOUT: %.loc17_27.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc17_27 [concrete = constants.%int_-1.638] // CHECK:STDOUT: %.loc17_27.4: Core.IntLiteral = converted %int.snegate, %.loc17_27.3 [concrete = constants.%int_-1.638] // CHECK:STDOUT: %array_type: type = array_type %.loc17_27.4, %i32 [concrete = ] diff --git a/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon b/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon index 6e346d737bbd..a73c8cddda43 100644 --- a/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon +++ b/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon @@ -34,13 +34,14 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %Convert.bound.b30: = bound_method %int_3.1ba, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.b42: = specific_function %Convert.bound.b30, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.047: = bound_method %int_3.1ba, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_1.5d2, %int_2.ef8, %int_3.822) [concrete] // CHECK:STDOUT: %struct_type.index: type = struct_type {.index: Core.IntLiteral} [concrete] @@ -95,24 +96,27 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: %.loc11_32.1: %tuple.type = tuple_literal (%int_1.loc11_25, %int_2.loc11_28, %int_3.loc11) // CHECK:STDOUT: %impl.elem0.loc11_32.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc11_32.1: = bound_method %int_1.loc11_25, %impl.elem0.loc11_32.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc11_32.1: = specific_function %bound_method.loc11_32.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc11_32.1: init %i32 = call %specific_fn.loc11_32.1(%int_1.loc11_25) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc11_32.1: = specific_function %impl.elem0.loc11_32.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_32.2: = bound_method %int_1.loc11_25, %specific_fn.loc11_32.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc11_32.1: init %i32 = call %bound_method.loc11_32.2(%int_1.loc11_25) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_32.2: init %i32 = converted %int_1.loc11_25, %int.convert_checked.loc11_32.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc11_32.3: ref %i32 = array_index file.%a.var, %int_0 // CHECK:STDOUT: %.loc11_32.4: init %i32 = initialize_from %.loc11_32.2 to %.loc11_32.3 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc11_32.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11_32.2: = bound_method %int_2.loc11_28, %impl.elem0.loc11_32.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc11_32.2: = specific_function %bound_method.loc11_32.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc11_32.2: init %i32 = call %specific_fn.loc11_32.2(%int_2.loc11_28) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc11_32.3: = bound_method %int_2.loc11_28, %impl.elem0.loc11_32.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc11_32.2: = specific_function %impl.elem0.loc11_32.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_32.4: = bound_method %int_2.loc11_28, %specific_fn.loc11_32.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc11_32.2: init %i32 = call %bound_method.loc11_32.4(%int_2.loc11_28) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc11_32.5: init %i32 = converted %int_2.loc11_28, %int.convert_checked.loc11_32.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %int_1.loc11_32: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc11_32.6: ref %i32 = array_index file.%a.var, %int_1.loc11_32 // CHECK:STDOUT: %.loc11_32.7: init %i32 = initialize_from %.loc11_32.5 to %.loc11_32.6 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %impl.elem0.loc11_32.3: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11_32.3: = bound_method %int_3.loc11, %impl.elem0.loc11_32.3 [concrete = constants.%Convert.bound.b30] -// CHECK:STDOUT: %specific_fn.loc11_32.3: = specific_function %bound_method.loc11_32.3, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc11_32.3: init %i32 = call %specific_fn.loc11_32.3(%int_3.loc11) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %bound_method.loc11_32.5: = bound_method %int_3.loc11, %impl.elem0.loc11_32.3 [concrete = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc11_32.3: = specific_function %impl.elem0.loc11_32.3, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_32.6: = bound_method %int_3.loc11, %specific_fn.loc11_32.3 [concrete = constants.%bound_method.047] +// CHECK:STDOUT: %int.convert_checked.loc11_32.3: init %i32 = call %bound_method.loc11_32.6(%int_3.loc11) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc11_32.8: init %i32 = converted %int_3.loc11, %int.convert_checked.loc11_32.3 [concrete = constants.%int_3.822] // CHECK:STDOUT: %int_2.loc11_32: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %.loc11_32.9: ref %i32 = array_index file.%a.var, %int_2.loc11_32 @@ -129,9 +133,10 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0.loc16: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc16: = bound_method %.loc16_28.1, %impl.elem0.loc16 [concrete = constants.%Convert.bound.b30] -// CHECK:STDOUT: %specific_fn.loc16: = specific_function %bound_method.loc16, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %specific_fn.loc16(%.loc16_28.1) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %bound_method.loc16_28.1: = bound_method %.loc16_28.1, %impl.elem0.loc16 [concrete = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc16: = specific_function %impl.elem0.loc16, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc16_28.2: = bound_method %.loc16_28.1, %specific_fn.loc16 [concrete = constants.%bound_method.047] +// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %bound_method.loc16_28.2(%.loc16_28.1) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc16_28.2: %i32 = value_of_initializer %int.convert_checked.loc16 [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc16_28.3: %i32 = converted %.loc16_28.1, %.loc16_28.2 [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc16_34.1: ref %i32 = array_index %a.ref, %.loc16_28.3 [concrete = ] diff --git a/toolchain/check/testdata/array/fail_type_mismatch.carbon b/toolchain/check/testdata/array/fail_type_mismatch.carbon index 0448d55c7ef0..c4427a957906 100644 --- a/toolchain/check/testdata/array/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/array/fail_type_mismatch.carbon @@ -60,7 +60,8 @@ var d: array(i32, 3) = t2; // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %tuple.type.ff9: type = tuple_type (type, type, type) [concrete] // CHECK:STDOUT: %tuple.type.9e7: type = tuple_type (%i32, String, String) [concrete] @@ -173,9 +174,10 @@ var d: array(i32, 3) = t2; // CHECK:STDOUT: %str.loc18_37: String = string_literal "World" [concrete = constants.%str.abb] // CHECK:STDOUT: %.loc18_44.1: %tuple.type.b0f = tuple_literal (%int_1.loc18, %str.loc18_28, %str.loc18_37) // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_1.loc18, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1.loc18) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc18_44.1: = bound_method %int_1.loc18, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc18_44.2: = bound_method %int_1.loc18, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc18_44.2(%int_1.loc18) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc18_44.2: init %i32 = converted %int_1.loc18, %int.convert_checked [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %int_0.loc18: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc18_44.3: ref %i32 = array_index file.%a.var, %int_0.loc18 diff --git a/toolchain/check/testdata/array/function_param.carbon b/toolchain/check/testdata/array/function_param.carbon index a784d724e0f4..c3d6c5d9ac34 100644 --- a/toolchain/check/testdata/array/function_param.carbon +++ b/toolchain/check/testdata/array/function_param.carbon @@ -39,13 +39,14 @@ fn G() -> i32 { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %Convert.bound.b30: = bound_method %int_3.1ba, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.b42: = specific_function %Convert.bound.b30, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.047: = bound_method %int_3.1ba, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_1.5d2, %int_2.ef8, %int_3.822) [concrete] // CHECK:STDOUT: } @@ -126,25 +127,28 @@ fn G() -> i32 { // CHECK:STDOUT: %int_1.loc16_23: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0.loc16_20.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc16_20.1: = bound_method %int_1.loc16_13, %impl.elem0.loc16_20.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc16_20.1: = specific_function %bound_method.loc16_20.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc16_20.1: init %i32 = call %specific_fn.loc16_20.1(%int_1.loc16_13) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc16_20.1: = specific_function %impl.elem0.loc16_20.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc16_20.2: = bound_method %int_1.loc16_13, %specific_fn.loc16_20.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc16_20.1: init %i32 = call %bound_method.loc16_20.2(%int_1.loc16_13) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc16_20.2: init %i32 = converted %int_1.loc16_13, %int.convert_checked.loc16_20.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc16_20.3: ref %array_type = temporary_storage // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc16_20.4: ref %i32 = array_index %.loc16_20.3, %int_0 // CHECK:STDOUT: %.loc16_20.5: init %i32 = initialize_from %.loc16_20.2 to %.loc16_20.4 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc16_20.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc16_20.2: = bound_method %int_2.loc16_16, %impl.elem0.loc16_20.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc16_20.2: = specific_function %bound_method.loc16_20.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc16_20.2: init %i32 = call %specific_fn.loc16_20.2(%int_2.loc16_16) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc16_20.3: = bound_method %int_2.loc16_16, %impl.elem0.loc16_20.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc16_20.2: = specific_function %impl.elem0.loc16_20.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc16_20.4: = bound_method %int_2.loc16_16, %specific_fn.loc16_20.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc16_20.2: init %i32 = call %bound_method.loc16_20.4(%int_2.loc16_16) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc16_20.6: init %i32 = converted %int_2.loc16_16, %int.convert_checked.loc16_20.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %int_1.loc16_20: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc16_20.7: ref %i32 = array_index %.loc16_20.3, %int_1.loc16_20 // CHECK:STDOUT: %.loc16_20.8: init %i32 = initialize_from %.loc16_20.6 to %.loc16_20.7 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %impl.elem0.loc16_20.3: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc16_20.3: = bound_method %int_3, %impl.elem0.loc16_20.3 [concrete = constants.%Convert.bound.b30] -// CHECK:STDOUT: %specific_fn.loc16_20.3: = specific_function %bound_method.loc16_20.3, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc16_20.3: init %i32 = call %specific_fn.loc16_20.3(%int_3) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %bound_method.loc16_20.5: = bound_method %int_3, %impl.elem0.loc16_20.3 [concrete = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc16_20.3: = specific_function %impl.elem0.loc16_20.3, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc16_20.6: = bound_method %int_3, %specific_fn.loc16_20.3 [concrete = constants.%bound_method.047] +// CHECK:STDOUT: %int.convert_checked.loc16_20.3: init %i32 = call %bound_method.loc16_20.6(%int_3) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc16_20.9: init %i32 = converted %int_3, %int.convert_checked.loc16_20.3 [concrete = constants.%int_3.822] // CHECK:STDOUT: %int_2.loc16_20: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %.loc16_20.10: ref %i32 = array_index %.loc16_20.3, %int_2.loc16_20 @@ -154,9 +158,10 @@ fn G() -> i32 { // CHECK:STDOUT: %.loc16_20.14: ref %array_type = temporary %.loc16_20.3, %.loc16_20.13 // CHECK:STDOUT: %.loc16_20.15: %array_type = bind_value %.loc16_20.14 // CHECK:STDOUT: %impl.elem0.loc16_23: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc16_23: = bound_method %int_1.loc16_23, %impl.elem0.loc16_23 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc16_23: = specific_function %bound_method.loc16_23, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc16_23: init %i32 = call %specific_fn.loc16_23(%int_1.loc16_23) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc16_23.1: = bound_method %int_1.loc16_23, %impl.elem0.loc16_23 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc16_23: = specific_function %impl.elem0.loc16_23, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc16_23.2: = bound_method %int_1.loc16_23, %specific_fn.loc16_23 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc16_23: init %i32 = call %bound_method.loc16_23.2(%int_1.loc16_23) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc16_23.1: %i32 = value_of_initializer %int.convert_checked.loc16_23 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc16_23.2: %i32 = converted %int_1.loc16_23, %.loc16_23.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %F.call: init %i32 = call %F.ref(%.loc16_20.15, %.loc16_23.2) diff --git a/toolchain/check/testdata/array/index_not_literal.carbon b/toolchain/check/testdata/array/index_not_literal.carbon index 437889ffa303..b2940ba3e9dd 100644 --- a/toolchain/check/testdata/array/index_not_literal.carbon +++ b/toolchain/check/testdata/array/index_not_literal.carbon @@ -30,13 +30,14 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %Convert.bound.b30: = bound_method %int_3.1ba, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.b42: = specific_function %Convert.bound.b30, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.047: = bound_method %int_3.1ba, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_1.5d2, %int_2.ef8, %int_3.822) [concrete] // CHECK:STDOUT: %struct_type.index: type = struct_type {.index: Core.IntLiteral} [concrete] @@ -91,24 +92,27 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: %.loc11_32.1: %tuple.type = tuple_literal (%int_1.loc11_25, %int_2.loc11_28, %int_3) // CHECK:STDOUT: %impl.elem0.loc11_32.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc11_32.1: = bound_method %int_1.loc11_25, %impl.elem0.loc11_32.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc11_32.1: = specific_function %bound_method.loc11_32.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc11_32.1: init %i32 = call %specific_fn.loc11_32.1(%int_1.loc11_25) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc11_32.1: = specific_function %impl.elem0.loc11_32.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_32.2: = bound_method %int_1.loc11_25, %specific_fn.loc11_32.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc11_32.1: init %i32 = call %bound_method.loc11_32.2(%int_1.loc11_25) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_32.2: init %i32 = converted %int_1.loc11_25, %int.convert_checked.loc11_32.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc11_32.3: ref %i32 = array_index file.%a.var, %int_0 // CHECK:STDOUT: %.loc11_32.4: init %i32 = initialize_from %.loc11_32.2 to %.loc11_32.3 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc11_32.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11_32.2: = bound_method %int_2.loc11_28, %impl.elem0.loc11_32.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc11_32.2: = specific_function %bound_method.loc11_32.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc11_32.2: init %i32 = call %specific_fn.loc11_32.2(%int_2.loc11_28) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc11_32.3: = bound_method %int_2.loc11_28, %impl.elem0.loc11_32.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc11_32.2: = specific_function %impl.elem0.loc11_32.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_32.4: = bound_method %int_2.loc11_28, %specific_fn.loc11_32.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc11_32.2: init %i32 = call %bound_method.loc11_32.4(%int_2.loc11_28) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc11_32.5: init %i32 = converted %int_2.loc11_28, %int.convert_checked.loc11_32.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %int_1.loc11_32: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc11_32.6: ref %i32 = array_index file.%a.var, %int_1.loc11_32 // CHECK:STDOUT: %.loc11_32.7: init %i32 = initialize_from %.loc11_32.5 to %.loc11_32.6 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %impl.elem0.loc11_32.3: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11_32.3: = bound_method %int_3, %impl.elem0.loc11_32.3 [concrete = constants.%Convert.bound.b30] -// CHECK:STDOUT: %specific_fn.loc11_32.3: = specific_function %bound_method.loc11_32.3, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc11_32.3: init %i32 = call %specific_fn.loc11_32.3(%int_3) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %bound_method.loc11_32.5: = bound_method %int_3, %impl.elem0.loc11_32.3 [concrete = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc11_32.3: = specific_function %impl.elem0.loc11_32.3, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_32.6: = bound_method %int_3, %specific_fn.loc11_32.3 [concrete = constants.%bound_method.047] +// CHECK:STDOUT: %int.convert_checked.loc11_32.3: init %i32 = call %bound_method.loc11_32.6(%int_3) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc11_32.8: init %i32 = converted %int_3, %int.convert_checked.loc11_32.3 [concrete = constants.%int_3.822] // CHECK:STDOUT: %int_2.loc11_32: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %.loc11_32.9: ref %i32 = array_index file.%a.var, %int_2.loc11_32 @@ -125,9 +129,10 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0.loc12: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc12: = bound_method %.loc12_28.1, %impl.elem0.loc12 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc12: = specific_function %bound_method.loc12, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %specific_fn.loc12(%.loc12_28.1) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc12_28.1: = bound_method %.loc12_28.1, %impl.elem0.loc12 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc12: = specific_function %impl.elem0.loc12, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_28.2: = bound_method %.loc12_28.1, %specific_fn.loc12 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %bound_method.loc12_28.2(%.loc12_28.1) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc12_28.2: %i32 = value_of_initializer %int.convert_checked.loc12 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc12_28.3: %i32 = converted %.loc12_28.1, %.loc12_28.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc12_34.1: ref %i32 = array_index %a.ref, %.loc12_28.3 diff --git a/toolchain/check/testdata/array/init_dependent_bound.carbon b/toolchain/check/testdata/array/init_dependent_bound.carbon index 3f76672792a3..ea4e243f5bc9 100644 --- a/toolchain/check/testdata/array/init_dependent_bound.carbon +++ b/toolchain/check/testdata/array/init_dependent_bound.carbon @@ -52,10 +52,11 @@ fn H() { G(3); } // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.2fd = facet_value %i32, %impl_witness.023 [concrete] // CHECK:STDOUT: %.10e: type = fn_type_with_self_type %Convert.type.71e, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %N.51e, %Convert.960 [symbolic] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.3(%int_32) [symbolic] -// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn(%N.51e) [symbolic] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.960, @Convert.3(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %N.51e, %Convert.specific_fn [symbolic] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %bound_method(%N.51e) [symbolic] // CHECK:STDOUT: %array_type: type = array_type %int.convert_checked, %i32 [symbolic] -// CHECK:STDOUT: %require_complete.9dc: = require_complete_type %array_type [symbolic] +// CHECK:STDOUT: %require_complete.7cb: = require_complete_type %array_type [symbolic] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete] @@ -94,10 +95,10 @@ fn H() { G(3); } // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Convert.bound: = bound_method %N.loc4_6.2, constants.%Convert.960 [symbolic = %Convert.bound (constants.%Convert.bound)] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn (constants.%Convert.specific_fn)] -// CHECK:STDOUT: %int.convert_checked.loc9_23.2: init Core.IntLiteral = call %Convert.specific_fn(%N.loc4_6.2) [symbolic = %int.convert_checked.loc9_23.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %bound_method.loc9_23.3: = bound_method %N.loc4_6.2, constants.%Convert.specific_fn [symbolic = %bound_method.loc9_23.3 (constants.%bound_method)] +// CHECK:STDOUT: %int.convert_checked.loc9_23.2: init Core.IntLiteral = call %bound_method.loc9_23.3(%N.loc4_6.2) [symbolic = %int.convert_checked.loc9_23.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %array_type.loc9_24.2: type = array_type %int.convert_checked.loc9_23.2, %i32 [symbolic = %array_type.loc9_24.2 (constants.%array_type)] -// CHECK:STDOUT: %require_complete: = require_complete_type @F.%array_type.loc9_24.2 (%array_type) [symbolic = %require_complete (constants.%require_complete.9dc)] +// CHECK:STDOUT: %require_complete: = require_complete_type @F.%array_type.loc9_24.2 (%array_type) [symbolic = %require_complete (constants.%require_complete.7cb)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%N.patt.loc4_6.1: %i32) { // CHECK:STDOUT: !entry: @@ -116,9 +117,10 @@ fn H() { G(3); } // CHECK:STDOUT: %i32.loc9: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc4_6.1 [symbolic = %N.loc4_6.2 (constants.%N.51e)] // CHECK:STDOUT: %impl.elem0: %.10e = impl_witness_access constants.%impl_witness.023, element0 [concrete = constants.%Convert.960] -// CHECK:STDOUT: %bound_method: = bound_method %N.ref, %impl.elem0 [symbolic = %Convert.bound (constants.%Convert.bound)] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn (constants.%Convert.specific_fn)] -// CHECK:STDOUT: %int.convert_checked.loc9_23.1: init Core.IntLiteral = call %specific_fn(%N.ref) [symbolic = %int.convert_checked.loc9_23.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %bound_method.loc9_23.1: = bound_method %N.ref, %impl.elem0 [symbolic = %Convert.bound (constants.%Convert.bound)] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_23.2: = bound_method %N.ref, %specific_fn [symbolic = %bound_method.loc9_23.3 (constants.%bound_method)] +// CHECK:STDOUT: %int.convert_checked.loc9_23.1: init Core.IntLiteral = call %bound_method.loc9_23.2(%N.ref) [symbolic = %int.convert_checked.loc9_23.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc9_23.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc9_23.1 [symbolic = %int.convert_checked.loc9_23.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc9_23.2: Core.IntLiteral = converted %N.ref, %.loc9_23.1 [symbolic = %int.convert_checked.loc9_23.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %array_type.loc9_24.1: type = array_type %.loc9_23.2, %i32 [symbolic = %array_type.loc9_24.2 (constants.%array_type)] @@ -151,10 +153,11 @@ fn H() { G(3); } // CHECK:STDOUT: %ImplicitAs.facet.e25: %ImplicitAs.type.2fd = facet_value %i32, %impl_witness.023 [concrete] // CHECK:STDOUT: %.10e: type = fn_type_with_self_type %Convert.type.71e, %ImplicitAs.facet.e25 [concrete] // CHECK:STDOUT: %Convert.bound.588: = bound_method %N.51e, %Convert.960 [template] -// CHECK:STDOUT: %Convert.specific_fn.18b: = specific_function %Convert.bound.588, @Convert.3(%int_32) [template] -// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn.18b(%N.51e) [template] -// CHECK:STDOUT: %array_type.b04: type = array_type %int.convert_checked, %i32 [template] -// CHECK:STDOUT: %require_complete.9dc: = require_complete_type %array_type.b04 [template] +// CHECK:STDOUT: %Convert.specific_fn.8a8: = specific_function %Convert.960, @Convert.3(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.f9c: = bound_method %N.51e, %Convert.specific_fn.8a8 [template] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %bound_method.f9c(%N.51e) [template] +// CHECK:STDOUT: %array_type.c7c: type = array_type %int.convert_checked, %i32 [template] +// CHECK:STDOUT: %require_complete.7cb: = require_complete_type %array_type.c7c [template] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete] @@ -169,11 +172,12 @@ fn H() { G(3); } // CHECK:STDOUT: %ImplicitAs.facet.f7f: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet.f7f [concrete] // CHECK:STDOUT: %Convert.bound.b30: = bound_method %int_3.1ba, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.b42: = specific_function %Convert.bound.b30, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn.b6f: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.047: = bound_method %int_3.1ba, %Convert.specific_fn.b6f [concrete] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %G.specific_fn: = specific_function %G, @G(%int_3.822) [concrete] // CHECK:STDOUT: %Convert.bound.2d6: = bound_method %int_3.822, %Convert.960 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.377: = specific_function %Convert.bound.2d6, @Convert.3(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.c6f: = bound_method %int_3.822, %Convert.specific_fn.8a8 [concrete] // CHECK:STDOUT: %array_type.3fb: type = array_type %int_3.1ba, %i32 [concrete] // CHECK:STDOUT: %complete_type.cbf: = complete_type_witness %array_type.3fb [concrete] // CHECK:STDOUT: } @@ -212,36 +216,37 @@ fn H() { G(3); } // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Convert.bound: = bound_method %N.loc5_15.2, constants.%Convert.960 [template = %Convert.bound (constants.%Convert.bound.588)] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.3(constants.%int_32) [template = %Convert.specific_fn (constants.%Convert.specific_fn.18b)] -// CHECK:STDOUT: %int.convert_checked.loc10_23.2: init Core.IntLiteral = call %Convert.specific_fn(%N.loc5_15.2) [template = %int.convert_checked.loc10_23.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %array_type.loc10_24.2: type = array_type %int.convert_checked.loc10_23.2, %i32 [template = %array_type.loc10_24.2 (constants.%array_type.b04)] -// CHECK:STDOUT: %require_complete: = require_complete_type @G.%array_type.loc10_24.2 (%array_type.b04) [template = %require_complete (constants.%require_complete.9dc)] +// CHECK:STDOUT: %bound_method.loc10_23.3: = bound_method %N.loc5_15.2, constants.%Convert.specific_fn.8a8 [template = %bound_method.loc10_23.3 (constants.%bound_method.f9c)] +// CHECK:STDOUT: %int.convert_checked.loc10_23.2: init Core.IntLiteral = call %bound_method.loc10_23.3(%N.loc5_15.2) [template = %int.convert_checked.loc10_23.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %array_type.loc10_24.2: type = array_type %int.convert_checked.loc10_23.2, %i32 [template = %array_type.loc10_24.2 (constants.%array_type.c7c)] +// CHECK:STDOUT: %require_complete: = require_complete_type @G.%array_type.loc10_24.2 (%array_type.c7c) [template = %require_complete (constants.%require_complete.7cb)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%N.patt.loc5_15.1: %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %arr.patt: @G.%array_type.loc10_24.2 (%array_type.b04) = binding_pattern arr -// CHECK:STDOUT: %.loc10_3: @G.%array_type.loc10_24.2 (%array_type.b04) = var_pattern %arr.patt +// CHECK:STDOUT: %arr.patt: @G.%array_type.loc10_24.2 (%array_type.c7c) = binding_pattern arr +// CHECK:STDOUT: %.loc10_3: @G.%array_type.loc10_24.2 (%array_type.c7c) = var_pattern %arr.patt // CHECK:STDOUT: } -// CHECK:STDOUT: %arr.var: ref @G.%array_type.loc10_24.2 (%array_type.b04) = var arr +// CHECK:STDOUT: %arr.var: ref @G.%array_type.loc10_24.2 (%array_type.c7c) = var arr // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %.loc10_36: %tuple.type = tuple_literal (%int_1, %int_2, %int_3) // CHECK:STDOUT: assign %arr.var, -// CHECK:STDOUT: %.loc10_24: type = splice_block %array_type.loc10_24.1 [template = %array_type.loc10_24.2 (constants.%array_type.b04)] { +// CHECK:STDOUT: %.loc10_24: type = splice_block %array_type.loc10_24.1 [template = %array_type.loc10_24.2 (constants.%array_type.c7c)] { // CHECK:STDOUT: %int_32.loc10: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc10: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc5_15.1 [template = %N.loc5_15.2 (constants.%N.51e)] // CHECK:STDOUT: %impl.elem0: %.10e = impl_witness_access constants.%impl_witness.023, element0 [concrete = constants.%Convert.960] -// CHECK:STDOUT: %bound_method: = bound_method %N.ref, %impl.elem0 [template = %Convert.bound (constants.%Convert.bound.588)] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.3(constants.%int_32) [template = %Convert.specific_fn (constants.%Convert.specific_fn.18b)] -// CHECK:STDOUT: %int.convert_checked.loc10_23.1: init Core.IntLiteral = call %specific_fn(%N.ref) [template = %int.convert_checked.loc10_23.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %bound_method.loc10_23.1: = bound_method %N.ref, %impl.elem0 [template = %Convert.bound (constants.%Convert.bound.588)] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn.8a8] +// CHECK:STDOUT: %bound_method.loc10_23.2: = bound_method %N.ref, %specific_fn [template = %bound_method.loc10_23.3 (constants.%bound_method.f9c)] +// CHECK:STDOUT: %int.convert_checked.loc10_23.1: init Core.IntLiteral = call %bound_method.loc10_23.2(%N.ref) [template = %int.convert_checked.loc10_23.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc10_23.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc10_23.1 [template = %int.convert_checked.loc10_23.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc10_23.2: Core.IntLiteral = converted %N.ref, %.loc10_23.1 [template = %int.convert_checked.loc10_23.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %array_type.loc10_24.1: type = array_type %.loc10_23.2, %i32 [template = %array_type.loc10_24.2 (constants.%array_type.b04)] +// CHECK:STDOUT: %array_type.loc10_24.1: type = array_type %.loc10_23.2, %i32 [template = %array_type.loc10_24.2 (constants.%array_type.c7c)] // CHECK:STDOUT: } -// CHECK:STDOUT: %arr: ref @G.%array_type.loc10_24.2 (%array_type.b04) = bind_name arr, %arr.var +// CHECK:STDOUT: %arr: ref @G.%array_type.loc10_24.2 (%array_type.c7c) = bind_name arr, %arr.var // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -251,9 +256,10 @@ fn H() { G(3); } // CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [concrete = constants.%G] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_3, %impl.elem0 [concrete = constants.%Convert.bound.b30] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_3) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %bound_method.loc13_13.1: = bound_method %int_3, %impl.elem0 [concrete = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b6f] +// CHECK:STDOUT: %bound_method.loc13_13.2: = bound_method %int_3, %specific_fn [concrete = constants.%bound_method.047] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc13_13.2(%int_3) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc13_13.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc13_13.2: %i32 = converted %int_3, %.loc13_13.1 [concrete = constants.%int_3.822] // CHECK:STDOUT: %G.specific_fn: = specific_function %G.ref, @G(constants.%int_3.822) [concrete = constants.%G.specific_fn] @@ -272,7 +278,7 @@ fn H() { G(3); } // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Convert.bound => constants.%Convert.bound.2d6 -// CHECK:STDOUT: %Convert.specific_fn => constants.%Convert.specific_fn.377 +// CHECK:STDOUT: %bound_method.loc10_23.3 => constants.%bound_method.c6f // CHECK:STDOUT: %int.convert_checked.loc10_23.2 => constants.%int_3.1ba // CHECK:STDOUT: %array_type.loc10_24.2 => constants.%array_type.3fb // CHECK:STDOUT: %require_complete => constants.%complete_type.cbf diff --git a/toolchain/check/testdata/array/nine_elements.carbon b/toolchain/check/testdata/array/nine_elements.carbon index 5b5e6e2de1de..c181b3595fa3 100644 --- a/toolchain/check/testdata/array/nine_elements.carbon +++ b/toolchain/check/testdata/array/nine_elements.carbon @@ -35,31 +35,32 @@ var a: array(i32, 9) = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %Convert.bound.b30: = bound_method %int_3.1ba, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.b42: = specific_function %Convert.bound.b30, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.047: = bound_method %int_3.1ba, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %Convert.bound.ac3: = bound_method %int_4.0c1, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.450: = specific_function %Convert.bound.ac3, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.1da: = bound_method %int_4.0c1, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete] // CHECK:STDOUT: %Convert.bound.4e6: = bound_method %int_5.64b, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.ba9: = specific_function %Convert.bound.4e6, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.a25: = bound_method %int_5.64b, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_5.0f6: %i32 = int_value 5 [concrete] // CHECK:STDOUT: %Convert.bound.ce9: = bound_method %int_6.462, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.631: = specific_function %Convert.bound.ce9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.efa: = bound_method %int_6.462, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_6.e56: %i32 = int_value 6 [concrete] // CHECK:STDOUT: %Convert.bound.208: = bound_method %int_7.29f, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.c12: = specific_function %Convert.bound.208, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.3bd: = bound_method %int_7.29f, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_7.0b1: %i32 = int_value 7 [concrete] // CHECK:STDOUT: %Convert.bound.e09: = bound_method %int_8.b85, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.e0d: = specific_function %Convert.bound.e09, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.02d: = bound_method %int_8.b85, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_8.98c: %i32 = int_value 8 [concrete] // CHECK:STDOUT: %Convert.bound.9e2: = bound_method %int_9.988, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.b02: = specific_function %Convert.bound.9e2, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.cd3: = bound_method %int_9.988, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_9.f88: %i32 = int_value 9 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_1.5d2, %int_2.ef8, %int_3.822, %int_4.940, %int_5.0f6, %int_6.e56, %int_7.0b1, %int_8.98c, %int_9.f88) [concrete] // CHECK:STDOUT: } @@ -107,72 +108,81 @@ var a: array(i32, 9) = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %.loc11_50.1: %tuple.type = tuple_literal (%int_1.loc11_25, %int_2.loc11_28, %int_3.loc11_31, %int_4.loc11_34, %int_5.loc11_37, %int_6.loc11_40, %int_7.loc11_43, %int_8.loc11_46, %int_9) // CHECK:STDOUT: %impl.elem0.loc11_50.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc11_50.1: = bound_method %int_1.loc11_25, %impl.elem0.loc11_50.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc11_50.1: = specific_function %bound_method.loc11_50.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc11_50.1: init %i32 = call %specific_fn.loc11_50.1(%int_1.loc11_25) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc11_50.1: = specific_function %impl.elem0.loc11_50.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_50.2: = bound_method %int_1.loc11_25, %specific_fn.loc11_50.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc11_50.1: init %i32 = call %bound_method.loc11_50.2(%int_1.loc11_25) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_50.2: init %i32 = converted %int_1.loc11_25, %int.convert_checked.loc11_50.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc11_50.3: ref %i32 = array_index file.%a.var, %int_0 // CHECK:STDOUT: %.loc11_50.4: init %i32 = initialize_from %.loc11_50.2 to %.loc11_50.3 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc11_50.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11_50.2: = bound_method %int_2.loc11_28, %impl.elem0.loc11_50.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc11_50.2: = specific_function %bound_method.loc11_50.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc11_50.2: init %i32 = call %specific_fn.loc11_50.2(%int_2.loc11_28) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc11_50.3: = bound_method %int_2.loc11_28, %impl.elem0.loc11_50.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc11_50.2: = specific_function %impl.elem0.loc11_50.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_50.4: = bound_method %int_2.loc11_28, %specific_fn.loc11_50.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc11_50.2: init %i32 = call %bound_method.loc11_50.4(%int_2.loc11_28) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc11_50.5: init %i32 = converted %int_2.loc11_28, %int.convert_checked.loc11_50.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %int_1.loc11_50: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc11_50.6: ref %i32 = array_index file.%a.var, %int_1.loc11_50 // CHECK:STDOUT: %.loc11_50.7: init %i32 = initialize_from %.loc11_50.5 to %.loc11_50.6 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %impl.elem0.loc11_50.3: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11_50.3: = bound_method %int_3.loc11_31, %impl.elem0.loc11_50.3 [concrete = constants.%Convert.bound.b30] -// CHECK:STDOUT: %specific_fn.loc11_50.3: = specific_function %bound_method.loc11_50.3, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc11_50.3: init %i32 = call %specific_fn.loc11_50.3(%int_3.loc11_31) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %bound_method.loc11_50.5: = bound_method %int_3.loc11_31, %impl.elem0.loc11_50.3 [concrete = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc11_50.3: = specific_function %impl.elem0.loc11_50.3, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_50.6: = bound_method %int_3.loc11_31, %specific_fn.loc11_50.3 [concrete = constants.%bound_method.047] +// CHECK:STDOUT: %int.convert_checked.loc11_50.3: init %i32 = call %bound_method.loc11_50.6(%int_3.loc11_31) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc11_50.8: init %i32 = converted %int_3.loc11_31, %int.convert_checked.loc11_50.3 [concrete = constants.%int_3.822] // CHECK:STDOUT: %int_2.loc11_50: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %.loc11_50.9: ref %i32 = array_index file.%a.var, %int_2.loc11_50 // CHECK:STDOUT: %.loc11_50.10: init %i32 = initialize_from %.loc11_50.8 to %.loc11_50.9 [concrete = constants.%int_3.822] // CHECK:STDOUT: %impl.elem0.loc11_50.4: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11_50.4: = bound_method %int_4.loc11_34, %impl.elem0.loc11_50.4 [concrete = constants.%Convert.bound.ac3] -// CHECK:STDOUT: %specific_fn.loc11_50.4: = specific_function %bound_method.loc11_50.4, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.450] -// CHECK:STDOUT: %int.convert_checked.loc11_50.4: init %i32 = call %specific_fn.loc11_50.4(%int_4.loc11_34) [concrete = constants.%int_4.940] +// CHECK:STDOUT: %bound_method.loc11_50.7: = bound_method %int_4.loc11_34, %impl.elem0.loc11_50.4 [concrete = constants.%Convert.bound.ac3] +// CHECK:STDOUT: %specific_fn.loc11_50.4: = specific_function %impl.elem0.loc11_50.4, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_50.8: = bound_method %int_4.loc11_34, %specific_fn.loc11_50.4 [concrete = constants.%bound_method.1da] +// CHECK:STDOUT: %int.convert_checked.loc11_50.4: init %i32 = call %bound_method.loc11_50.8(%int_4.loc11_34) [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc11_50.11: init %i32 = converted %int_4.loc11_34, %int.convert_checked.loc11_50.4 [concrete = constants.%int_4.940] // CHECK:STDOUT: %int_3.loc11_50: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %.loc11_50.12: ref %i32 = array_index file.%a.var, %int_3.loc11_50 // CHECK:STDOUT: %.loc11_50.13: init %i32 = initialize_from %.loc11_50.11 to %.loc11_50.12 [concrete = constants.%int_4.940] // CHECK:STDOUT: %impl.elem0.loc11_50.5: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11_50.5: = bound_method %int_5.loc11_37, %impl.elem0.loc11_50.5 [concrete = constants.%Convert.bound.4e6] -// CHECK:STDOUT: %specific_fn.loc11_50.5: = specific_function %bound_method.loc11_50.5, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.ba9] -// CHECK:STDOUT: %int.convert_checked.loc11_50.5: init %i32 = call %specific_fn.loc11_50.5(%int_5.loc11_37) [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %bound_method.loc11_50.9: = bound_method %int_5.loc11_37, %impl.elem0.loc11_50.5 [concrete = constants.%Convert.bound.4e6] +// CHECK:STDOUT: %specific_fn.loc11_50.5: = specific_function %impl.elem0.loc11_50.5, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_50.10: = bound_method %int_5.loc11_37, %specific_fn.loc11_50.5 [concrete = constants.%bound_method.a25] +// CHECK:STDOUT: %int.convert_checked.loc11_50.5: init %i32 = call %bound_method.loc11_50.10(%int_5.loc11_37) [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc11_50.14: init %i32 = converted %int_5.loc11_37, %int.convert_checked.loc11_50.5 [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %int_4.loc11_50: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1] // CHECK:STDOUT: %.loc11_50.15: ref %i32 = array_index file.%a.var, %int_4.loc11_50 // CHECK:STDOUT: %.loc11_50.16: init %i32 = initialize_from %.loc11_50.14 to %.loc11_50.15 [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %impl.elem0.loc11_50.6: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11_50.6: = bound_method %int_6.loc11_40, %impl.elem0.loc11_50.6 [concrete = constants.%Convert.bound.ce9] -// CHECK:STDOUT: %specific_fn.loc11_50.6: = specific_function %bound_method.loc11_50.6, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.631] -// CHECK:STDOUT: %int.convert_checked.loc11_50.6: init %i32 = call %specific_fn.loc11_50.6(%int_6.loc11_40) [concrete = constants.%int_6.e56] +// CHECK:STDOUT: %bound_method.loc11_50.11: = bound_method %int_6.loc11_40, %impl.elem0.loc11_50.6 [concrete = constants.%Convert.bound.ce9] +// CHECK:STDOUT: %specific_fn.loc11_50.6: = specific_function %impl.elem0.loc11_50.6, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_50.12: = bound_method %int_6.loc11_40, %specific_fn.loc11_50.6 [concrete = constants.%bound_method.efa] +// CHECK:STDOUT: %int.convert_checked.loc11_50.6: init %i32 = call %bound_method.loc11_50.12(%int_6.loc11_40) [concrete = constants.%int_6.e56] // CHECK:STDOUT: %.loc11_50.17: init %i32 = converted %int_6.loc11_40, %int.convert_checked.loc11_50.6 [concrete = constants.%int_6.e56] // CHECK:STDOUT: %int_5.loc11_50: Core.IntLiteral = int_value 5 [concrete = constants.%int_5.64b] // CHECK:STDOUT: %.loc11_50.18: ref %i32 = array_index file.%a.var, %int_5.loc11_50 // CHECK:STDOUT: %.loc11_50.19: init %i32 = initialize_from %.loc11_50.17 to %.loc11_50.18 [concrete = constants.%int_6.e56] // CHECK:STDOUT: %impl.elem0.loc11_50.7: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11_50.7: = bound_method %int_7.loc11_43, %impl.elem0.loc11_50.7 [concrete = constants.%Convert.bound.208] -// CHECK:STDOUT: %specific_fn.loc11_50.7: = specific_function %bound_method.loc11_50.7, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.c12] -// CHECK:STDOUT: %int.convert_checked.loc11_50.7: init %i32 = call %specific_fn.loc11_50.7(%int_7.loc11_43) [concrete = constants.%int_7.0b1] +// CHECK:STDOUT: %bound_method.loc11_50.13: = bound_method %int_7.loc11_43, %impl.elem0.loc11_50.7 [concrete = constants.%Convert.bound.208] +// CHECK:STDOUT: %specific_fn.loc11_50.7: = specific_function %impl.elem0.loc11_50.7, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_50.14: = bound_method %int_7.loc11_43, %specific_fn.loc11_50.7 [concrete = constants.%bound_method.3bd] +// CHECK:STDOUT: %int.convert_checked.loc11_50.7: init %i32 = call %bound_method.loc11_50.14(%int_7.loc11_43) [concrete = constants.%int_7.0b1] // CHECK:STDOUT: %.loc11_50.20: init %i32 = converted %int_7.loc11_43, %int.convert_checked.loc11_50.7 [concrete = constants.%int_7.0b1] // CHECK:STDOUT: %int_6.loc11_50: Core.IntLiteral = int_value 6 [concrete = constants.%int_6.462] // CHECK:STDOUT: %.loc11_50.21: ref %i32 = array_index file.%a.var, %int_6.loc11_50 // CHECK:STDOUT: %.loc11_50.22: init %i32 = initialize_from %.loc11_50.20 to %.loc11_50.21 [concrete = constants.%int_7.0b1] // CHECK:STDOUT: %impl.elem0.loc11_50.8: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11_50.8: = bound_method %int_8.loc11_46, %impl.elem0.loc11_50.8 [concrete = constants.%Convert.bound.e09] -// CHECK:STDOUT: %specific_fn.loc11_50.8: = specific_function %bound_method.loc11_50.8, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.e0d] -// CHECK:STDOUT: %int.convert_checked.loc11_50.8: init %i32 = call %specific_fn.loc11_50.8(%int_8.loc11_46) [concrete = constants.%int_8.98c] +// CHECK:STDOUT: %bound_method.loc11_50.15: = bound_method %int_8.loc11_46, %impl.elem0.loc11_50.8 [concrete = constants.%Convert.bound.e09] +// CHECK:STDOUT: %specific_fn.loc11_50.8: = specific_function %impl.elem0.loc11_50.8, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_50.16: = bound_method %int_8.loc11_46, %specific_fn.loc11_50.8 [concrete = constants.%bound_method.02d] +// CHECK:STDOUT: %int.convert_checked.loc11_50.8: init %i32 = call %bound_method.loc11_50.16(%int_8.loc11_46) [concrete = constants.%int_8.98c] // CHECK:STDOUT: %.loc11_50.23: init %i32 = converted %int_8.loc11_46, %int.convert_checked.loc11_50.8 [concrete = constants.%int_8.98c] // CHECK:STDOUT: %int_7.loc11_50: Core.IntLiteral = int_value 7 [concrete = constants.%int_7.29f] // CHECK:STDOUT: %.loc11_50.24: ref %i32 = array_index file.%a.var, %int_7.loc11_50 // CHECK:STDOUT: %.loc11_50.25: init %i32 = initialize_from %.loc11_50.23 to %.loc11_50.24 [concrete = constants.%int_8.98c] // CHECK:STDOUT: %impl.elem0.loc11_50.9: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11_50.9: = bound_method %int_9, %impl.elem0.loc11_50.9 [concrete = constants.%Convert.bound.9e2] -// CHECK:STDOUT: %specific_fn.loc11_50.9: = specific_function %bound_method.loc11_50.9, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b02] -// CHECK:STDOUT: %int.convert_checked.loc11_50.9: init %i32 = call %specific_fn.loc11_50.9(%int_9) [concrete = constants.%int_9.f88] +// CHECK:STDOUT: %bound_method.loc11_50.17: = bound_method %int_9, %impl.elem0.loc11_50.9 [concrete = constants.%Convert.bound.9e2] +// CHECK:STDOUT: %specific_fn.loc11_50.9: = specific_function %impl.elem0.loc11_50.9, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_50.18: = bound_method %int_9, %specific_fn.loc11_50.9 [concrete = constants.%bound_method.cd3] +// CHECK:STDOUT: %int.convert_checked.loc11_50.9: init %i32 = call %bound_method.loc11_50.18(%int_9) [concrete = constants.%int_9.f88] // CHECK:STDOUT: %.loc11_50.26: init %i32 = converted %int_9, %int.convert_checked.loc11_50.9 [concrete = constants.%int_9.f88] // CHECK:STDOUT: %int_8.loc11_50: Core.IntLiteral = int_value 8 [concrete = constants.%int_8.b85] // CHECK:STDOUT: %.loc11_50.27: ref %i32 = array_index file.%a.var, %int_8.loc11_50 diff --git a/toolchain/check/testdata/as/adapter_conversion.carbon b/toolchain/check/testdata/as/adapter_conversion.carbon index b2be1f2bedf3..1779aab51815 100644 --- a/toolchain/check/testdata/as/adapter_conversion.carbon +++ b/toolchain/check/testdata/as/adapter_conversion.carbon @@ -185,10 +185,11 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %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: type = class_type @B [concrete] @@ -300,15 +301,17 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %.loc9_27.1: %struct_type.x.y.4cf = struct_literal (%int_1, %int_2) // CHECK:STDOUT: %impl.elem0.loc9_27.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc9_27.1: = bound_method %int_1, %impl.elem0.loc9_27.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc9_27.1: = specific_function %bound_method.loc9_27.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc9_27.1: init %i32 = call %specific_fn.loc9_27.1(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc9_27.1: = specific_function %impl.elem0.loc9_27.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_27.2: = bound_method %int_1, %specific_fn.loc9_27.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc9_27.1: init %i32 = call %bound_method.loc9_27.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc9_27.2: init %i32 = converted %int_1, %int.convert_checked.loc9_27.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc9_27.3: ref %i32 = class_element_access %return, element0 // CHECK:STDOUT: %.loc9_27.4: init %i32 = initialize_from %.loc9_27.2 to %.loc9_27.3 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc9_27.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc9_27.2: = bound_method %int_2, %impl.elem0.loc9_27.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc9_27.2: = specific_function %bound_method.loc9_27.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc9_27.2: init %i32 = call %specific_fn.loc9_27.2(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc9_27.3: = bound_method %int_2, %impl.elem0.loc9_27.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc9_27.2: = specific_function %impl.elem0.loc9_27.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_27.4: = bound_method %int_2, %specific_fn.loc9_27.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc9_27.2: init %i32 = call %bound_method.loc9_27.4(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc9_27.5: init %i32 = converted %int_2, %int.convert_checked.loc9_27.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc9_27.6: ref %i32 = class_element_access %return, element1 // CHECK:STDOUT: %.loc9_27.7: init %i32 = initialize_from %.loc9_27.5 to %.loc9_27.6 [concrete = constants.%int_2.ef8] @@ -324,15 +327,17 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %.loc17_31.1: %struct_type.x.y.4cf = struct_literal (%int_1, %int_2) // CHECK:STDOUT: %impl.elem0.loc17_31.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc17_31.1: = bound_method %int_1, %impl.elem0.loc17_31.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc17_31.1: = specific_function %bound_method.loc17_31.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc17_31.1: init %i32 = call %specific_fn.loc17_31.1(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc17_31.1: = specific_function %impl.elem0.loc17_31.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc17_31.2: = bound_method %int_1, %specific_fn.loc17_31.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc17_31.1: init %i32 = call %bound_method.loc17_31.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc17_31.2: init %i32 = converted %int_1, %int.convert_checked.loc17_31.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc17_31.3: ref %i32 = class_element_access file.%a_ref.var, element0 // CHECK:STDOUT: %.loc17_31.4: init %i32 = initialize_from %.loc17_31.2 to %.loc17_31.3 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc17_31.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc17_31.2: = bound_method %int_2, %impl.elem0.loc17_31.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc17_31.2: = specific_function %bound_method.loc17_31.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc17_31.2: init %i32 = call %specific_fn.loc17_31.2(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc17_31.3: = bound_method %int_2, %impl.elem0.loc17_31.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc17_31.2: = specific_function %impl.elem0.loc17_31.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc17_31.4: = bound_method %int_2, %specific_fn.loc17_31.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc17_31.2: init %i32 = call %bound_method.loc17_31.4(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc17_31.5: init %i32 = converted %int_2, %int.convert_checked.loc17_31.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc17_31.6: ref %i32 = class_element_access file.%a_ref.var, element1 // CHECK:STDOUT: %.loc17_31.7: init %i32 = initialize_from %.loc17_31.5 to %.loc17_31.6 [concrete = constants.%int_2.ef8] @@ -377,7 +382,8 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %As.facet: %As.type.fd4 = facet_value Core.IntLiteral, %impl_witness.882 [concrete] // CHECK:STDOUT: %.214: type = fn_type_with_self_type %Convert.type.99b, %As.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.197 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.197, @Convert.5(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %int_1.e78: %A = int_value 1 [concrete] // CHECK:STDOUT: } @@ -432,9 +438,10 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0: %.214 = impl_witness_access constants.%impl_witness.882, element0 [concrete = constants.%Convert.197] -// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.5(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc8_15.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.5(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_15.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc8_15.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc8_15.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc8_15.2: %i32 = converted %int_1, %.loc8_15.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A] @@ -564,10 +571,11 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %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: } @@ -637,16 +645,18 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A] // CHECK:STDOUT: %impl.elem0.loc13_34.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc13_34.1: = bound_method %int_1, %impl.elem0.loc13_34.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc13_34.1: = specific_function %bound_method.loc13_34.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc13_34.1: init %i32 = call %specific_fn.loc13_34.1(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc13_34.1: = specific_function %impl.elem0.loc13_34.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_34.2: = bound_method %int_1, %specific_fn.loc13_34.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc13_34.1: init %i32 = call %bound_method.loc13_34.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_34.2: init %i32 = converted %int_1, %int.convert_checked.loc13_34.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_34.3: ref %A = temporary_storage // CHECK:STDOUT: %.loc13_34.4: ref %i32 = class_element_access %.loc13_34.3, element0 // CHECK:STDOUT: %.loc13_34.5: init %i32 = initialize_from %.loc13_34.2 to %.loc13_34.4 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc13_34.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc13_34.2: = bound_method %int_2, %impl.elem0.loc13_34.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc13_34.2: = specific_function %bound_method.loc13_34.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc13_34.2: init %i32 = call %specific_fn.loc13_34.2(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc13_34.3: = bound_method %int_2, %impl.elem0.loc13_34.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc13_34.2: = specific_function %impl.elem0.loc13_34.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_34.4: = bound_method %int_2, %specific_fn.loc13_34.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc13_34.2: init %i32 = call %bound_method.loc13_34.4(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_34.6: init %i32 = converted %int_2, %int.convert_checked.loc13_34.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_34.7: ref %i32 = class_element_access %.loc13_34.3, element1 // CHECK:STDOUT: %.loc13_34.8: init %i32 = initialize_from %.loc13_34.6 to %.loc13_34.7 [concrete = constants.%int_2.ef8] @@ -680,10 +690,11 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %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: } @@ -755,16 +766,18 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A] // CHECK:STDOUT: %impl.elem0.loc22_33.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc22_33.1: = bound_method %int_1, %impl.elem0.loc22_33.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc22_33.1: = specific_function %bound_method.loc22_33.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc22_33.1: init %i32 = call %specific_fn.loc22_33.1(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc22_33.1: = specific_function %impl.elem0.loc22_33.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc22_33.2: = bound_method %int_1, %specific_fn.loc22_33.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc22_33.1: init %i32 = call %bound_method.loc22_33.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc22_33.2: init %i32 = converted %int_1, %int.convert_checked.loc22_33.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc22_33.3: ref %A = temporary_storage // CHECK:STDOUT: %.loc22_33.4: ref %i32 = class_element_access %.loc22_33.3, element0 // CHECK:STDOUT: %.loc22_33.5: init %i32 = initialize_from %.loc22_33.2 to %.loc22_33.4 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc22_33.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc22_33.2: = bound_method %int_2, %impl.elem0.loc22_33.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc22_33.2: = specific_function %bound_method.loc22_33.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc22_33.2: init %i32 = call %specific_fn.loc22_33.2(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc22_33.3: = bound_method %int_2, %impl.elem0.loc22_33.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc22_33.2: = specific_function %impl.elem0.loc22_33.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc22_33.4: = bound_method %int_2, %specific_fn.loc22_33.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc22_33.2: init %i32 = call %bound_method.loc22_33.4(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc22_33.6: init %i32 = converted %int_2, %int.convert_checked.loc22_33.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc22_33.7: ref %i32 = class_element_access %.loc22_33.3, element1 // CHECK:STDOUT: %.loc22_33.8: init %i32 = initialize_from %.loc22_33.6 to %.loc22_33.7 [concrete = constants.%int_2.ef8] diff --git a/toolchain/check/testdata/as/basic.carbon b/toolchain/check/testdata/as/basic.carbon index ae94e075c0e3..27e9c5ce1e6b 100644 --- a/toolchain/check/testdata/as/basic.carbon +++ b/toolchain/check/testdata/as/basic.carbon @@ -28,7 +28,8 @@ fn Main() -> i32 { // CHECK:STDOUT: %As.facet: %As.type.fd4 = facet_value Core.IntLiteral, %impl_witness.882 [concrete] // CHECK:STDOUT: %.214: type = fn_type_with_self_type %Convert.type.99b, %As.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.197 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.197, @Convert.5(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -64,9 +65,10 @@ fn Main() -> i32 { // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0: %.214 = impl_witness_access constants.%impl_witness.882, element0 [concrete = constants.%Convert.197] -// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.5(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc12_12.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.5(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_12.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc12_12.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc12_12.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc12_12.2: %i32 = converted %int_1, %.loc12_12.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: return %.loc12_12.2 diff --git a/toolchain/check/testdata/as/overloaded.carbon b/toolchain/check/testdata/as/overloaded.carbon index 55d961e018d4..738329ef0328 100644 --- a/toolchain/check/testdata/as/overloaded.carbon +++ b/toolchain/check/testdata/as/overloaded.carbon @@ -52,7 +52,8 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %As.facet.5e2: %As.type.fd4 = facet_value Core.IntLiteral, %impl_witness.882 [concrete] // CHECK:STDOUT: %.214: type = fn_type_with_self_type %Convert.type.99b, %As.facet.5e2 [concrete] // CHECK:STDOUT: %Convert.bound.e80: = bound_method %int_4.0c1, %Convert.197 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound.e80, @Convert.7(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.197, @Convert.7(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_4.0c1, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete] // CHECK:STDOUT: %.b22: type = fn_type_with_self_type %Convert.type.35b, %As.facet.e45 [concrete] // CHECK:STDOUT: %Convert.bound.483: = bound_method %int_4.940, %Convert.311 [concrete] @@ -191,9 +192,10 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %int_32.loc23_21: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc23_21: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0.loc23_18: %.214 = impl_witness_access constants.%impl_witness.882, element0 [concrete = constants.%Convert.197] -// CHECK:STDOUT: %bound_method.loc23_18: = bound_method %int_4, %impl.elem0.loc23_18 [concrete = constants.%Convert.bound.e80] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method.loc23_18, @Convert.7(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_4) [concrete = constants.%int_4.940] +// CHECK:STDOUT: %bound_method.loc23_18.1: = bound_method %int_4, %impl.elem0.loc23_18 [concrete = constants.%Convert.bound.e80] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc23_18, @Convert.7(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc23_18.2: = bound_method %int_4, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc23_18.2(%int_4) [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc23_18.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc23_18.2: %i32 = converted %int_4, %.loc23_18.1 [concrete = constants.%int_4.940] // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X] diff --git a/toolchain/check/testdata/basics/builtin_types.carbon b/toolchain/check/testdata/basics/builtin_types.carbon index f705be2358ef..31514aa8768d 100644 --- a/toolchain/check/testdata/basics/builtin_types.carbon +++ b/toolchain/check/testdata/basics/builtin_types.carbon @@ -27,7 +27,8 @@ var test_type: type = i32; // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete] // CHECK:STDOUT: %Float.type: type = fn_type @Float [concrete] @@ -93,9 +94,10 @@ var test_type: type = i32; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc11_1.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_1.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc11_1.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc11: init %i32 = converted %int_0, %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: assign file.%test_i32.var, %.loc11 // CHECK:STDOUT: %float: f64 = float_literal 0.10000000000000001 [concrete = constants.%float] diff --git a/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon b/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon index ac7290fac8fa..2968321963da 100644 --- a/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon +++ b/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon @@ -52,11 +52,12 @@ let e: f64 = 5.0e39999999999999999993; // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.7ef: = bound_method %int_39999999999999999993.af6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.2ed: = specific_function %Convert.bound.7ef, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.75f: = bound_method %int_39999999999999999993.af6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_39999999999999999993.dee: %i32 = int_value 39999999999999999993 [concrete] // CHECK:STDOUT: %int_2147483648.1db: Core.IntLiteral = int_value 2147483648 [concrete] // CHECK:STDOUT: %Convert.bound.85f: = bound_method %int_2147483648.1db, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.387: = specific_function %Convert.bound.85f, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.f79: = bound_method %int_2147483648.1db, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2147483648.8df: %i32 = int_value 2147483648 [concrete] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete] // CHECK:STDOUT: %Float.type: type = fn_type @Float [concrete] @@ -91,9 +92,10 @@ let e: f64 = 5.0e39999999999999999993; // CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0.loc15: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc15: = bound_method @__global_init.%int_39999999999999999993, %impl.elem0.loc15 [concrete = constants.%Convert.bound.7ef] -// CHECK:STDOUT: %specific_fn.loc15: = specific_function %bound_method.loc15, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.2ed] -// CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %specific_fn.loc15(@__global_init.%int_39999999999999999993) [concrete = constants.%int_39999999999999999993.dee] +// CHECK:STDOUT: %bound_method.loc15_14.1: = bound_method @__global_init.%int_39999999999999999993, %impl.elem0.loc15 [concrete = constants.%Convert.bound.7ef] +// CHECK:STDOUT: %specific_fn.loc15: = specific_function %impl.elem0.loc15, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc15_14.2: = bound_method @__global_init.%int_39999999999999999993, %specific_fn.loc15 [concrete = constants.%bound_method.75f] +// CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %bound_method.loc15_14.2(@__global_init.%int_39999999999999999993) [concrete = constants.%int_39999999999999999993.dee] // CHECK:STDOUT: %.loc15_14.1: %i32 = value_of_initializer %int.convert_checked.loc15 [concrete = constants.%int_39999999999999999993.dee] // CHECK:STDOUT: %.loc15_14.2: %i32 = converted @__global_init.%int_39999999999999999993, %.loc15_14.1 [concrete = constants.%int_39999999999999999993.dee] // CHECK:STDOUT: %a: %i32 = bind_name a, %.loc15_14.2 @@ -105,9 +107,10 @@ let e: f64 = 5.0e39999999999999999993; // CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0.loc21: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc21: = bound_method @__global_init.%int_2147483648.loc21, %impl.elem0.loc21 [concrete = constants.%Convert.bound.85f] -// CHECK:STDOUT: %specific_fn.loc21: = specific_function %bound_method.loc21, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.387] -// CHECK:STDOUT: %int.convert_checked.loc21: init %i32 = call %specific_fn.loc21(@__global_init.%int_2147483648.loc21) [concrete = constants.%int_2147483648.8df] +// CHECK:STDOUT: %bound_method.loc21_14.1: = bound_method @__global_init.%int_2147483648.loc21, %impl.elem0.loc21 [concrete = constants.%Convert.bound.85f] +// CHECK:STDOUT: %specific_fn.loc21: = specific_function %impl.elem0.loc21, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc21_14.2: = bound_method @__global_init.%int_2147483648.loc21, %specific_fn.loc21 [concrete = constants.%bound_method.f79] +// CHECK:STDOUT: %int.convert_checked.loc21: init %i32 = call %bound_method.loc21_14.2(@__global_init.%int_2147483648.loc21) [concrete = constants.%int_2147483648.8df] // CHECK:STDOUT: %.loc21_14.1: %i32 = value_of_initializer %int.convert_checked.loc21 [concrete = constants.%int_2147483648.8df] // CHECK:STDOUT: %.loc21_14.2: %i32 = converted @__global_init.%int_2147483648.loc21, %.loc21_14.1 [concrete = constants.%int_2147483648.8df] // CHECK:STDOUT: %b: %i32 = bind_name b, %.loc21_14.2 @@ -119,9 +122,10 @@ let e: f64 = 5.0e39999999999999999993; // CHECK:STDOUT: %i32.loc27: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0.loc27: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc27: = bound_method @__global_init.%int_2147483648.loc27, %impl.elem0.loc27 [concrete = constants.%Convert.bound.85f] -// CHECK:STDOUT: %specific_fn.loc27: = specific_function %bound_method.loc27, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.387] -// CHECK:STDOUT: %int.convert_checked.loc27: init %i32 = call %specific_fn.loc27(@__global_init.%int_2147483648.loc27) [concrete = constants.%int_2147483648.8df] +// CHECK:STDOUT: %bound_method.loc27_14.1: = bound_method @__global_init.%int_2147483648.loc27, %impl.elem0.loc27 [concrete = constants.%Convert.bound.85f] +// CHECK:STDOUT: %specific_fn.loc27: = specific_function %impl.elem0.loc27, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc27_14.2: = bound_method @__global_init.%int_2147483648.loc27, %specific_fn.loc27 [concrete = constants.%bound_method.f79] +// CHECK:STDOUT: %int.convert_checked.loc27: init %i32 = call %bound_method.loc27_14.2(@__global_init.%int_2147483648.loc27) [concrete = constants.%int_2147483648.8df] // CHECK:STDOUT: %.loc27_14.1: %i32 = value_of_initializer %int.convert_checked.loc27 [concrete = constants.%int_2147483648.8df] // CHECK:STDOUT: %.loc27_14.2: %i32 = converted @__global_init.%int_2147483648.loc27, %.loc27_14.1 [concrete = constants.%int_2147483648.8df] // CHECK:STDOUT: %c: %i32 = bind_name c, %.loc27_14.2 diff --git a/toolchain/check/testdata/basics/numeric_literals.carbon b/toolchain/check/testdata/basics/numeric_literals.carbon index f8f449f43a6a..fa41ab2bff99 100644 --- a/toolchain/check/testdata/basics/numeric_literals.carbon +++ b/toolchain/check/testdata/basics/numeric_literals.carbon @@ -51,17 +51,18 @@ fn F() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.e09: = bound_method %int_8.b85, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.e0d: = specific_function %Convert.bound.e09, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.02d: = bound_method %int_8.b85, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_8.98c: %i32 = int_value 8 [concrete] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.9e2: = bound_method %int_9.988, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.b02: = specific_function %Convert.bound.9e2, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.cd3: = bound_method %int_9.988, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_9.f88: %i32 = int_value 9 [concrete] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete] // CHECK:STDOUT: %Convert.bound.f38: = bound_method %int_2147483647.d89, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.221: = specific_function %Convert.bound.f38, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.8e1: = bound_method %int_2147483647.d89, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2147483647.a74: %i32 = int_value 2147483647 [concrete] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete] // CHECK:STDOUT: %array.ae2: %array_type.d49 = tuple_value (%int_8.98c, %int_9.f88, %int_8.98c, %int_8.98c, %int_2147483647.a74, %int_2147483647.a74) [concrete] @@ -114,48 +115,54 @@ fn F() { // CHECK:STDOUT: %.loc21_3.1: %tuple.type.27c = tuple_literal (%int_8.loc15, %int_9, %int_8.loc17, %int_8.loc18, %int_2147483647.loc19, %int_2147483647.loc20) // CHECK:STDOUT: %impl.elem0.loc21_3.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc21_3.1: = bound_method %int_8.loc15, %impl.elem0.loc21_3.1 [concrete = constants.%Convert.bound.e09] -// CHECK:STDOUT: %specific_fn.loc21_3.1: = specific_function %bound_method.loc21_3.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.e0d] -// CHECK:STDOUT: %int.convert_checked.loc21_3.1: init %i32 = call %specific_fn.loc21_3.1(%int_8.loc15) [concrete = constants.%int_8.98c] +// CHECK:STDOUT: %specific_fn.loc21_3.1: = specific_function %impl.elem0.loc21_3.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc21_3.2: = bound_method %int_8.loc15, %specific_fn.loc21_3.1 [concrete = constants.%bound_method.02d] +// CHECK:STDOUT: %int.convert_checked.loc21_3.1: init %i32 = call %bound_method.loc21_3.2(%int_8.loc15) [concrete = constants.%int_8.98c] // CHECK:STDOUT: %.loc21_3.2: init %i32 = converted %int_8.loc15, %int.convert_checked.loc21_3.1 [concrete = constants.%int_8.98c] // CHECK:STDOUT: %int_0.loc21: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc21_3.3: ref %i32 = array_index %ints.var, %int_0.loc21 // CHECK:STDOUT: %.loc21_3.4: init %i32 = initialize_from %.loc21_3.2 to %.loc21_3.3 [concrete = constants.%int_8.98c] // CHECK:STDOUT: %impl.elem0.loc21_3.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc21_3.2: = bound_method %int_9, %impl.elem0.loc21_3.2 [concrete = constants.%Convert.bound.9e2] -// CHECK:STDOUT: %specific_fn.loc21_3.2: = specific_function %bound_method.loc21_3.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b02] -// CHECK:STDOUT: %int.convert_checked.loc21_3.2: init %i32 = call %specific_fn.loc21_3.2(%int_9) [concrete = constants.%int_9.f88] +// CHECK:STDOUT: %bound_method.loc21_3.3: = bound_method %int_9, %impl.elem0.loc21_3.2 [concrete = constants.%Convert.bound.9e2] +// CHECK:STDOUT: %specific_fn.loc21_3.2: = specific_function %impl.elem0.loc21_3.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc21_3.4: = bound_method %int_9, %specific_fn.loc21_3.2 [concrete = constants.%bound_method.cd3] +// CHECK:STDOUT: %int.convert_checked.loc21_3.2: init %i32 = call %bound_method.loc21_3.4(%int_9) [concrete = constants.%int_9.f88] // CHECK:STDOUT: %.loc21_3.5: init %i32 = converted %int_9, %int.convert_checked.loc21_3.2 [concrete = constants.%int_9.f88] // CHECK:STDOUT: %int_1.loc21: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] // CHECK:STDOUT: %.loc21_3.6: ref %i32 = array_index %ints.var, %int_1.loc21 // CHECK:STDOUT: %.loc21_3.7: init %i32 = initialize_from %.loc21_3.5 to %.loc21_3.6 [concrete = constants.%int_9.f88] // CHECK:STDOUT: %impl.elem0.loc21_3.3: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc21_3.3: = bound_method %int_8.loc17, %impl.elem0.loc21_3.3 [concrete = constants.%Convert.bound.e09] -// CHECK:STDOUT: %specific_fn.loc21_3.3: = specific_function %bound_method.loc21_3.3, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.e0d] -// CHECK:STDOUT: %int.convert_checked.loc21_3.3: init %i32 = call %specific_fn.loc21_3.3(%int_8.loc17) [concrete = constants.%int_8.98c] +// CHECK:STDOUT: %bound_method.loc21_3.5: = bound_method %int_8.loc17, %impl.elem0.loc21_3.3 [concrete = constants.%Convert.bound.e09] +// CHECK:STDOUT: %specific_fn.loc21_3.3: = specific_function %impl.elem0.loc21_3.3, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc21_3.6: = bound_method %int_8.loc17, %specific_fn.loc21_3.3 [concrete = constants.%bound_method.02d] +// CHECK:STDOUT: %int.convert_checked.loc21_3.3: init %i32 = call %bound_method.loc21_3.6(%int_8.loc17) [concrete = constants.%int_8.98c] // CHECK:STDOUT: %.loc21_3.8: init %i32 = converted %int_8.loc17, %int.convert_checked.loc21_3.3 [concrete = constants.%int_8.98c] // CHECK:STDOUT: %int_2.loc21: Core.IntLiteral = int_value 2 [concrete = constants.%int_2] // CHECK:STDOUT: %.loc21_3.9: ref %i32 = array_index %ints.var, %int_2.loc21 // CHECK:STDOUT: %.loc21_3.10: init %i32 = initialize_from %.loc21_3.8 to %.loc21_3.9 [concrete = constants.%int_8.98c] // CHECK:STDOUT: %impl.elem0.loc21_3.4: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc21_3.4: = bound_method %int_8.loc18, %impl.elem0.loc21_3.4 [concrete = constants.%Convert.bound.e09] -// CHECK:STDOUT: %specific_fn.loc21_3.4: = specific_function %bound_method.loc21_3.4, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.e0d] -// CHECK:STDOUT: %int.convert_checked.loc21_3.4: init %i32 = call %specific_fn.loc21_3.4(%int_8.loc18) [concrete = constants.%int_8.98c] +// CHECK:STDOUT: %bound_method.loc21_3.7: = bound_method %int_8.loc18, %impl.elem0.loc21_3.4 [concrete = constants.%Convert.bound.e09] +// CHECK:STDOUT: %specific_fn.loc21_3.4: = specific_function %impl.elem0.loc21_3.4, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc21_3.8: = bound_method %int_8.loc18, %specific_fn.loc21_3.4 [concrete = constants.%bound_method.02d] +// CHECK:STDOUT: %int.convert_checked.loc21_3.4: init %i32 = call %bound_method.loc21_3.8(%int_8.loc18) [concrete = constants.%int_8.98c] // CHECK:STDOUT: %.loc21_3.11: init %i32 = converted %int_8.loc18, %int.convert_checked.loc21_3.4 [concrete = constants.%int_8.98c] // CHECK:STDOUT: %int_3.loc21: Core.IntLiteral = int_value 3 [concrete = constants.%int_3] // CHECK:STDOUT: %.loc21_3.12: ref %i32 = array_index %ints.var, %int_3.loc21 // CHECK:STDOUT: %.loc21_3.13: init %i32 = initialize_from %.loc21_3.11 to %.loc21_3.12 [concrete = constants.%int_8.98c] // CHECK:STDOUT: %impl.elem0.loc21_3.5: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc21_3.5: = bound_method %int_2147483647.loc19, %impl.elem0.loc21_3.5 [concrete = constants.%Convert.bound.f38] -// CHECK:STDOUT: %specific_fn.loc21_3.5: = specific_function %bound_method.loc21_3.5, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.221] -// CHECK:STDOUT: %int.convert_checked.loc21_3.5: init %i32 = call %specific_fn.loc21_3.5(%int_2147483647.loc19) [concrete = constants.%int_2147483647.a74] +// CHECK:STDOUT: %bound_method.loc21_3.9: = bound_method %int_2147483647.loc19, %impl.elem0.loc21_3.5 [concrete = constants.%Convert.bound.f38] +// CHECK:STDOUT: %specific_fn.loc21_3.5: = specific_function %impl.elem0.loc21_3.5, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc21_3.10: = bound_method %int_2147483647.loc19, %specific_fn.loc21_3.5 [concrete = constants.%bound_method.8e1] +// CHECK:STDOUT: %int.convert_checked.loc21_3.5: init %i32 = call %bound_method.loc21_3.10(%int_2147483647.loc19) [concrete = constants.%int_2147483647.a74] // CHECK:STDOUT: %.loc21_3.14: init %i32 = converted %int_2147483647.loc19, %int.convert_checked.loc21_3.5 [concrete = constants.%int_2147483647.a74] // CHECK:STDOUT: %int_4.loc21: Core.IntLiteral = int_value 4 [concrete = constants.%int_4] // CHECK:STDOUT: %.loc21_3.15: ref %i32 = array_index %ints.var, %int_4.loc21 // CHECK:STDOUT: %.loc21_3.16: init %i32 = initialize_from %.loc21_3.14 to %.loc21_3.15 [concrete = constants.%int_2147483647.a74] // CHECK:STDOUT: %impl.elem0.loc21_3.6: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc21_3.6: = bound_method %int_2147483647.loc20, %impl.elem0.loc21_3.6 [concrete = constants.%Convert.bound.f38] -// CHECK:STDOUT: %specific_fn.loc21_3.6: = specific_function %bound_method.loc21_3.6, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.221] -// CHECK:STDOUT: %int.convert_checked.loc21_3.6: init %i32 = call %specific_fn.loc21_3.6(%int_2147483647.loc20) [concrete = constants.%int_2147483647.a74] +// CHECK:STDOUT: %bound_method.loc21_3.11: = bound_method %int_2147483647.loc20, %impl.elem0.loc21_3.6 [concrete = constants.%Convert.bound.f38] +// CHECK:STDOUT: %specific_fn.loc21_3.6: = specific_function %impl.elem0.loc21_3.6, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc21_3.12: = bound_method %int_2147483647.loc20, %specific_fn.loc21_3.6 [concrete = constants.%bound_method.8e1] +// CHECK:STDOUT: %int.convert_checked.loc21_3.6: init %i32 = call %bound_method.loc21_3.12(%int_2147483647.loc20) [concrete = constants.%int_2147483647.a74] // CHECK:STDOUT: %.loc21_3.17: init %i32 = converted %int_2147483647.loc20, %int.convert_checked.loc21_3.6 [concrete = constants.%int_2147483647.a74] // CHECK:STDOUT: %int_5.loc21: Core.IntLiteral = int_value 5 [concrete = constants.%int_5] // CHECK:STDOUT: %.loc21_3.18: ref %i32 = array_index %ints.var, %int_5.loc21 diff --git a/toolchain/check/testdata/basics/parens.carbon b/toolchain/check/testdata/basics/parens.carbon index 86ae9ca49816..7b470b07ea0f 100644 --- a/toolchain/check/testdata/basics/parens.carbon +++ b/toolchain/check/testdata/basics/parens.carbon @@ -25,11 +25,12 @@ var b: i32 = ((2)); // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -75,16 +76,18 @@ var b: i32 = ((2)); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0.loc11: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11: = bound_method %int_1, %impl.elem0.loc11 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc11: = specific_function %bound_method.loc11, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %specific_fn.loc11(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc11_1.1: = bound_method %int_1, %impl.elem0.loc11 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc11: = specific_function %impl.elem0.loc11, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_1.2: = bound_method %int_1, %specific_fn.loc11 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %bound_method.loc11_1.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11: init %i32 = converted %int_1, %int.convert_checked.loc11 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: assign file.%a.var, %.loc11 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %impl.elem0.loc12: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc12: = bound_method %int_2, %impl.elem0.loc12 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc12: = specific_function %bound_method.loc12, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %specific_fn.loc12(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc12_1.1: = bound_method %int_2, %impl.elem0.loc12 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc12: = specific_function %impl.elem0.loc12, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_1.2: = bound_method %int_2, %specific_fn.loc12 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %bound_method.loc12_1.2(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc12: init %i32 = converted %int_2, %int.convert_checked.loc12 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: assign file.%b.var, %.loc12 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/basics/run_i32.carbon b/toolchain/check/testdata/basics/run_i32.carbon index fb8bd4c67b1c..a97cf9326bb6 100644 --- a/toolchain/check/testdata/basics/run_i32.carbon +++ b/toolchain/check/testdata/basics/run_i32.carbon @@ -26,7 +26,8 @@ fn Run() -> i32 { return 0; } // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -62,9 +63,10 @@ fn Run() -> i32 { return 0; } // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc11_27.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_27.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc11_27.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc11_27.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc11_27.2: %i32 = converted %int_0, %.loc11_27.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: return %.loc11_27.2 diff --git a/toolchain/check/testdata/builtin_conversions/no_prelude/convert_facet_value_to_narrowed_facet_type.carbon b/toolchain/check/testdata/builtin_conversions/no_prelude/convert_facet_value_to_narrowed_facet_type.carbon index 0cabfd1574c4..d9bd8a07ac7c 100644 --- a/toolchain/check/testdata/builtin_conversions/no_prelude/convert_facet_value_to_narrowed_facet_type.carbon +++ b/toolchain/check/testdata/builtin_conversions/no_prelude/convert_facet_value_to_narrowed_facet_type.carbon @@ -339,7 +339,8 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) { // CHECK:STDOUT: %BitAnd.facet: %BitAnd.type = facet_value type, %impl_witness.3ea [concrete] // CHECK:STDOUT: %.d4d: type = fn_type_with_self_type %Op.type.27a, %BitAnd.facet [concrete] // CHECK:STDOUT: %Op.bound: = bound_method %Animal.type, %Op.444 [concrete] -// CHECK:STDOUT: %Op.specific_fn: = specific_function %Op.bound, @Op.2(type) [concrete] +// CHECK:STDOUT: %Op.specific_fn: = specific_function %Op.444, @Op.2(type) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %Animal.type, %Op.specific_fn [concrete] // CHECK:STDOUT: %facet_type: type = facet_type <@Eats & @Animal> [concrete] // CHECK:STDOUT: %U: %facet_type = bind_symbolic_name U, 0 [symbolic] // CHECK:STDOUT: %U.patt: %facet_type = symbolic_binding_pattern U, 0 [symbolic] @@ -404,9 +405,10 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) { // CHECK:STDOUT: %Animal.ref: type = name_ref Animal, file.%Animal.decl [concrete = constants.%Animal.type] // CHECK:STDOUT: %Eats.ref: type = name_ref Eats, file.%Eats.decl [concrete = constants.%Eats.type] // CHECK:STDOUT: %impl.elem0: %.d4d = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] -// CHECK:STDOUT: %bound_method: = bound_method %Animal.ref, %impl.elem0 [concrete = constants.%Op.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Op.2(type) [concrete = constants.%Op.specific_fn] -// CHECK:STDOUT: %type.and: init type = call %specific_fn(%Animal.ref, %Eats.ref) [concrete = constants.%facet_type] +// CHECK:STDOUT: %bound_method.loc10_28.1: = bound_method %Animal.ref, %impl.elem0 [concrete = constants.%Op.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Op.2(type) [concrete = constants.%Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_28.2: = bound_method %Animal.ref, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %type.and: init type = call %bound_method.loc10_28.2(%Animal.ref, %Eats.ref) [concrete = constants.%facet_type] // CHECK:STDOUT: %.loc10_28.2: type = value_of_initializer %type.and [concrete = constants.%facet_type] // CHECK:STDOUT: %.loc10_28.3: type = converted %type.and, %.loc10_28.2 [concrete = constants.%facet_type] // CHECK:STDOUT: } @@ -604,7 +606,8 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) { // CHECK:STDOUT: %BitAnd.facet: %BitAnd.type = facet_value type, %impl_witness.3ea [concrete] // CHECK:STDOUT: %.d4d: type = fn_type_with_self_type %Op.type.27a, %BitAnd.facet [concrete] // CHECK:STDOUT: %Op.bound.9f8: = bound_method %Tame.type, %Op.444 [concrete] -// CHECK:STDOUT: %Op.specific_fn.163: = specific_function %Op.bound.9f8, @Op.2(type) [concrete] +// CHECK:STDOUT: %Op.specific_fn: = specific_function %Op.444, @Op.2(type) [concrete] +// CHECK:STDOUT: %bound_method.a56: = bound_method %Tame.type, %Op.specific_fn [concrete] // CHECK:STDOUT: %facet_type.6ff: type = facet_type <@Eats & @Tame> [concrete] // CHECK:STDOUT: %V: %facet_type.6ff = bind_symbolic_name V, 0 [symbolic] // CHECK:STDOUT: %V.patt: %facet_type.6ff = symbolic_binding_pattern V, 0 [symbolic] @@ -613,10 +616,10 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) { // CHECK:STDOUT: %FeedTame: %FeedTame.type = struct_value () [concrete] // CHECK:STDOUT: %require_complete.940: = require_complete_type %V.as_type [symbolic] // CHECK:STDOUT: %Op.bound.d46: = bound_method %Eats.type, %Op.444 [concrete] -// CHECK:STDOUT: %Op.specific_fn.8e0: = specific_function %Op.bound.d46, @Op.2(type) [concrete] +// CHECK:STDOUT: %bound_method.f8f: = bound_method %Eats.type, %Op.specific_fn [concrete] // CHECK:STDOUT: %facet_type.c3f: type = facet_type <@Eats & @Animal> [concrete] // CHECK:STDOUT: %Op.bound.c0a: = bound_method %facet_type.c3f, %Op.444 [concrete] -// CHECK:STDOUT: %Op.specific_fn.394: = specific_function %Op.bound.c0a, @Op.2(type) [concrete] +// CHECK:STDOUT: %bound_method.7fc: = bound_method %facet_type.c3f, %Op.specific_fn [concrete] // CHECK:STDOUT: %facet_type.a95: type = facet_type <@Eats & @Animal & @Tame> [concrete] // CHECK:STDOUT: %W: %facet_type.a95 = bind_symbolic_name W, 0 [symbolic] // CHECK:STDOUT: %W.patt: %facet_type.a95 = symbolic_binding_pattern W, 0 [symbolic] @@ -668,9 +671,10 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) { // CHECK:STDOUT: %Tame.ref: type = name_ref Tame, file.%Tame.decl [concrete = constants.%Tame.type] // CHECK:STDOUT: %Eats.ref: type = name_ref Eats, file.%Eats.decl [concrete = constants.%Eats.type] // CHECK:STDOUT: %impl.elem0: %.d4d = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] -// CHECK:STDOUT: %bound_method: = bound_method %Tame.ref, %impl.elem0 [concrete = constants.%Op.bound.9f8] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Op.2(type) [concrete = constants.%Op.specific_fn.163] -// CHECK:STDOUT: %type.and: init type = call %specific_fn(%Tame.ref, %Eats.ref) [concrete = constants.%facet_type.6ff] +// CHECK:STDOUT: %bound_method.loc9_22.1: = bound_method %Tame.ref, %impl.elem0 [concrete = constants.%Op.bound.9f8] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Op.2(type) [concrete = constants.%Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_22.2: = bound_method %Tame.ref, %specific_fn [concrete = constants.%bound_method.a56] +// CHECK:STDOUT: %type.and: init type = call %bound_method.loc9_22.2(%Tame.ref, %Eats.ref) [concrete = constants.%facet_type.6ff] // CHECK:STDOUT: %.loc9_22.2: type = value_of_initializer %type.and [concrete = constants.%facet_type.6ff] // CHECK:STDOUT: %.loc9_22.3: type = converted %type.and, %.loc9_22.2 [concrete = constants.%facet_type.6ff] // CHECK:STDOUT: } @@ -692,16 +696,18 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) { // CHECK:STDOUT: %Eats.ref: type = name_ref Eats, file.%Eats.decl [concrete = constants.%Eats.type] // CHECK:STDOUT: %Animal.ref: type = name_ref Animal, file.%Animal.decl [concrete = constants.%Animal.type] // CHECK:STDOUT: %impl.elem0.loc11_30: %.d4d = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] -// CHECK:STDOUT: %bound_method.loc11_30: = bound_method %Eats.ref, %impl.elem0.loc11_30 [concrete = constants.%Op.bound.d46] -// CHECK:STDOUT: %specific_fn.loc11_30: = specific_function %bound_method.loc11_30, @Op.2(type) [concrete = constants.%Op.specific_fn.8e0] -// CHECK:STDOUT: %type.and.loc11_30: init type = call %specific_fn.loc11_30(%Eats.ref, %Animal.ref) [concrete = constants.%facet_type.c3f] +// CHECK:STDOUT: %bound_method.loc11_30.1: = bound_method %Eats.ref, %impl.elem0.loc11_30 [concrete = constants.%Op.bound.d46] +// CHECK:STDOUT: %specific_fn.loc11_30: = specific_function %impl.elem0.loc11_30, @Op.2(type) [concrete = constants.%Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_30.2: = bound_method %Eats.ref, %specific_fn.loc11_30 [concrete = constants.%bound_method.f8f] +// CHECK:STDOUT: %type.and.loc11_30: init type = call %bound_method.loc11_30.2(%Eats.ref, %Animal.ref) [concrete = constants.%facet_type.c3f] // CHECK:STDOUT: %Tame.ref: type = name_ref Tame, file.%Tame.decl [concrete = constants.%Tame.type] // CHECK:STDOUT: %impl.elem0.loc11_39: %.d4d = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] -// CHECK:STDOUT: %bound_method.loc11_39: = bound_method %type.and.loc11_30, %impl.elem0.loc11_39 [concrete = constants.%Op.bound.c0a] -// CHECK:STDOUT: %specific_fn.loc11_39: = specific_function %bound_method.loc11_39, @Op.2(type) [concrete = constants.%Op.specific_fn.394] +// CHECK:STDOUT: %bound_method.loc11_39.1: = bound_method %type.and.loc11_30, %impl.elem0.loc11_39 [concrete = constants.%Op.bound.c0a] +// CHECK:STDOUT: %specific_fn.loc11_39: = specific_function %impl.elem0.loc11_39, @Op.2(type) [concrete = constants.%Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_39.2: = bound_method %type.and.loc11_30, %specific_fn.loc11_39 [concrete = constants.%bound_method.7fc] // CHECK:STDOUT: %.loc11_30.1: type = value_of_initializer %type.and.loc11_30 [concrete = constants.%facet_type.c3f] // CHECK:STDOUT: %.loc11_30.2: type = converted %type.and.loc11_30, %.loc11_30.1 [concrete = constants.%facet_type.c3f] -// CHECK:STDOUT: %type.and.loc11_39: init type = call %specific_fn.loc11_39(%.loc11_30.2, %Tame.ref) [concrete = constants.%facet_type.a95] +// CHECK:STDOUT: %type.and.loc11_39: init type = call %bound_method.loc11_39.2(%.loc11_30.2, %Tame.ref) [concrete = constants.%facet_type.a95] // CHECK:STDOUT: %.loc11_39.2: type = value_of_initializer %type.and.loc11_39 [concrete = constants.%facet_type.a95] // CHECK:STDOUT: %.loc11_39.3: type = converted %type.and.loc11_39, %.loc11_39.2 [concrete = constants.%facet_type.a95] // CHECK:STDOUT: } @@ -912,7 +918,8 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) { // CHECK:STDOUT: %BitAnd.facet: %BitAnd.type = facet_value type, %impl_witness.3ea [concrete] // CHECK:STDOUT: %.d4d: type = fn_type_with_self_type %Op.type.27a, %BitAnd.facet [concrete] // CHECK:STDOUT: %Op.bound.9f8: = bound_method %Tame.type, %Op.444 [concrete] -// CHECK:STDOUT: %Op.specific_fn.163: = specific_function %Op.bound.9f8, @Op.2(type) [concrete] +// CHECK:STDOUT: %Op.specific_fn: = specific_function %Op.444, @Op.2(type) [concrete] +// CHECK:STDOUT: %bound_method.a56: = bound_method %Tame.type, %Op.specific_fn [concrete] // CHECK:STDOUT: %facet_type.6ff: type = facet_type <@Eats & @Tame> [concrete] // CHECK:STDOUT: %V: %facet_type.6ff = bind_symbolic_name V, 0 [symbolic] // CHECK:STDOUT: %V.patt: %facet_type.6ff = symbolic_binding_pattern V, 0 [symbolic] @@ -921,7 +928,7 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) { // CHECK:STDOUT: %FeedTame2: %FeedTame2.type = struct_value () [concrete] // CHECK:STDOUT: %require_complete.940: = require_complete_type %V.as_type [symbolic] // CHECK:STDOUT: %Op.bound.fe3: = bound_method %Animal.type, %Op.444 [concrete] -// CHECK:STDOUT: %Op.specific_fn.1fd: = specific_function %Op.bound.fe3, @Op.2(type) [concrete] +// CHECK:STDOUT: %bound_method.a26: = bound_method %Animal.type, %Op.specific_fn [concrete] // CHECK:STDOUT: %facet_type.65c: type = facet_type <@Animal & @Tame> [concrete] // CHECK:STDOUT: %W: %facet_type.65c = bind_symbolic_name W, 0 [symbolic] // CHECK:STDOUT: %W.patt: %facet_type.65c = symbolic_binding_pattern W, 0 [symbolic] @@ -1005,9 +1012,10 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) { // CHECK:STDOUT: %Tame.ref: type = name_ref Tame, file.%Tame.decl [concrete = constants.%Tame.type] // CHECK:STDOUT: %Eats.ref: type = name_ref Eats, file.%Eats.decl [concrete = constants.%Eats.type] // CHECK:STDOUT: %impl.elem0: %.d4d = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] -// CHECK:STDOUT: %bound_method: = bound_method %Tame.ref, %impl.elem0 [concrete = constants.%Op.bound.9f8] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Op.2(type) [concrete = constants.%Op.specific_fn.163] -// CHECK:STDOUT: %type.and: init type = call %specific_fn(%Tame.ref, %Eats.ref) [concrete = constants.%facet_type.6ff] +// CHECK:STDOUT: %bound_method.loc11_23.1: = bound_method %Tame.ref, %impl.elem0 [concrete = constants.%Op.bound.9f8] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Op.2(type) [concrete = constants.%Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_23.2: = bound_method %Tame.ref, %specific_fn [concrete = constants.%bound_method.a56] +// CHECK:STDOUT: %type.and: init type = call %bound_method.loc11_23.2(%Tame.ref, %Eats.ref) [concrete = constants.%facet_type.6ff] // CHECK:STDOUT: %.loc11_23.2: type = value_of_initializer %type.and [concrete = constants.%facet_type.6ff] // CHECK:STDOUT: %.loc11_23.3: type = converted %type.and, %.loc11_23.2 [concrete = constants.%facet_type.6ff] // CHECK:STDOUT: } @@ -1029,9 +1037,10 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) { // CHECK:STDOUT: %Animal.ref: type = name_ref Animal, file.%Animal.decl [concrete = constants.%Animal.type] // CHECK:STDOUT: %Tame.ref: type = name_ref Tame, file.%Tame.decl [concrete = constants.%Tame.type] // CHECK:STDOUT: %impl.elem0: %.d4d = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] -// CHECK:STDOUT: %bound_method: = bound_method %Animal.ref, %impl.elem0 [concrete = constants.%Op.bound.fe3] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Op.2(type) [concrete = constants.%Op.specific_fn.1fd] -// CHECK:STDOUT: %type.and: init type = call %specific_fn(%Animal.ref, %Tame.ref) [concrete = constants.%facet_type.65c] +// CHECK:STDOUT: %bound_method.loc13_33.1: = bound_method %Animal.ref, %impl.elem0 [concrete = constants.%Op.bound.fe3] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Op.2(type) [concrete = constants.%Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_33.2: = bound_method %Animal.ref, %specific_fn [concrete = constants.%bound_method.a26] +// CHECK:STDOUT: %type.and: init type = call %bound_method.loc13_33.2(%Animal.ref, %Tame.ref) [concrete = constants.%facet_type.65c] // CHECK:STDOUT: %.loc13_33.2: type = value_of_initializer %type.and [concrete = constants.%facet_type.65c] // CHECK:STDOUT: %.loc13_33.3: type = converted %type.and, %.loc13_33.2 [concrete = constants.%facet_type.65c] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/builtin_conversions/value_with_type_through_access.carbon b/toolchain/check/testdata/builtin_conversions/value_with_type_through_access.carbon index ad98f99b3703..120ca7cf0196 100644 --- a/toolchain/check/testdata/builtin_conversions/value_with_type_through_access.carbon +++ b/toolchain/check/testdata/builtin_conversions/value_with_type_through_access.carbon @@ -664,7 +664,8 @@ fn G() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] @@ -729,9 +730,10 @@ fn G() { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc12_48.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_48.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc12_48.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_48.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_48.2: %i32 = converted %int_0, %.loc12_48.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_49.1: ref %array_type = value_as_ref %T.ref.loc12_46 diff --git a/toolchain/check/testdata/builtins/float/make_type.carbon b/toolchain/check/testdata/builtins/float/make_type.carbon index 1655b6b13f9f..4634d26283fe 100644 --- a/toolchain/check/testdata/builtins/float/make_type.carbon +++ b/toolchain/check/testdata/builtins/float/make_type.carbon @@ -103,7 +103,8 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.9ba = facet_value Core.IntLiteral, %impl_witness.b97 [concrete] // CHECK:STDOUT: %.39b: type = fn_type_with_self_type %Convert.type.6da, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_64.fab, %Convert.16d [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.16d, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_64.fab, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_64.198: %i32 = int_value 64 [concrete] // CHECK:STDOUT: %float: f64 = float_literal 0 [concrete] // CHECK:STDOUT: %GetFloat.type: type = fn_type @GetFloat [concrete] @@ -138,9 +139,10 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %Float.ref: %Float.type = name_ref Float, imports.%Main.Float [concrete = constants.%Float] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete = constants.%int_64.fab] // CHECK:STDOUT: %impl.elem0: %.39b = impl_witness_access constants.%impl_witness.b97, element0 [concrete = constants.%Convert.16d] -// CHECK:STDOUT: %bound_method: = bound_method %int_64, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_64) [concrete = constants.%int_64.198] +// CHECK:STDOUT: %bound_method.loc6_14.1: = bound_method %int_64, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_14.2: = bound_method %int_64, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc6_14.2(%int_64) [concrete = constants.%int_64.198] // CHECK:STDOUT: %.loc6_14.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_64.198] // CHECK:STDOUT: %.loc6_14.2: %i32 = converted %int_64, %.loc6_14.1 [concrete = constants.%int_64.198] // CHECK:STDOUT: %float.make_type: init type = call %Float.ref(%.loc6_14.2) [concrete = f64] @@ -199,11 +201,12 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.9ba = facet_value Core.IntLiteral, %impl_witness.b97 [concrete] // CHECK:STDOUT: %.39b: type = fn_type_with_self_type %Convert.type.6da, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.cce: = bound_method %int_32.be0, %Convert.16d [concrete] -// CHECK:STDOUT: %Convert.specific_fn.23b: = specific_function %Convert.bound.cce, @Convert.2(%int_32.be0) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.16d, @Convert.2(%int_32.be0) [concrete] +// CHECK:STDOUT: %bound_method.480: = bound_method %int_32.be0, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_32.4de: %i32 = int_value 32 [concrete] // CHECK:STDOUT: %int_64.fab: Core.IntLiteral = int_value 64 [concrete] // CHECK:STDOUT: %Convert.bound.575: = bound_method %int_64.fab, %Convert.16d [concrete] -// CHECK:STDOUT: %Convert.specific_fn.bd8: = specific_function %Convert.bound.575, @Convert.2(%int_32.be0) [concrete] +// CHECK:STDOUT: %bound_method.767: = bound_method %int_64.fab, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_64.198: %i32 = int_value 64 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -236,9 +239,10 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %Float.ref.loc10: %Float.type = name_ref Float, imports.%Main.Float [concrete = constants.%Float] // CHECK:STDOUT: %int_32.loc10: Core.IntLiteral = int_value 32 [concrete = constants.%int_32.be0] // CHECK:STDOUT: %impl.elem0: %.39b = impl_witness_access constants.%impl_witness.b97, element0 [concrete = constants.%Convert.16d] -// CHECK:STDOUT: %bound_method: = bound_method %int_32.loc10, %impl.elem0 [concrete = constants.%Convert.bound.cce] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32.be0) [concrete = constants.%Convert.specific_fn.23b] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_32.loc10) [concrete = constants.%int_32.4de] +// CHECK:STDOUT: %bound_method.loc10_26.1: = bound_method %int_32.loc10, %impl.elem0 [concrete = constants.%Convert.bound.cce] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32.be0) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_26.2: = bound_method %int_32.loc10, %specific_fn [concrete = constants.%bound_method.480] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc10_26.2(%int_32.loc10) [concrete = constants.%int_32.4de] // CHECK:STDOUT: %.loc10_26.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_32.4de] // CHECK:STDOUT: %.loc10_26.2: %i32 = converted %int_32.loc10, %.loc10_26.1 [concrete = constants.%int_32.4de] // CHECK:STDOUT: %float.make_type.loc10: init type = call %Float.ref.loc10(%.loc10_26.2) [concrete = ] @@ -278,9 +282,10 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete = constants.%int_64.fab] // CHECK:STDOUT: %impl.elem0: %.39b = impl_witness_access constants.%impl_witness.b97, element0 [concrete = constants.%Convert.16d] -// CHECK:STDOUT: %bound_method: = bound_method %int_64, %impl.elem0 [concrete = constants.%Convert.bound.575] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32.be0) [concrete = constants.%Convert.specific_fn.bd8] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_64) [concrete = constants.%int_64.198] +// CHECK:STDOUT: %bound_method.loc12_1.1: = bound_method %int_64, %impl.elem0 [concrete = constants.%Convert.bound.575] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32.be0) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_1.2: = bound_method %int_64, %specific_fn [concrete = constants.%bound_method.767] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc12_1.2(%int_64) [concrete = constants.%int_64.198] // CHECK:STDOUT: %.loc12: init %i32 = converted %int_64, %int.convert_checked [concrete = constants.%int_64.198] // CHECK:STDOUT: assign file.%dyn_size.var, %.loc12 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/builtins/print/char.carbon b/toolchain/check/testdata/builtins/print/char.carbon index b8d295ef798b..0f9a5df364d1 100644 --- a/toolchain/check/testdata/builtins/print/char.carbon +++ b/toolchain/check/testdata/builtins/print/char.carbon @@ -35,13 +35,14 @@ fn Main() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %PrintChar.type.089: type = fn_type @PrintChar.2 [concrete] // CHECK:STDOUT: %PrintChar.d75: %PrintChar.type.089 = struct_value () [concrete] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -91,9 +92,10 @@ fn Main() { // CHECK:STDOUT: %PrintChar.ref.loc16: %PrintChar.type.c95 = name_ref PrintChar, file.%PrintChar.decl [concrete = constants.%PrintChar.843] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0.loc16: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc16: = bound_method %int_1, %impl.elem0.loc16 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc16: = specific_function %bound_method.loc16, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %specific_fn.loc16(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc16_13.1: = bound_method %int_1, %impl.elem0.loc16 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc16: = specific_function %impl.elem0.loc16, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc16_13.2: = bound_method %int_1, %specific_fn.loc16 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %bound_method.loc16_13.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc16_13.1: %i32 = value_of_initializer %int.convert_checked.loc16 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc16_13.2: %i32 = converted %int_1, %.loc16_13.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %print.char.loc16: init %i32 = call %PrintChar.ref.loc16(%.loc16_13.2) @@ -101,9 +103,10 @@ fn Main() { // CHECK:STDOUT: %PrintChar.ref.loc17: %PrintChar.type.089 = name_ref PrintChar, imports.%Core.PrintChar [concrete = constants.%PrintChar.d75] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %impl.elem0.loc17: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc17: = bound_method %int_2, %impl.elem0.loc17 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc17: = specific_function %bound_method.loc17, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %specific_fn.loc17(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc17_18.1: = bound_method %int_2, %impl.elem0.loc17 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc17: = specific_function %impl.elem0.loc17, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc17_18.2: = bound_method %int_2, %specific_fn.loc17 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %bound_method.loc17_18.2(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc17_18.1: %i32 = value_of_initializer %int.convert_checked.loc17 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc17_18.2: %i32 = converted %int_2, %.loc17_18.1 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %print.char.loc17: init %i32 = call %PrintChar.ref.loc17(%.loc17_18.2) diff --git a/toolchain/check/testdata/builtins/print/int.carbon b/toolchain/check/testdata/builtins/print/int.carbon index b7353685de6e..b9de361a4d63 100644 --- a/toolchain/check/testdata/builtins/print/int.carbon +++ b/toolchain/check/testdata/builtins/print/int.carbon @@ -37,13 +37,14 @@ fn Main() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Print.type.6ed: type = fn_type @Print.2 [concrete] // CHECK:STDOUT: %Print.723: %Print.type.6ed = struct_value () [concrete] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -87,9 +88,10 @@ fn Main() { // CHECK:STDOUT: %Print.ref.loc16: %Print.type.980 = name_ref Print, file.%Print.decl [concrete = constants.%Print.b7c] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0.loc16: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc16: = bound_method %int_1, %impl.elem0.loc16 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc16: = specific_function %bound_method.loc16, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %specific_fn.loc16(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc16_9.1: = bound_method %int_1, %impl.elem0.loc16 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc16: = specific_function %impl.elem0.loc16, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc16_9.2: = bound_method %int_1, %specific_fn.loc16 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %bound_method.loc16_9.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc16_9.1: %i32 = value_of_initializer %int.convert_checked.loc16 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc16_9.2: %i32 = converted %int_1, %.loc16_9.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %print.int.loc16: init %empty_tuple.type = call %Print.ref.loc16(%.loc16_9.2) @@ -97,9 +99,10 @@ fn Main() { // CHECK:STDOUT: %Print.ref.loc18: %Print.type.6ed = name_ref Print, imports.%Core.Print [concrete = constants.%Print.723] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %impl.elem0.loc18: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc18: = bound_method %int_2, %impl.elem0.loc18 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc18: = specific_function %bound_method.loc18, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %specific_fn.loc18(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc18_14.1: = bound_method %int_2, %impl.elem0.loc18 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc18: = specific_function %impl.elem0.loc18, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc18_14.2: = bound_method %int_2, %specific_fn.loc18 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %bound_method.loc18_14.2(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc18_14.1: %i32 = value_of_initializer %int.convert_checked.loc18 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc18_14.2: %i32 = converted %int_2, %.loc18_14.1 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %print.int.loc18: init %empty_tuple.type = call %Print.ref.loc18(%.loc18_14.2) diff --git a/toolchain/check/testdata/choice/basic.carbon b/toolchain/check/testdata/choice/basic.carbon index d9c18c9bcf5e..88a7a425c29e 100644 --- a/toolchain/check/testdata/choice/basic.carbon +++ b/toolchain/check/testdata/choice/basic.carbon @@ -171,21 +171,22 @@ fn G() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.54b = facet_value Core.IntLiteral, %impl_witness.f5e [concrete] // CHECK:STDOUT: %.89d: type = fn_type_with_self_type %Convert.type.f0e, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.5bb: = bound_method %int_0.5c6, %Convert.474 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.dd9: = specific_function %Convert.bound.5bb, @Convert.2(%int_2.ecc) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.474, @Convert.2(%int_2.ecc) [concrete] +// CHECK:STDOUT: %bound_method.d36: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.9fd: %u2 = int_value 0 [concrete] // CHECK:STDOUT: %Ordering.val.a29: %Ordering = struct_value (%int_0.9fd) [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.0dd: = bound_method %int_1.5b8, %Convert.474 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.95d: = specific_function %Convert.bound.0dd, @Convert.2(%int_2.ecc) [concrete] +// CHECK:STDOUT: %bound_method.6bf: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.b2c: %u2 = int_value 1 [concrete] // CHECK:STDOUT: %Ordering.val.927: %Ordering = struct_value (%int_1.b2c) [concrete] // CHECK:STDOUT: %Convert.bound.122: = bound_method %int_2.ecc, %Convert.474 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.190: = specific_function %Convert.bound.122, @Convert.2(%int_2.ecc) [concrete] +// CHECK:STDOUT: %bound_method.f7d: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.788: %u2 = int_value 2 [concrete] // CHECK:STDOUT: %Ordering.val.968: %Ordering = struct_value (%int_2.788) [concrete] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete] // CHECK:STDOUT: %Convert.bound.a5c: = bound_method %int_3.1ba, %Convert.474 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.9bc: = specific_function %Convert.bound.a5c, @Convert.2(%int_2.ecc) [concrete] +// CHECK:STDOUT: %bound_method.c7e: = bound_method %int_3.1ba, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.975: %u2 = int_value 3 [concrete] // CHECK:STDOUT: %Ordering.val.8a7: %Ordering = struct_value (%int_3.975) [concrete] // CHECK:STDOUT: %H.type: type = fn_type @H [concrete] @@ -218,9 +219,10 @@ fn G() { // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.discriminant [concrete = constants.%complete_type.de2] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0.loc4: %.89d = impl_witness_access constants.%impl_witness.f5e, element0 [concrete = constants.%Convert.474] -// CHECK:STDOUT: %bound_method.loc4: = bound_method %int_0, %impl.elem0.loc4 [concrete = constants.%Convert.bound.5bb] -// CHECK:STDOUT: %specific_fn.loc4: = specific_function %bound_method.loc4, @Convert.2(constants.%int_2.ecc) [concrete = constants.%Convert.specific_fn.dd9] -// CHECK:STDOUT: %int.convert_checked.loc4: init %u2 = call %specific_fn.loc4(%int_0) [concrete = constants.%int_0.9fd] +// CHECK:STDOUT: %bound_method.loc4_7.1: = bound_method %int_0, %impl.elem0.loc4 [concrete = constants.%Convert.bound.5bb] +// CHECK:STDOUT: %specific_fn.loc4: = specific_function %impl.elem0.loc4, @Convert.2(constants.%int_2.ecc) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc4_7.2: = bound_method %int_0, %specific_fn.loc4 [concrete = constants.%bound_method.d36] +// CHECK:STDOUT: %int.convert_checked.loc4: init %u2 = call %bound_method.loc4_7.2(%int_0) [concrete = constants.%int_0.9fd] // CHECK:STDOUT: %.loc4_7.1: %u2 = value_of_initializer %int.convert_checked.loc4 [concrete = constants.%int_0.9fd] // CHECK:STDOUT: %.loc4_7.2: %u2 = converted %int_0, %.loc4_7.1 [concrete = constants.%int_0.9fd] // CHECK:STDOUT: %.loc4_7.3: %struct_type.discriminant = struct_literal (%.loc4_7.2) @@ -234,9 +236,10 @@ fn G() { // CHECK:STDOUT: %Less: %Ordering = bind_name Less, %.loc4_7.10 // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0.loc5: %.89d = impl_witness_access constants.%impl_witness.f5e, element0 [concrete = constants.%Convert.474] -// CHECK:STDOUT: %bound_method.loc5: = bound_method %int_1, %impl.elem0.loc5 [concrete = constants.%Convert.bound.0dd] -// CHECK:STDOUT: %specific_fn.loc5: = specific_function %bound_method.loc5, @Convert.2(constants.%int_2.ecc) [concrete = constants.%Convert.specific_fn.95d] -// CHECK:STDOUT: %int.convert_checked.loc5: init %u2 = call %specific_fn.loc5(%int_1) [concrete = constants.%int_1.b2c] +// CHECK:STDOUT: %bound_method.loc5_13.1: = bound_method %int_1, %impl.elem0.loc5 [concrete = constants.%Convert.bound.0dd] +// CHECK:STDOUT: %specific_fn.loc5: = specific_function %impl.elem0.loc5, @Convert.2(constants.%int_2.ecc) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc5_13.2: = bound_method %int_1, %specific_fn.loc5 [concrete = constants.%bound_method.6bf] +// CHECK:STDOUT: %int.convert_checked.loc5: init %u2 = call %bound_method.loc5_13.2(%int_1) [concrete = constants.%int_1.b2c] // CHECK:STDOUT: %.loc5_13.1: %u2 = value_of_initializer %int.convert_checked.loc5 [concrete = constants.%int_1.b2c] // CHECK:STDOUT: %.loc5_13.2: %u2 = converted %int_1, %.loc5_13.1 [concrete = constants.%int_1.b2c] // CHECK:STDOUT: %.loc5_13.3: %struct_type.discriminant = struct_literal (%.loc5_13.2) @@ -250,9 +253,10 @@ fn G() { // CHECK:STDOUT: %Equivalent: %Ordering = bind_name Equivalent, %.loc5_13.10 // CHECK:STDOUT: %int_2.loc6: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %impl.elem0.loc6: %.89d = impl_witness_access constants.%impl_witness.f5e, element0 [concrete = constants.%Convert.474] -// CHECK:STDOUT: %bound_method.loc6: = bound_method %int_2.loc6, %impl.elem0.loc6 [concrete = constants.%Convert.bound.122] -// CHECK:STDOUT: %specific_fn.loc6: = specific_function %bound_method.loc6, @Convert.2(constants.%int_2.ecc) [concrete = constants.%Convert.specific_fn.190] -// CHECK:STDOUT: %int.convert_checked.loc6: init %u2 = call %specific_fn.loc6(%int_2.loc6) [concrete = constants.%int_2.788] +// CHECK:STDOUT: %bound_method.loc6_10.1: = bound_method %int_2.loc6, %impl.elem0.loc6 [concrete = constants.%Convert.bound.122] +// CHECK:STDOUT: %specific_fn.loc6: = specific_function %impl.elem0.loc6, @Convert.2(constants.%int_2.ecc) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_10.2: = bound_method %int_2.loc6, %specific_fn.loc6 [concrete = constants.%bound_method.f7d] +// CHECK:STDOUT: %int.convert_checked.loc6: init %u2 = call %bound_method.loc6_10.2(%int_2.loc6) [concrete = constants.%int_2.788] // CHECK:STDOUT: %.loc6_10.1: %u2 = value_of_initializer %int.convert_checked.loc6 [concrete = constants.%int_2.788] // CHECK:STDOUT: %.loc6_10.2: %u2 = converted %int_2.loc6, %.loc6_10.1 [concrete = constants.%int_2.788] // CHECK:STDOUT: %.loc6_10.3: %struct_type.discriminant = struct_literal (%.loc6_10.2) @@ -266,9 +270,10 @@ fn G() { // CHECK:STDOUT: %Greater: %Ordering = bind_name Greater, %.loc6_10.10 // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %impl.elem0.loc8: %.89d = impl_witness_access constants.%impl_witness.f5e, element0 [concrete = constants.%Convert.474] -// CHECK:STDOUT: %bound_method.loc8: = bound_method %int_3, %impl.elem0.loc8 [concrete = constants.%Convert.bound.a5c] -// CHECK:STDOUT: %specific_fn.loc8: = specific_function %bound_method.loc8, @Convert.2(constants.%int_2.ecc) [concrete = constants.%Convert.specific_fn.9bc] -// CHECK:STDOUT: %int.convert_checked.loc8: init %u2 = call %specific_fn.loc8(%int_3) [concrete = constants.%int_3.975] +// CHECK:STDOUT: %bound_method.loc8_1.1: = bound_method %int_3, %impl.elem0.loc8 [concrete = constants.%Convert.bound.a5c] +// CHECK:STDOUT: %specific_fn.loc8: = specific_function %impl.elem0.loc8, @Convert.2(constants.%int_2.ecc) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_1.2: = bound_method %int_3, %specific_fn.loc8 [concrete = constants.%bound_method.c7e] +// CHECK:STDOUT: %int.convert_checked.loc8: init %u2 = call %bound_method.loc8_1.2(%int_3) [concrete = constants.%int_3.975] // CHECK:STDOUT: %.loc8_1.1: %u2 = value_of_initializer %int.convert_checked.loc8 [concrete = constants.%int_3.975] // CHECK:STDOUT: %.loc8_1.2: %u2 = converted %int_3, %.loc8_1.1 [concrete = constants.%int_3.975] // CHECK:STDOUT: %.loc8_1.3: %struct_type.discriminant = struct_literal (%.loc8_1.2) diff --git a/toolchain/check/testdata/choice/fail_todo_params.carbon b/toolchain/check/testdata/choice/fail_todo_params.carbon index 7aa7610d4ea6..998c16c47394 100644 --- a/toolchain/check/testdata/choice/fail_todo_params.carbon +++ b/toolchain/check/testdata/choice/fail_todo_params.carbon @@ -64,11 +64,12 @@ choice C { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.766 = facet_value Core.IntLiteral, %impl_witness.514 [concrete] // CHECK:STDOUT: %.996: type = fn_type_with_self_type %Convert.type.5a2, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.db0: = bound_method %int_0.5c6, %Convert.84e [concrete] -// CHECK:STDOUT: %Convert.specific_fn.e7f: = specific_function %Convert.bound.db0, @Convert.2(%int_1.5b8) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.84e, @Convert.2(%int_1.5b8) [concrete] +// CHECK:STDOUT: %bound_method.06f: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.cd3: %u1 = int_value 0 [concrete] // CHECK:STDOUT: %C.val.6ef: %C = struct_value (%int_0.cd3) [concrete] // CHECK:STDOUT: %Convert.bound.1f9: = bound_method %int_1.5b8, %Convert.84e [concrete] -// CHECK:STDOUT: %Convert.specific_fn.9b2: = specific_function %Convert.bound.1f9, @Convert.2(%int_1.5b8) [concrete] +// CHECK:STDOUT: %bound_method.734: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.ae4: %u1 = int_value 1 [concrete] // CHECK:STDOUT: %C.val.5bf: %C = struct_value (%int_1.ae4) [concrete] // CHECK:STDOUT: } @@ -110,9 +111,10 @@ choice C { // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.discriminant [concrete = constants.%complete_type.df6] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0.loc4: %.996 = impl_witness_access constants.%impl_witness.514, element0 [concrete = constants.%Convert.84e] -// CHECK:STDOUT: %bound_method.loc4: = bound_method %int_0, %impl.elem0.loc4 [concrete = constants.%Convert.bound.db0] -// CHECK:STDOUT: %specific_fn.loc4: = specific_function %bound_method.loc4, @Convert.2(constants.%int_1.5b8) [concrete = constants.%Convert.specific_fn.e7f] -// CHECK:STDOUT: %int.convert_checked.loc4: init %u1 = call %specific_fn.loc4(%int_0) [concrete = constants.%int_0.cd3] +// CHECK:STDOUT: %bound_method.loc4_7.1: = bound_method %int_0, %impl.elem0.loc4 [concrete = constants.%Convert.bound.db0] +// CHECK:STDOUT: %specific_fn.loc4: = specific_function %impl.elem0.loc4, @Convert.2(constants.%int_1.5b8) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc4_7.2: = bound_method %int_0, %specific_fn.loc4 [concrete = constants.%bound_method.06f] +// CHECK:STDOUT: %int.convert_checked.loc4: init %u1 = call %bound_method.loc4_7.2(%int_0) [concrete = constants.%int_0.cd3] // CHECK:STDOUT: %.loc4_7.1: %u1 = value_of_initializer %int.convert_checked.loc4 [concrete = constants.%int_0.cd3] // CHECK:STDOUT: %.loc4_7.2: %u1 = converted %int_0, %.loc4_7.1 [concrete = constants.%int_0.cd3] // CHECK:STDOUT: %.loc4_7.3: %struct_type.discriminant = struct_literal (%.loc4_7.2) @@ -126,9 +128,10 @@ choice C { // CHECK:STDOUT: %Alt1: %C = bind_name Alt1, %.loc4_7.10 // CHECK:STDOUT: %int_1.loc10: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0.loc10: %.996 = impl_witness_access constants.%impl_witness.514, element0 [concrete = constants.%Convert.84e] -// CHECK:STDOUT: %bound_method.loc10: = bound_method %int_1.loc10, %impl.elem0.loc10 [concrete = constants.%Convert.bound.1f9] -// CHECK:STDOUT: %specific_fn.loc10: = specific_function %bound_method.loc10, @Convert.2(constants.%int_1.5b8) [concrete = constants.%Convert.specific_fn.9b2] -// CHECK:STDOUT: %int.convert_checked.loc10: init %u1 = call %specific_fn.loc10(%int_1.loc10) [concrete = constants.%int_1.ae4] +// CHECK:STDOUT: %bound_method.loc10_7.1: = bound_method %int_1.loc10, %impl.elem0.loc10 [concrete = constants.%Convert.bound.1f9] +// CHECK:STDOUT: %specific_fn.loc10: = specific_function %impl.elem0.loc10, @Convert.2(constants.%int_1.5b8) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_7.2: = bound_method %int_1.loc10, %specific_fn.loc10 [concrete = constants.%bound_method.734] +// CHECK:STDOUT: %int.convert_checked.loc10: init %u1 = call %bound_method.loc10_7.2(%int_1.loc10) [concrete = constants.%int_1.ae4] // CHECK:STDOUT: %.loc10_7.1: %u1 = value_of_initializer %int.convert_checked.loc10 [concrete = constants.%int_1.ae4] // CHECK:STDOUT: %.loc10_7.2: %u1 = converted %int_1.loc10, %.loc10_7.1 [concrete = constants.%int_1.ae4] // CHECK:STDOUT: %.loc10_7.3: %struct_type.discriminant = struct_literal (%.loc10_7.2) diff --git a/toolchain/check/testdata/class/access_modifers.carbon b/toolchain/check/testdata/class/access_modifers.carbon index a3bfe006bdfe..b6688aeeed23 100644 --- a/toolchain/check/testdata/class/access_modifers.carbon +++ b/toolchain/check/testdata/class/access_modifers.carbon @@ -162,7 +162,8 @@ class A { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.4e6: = bound_method %int_5.64b, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.ba9: = specific_function %Convert.bound.4e6, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.a25: = bound_method %int_5.64b, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_5.0f6: %i32 = int_value 5 [concrete] // CHECK:STDOUT: %SomeInternalFunction.type: type = fn_type @SomeInternalFunction [concrete] // CHECK:STDOUT: %SomeInternalFunction: %SomeInternalFunction.type = struct_value () [concrete] @@ -172,7 +173,7 @@ class A { // CHECK:STDOUT: %complete_type.5a5: = complete_type_witness %struct_type.radius.251 [concrete] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b6e: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %struct_type.radius.f47: type = struct_type {.radius: Core.IntLiteral} [concrete] // CHECK:STDOUT: %Circle.val: %Circle = struct_value (%int_5.0f6) [concrete] @@ -215,9 +216,10 @@ class A { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_5, %impl.elem0 [concrete = constants.%Convert.bound.4e6] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.ba9] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_5) [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %bound_method.loc6_45.1: = bound_method %int_5, %impl.elem0 [concrete = constants.%Convert.bound.4e6] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_45.2: = bound_method %int_5, %specific_fn [concrete = constants.%bound_method.a25] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc6_45.2(%int_5) [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc6_45.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc6_45.2: %i32 = converted %int_5, %.loc6_45.1 [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %SOME_INTERNAL_CONSTANT: %i32 = bind_name SOME_INTERNAL_CONSTANT, %.loc6_45.2 @@ -253,9 +255,10 @@ class A { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc9_13.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_13.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc9_13.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc9_13.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc9_13.2: %i32 = converted %int_0, %.loc9_13.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: return %.loc9_13.2 @@ -266,9 +269,10 @@ class A { // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete = constants.%int_5.64b] // CHECK:STDOUT: %.loc13_24.1: %struct_type.radius.f47 = struct_literal (%int_5) // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_5, %impl.elem0 [concrete = constants.%Convert.bound.4e6] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.ba9] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_5) [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %bound_method.loc13_24.1: = bound_method %int_5, %impl.elem0 [concrete = constants.%Convert.bound.4e6] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_24.2: = bound_method %int_5, %specific_fn [concrete = constants.%bound_method.a25] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc13_24.2(%int_5) [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc13_24.2: init %i32 = converted %int_5, %int.convert_checked [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc13_24.3: ref %i32 = class_element_access %return, element0 // CHECK:STDOUT: %.loc13_24.4: init %i32 = initialize_from %.loc13_24.2 to %.loc13_24.3 [concrete = constants.%int_5.0f6] @@ -395,7 +399,8 @@ class A { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -484,9 +489,10 @@ class A { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc12_13.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_13.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc12_13.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_13.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_13.2: %i32 = converted %int_0, %.loc12_13.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: return %.loc12_13.2 @@ -517,7 +523,8 @@ class A { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5.64b, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_5.64b, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_5.0f6: %i32 = int_value 5 [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] @@ -560,9 +567,10 @@ class A { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_5, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_5) [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %bound_method.loc5_16.1: = bound_method %int_5, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc5_16.2: = bound_method %int_5, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc5_16.2(%int_5) [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc5_16.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc5_16.2: %i32 = converted %int_5, %.loc5_16.1 [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %x: %i32 = bind_name x, %.loc5_16.2 @@ -596,7 +604,8 @@ class A { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5.64b, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_5.64b, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_5.0f6: %i32 = int_value 5 [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] @@ -648,9 +657,10 @@ class A { // CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0.loc5: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc5: = bound_method %int_5.loc5, %impl.elem0.loc5 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc5: = specific_function %bound_method.loc5, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc5: init %i32 = call %specific_fn.loc5(%int_5.loc5) [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %bound_method.loc5_26.1: = bound_method %int_5.loc5, %impl.elem0.loc5 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc5: = specific_function %impl.elem0.loc5, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc5_26.2: = bound_method %int_5.loc5, %specific_fn.loc5 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc5: init %i32 = call %bound_method.loc5_26.2(%int_5.loc5) [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc5_26.1: %i32 = value_of_initializer %int.convert_checked.loc5 [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc5_26.2: %i32 = converted %int_5.loc5, %.loc5_26.1 [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %x: %i32 = bind_name x, %.loc5_26.2 @@ -663,9 +673,10 @@ class A { // CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0.loc6: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc6: = bound_method %int_5.loc6, %impl.elem0.loc6 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc6: = specific_function %bound_method.loc6, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %specific_fn.loc6(%int_5.loc6) [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %bound_method.loc6_24.1: = bound_method %int_5.loc6, %impl.elem0.loc6 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc6: = specific_function %impl.elem0.loc6, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_24.2: = bound_method %int_5.loc6, %specific_fn.loc6 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %bound_method.loc6_24.2(%int_5.loc6) [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc6_24.1: %i32 = value_of_initializer %int.convert_checked.loc6 [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc6_24.2: %i32 = converted %int_5.loc6, %.loc6_24.1 [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %y: %i32 = bind_name y, %.loc6_24.2 diff --git a/toolchain/check/testdata/class/adapter/init_adapt.carbon b/toolchain/check/testdata/class/adapter/init_adapt.carbon index f3ee88cf2790..b805e6aed217 100644 --- a/toolchain/check/testdata/class/adapter/init_adapt.carbon +++ b/toolchain/check/testdata/class/adapter/init_adapt.carbon @@ -113,10 +113,11 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %C.val: %C = struct_value (%int_1.5d2, %int_2.ef8) [concrete] // CHECK:STDOUT: %MakeC.type: type = fn_type @MakeC [concrete] @@ -156,16 +157,18 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [concrete = constants.%C] // CHECK:STDOUT: %impl.elem0.loc13_27.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc13_27.1: = bound_method @__global_init.%int_1, %impl.elem0.loc13_27.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc13_27.1: = specific_function %bound_method.loc13_27.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc13_27.1: init %i32 = call %specific_fn.loc13_27.1(@__global_init.%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc13_27.1: = specific_function %impl.elem0.loc13_27.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_27.2: = bound_method @__global_init.%int_1, %specific_fn.loc13_27.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc13_27.1: init %i32 = call %bound_method.loc13_27.2(@__global_init.%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_27.1: init %i32 = converted @__global_init.%int_1, %int.convert_checked.loc13_27.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_27.2: ref %C = temporary_storage // CHECK:STDOUT: %.loc13_27.3: ref %i32 = class_element_access %.loc13_27.2, element0 // CHECK:STDOUT: %.loc13_27.4: init %i32 = initialize_from %.loc13_27.1 to %.loc13_27.3 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc13_27.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc13_27.2: = bound_method @__global_init.%int_2, %impl.elem0.loc13_27.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc13_27.2: = specific_function %bound_method.loc13_27.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc13_27.2: init %i32 = call %specific_fn.loc13_27.2(@__global_init.%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc13_27.3: = bound_method @__global_init.%int_2, %impl.elem0.loc13_27.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc13_27.2: = specific_function %impl.elem0.loc13_27.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_27.4: = bound_method @__global_init.%int_2, %specific_fn.loc13_27.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc13_27.2: init %i32 = call %bound_method.loc13_27.4(@__global_init.%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_27.5: init %i32 = converted @__global_init.%int_2, %int.convert_checked.loc13_27.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_27.6: ref %i32 = class_element_access %.loc13_27.2, element1 // CHECK:STDOUT: %.loc13_27.7: init %i32 = initialize_from %.loc13_27.5 to %.loc13_27.6 [concrete = constants.%int_2.ef8] @@ -301,10 +304,11 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %C.val: %C = struct_value (%int_1.5d2, %int_2.ef8) [concrete] // CHECK:STDOUT: %MakeC.type: type = fn_type @MakeC [concrete] @@ -344,16 +348,18 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [concrete = constants.%C] // CHECK:STDOUT: %impl.elem0.loc13_27.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc13_27.1: = bound_method @__global_init.%int_1, %impl.elem0.loc13_27.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc13_27.1: = specific_function %bound_method.loc13_27.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc13_27.1: init %i32 = call %specific_fn.loc13_27.1(@__global_init.%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc13_27.1: = specific_function %impl.elem0.loc13_27.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_27.2: = bound_method @__global_init.%int_1, %specific_fn.loc13_27.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc13_27.1: init %i32 = call %bound_method.loc13_27.2(@__global_init.%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_27.1: init %i32 = converted @__global_init.%int_1, %int.convert_checked.loc13_27.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_27.2: ref %C = temporary_storage // CHECK:STDOUT: %.loc13_27.3: ref %i32 = class_element_access %.loc13_27.2, element0 // CHECK:STDOUT: %.loc13_27.4: init %i32 = initialize_from %.loc13_27.1 to %.loc13_27.3 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc13_27.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc13_27.2: = bound_method @__global_init.%int_2, %impl.elem0.loc13_27.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc13_27.2: = specific_function %bound_method.loc13_27.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc13_27.2: init %i32 = call %specific_fn.loc13_27.2(@__global_init.%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc13_27.3: = bound_method @__global_init.%int_2, %impl.elem0.loc13_27.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc13_27.2: = specific_function %impl.elem0.loc13_27.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_27.4: = bound_method @__global_init.%int_2, %specific_fn.loc13_27.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc13_27.2: init %i32 = call %bound_method.loc13_27.4(@__global_init.%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_27.5: init %i32 = converted @__global_init.%int_2, %int.convert_checked.loc13_27.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_27.6: ref %i32 = class_element_access %.loc13_27.2, element1 // CHECK:STDOUT: %.loc13_27.7: init %i32 = initialize_from %.loc13_27.5 to %.loc13_27.6 [concrete = constants.%int_2.ef8] diff --git a/toolchain/check/testdata/class/base.carbon b/toolchain/check/testdata/class/base.carbon index eb96a155c057..727821565d7b 100644 --- a/toolchain/check/testdata/class/base.carbon +++ b/toolchain/check/testdata/class/base.carbon @@ -73,11 +73,12 @@ class Derived { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ac3: = bound_method %int_4.0c1, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.450: = specific_function %Convert.bound.ac3, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.1da: = bound_method %int_4.0c1, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete] // CHECK:STDOUT: %Base.val: %Base = struct_value (%int_4.940) [concrete] // CHECK:STDOUT: %Convert.bound.208: = bound_method %int_7.29f, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.c12: = specific_function %Convert.bound.208, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.3bd: = bound_method %int_7.29f, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_7.0b1: %i32 = int_value 7 [concrete] // CHECK:STDOUT: %Derived.val: %Derived = struct_value (%Base.val, %int_7.0b1) [concrete] // CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete] @@ -174,9 +175,10 @@ class Derived { // CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [concrete = constants.%int_7.29f] // CHECK:STDOUT: %.loc14_35.1: %struct_type.base.d.a20 = struct_literal (%.loc14_26.1, %int_7) // CHECK:STDOUT: %impl.elem0.loc14_26: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc14_26: = bound_method %int_4, %impl.elem0.loc14_26 [concrete = constants.%Convert.bound.ac3] -// CHECK:STDOUT: %specific_fn.loc14_26: = specific_function %bound_method.loc14_26, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.450] -// CHECK:STDOUT: %int.convert_checked.loc14_26: init %i32 = call %specific_fn.loc14_26(%int_4) [concrete = constants.%int_4.940] +// CHECK:STDOUT: %bound_method.loc14_26.1: = bound_method %int_4, %impl.elem0.loc14_26 [concrete = constants.%Convert.bound.ac3] +// CHECK:STDOUT: %specific_fn.loc14_26: = specific_function %impl.elem0.loc14_26, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_26.2: = bound_method %int_4, %specific_fn.loc14_26 [concrete = constants.%bound_method.1da] +// CHECK:STDOUT: %int.convert_checked.loc14_26: init %i32 = call %bound_method.loc14_26.2(%int_4) [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc14_26.2: init %i32 = converted %int_4, %int.convert_checked.loc14_26 [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc14_35.2: ref %Base = class_element_access %return, element0 // CHECK:STDOUT: %.loc14_26.3: ref %i32 = class_element_access %.loc14_35.2, element0 @@ -184,9 +186,10 @@ class Derived { // CHECK:STDOUT: %.loc14_26.5: init %Base = class_init (%.loc14_26.4), %.loc14_35.2 [concrete = constants.%Base.val] // CHECK:STDOUT: %.loc14_35.3: init %Base = converted %.loc14_26.1, %.loc14_26.5 [concrete = constants.%Base.val] // CHECK:STDOUT: %impl.elem0.loc14_35: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc14_35: = bound_method %int_7, %impl.elem0.loc14_35 [concrete = constants.%Convert.bound.208] -// CHECK:STDOUT: %specific_fn.loc14_35: = specific_function %bound_method.loc14_35, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.c12] -// CHECK:STDOUT: %int.convert_checked.loc14_35: init %i32 = call %specific_fn.loc14_35(%int_7) [concrete = constants.%int_7.0b1] +// CHECK:STDOUT: %bound_method.loc14_35.1: = bound_method %int_7, %impl.elem0.loc14_35 [concrete = constants.%Convert.bound.208] +// CHECK:STDOUT: %specific_fn.loc14_35: = specific_function %impl.elem0.loc14_35, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_35.2: = bound_method %int_7, %specific_fn.loc14_35 [concrete = constants.%bound_method.3bd] +// CHECK:STDOUT: %int.convert_checked.loc14_35: init %i32 = call %bound_method.loc14_35.2(%int_7) [concrete = constants.%int_7.0b1] // CHECK:STDOUT: %.loc14_35.4: init %i32 = converted %int_7, %int.convert_checked.loc14_35 [concrete = constants.%int_7.0b1] // CHECK:STDOUT: %.loc14_35.5: ref %i32 = class_element_access %return, element1 // CHECK:STDOUT: %.loc14_35.6: init %i32 = initialize_from %.loc14_35.4 to %.loc14_35.5 [concrete = constants.%int_7.0b1] diff --git a/toolchain/check/testdata/class/base_method.carbon b/toolchain/check/testdata/class/base_method.carbon index 2e4b78ed969c..a59e22e024a2 100644 --- a/toolchain/check/testdata/class/base_method.carbon +++ b/toolchain/check/testdata/class/base_method.carbon @@ -48,7 +48,8 @@ fn Call(p: Derived*) { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Derived: type = class_type @Derived [concrete] // CHECK:STDOUT: %Derived.elem: type = unbound_element_type %Derived, %Base [concrete] @@ -152,9 +153,10 @@ fn Call(p: Derived*) { // CHECK:STDOUT: %.loc18_10: ref %i32 = class_element_access %.loc18_4, element0 // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc18_13.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc18_13.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc18_13.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc18_13: init %i32 = converted %int_1, %int.convert_checked [concrete = constants.%int_1.5d2] // CHECK:STDOUT: assign %.loc18_10, %.loc18_13 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/class/basic.carbon b/toolchain/check/testdata/class/basic.carbon index 3b179b87e1f2..48ccc6b516eb 100644 --- a/toolchain/check/testdata/class/basic.carbon +++ b/toolchain/check/testdata/class/basic.carbon @@ -50,7 +50,8 @@ fn Run() -> i32 { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_4.0c1, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_4.0c1, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -169,9 +170,10 @@ fn Run() -> i32 { // CHECK:STDOUT: %F.ref: %F.type = name_ref F, @Class.%F.decl [concrete = constants.%F] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_4, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_4) [concrete = constants.%int_4.940] +// CHECK:STDOUT: %bound_method.loc26_18.1: = bound_method %int_4, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc26_18.2: = bound_method %int_4, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc26_18.2(%int_4) [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc26_18.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc26_18.2: %i32 = converted %int_4, %.loc26_18.1 [concrete = constants.%int_4.940] // CHECK:STDOUT: %F.call: init %i32 = call %F.ref(%.loc26_18.2) diff --git a/toolchain/check/testdata/class/derived_to_base.carbon b/toolchain/check/testdata/class/derived_to_base.carbon index ee13159b1c61..823079ccee5d 100644 --- a/toolchain/check/testdata/class/derived_to_base.carbon +++ b/toolchain/check/testdata/class/derived_to_base.carbon @@ -86,15 +86,16 @@ fn ConvertInit() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %A.val: %A = struct_value (%int_1.5d2) [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %B.val: %B = struct_value (%A.val, %int_2.ef8) [concrete] // CHECK:STDOUT: %Convert.bound.b30: = bound_method %int_3.1ba, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.b42: = specific_function %Convert.bound.b30, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.047: = bound_method %int_3.1ba, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %C.val: %C = struct_value (%B.val, %int_3.822) [concrete] // CHECK:STDOUT: } @@ -326,9 +327,10 @@ fn ConvertInit() { // CHECK:STDOUT: %.loc38_57.1: %struct_type.base.c.136 = struct_literal (%.loc38_48.1, %int_3) // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %impl.elem0.loc38_39: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc38_39: = bound_method %int_1, %impl.elem0.loc38_39 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc38_39: = specific_function %bound_method.loc38_39, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc38_39: init %i32 = call %specific_fn.loc38_39(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc38_39.1: = bound_method %int_1, %impl.elem0.loc38_39 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc38_39: = specific_function %impl.elem0.loc38_39, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc38_39.2: = bound_method %int_1, %specific_fn.loc38_39 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc38_39: init %i32 = call %bound_method.loc38_39.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc38_39.2: init %i32 = converted %int_1, %int.convert_checked.loc38_39 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc38_57.2: ref %C = temporary_storage // CHECK:STDOUT: %.loc38_57.3: ref %B = class_element_access %.loc38_57.2, element0 @@ -338,18 +340,20 @@ fn ConvertInit() { // CHECK:STDOUT: %.loc38_39.5: init %A = class_init (%.loc38_39.4), %.loc38_48.2 [concrete = constants.%A.val] // CHECK:STDOUT: %.loc38_48.3: init %A = converted %.loc38_39.1, %.loc38_39.5 [concrete = constants.%A.val] // CHECK:STDOUT: %impl.elem0.loc38_48: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc38_48: = bound_method %int_2, %impl.elem0.loc38_48 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc38_48: = specific_function %bound_method.loc38_48, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc38_48: init %i32 = call %specific_fn.loc38_48(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc38_48.1: = bound_method %int_2, %impl.elem0.loc38_48 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc38_48: = specific_function %impl.elem0.loc38_48, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc38_48.2: = bound_method %int_2, %specific_fn.loc38_48 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc38_48: init %i32 = call %bound_method.loc38_48.2(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc38_48.4: init %i32 = converted %int_2, %int.convert_checked.loc38_48 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc38_48.5: ref %i32 = class_element_access %.loc38_57.3, element1 // CHECK:STDOUT: %.loc38_48.6: init %i32 = initialize_from %.loc38_48.4 to %.loc38_48.5 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc38_48.7: init %B = class_init (%.loc38_48.3, %.loc38_48.6), %.loc38_57.3 [concrete = constants.%B.val] // CHECK:STDOUT: %.loc38_57.4: init %B = converted %.loc38_48.1, %.loc38_48.7 [concrete = constants.%B.val] // CHECK:STDOUT: %impl.elem0.loc38_57: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc38_57: = bound_method %int_3, %impl.elem0.loc38_57 [concrete = constants.%Convert.bound.b30] -// CHECK:STDOUT: %specific_fn.loc38_57: = specific_function %bound_method.loc38_57, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc38_57: init %i32 = call %specific_fn.loc38_57(%int_3) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %bound_method.loc38_57.1: = bound_method %int_3, %impl.elem0.loc38_57 [concrete = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc38_57: = specific_function %impl.elem0.loc38_57, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc38_57.2: = bound_method %int_3, %specific_fn.loc38_57 [concrete = constants.%bound_method.047] +// CHECK:STDOUT: %int.convert_checked.loc38_57: init %i32 = call %bound_method.loc38_57.2(%int_3) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc38_57.5: init %i32 = converted %int_3, %int.convert_checked.loc38_57 [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc38_57.6: ref %i32 = class_element_access %.loc38_57.2, element1 // CHECK:STDOUT: %.loc38_57.7: init %i32 = initialize_from %.loc38_57.5 to %.loc38_57.6 [concrete = constants.%int_3.822] diff --git a/toolchain/check/testdata/class/fail_field_modifiers.carbon b/toolchain/check/testdata/class/fail_field_modifiers.carbon index ffa067a8682a..c5b6b57449ff 100644 --- a/toolchain/check/testdata/class/fail_field_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_field_modifiers.carbon @@ -51,11 +51,12 @@ class Class { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b6e: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %struct_type.j.k: type = struct_type {.j: %i32, .k: %i32} [concrete] // CHECK:STDOUT: %complete_type.cf7: = complete_type_witness %struct_type.j.k [concrete] @@ -99,9 +100,10 @@ class Class { // CHECK:STDOUT: %i32.loc29: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0.loc29: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc29: = bound_method %int_0, %impl.elem0.loc29 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn.loc29: = specific_function %bound_method.loc29, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc29: init %i32 = call %specific_fn.loc29(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc29_24.1: = bound_method %int_0, %impl.elem0.loc29 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc29: = specific_function %impl.elem0.loc29, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc29_24.2: = bound_method %int_0, %specific_fn.loc29 [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked.loc29: init %i32 = call %bound_method.loc29_24.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc29_24.1: %i32 = value_of_initializer %int.convert_checked.loc29 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc29_24.2: %i32 = converted %int_0, %.loc29_24.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %l: %i32 = bind_name l, %.loc29_24.2 @@ -114,9 +116,10 @@ class Class { // CHECK:STDOUT: %i32.loc35: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0.loc35: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc35: = bound_method %int_1, %impl.elem0.loc35 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc35: = specific_function %bound_method.loc35, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc35: init %i32 = call %specific_fn.loc35(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc35_22.1: = bound_method %int_1, %impl.elem0.loc35 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc35: = specific_function %impl.elem0.loc35, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc35_22.2: = bound_method %int_1, %specific_fn.loc35 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc35: init %i32 = call %bound_method.loc35_22.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc35_22.1: %i32 = value_of_initializer %int.convert_checked.loc35 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc35_22.2: %i32 = converted %int_1, %.loc35_22.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %m: %i32 = bind_name m, %.loc35_22.2 diff --git a/toolchain/check/testdata/class/fail_init.carbon b/toolchain/check/testdata/class/fail_init.carbon index c9608c3df155..7b89ed3a3a4d 100644 --- a/toolchain/check/testdata/class/fail_init.carbon +++ b/toolchain/check/testdata/class/fail_init.carbon @@ -54,7 +54,8 @@ fn F() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete] // CHECK:STDOUT: %struct_type.a.b.c: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral, .c: Core.IntLiteral} [concrete] @@ -113,9 +114,10 @@ fn F() { // CHECK:STDOUT: %.loc26_18.1: %struct_type.a.c = struct_literal (%int_1.loc26, %int_2.loc26) // CHECK:STDOUT: %Class.ref.loc26: type = name_ref Class, file.%Class.decl [concrete = constants.%Class] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_1.loc26, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1.loc26) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc26_18.1: = bound_method %int_1.loc26, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc26_18.2: = bound_method %int_1.loc26, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc26_18.2(%int_1.loc26) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc26_18.2: init %i32 = converted %int_1.loc26, %int.convert_checked [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc26_18.3: ref %Class = temporary_storage // CHECK:STDOUT: %.loc26_18.4: ref %i32 = class_element_access %.loc26_18.3, element0 diff --git a/toolchain/check/testdata/class/fail_init_as_inplace.carbon b/toolchain/check/testdata/class/fail_init_as_inplace.carbon index 79cbde6d47e5..85561d9c7e2e 100644 --- a/toolchain/check/testdata/class/fail_init_as_inplace.carbon +++ b/toolchain/check/testdata/class/fail_init_as_inplace.carbon @@ -53,10 +53,11 @@ fn F() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %Class.val: %Class = struct_value (%int_1.5d2, %int_2.ef8) [concrete] // CHECK:STDOUT: } @@ -128,16 +129,18 @@ fn F() { // CHECK:STDOUT: %Class.ref.loc26_38: type = name_ref Class, file.%Class.decl [concrete = constants.%Class] // CHECK:STDOUT: %impl.elem0.loc26_33.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc26_33.1: = bound_method %int_1, %impl.elem0.loc26_33.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc26_33.1: = specific_function %bound_method.loc26_33.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc26_33.1: init %i32 = call %specific_fn.loc26_33.1(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc26_33.1: = specific_function %impl.elem0.loc26_33.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc26_33.2: = bound_method %int_1, %specific_fn.loc26_33.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.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, %int.convert_checked.loc26_33.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc26_33.3: ref %Class = temporary_storage // CHECK:STDOUT: %.loc26_33.4: ref %i32 = class_element_access %.loc26_33.3, element0 // CHECK:STDOUT: %.loc26_33.5: init %i32 = initialize_from %.loc26_33.2 to %.loc26_33.4 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc26_33.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc26_33.2: = bound_method %int_2, %impl.elem0.loc26_33.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc26_33.2: = specific_function %bound_method.loc26_33.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc26_33.2: init %i32 = call %specific_fn.loc26_33.2(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc26_33.3: = bound_method %int_2, %impl.elem0.loc26_33.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc26_33.2: = specific_function %impl.elem0.loc26_33.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc26_33.4: = bound_method %int_2, %specific_fn.loc26_33.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc26_33.2: init %i32 = call %bound_method.loc26_33.4(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc26_33.6: init %i32 = converted %int_2, %int.convert_checked.loc26_33.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc26_33.7: ref %i32 = class_element_access %.loc26_33.3, element1 // CHECK:STDOUT: %.loc26_33.8: init %i32 = initialize_from %.loc26_33.6 to %.loc26_33.7 [concrete = constants.%int_2.ef8] diff --git a/toolchain/check/testdata/class/fail_scope.carbon b/toolchain/check/testdata/class/fail_scope.carbon index 7b79e5b4e117..b4e51b84318b 100644 --- a/toolchain/check/testdata/class/fail_scope.carbon +++ b/toolchain/check/testdata/class/fail_scope.carbon @@ -41,7 +41,8 @@ fn G() -> i32 { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] @@ -98,9 +99,10 @@ fn G() -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc13_13.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_13.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc13_13.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_13.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_13.2: %i32 = converted %int_1, %.loc13_13.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: return %.loc13_13.2 diff --git a/toolchain/check/testdata/class/field_access.carbon b/toolchain/check/testdata/class/field_access.carbon index 4bf5b9a2dfa7..74b1fa7bff33 100644 --- a/toolchain/check/testdata/class/field_access.carbon +++ b/toolchain/check/testdata/class/field_access.carbon @@ -41,11 +41,12 @@ fn Run() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -103,9 +104,10 @@ fn Run() { // CHECK:STDOUT: %.loc18_4: ref %i32 = class_element_access %c.ref.loc18, element0 // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0.loc18: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc18: = bound_method %int_1, %impl.elem0.loc18 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc18: = specific_function %bound_method.loc18, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %specific_fn.loc18(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc18_7.1: = bound_method %int_1, %impl.elem0.loc18 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc18: = specific_function %impl.elem0.loc18, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc18_7.2: = bound_method %int_1, %specific_fn.loc18 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %bound_method.loc18_7.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc18_7: init %i32 = converted %int_1, %int.convert_checked.loc18 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: assign %.loc18_4, %.loc18_7 // CHECK:STDOUT: %c.ref.loc19: ref %Class = name_ref c, %c @@ -113,9 +115,10 @@ fn Run() { // CHECK:STDOUT: %.loc19_4: ref %i32 = class_element_access %c.ref.loc19, element1 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %impl.elem0.loc19: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc19: = bound_method %int_2, %impl.elem0.loc19 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc19: = specific_function %bound_method.loc19, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc19: init %i32 = call %specific_fn.loc19(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc19_7.1: = bound_method %int_2, %impl.elem0.loc19 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc19: = specific_function %impl.elem0.loc19, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc19_7.2: = bound_method %int_2, %specific_fn.loc19 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc19: init %i32 = call %bound_method.loc19_7.2(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc19_7: init %i32 = converted %int_2, %int.convert_checked.loc19 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: assign %.loc19_4, %.loc19_7 // CHECK:STDOUT: name_binding_decl { diff --git a/toolchain/check/testdata/class/field_access_in_value.carbon b/toolchain/check/testdata/class/field_access_in_value.carbon index 0b3faa350a27..11de7552006b 100644 --- a/toolchain/check/testdata/class/field_access_in_value.carbon +++ b/toolchain/check/testdata/class/field_access_in_value.carbon @@ -42,11 +42,12 @@ fn Test() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -104,9 +105,10 @@ fn Test() { // CHECK:STDOUT: %.loc18_5: ref %i32 = class_element_access %cv.ref.loc18, element0 // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0.loc18: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc18: = bound_method %int_1, %impl.elem0.loc18 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc18: = specific_function %bound_method.loc18, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %specific_fn.loc18(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc18_8.1: = bound_method %int_1, %impl.elem0.loc18 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc18: = specific_function %impl.elem0.loc18, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc18_8.2: = bound_method %int_1, %specific_fn.loc18 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %bound_method.loc18_8.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc18_8: init %i32 = converted %int_1, %int.convert_checked.loc18 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: assign %.loc18_5, %.loc18_8 // CHECK:STDOUT: %cv.ref.loc19: ref %Class = name_ref cv, %cv @@ -114,9 +116,10 @@ fn Test() { // CHECK:STDOUT: %.loc19_5: ref %i32 = class_element_access %cv.ref.loc19, element1 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %impl.elem0.loc19: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc19: = bound_method %int_2, %impl.elem0.loc19 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc19: = specific_function %bound_method.loc19, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc19: init %i32 = call %specific_fn.loc19(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc19_8.1: = bound_method %int_2, %impl.elem0.loc19 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc19: = specific_function %impl.elem0.loc19, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc19_8.2: = bound_method %int_2, %specific_fn.loc19 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc19: init %i32 = call %bound_method.loc19_8.2(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc19_8: init %i32 = converted %int_2, %int.convert_checked.loc19 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: assign %.loc19_5, %.loc19_8 // CHECK:STDOUT: name_binding_decl { diff --git a/toolchain/check/testdata/class/generic/call.carbon b/toolchain/check/testdata/class/generic/call.carbon index 1306dc582c8c..751ac0ba1686 100644 --- a/toolchain/check/testdata/class/generic/call.carbon +++ b/toolchain/check/testdata/class/generic/call.carbon @@ -111,12 +111,13 @@ class Outer(T:! type) { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.4e6: = bound_method %int_5.64b, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.ba9: = specific_function %Convert.bound.4e6, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.a25: = bound_method %int_5.64b, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_5.0f6: %i32 = int_value 5 [concrete] // CHECK:STDOUT: %Class.f29: type = class_type @Class, @Class(%ptr.235, %int_5.0f6) [concrete] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b6e: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %Class.dd4: type = class_type @Class, @Class(%empty_tuple.type, %int_0.6a9) [concrete] // CHECK:STDOUT: } @@ -161,9 +162,10 @@ class Outer(T:! type) { // CHECK:STDOUT: %ptr: type = ptr_type %i32 [concrete = constants.%ptr.235] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete = constants.%int_5.64b] // CHECK:STDOUT: %impl.elem0.loc6: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc6: = bound_method %int_5, %impl.elem0.loc6 [concrete = constants.%Convert.bound.4e6] -// CHECK:STDOUT: %specific_fn.loc6: = specific_function %bound_method.loc6, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.ba9] -// CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %specific_fn.loc6(%int_5) [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %bound_method.loc6_21.1: = bound_method %int_5, %impl.elem0.loc6 [concrete = constants.%Convert.bound.4e6] +// CHECK:STDOUT: %specific_fn.loc6: = specific_function %impl.elem0.loc6, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_21.2: = bound_method %int_5, %specific_fn.loc6 [concrete = constants.%bound_method.a25] +// CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %bound_method.loc6_21.2(%int_5) [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc6_21.2: %i32 = value_of_initializer %int.convert_checked.loc6 [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc6_21.3: %i32 = converted %int_5, %.loc6_21.2 [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %Class.loc6: type = class_type @Class, @Class(constants.%ptr.235, constants.%int_5.0f6) [concrete = constants.%Class.f29] @@ -180,9 +182,10 @@ class Outer(T:! type) { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %.loc9_19.2: type = converted %.loc9_15, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: %impl.elem0.loc9: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc9: = bound_method %int_0, %impl.elem0.loc9 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn.loc9: = specific_function %bound_method.loc9, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc9: init %i32 = call %specific_fn.loc9(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc9_19.1: = bound_method %int_0, %impl.elem0.loc9 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc9: = specific_function %impl.elem0.loc9, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_19.2: = bound_method %int_0, %specific_fn.loc9 [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked.loc9: init %i32 = call %bound_method.loc9_19.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc9_19.3: %i32 = value_of_initializer %int.convert_checked.loc9 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc9_19.4: %i32 = converted %int_0, %.loc9_19.3 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %Class.loc9: type = class_type @Class, @Class(constants.%empty_tuple.type, constants.%int_0.6a9) [concrete = constants.%Class.dd4] diff --git a/toolchain/check/testdata/class/generic/complete_in_conversion.carbon b/toolchain/check/testdata/class/generic/complete_in_conversion.carbon index adabc8b87a13..14b84a96c768 100644 --- a/toolchain/check/testdata/class/generic/complete_in_conversion.carbon +++ b/toolchain/check/testdata/class/generic/complete_in_conversion.carbon @@ -52,13 +52,14 @@ fn F(a: A(0)*) { // CHECK:STDOUT: %Convert.type.4ad: type = fn_type @Convert.3, @impl.971(%int_32) [concrete] // CHECK:STDOUT: %Convert.960: %Convert.type.4ad = struct_value () [concrete] // CHECK:STDOUT: %Convert.bound.588: = bound_method %N.51e, %Convert.960 [symbolic] -// CHECK:STDOUT: %Convert.specific_fn.18b: = specific_function %Convert.bound.588, @Convert.3(%int_32) [symbolic] -// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn.18b(%N.51e) [symbolic] -// CHECK:STDOUT: %iN.builtin.c5d: type = int_type signed, %int.convert_checked [symbolic] -// CHECK:STDOUT: %require_complete.be5: = require_complete_type %iN.builtin.c5d [symbolic] -// CHECK:STDOUT: %A.elem.d60: type = unbound_element_type %A.dd3, %iN.builtin.c5d [symbolic] -// CHECK:STDOUT: %struct_type.base.n: type = struct_type {.base: %B, .n: %iN.builtin.c5d} [symbolic] -// CHECK:STDOUT: %complete_type.547: = complete_type_witness %struct_type.base.n [symbolic] +// CHECK:STDOUT: %Convert.specific_fn.8a8: = specific_function %Convert.960, @Convert.3(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.f9c: = bound_method %N.51e, %Convert.specific_fn.8a8 [symbolic] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %bound_method.f9c(%N.51e) [symbolic] +// CHECK:STDOUT: %iN.builtin.8fe: type = int_type signed, %int.convert_checked [symbolic] +// CHECK:STDOUT: %require_complete.e34: = require_complete_type %iN.builtin.8fe [symbolic] +// CHECK:STDOUT: %A.elem.07f: type = unbound_element_type %A.dd3, %iN.builtin.8fe [symbolic] +// CHECK:STDOUT: %struct_type.base.n: type = struct_type {.base: %B, .n: %iN.builtin.8fe} [symbolic] +// CHECK:STDOUT: %complete_type.beb: = complete_type_witness %struct_type.base.n [symbolic] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete] @@ -68,7 +69,8 @@ fn F(a: A(0)*) { // CHECK:STDOUT: %ImplicitAs.facet.f7f: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet.f7f [concrete] // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn.b6f: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b6e: = bound_method %int_0.5c6, %Convert.specific_fn.b6f [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %A.6fc: type = class_type @A, @A(%int_0.6a9) [concrete] // CHECK:STDOUT: %ptr.b65: type = ptr_type %A.6fc [concrete] @@ -77,7 +79,7 @@ fn F(a: A(0)*) { // CHECK:STDOUT: %ptr.e79: type = ptr_type %B [concrete] // CHECK:STDOUT: %A.elem.d81: type = unbound_element_type %A.6fc, %B [concrete] // CHECK:STDOUT: %Convert.bound.0fd: = bound_method %int_0.6a9, %Convert.960 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.f3f: = specific_function %Convert.bound.0fd, @Convert.3(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.4b5: = bound_method %int_0.6a9, %Convert.specific_fn.8a8 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -137,9 +139,10 @@ fn F(a: A(0)*) { // CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%A.decl [concrete = constants.%A.generic] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc15_12.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b6f] +// CHECK:STDOUT: %bound_method.loc15_12.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc15_12.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc15_12.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc15_12.2: %i32 = converted %int_0, %.loc15_12.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %A: type = class_type @A, @A(constants.%int_0.6a9) [concrete = constants.%A.6fc] @@ -167,23 +170,23 @@ fn F(a: A(0)*) { // CHECK:STDOUT: %A: type = class_type @A, @A(%N.loc6_9.2) [symbolic = %A (constants.%A.dd3)] // CHECK:STDOUT: %A.elem.loc7: type = unbound_element_type @A.%A (%A.dd3), %B [symbolic = %A.elem.loc7 (constants.%A.elem.500)] // CHECK:STDOUT: %Convert.bound: = bound_method %N.loc6_9.2, constants.%Convert.960 [symbolic = %Convert.bound (constants.%Convert.bound.588)] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn (constants.%Convert.specific_fn.18b)] -// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn(%N.loc6_9.2) [symbolic = %int.convert_checked (constants.%int.convert_checked)] -// CHECK:STDOUT: %iN.builtin: type = int_type signed, %int.convert_checked [symbolic = %iN.builtin (constants.%iN.builtin.c5d)] -// CHECK:STDOUT: %require_complete: = require_complete_type @A.%iN.builtin (%iN.builtin.c5d) [symbolic = %require_complete (constants.%require_complete.be5)] -// CHECK:STDOUT: %A.elem.loc12: type = unbound_element_type @A.%A (%A.dd3), @A.%iN.builtin (%iN.builtin.c5d) [symbolic = %A.elem.loc12 (constants.%A.elem.d60)] -// CHECK:STDOUT: %struct_type.base.n: type = struct_type {.base: %B, .n: @A.%iN.builtin (%iN.builtin.c5d)} [symbolic = %struct_type.base.n (constants.%struct_type.base.n)] -// CHECK:STDOUT: %complete_type.loc13_1.2: = complete_type_witness @A.%struct_type.base.n (%struct_type.base.n) [symbolic = %complete_type.loc13_1.2 (constants.%complete_type.547)] +// CHECK:STDOUT: %bound_method: = bound_method %N.loc6_9.2, constants.%Convert.specific_fn.8a8 [symbolic = %bound_method (constants.%bound_method.f9c)] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %bound_method(%N.loc6_9.2) [symbolic = %int.convert_checked (constants.%int.convert_checked)] +// CHECK:STDOUT: %iN.builtin: type = int_type signed, %int.convert_checked [symbolic = %iN.builtin (constants.%iN.builtin.8fe)] +// CHECK:STDOUT: %require_complete: = require_complete_type @A.%iN.builtin (%iN.builtin.8fe) [symbolic = %require_complete (constants.%require_complete.e34)] +// CHECK:STDOUT: %A.elem.loc12: type = unbound_element_type @A.%A (%A.dd3), @A.%iN.builtin (%iN.builtin.8fe) [symbolic = %A.elem.loc12 (constants.%A.elem.07f)] +// CHECK:STDOUT: %struct_type.base.n: type = struct_type {.base: %B, .n: @A.%iN.builtin (%iN.builtin.8fe)} [symbolic = %struct_type.base.n (constants.%struct_type.base.n)] +// CHECK:STDOUT: %complete_type.loc13_1.2: = complete_type_witness @A.%struct_type.base.n (%struct_type.base.n) [symbolic = %complete_type.loc13_1.2 (constants.%complete_type.beb)] // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B] // CHECK:STDOUT: %.loc7: @A.%A.elem.loc7 (%A.elem.500) = base_decl %B.ref, element0 [concrete] -// CHECK:STDOUT: %.loc12_8: @A.%A.elem.loc12 (%A.elem.d60) = field_decl n, element1 [concrete] +// CHECK:STDOUT: %.loc12_8: @A.%A.elem.loc12 (%A.elem.07f) = field_decl n, element1 [concrete] // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %.loc12_3: @A.%A.elem.loc12 (%A.elem.d60) = var_pattern %.loc12_8 +// CHECK:STDOUT: %.loc12_3: @A.%A.elem.loc12 (%A.elem.07f) = var_pattern %.loc12_8 // CHECK:STDOUT: } -// CHECK:STDOUT: %.var: ref @A.%A.elem.loc12 (%A.elem.d60) = var -// CHECK:STDOUT: %complete_type.loc13_1.1: = complete_type_witness %struct_type.base.n [symbolic = %complete_type.loc13_1.2 (constants.%complete_type.547)] +// CHECK:STDOUT: %.var: ref @A.%A.elem.loc12 (%A.elem.07f) = var +// CHECK:STDOUT: %complete_type.loc13_1.1: = complete_type_witness %struct_type.base.n [symbolic = %complete_type.loc13_1.2 (constants.%complete_type.beb)] // CHECK:STDOUT: complete_type_witness = %complete_type.loc13_1.1 // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -232,7 +235,7 @@ fn F(a: A(0)*) { // CHECK:STDOUT: %A => constants.%A.6fc // CHECK:STDOUT: %A.elem.loc7 => constants.%A.elem.d81 // CHECK:STDOUT: %Convert.bound => constants.%Convert.bound.0fd -// CHECK:STDOUT: %Convert.specific_fn => constants.%Convert.specific_fn.f3f +// CHECK:STDOUT: %bound_method => constants.%bound_method.4b5 // CHECK:STDOUT: %int.convert_checked => constants.%int_0.5c6 // CHECK:STDOUT: %iN.builtin => // CHECK:STDOUT: %require_complete => diff --git a/toolchain/check/testdata/class/generic/import.carbon b/toolchain/check/testdata/class/generic/import.carbon index ea6b0b72c38b..859dcd3a8de7 100644 --- a/toolchain/check/testdata/class/generic/import.carbon +++ b/toolchain/check/testdata/class/generic/import.carbon @@ -111,7 +111,8 @@ class Class(U:! type) { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %CompleteClass.e9e: type = class_type @CompleteClass, @CompleteClass(%i32) [concrete] // CHECK:STDOUT: %F.type.b25: type = fn_type @F.2 [concrete] @@ -207,9 +208,10 @@ class Class(U:! type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc8_27.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_27.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc8_27.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc8_27.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc8_27.2: %i32 = converted %int_0, %.loc8_27.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: return %.loc8_27.2 @@ -281,7 +283,8 @@ class Class(U:! type) { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.b9e = facet_value Core.IntLiteral, %impl_witness.847 [concrete] // CHECK:STDOUT: %.088: type = fn_type_with_self_type %Convert.type.ea0, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.4cb [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.4cb, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.47b: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %CompleteClass.val: %CompleteClass.a06 = struct_value (%int_1.47b) [concrete] // CHECK:STDOUT: } @@ -389,9 +392,10 @@ class Class(U:! type) { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc9_17.1: %struct_type.n.44a = struct_literal (%int_1) // CHECK:STDOUT: %impl.elem0: %.088 = impl_witness_access constants.%impl_witness.847, element0 [concrete = constants.%Convert.4cb] -// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [concrete = constants.%int_1.47b] +// CHECK:STDOUT: %bound_method.loc9_17.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_17.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc9_17.2(%int_1) [concrete = constants.%int_1.47b] // CHECK:STDOUT: %.loc9_17.2: init %i32 = converted %int_1, %int.convert_checked [concrete = constants.%int_1.47b] // CHECK:STDOUT: %.loc9_17.3: ref %i32 = class_element_access %return, element0 // CHECK:STDOUT: %.loc9_17.4: init %i32 = initialize_from %.loc9_17.2 to %.loc9_17.3 [concrete = constants.%int_1.47b] diff --git a/toolchain/check/testdata/class/generic/member_access.carbon b/toolchain/check/testdata/class/generic/member_access.carbon index 7e152410f150..2da373ca36b2 100644 --- a/toolchain/check/testdata/class/generic/member_access.carbon +++ b/toolchain/check/testdata/class/generic/member_access.carbon @@ -86,10 +86,12 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %complete_type.1ec: = complete_type_witness %struct_type.x.ed6 [concrete] // CHECK:STDOUT: %MethodCall.type: type = fn_type @MethodCall [concrete] // CHECK:STDOUT: %MethodCall: %MethodCall.type = struct_value () [concrete] +// CHECK:STDOUT: %Get.specific_fn: = specific_function %Get.a40, @Get(%i32) [concrete] // CHECK:STDOUT: %ptr.f7c: type = ptr_type %Class.247 [concrete] // CHECK:STDOUT: %AddrMethodCall.type: type = fn_type @AddrMethodCall [concrete] // CHECK:STDOUT: %AddrMethodCall: %AddrMethodCall.type = struct_value () [concrete] // CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [concrete] +// CHECK:STDOUT: %GetAddr.specific_fn: = specific_function %GetAddr.909, @GetAddr(%i32) [concrete] // CHECK:STDOUT: %complete_type.3d0: = complete_type_witness %ptr.235 [concrete] // CHECK:STDOUT: %complete_type.6ee: = complete_type_witness %ptr.f7c [concrete] // CHECK:STDOUT: } @@ -301,8 +303,9 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %.loc15_11: %Get.type.59d = specific_constant @Class.%Get.decl, @Class(constants.%i32) [concrete = constants.%Get.a40] // CHECK:STDOUT: %Get.ref: %Get.type.59d = name_ref Get, %.loc15_11 [concrete = constants.%Get.a40] // CHECK:STDOUT: %Get.bound: = bound_method %x.ref, %Get.ref -// CHECK:STDOUT: %Get.specific_fn: = specific_function %Get.bound, @Get(constants.%i32) -// CHECK:STDOUT: %Get.call: init %i32 = call %Get.specific_fn(%x.ref) +// CHECK:STDOUT: %Get.specific_fn: = specific_function %Get.ref, @Get(constants.%i32) [concrete = constants.%Get.specific_fn] +// CHECK:STDOUT: %bound_method: = bound_method %x.ref, %Get.specific_fn +// CHECK:STDOUT: %Get.call: init %i32 = call %bound_method(%x.ref) // CHECK:STDOUT: %.loc15_17.1: %i32 = value_of_initializer %Get.call // CHECK:STDOUT: %.loc15_17.2: %i32 = converted %Get.call, %.loc15_17.1 // CHECK:STDOUT: return %.loc15_17.2 @@ -315,9 +318,10 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %.loc19_12.2: %GetAddr.type.be7 = specific_constant @Class.%GetAddr.decl, @Class(constants.%i32) [concrete = constants.%GetAddr.909] // CHECK:STDOUT: %GetAddr.ref: %GetAddr.type.be7 = name_ref GetAddr, %.loc19_12.2 [concrete = constants.%GetAddr.909] // CHECK:STDOUT: %GetAddr.bound: = bound_method %.loc19_12.1, %GetAddr.ref -// CHECK:STDOUT: %GetAddr.specific_fn: = specific_function %GetAddr.bound, @GetAddr(constants.%i32) +// CHECK:STDOUT: %GetAddr.specific_fn: = specific_function %GetAddr.ref, @GetAddr(constants.%i32) [concrete = constants.%GetAddr.specific_fn] +// CHECK:STDOUT: %bound_method: = bound_method %.loc19_12.1, %GetAddr.specific_fn // CHECK:STDOUT: %addr: %ptr.f7c = addr_of %.loc19_12.1 -// CHECK:STDOUT: %GetAddr.call: init %ptr.235 = call %GetAddr.specific_fn(%addr) +// CHECK:STDOUT: %GetAddr.call: init %ptr.235 = call %bound_method(%addr) // CHECK:STDOUT: %.loc19_22.1: %ptr.235 = value_of_initializer %GetAddr.call // CHECK:STDOUT: %.loc19_22.2: %ptr.235 = converted %GetAddr.call, %.loc19_22.1 // CHECK:STDOUT: %.loc19_10.1: ref %i32 = deref %.loc19_22.2 diff --git a/toolchain/check/testdata/class/generic/stringify.carbon b/toolchain/check/testdata/class/generic/stringify.carbon index 5230d26cf41c..793b4c4e8667 100644 --- a/toolchain/check/testdata/class/generic/stringify.carbon +++ b/toolchain/check/testdata/class/generic/stringify.carbon @@ -340,7 +340,8 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_123.fff, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_123.fff, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_123.f7f: %i32 = int_value 123 [concrete] // CHECK:STDOUT: %C.4c3: type = class_type @C, @C(%int_123.f7f) [concrete] // CHECK:STDOUT: } @@ -379,9 +380,10 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %C.ref: %C.type = name_ref C, %C.decl [concrete = constants.%C.generic] // CHECK:STDOUT: %int_123: Core.IntLiteral = int_value 123 [concrete = constants.%int_123.fff] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_123, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_123) [concrete = constants.%int_123.f7f] +// CHECK:STDOUT: %bound_method.loc13_13.1: = bound_method %int_123, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_13.2: = bound_method %int_123, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc13_13.2(%int_123) [concrete = constants.%int_123.f7f] // CHECK:STDOUT: %.loc13_13.2: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_123.f7f] // CHECK:STDOUT: %.loc13_13.3: %i32 = converted %int_123, %.loc13_13.2 [concrete = constants.%int_123.f7f] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_123.f7f) [concrete = constants.%C.4c3] @@ -451,19 +453,20 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %D.val.413: %D = struct_value (%int_1.5d2, %int_2.ef8) [concrete] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete] // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [concrete] // CHECK:STDOUT: %Convert.bound.b30: = bound_method %int_3.1ba, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.b42: = specific_function %Convert.bound.b30, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.047: = bound_method %int_3.1ba, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %Convert.bound.ac3: = bound_method %int_4.0c1, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.450: = specific_function %Convert.bound.ac3, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.1da: = bound_method %int_4.0c1, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete] // CHECK:STDOUT: %D.val.835: %D = struct_value (%int_3.822, %int_4.940) [concrete] // CHECK:STDOUT: } @@ -504,16 +507,18 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %.loc25_25.1: %struct_type.a.b.cfd = struct_literal (%int_1, %int_2) // CHECK:STDOUT: %impl.elem0.loc25_25.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc25_25.1: = bound_method %int_1, %impl.elem0.loc25_25.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc25_25.1: = specific_function %bound_method.loc25_25.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc25_25.1: init %i32 = call %specific_fn.loc25_25.1(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc25_25.1: = specific_function %impl.elem0.loc25_25.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc25_25.2: = bound_method %int_1, %specific_fn.loc25_25.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc25_25.1: init %i32 = call %bound_method.loc25_25.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc25_25.2: init %i32 = converted %int_1, %int.convert_checked.loc25_25.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc25_25.3: ref %D = temporary_storage // CHECK:STDOUT: %.loc25_25.4: ref %i32 = class_element_access %.loc25_25.3, element0 // CHECK:STDOUT: %.loc25_25.5: init %i32 = initialize_from %.loc25_25.2 to %.loc25_25.4 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc25_25.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc25_25.2: = bound_method %int_2, %impl.elem0.loc25_25.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc25_25.2: = specific_function %bound_method.loc25_25.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc25_25.2: init %i32 = call %specific_fn.loc25_25.2(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc25_25.3: = bound_method %int_2, %impl.elem0.loc25_25.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc25_25.2: = specific_function %impl.elem0.loc25_25.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc25_25.4: = bound_method %int_2, %specific_fn.loc25_25.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc25_25.2: init %i32 = call %bound_method.loc25_25.4(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc25_25.6: init %i32 = converted %int_2, %int.convert_checked.loc25_25.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc25_25.7: ref %i32 = class_element_access %.loc25_25.3, element1 // CHECK:STDOUT: %.loc25_25.8: init %i32 = initialize_from %.loc25_25.6 to %.loc25_25.7 [concrete = constants.%int_2.ef8] @@ -570,16 +575,18 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D] // CHECK:STDOUT: %impl.elem0.loc25_53.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc25_53.1: = bound_method %int_3, %impl.elem0.loc25_53.1 [concrete = constants.%Convert.bound.b30] -// CHECK:STDOUT: %specific_fn.loc25_53.1: = specific_function %bound_method.loc25_53.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc25_53.1: init %i32 = call %specific_fn.loc25_53.1(%int_3) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %specific_fn.loc25_53.1: = specific_function %impl.elem0.loc25_53.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc25_53.2: = bound_method %int_3, %specific_fn.loc25_53.1 [concrete = constants.%bound_method.047] +// CHECK:STDOUT: %int.convert_checked.loc25_53.1: init %i32 = call %bound_method.loc25_53.2(%int_3) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc25_53.2: init %i32 = converted %int_3, %int.convert_checked.loc25_53.1 [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc25_53.3: ref %D = temporary_storage // CHECK:STDOUT: %.loc25_53.4: ref %i32 = class_element_access %.loc25_53.3, element0 // CHECK:STDOUT: %.loc25_53.5: init %i32 = initialize_from %.loc25_53.2 to %.loc25_53.4 [concrete = constants.%int_3.822] // CHECK:STDOUT: %impl.elem0.loc25_53.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc25_53.2: = bound_method %int_4, %impl.elem0.loc25_53.2 [concrete = constants.%Convert.bound.ac3] -// CHECK:STDOUT: %specific_fn.loc25_53.2: = specific_function %bound_method.loc25_53.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.450] -// CHECK:STDOUT: %int.convert_checked.loc25_53.2: init %i32 = call %specific_fn.loc25_53.2(%int_4) [concrete = constants.%int_4.940] +// CHECK:STDOUT: %bound_method.loc25_53.3: = bound_method %int_4, %impl.elem0.loc25_53.2 [concrete = constants.%Convert.bound.ac3] +// CHECK:STDOUT: %specific_fn.loc25_53.2: = specific_function %impl.elem0.loc25_53.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc25_53.4: = bound_method %int_4, %specific_fn.loc25_53.2 [concrete = constants.%bound_method.1da] +// CHECK:STDOUT: %int.convert_checked.loc25_53.2: init %i32 = call %bound_method.loc25_53.4(%int_4) [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc25_53.6: init %i32 = converted %int_4, %int.convert_checked.loc25_53.2 [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc25_53.7: ref %i32 = class_element_access %.loc25_53.3, element1 // CHECK:STDOUT: %.loc25_53.8: init %i32 = initialize_from %.loc25_53.6 to %.loc25_53.7 [concrete = constants.%int_4.940] diff --git a/toolchain/check/testdata/class/import.carbon b/toolchain/check/testdata/class/import.carbon index 7a43509e5d15..8f4262d29eb1 100644 --- a/toolchain/check/testdata/class/import.carbon +++ b/toolchain/check/testdata/class/import.carbon @@ -177,13 +177,14 @@ fn Run() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.9ba = facet_value Core.IntLiteral, %impl_witness.b97 [concrete] // CHECK:STDOUT: %.39b: type = fn_type_with_self_type %Convert.type.6da, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.43e: = bound_method %int_1.5b8, %Convert.16d [concrete] -// CHECK:STDOUT: %Convert.specific_fn.c37: = specific_function %Convert.bound.43e, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.16d, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.947: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.47b: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Field.val: %Field = struct_value (%int_1.47b) [concrete] // CHECK:STDOUT: %Field.elem: type = unbound_element_type %Field, %i32 [concrete] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %Convert.bound.918: = bound_method %int_2.ecc, %Convert.16d [concrete] -// CHECK:STDOUT: %Convert.specific_fn.5a4: = specific_function %Convert.bound.918, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.c74: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.d0d: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %ForwardDeclared.7b34f2.1: type = class_type @ForwardDeclared.1 [concrete] // CHECK:STDOUT: %ForwardDeclared.val: %ForwardDeclared.7b34f2.1 = struct_value () [concrete] @@ -291,9 +292,10 @@ fn Run() { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc9_25.1: %struct_type.x.c96 = struct_literal (%int_1) // CHECK:STDOUT: %impl.elem0.loc9: %.39b = impl_witness_access constants.%impl_witness.b97, element0 [concrete = constants.%Convert.16d] -// CHECK:STDOUT: %bound_method.loc9: = bound_method %int_1, %impl.elem0.loc9 [concrete = constants.%Convert.bound.43e] -// CHECK:STDOUT: %specific_fn.loc9: = specific_function %bound_method.loc9, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.c37] -// CHECK:STDOUT: %int.convert_checked.loc9: init %i32 = call %specific_fn.loc9(%int_1) [concrete = constants.%int_1.47b] +// CHECK:STDOUT: %bound_method.loc9_25.1: = bound_method %int_1, %impl.elem0.loc9 [concrete = constants.%Convert.bound.43e] +// CHECK:STDOUT: %specific_fn.loc9: = specific_function %impl.elem0.loc9, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_25.2: = bound_method %int_1, %specific_fn.loc9 [concrete = constants.%bound_method.947] +// CHECK:STDOUT: %int.convert_checked.loc9: init %i32 = call %bound_method.loc9_25.2(%int_1) [concrete = constants.%int_1.47b] // CHECK:STDOUT: %.loc9_25.2: init %i32 = converted %int_1, %int.convert_checked.loc9 [concrete = constants.%int_1.47b] // CHECK:STDOUT: %.loc9_25.3: ref %i32 = class_element_access %b.var, element0 // CHECK:STDOUT: %.loc9_25.4: init %i32 = initialize_from %.loc9_25.2 to %.loc9_25.3 [concrete = constants.%int_1.47b] @@ -307,9 +309,10 @@ fn Run() { // CHECK:STDOUT: %.loc10_4: ref %i32 = class_element_access %b.ref, element0 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %impl.elem0.loc10: %.39b = impl_witness_access constants.%impl_witness.b97, element0 [concrete = constants.%Convert.16d] -// CHECK:STDOUT: %bound_method.loc10: = bound_method %int_2, %impl.elem0.loc10 [concrete = constants.%Convert.bound.918] -// CHECK:STDOUT: %specific_fn.loc10: = specific_function %bound_method.loc10, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.5a4] -// CHECK:STDOUT: %int.convert_checked.loc10: init %i32 = call %specific_fn.loc10(%int_2) [concrete = constants.%int_2.d0d] +// CHECK:STDOUT: %bound_method.loc10_7.1: = bound_method %int_2, %impl.elem0.loc10 [concrete = constants.%Convert.bound.918] +// CHECK:STDOUT: %specific_fn.loc10: = specific_function %impl.elem0.loc10, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_7.2: = bound_method %int_2, %specific_fn.loc10 [concrete = constants.%bound_method.c74] +// CHECK:STDOUT: %int.convert_checked.loc10: init %i32 = call %bound_method.loc10_7.2(%int_2) [concrete = constants.%int_2.d0d] // CHECK:STDOUT: %.loc10_7: init %i32 = converted %int_2, %int.convert_checked.loc10 [concrete = constants.%int_2.d0d] // CHECK:STDOUT: assign %.loc10_4, %.loc10_7 // CHECK:STDOUT: name_binding_decl { @@ -361,5 +364,5 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F[%self.param_patt: %ForwardDeclared.7b34f2.1]() [from "a.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @G[addr .inst1155: %ptr.6cf]() [from "a.carbon"]; +// CHECK:STDOUT: fn @G[addr .inst1158: %ptr.6cf]() [from "a.carbon"]; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/import_base.carbon b/toolchain/check/testdata/class/import_base.carbon index 5233b4af4906..378c63313659 100644 --- a/toolchain/check/testdata/class/import_base.carbon +++ b/toolchain/check/testdata/class/import_base.carbon @@ -155,17 +155,18 @@ fn Run() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.9ba = facet_value Core.IntLiteral, %impl_witness.b97 [concrete] // CHECK:STDOUT: %.39b: type = fn_type_with_self_type %Convert.type.6da, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.9aa: = bound_method %int_0.5c6, %Convert.16d [concrete] -// CHECK:STDOUT: %Convert.specific_fn.bae: = specific_function %Convert.bound.9aa, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.16d, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.8aa: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.263: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %Convert.bound.43e: = bound_method %int_1.5b8, %Convert.16d [concrete] -// CHECK:STDOUT: %Convert.specific_fn.c37: = specific_function %Convert.bound.43e, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.947: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.47b: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Base.val: %Base = struct_value (%int_0.263, %int_1.47b) [concrete] // CHECK:STDOUT: %Child.val: %Child = struct_value (%Base.val) [concrete] // CHECK:STDOUT: %Base.elem: type = unbound_element_type %Base, %i32 [concrete] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %Convert.bound.918: = bound_method %int_2.ecc, %Convert.16d [concrete] -// CHECK:STDOUT: %Convert.specific_fn.5a4: = specific_function %Convert.bound.918, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.c74: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.d0d: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] @@ -238,16 +239,18 @@ fn Run() { // CHECK:STDOUT: %.loc7_48.1: %struct_type.base.6c7 = struct_literal (%.loc7_47.1) // CHECK:STDOUT: %impl.elem0.loc7_47.1: %.39b = impl_witness_access constants.%impl_witness.b97, element0 [concrete = constants.%Convert.16d] // CHECK:STDOUT: %bound_method.loc7_47.1: = bound_method %int_0, %impl.elem0.loc7_47.1 [concrete = constants.%Convert.bound.9aa] -// CHECK:STDOUT: %specific_fn.loc7_47.1: = specific_function %bound_method.loc7_47.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.bae] -// CHECK:STDOUT: %int.convert_checked.loc7_47.1: init %i32 = call %specific_fn.loc7_47.1(%int_0) [concrete = constants.%int_0.263] +// CHECK:STDOUT: %specific_fn.loc7_47.1: = specific_function %impl.elem0.loc7_47.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc7_47.2: = bound_method %int_0, %specific_fn.loc7_47.1 [concrete = constants.%bound_method.8aa] +// CHECK:STDOUT: %int.convert_checked.loc7_47.1: init %i32 = call %bound_method.loc7_47.2(%int_0) [concrete = constants.%int_0.263] // CHECK:STDOUT: %.loc7_47.2: init %i32 = converted %int_0, %int.convert_checked.loc7_47.1 [concrete = constants.%int_0.263] // CHECK:STDOUT: %.loc7_48.2: ref %Base = class_element_access %a.var, element0 // CHECK:STDOUT: %.loc7_47.3: ref %i32 = class_element_access %.loc7_48.2, element0 // CHECK:STDOUT: %.loc7_47.4: init %i32 = initialize_from %.loc7_47.2 to %.loc7_47.3 [concrete = constants.%int_0.263] // CHECK:STDOUT: %impl.elem0.loc7_47.2: %.39b = impl_witness_access constants.%impl_witness.b97, element0 [concrete = constants.%Convert.16d] -// CHECK:STDOUT: %bound_method.loc7_47.2: = bound_method %int_1, %impl.elem0.loc7_47.2 [concrete = constants.%Convert.bound.43e] -// CHECK:STDOUT: %specific_fn.loc7_47.2: = specific_function %bound_method.loc7_47.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.c37] -// CHECK:STDOUT: %int.convert_checked.loc7_47.2: init %i32 = call %specific_fn.loc7_47.2(%int_1) [concrete = constants.%int_1.47b] +// CHECK:STDOUT: %bound_method.loc7_47.3: = bound_method %int_1, %impl.elem0.loc7_47.2 [concrete = constants.%Convert.bound.43e] +// CHECK:STDOUT: %specific_fn.loc7_47.2: = specific_function %impl.elem0.loc7_47.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc7_47.4: = bound_method %int_1, %specific_fn.loc7_47.2 [concrete = constants.%bound_method.947] +// CHECK:STDOUT: %int.convert_checked.loc7_47.2: init %i32 = call %bound_method.loc7_47.4(%int_1) [concrete = constants.%int_1.47b] // CHECK:STDOUT: %.loc7_47.5: init %i32 = converted %int_1, %int.convert_checked.loc7_47.2 [concrete = constants.%int_1.47b] // CHECK:STDOUT: %.loc7_47.6: ref %i32 = class_element_access %.loc7_48.2, element1 // CHECK:STDOUT: %.loc7_47.7: init %i32 = initialize_from %.loc7_47.5 to %.loc7_47.6 [concrete = constants.%int_1.47b] @@ -265,9 +268,10 @@ fn Run() { // CHECK:STDOUT: %.loc8_4.3: ref %i32 = class_element_access %.loc8_4.2, element0 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %impl.elem0.loc8: %.39b = impl_witness_access constants.%impl_witness.b97, element0 [concrete = constants.%Convert.16d] -// CHECK:STDOUT: %bound_method.loc8: = bound_method %int_2, %impl.elem0.loc8 [concrete = constants.%Convert.bound.918] -// CHECK:STDOUT: %specific_fn.loc8: = specific_function %bound_method.loc8, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.5a4] -// CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %specific_fn.loc8(%int_2) [concrete = constants.%int_2.d0d] +// CHECK:STDOUT: %bound_method.loc8_7.1: = bound_method %int_2, %impl.elem0.loc8 [concrete = constants.%Convert.bound.918] +// CHECK:STDOUT: %specific_fn.loc8: = specific_function %impl.elem0.loc8, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_7.2: = bound_method %int_2, %specific_fn.loc8 [concrete = constants.%bound_method.c74] +// CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %bound_method.loc8_7.2(%int_2) [concrete = constants.%int_2.d0d] // CHECK:STDOUT: %.loc8_7: init %i32 = converted %int_2, %int.convert_checked.loc8 [concrete = constants.%int_2.d0d] // CHECK:STDOUT: assign %.loc8_4.3, %.loc8_7 // CHECK:STDOUT: %a.ref.loc9: ref %Child = name_ref a, %a diff --git a/toolchain/check/testdata/class/inheritance_access.carbon b/toolchain/check/testdata/class/inheritance_access.carbon index 69913a1be510..b4eef7cad818 100644 --- a/toolchain/check/testdata/class/inheritance_access.carbon +++ b/toolchain/check/testdata/class/inheritance_access.carbon @@ -483,7 +483,8 @@ class B { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5.64b, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_5.64b, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_5.0f6: %i32 = int_value 5 [concrete] // CHECK:STDOUT: %SomeProtectedFunction.type: type = fn_type @SomeProtectedFunction [concrete] // CHECK:STDOUT: %SomeProtectedFunction: %SomeProtectedFunction.type = struct_value () [concrete] @@ -529,9 +530,10 @@ class B { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_5, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_5) [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %bound_method.loc5_38.1: = bound_method %int_5, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc5_38.2: = bound_method %int_5, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc5_38.2(%int_5) [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc5_38.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc5_38.2: %i32 = converted %int_5, %.loc5_38.1 [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %SOME_CONSTANT: %i32 = bind_name SOME_CONSTANT, %.loc5_38.2 @@ -591,9 +593,10 @@ class B { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete = constants.%int_5.64b] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_5, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_5) [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %bound_method.loc7_13.1: = bound_method %int_5, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc7_13.2: = bound_method %int_5, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc7_13.2(%int_5) [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc7_13.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc7_13.2: %i32 = converted %int_5, %.loc7_13.1 [concrete = constants.%int_5.0f6] // CHECK:STDOUT: return %.loc7_13.2 @@ -971,7 +974,8 @@ class B { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5.64b, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_5.64b, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_5.0f6: %i32 = int_value 5 [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] @@ -1018,9 +1022,10 @@ class B { // CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0.loc5: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc5: = bound_method %int_5.loc5, %impl.elem0.loc5 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc5: = specific_function %bound_method.loc5, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc5: init %i32 = call %specific_fn.loc5(%int_5.loc5) [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %bound_method.loc5_48.1: = bound_method %int_5.loc5, %impl.elem0.loc5 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc5: = specific_function %impl.elem0.loc5, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc5_48.2: = bound_method %int_5.loc5, %specific_fn.loc5 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc5: init %i32 = call %bound_method.loc5_48.2(%int_5.loc5) [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc5_48.1: %i32 = value_of_initializer %int.convert_checked.loc5 [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc5_48.2: %i32 = converted %int_5.loc5, %.loc5_48.1 [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %SOME_PROTECTED_CONSTANT: %i32 = bind_name SOME_PROTECTED_CONSTANT, %.loc5_48.2 @@ -1033,9 +1038,10 @@ class B { // CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0.loc6: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc6: = bound_method %int_5.loc6, %impl.elem0.loc6 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc6: = specific_function %bound_method.loc6, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %specific_fn.loc6(%int_5.loc6) [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %bound_method.loc6_44.1: = bound_method %int_5.loc6, %impl.elem0.loc6 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc6: = specific_function %impl.elem0.loc6, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_44.2: = bound_method %int_5.loc6, %specific_fn.loc6 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %bound_method.loc6_44.2(%int_5.loc6) [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc6_44.1: %i32 = value_of_initializer %int.convert_checked.loc6 [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc6_44.2: %i32 = converted %int_5.loc6, %.loc6_44.1 [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %SOME_PRIVATE_CONSTANT: %i32 = bind_name SOME_PRIVATE_CONSTANT, %.loc6_44.2 @@ -1058,9 +1064,10 @@ class B { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_5, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_5) [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %bound_method.loc10_42.1: = bound_method %int_5, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_42.2: = bound_method %int_5, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc10_42.2(%int_5) [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc10_42.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc10_42.2: %i32 = converted %int_5, %.loc10_42.1 [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %INTERNAL_CONSTANT: %i32 = bind_name INTERNAL_CONSTANT, %.loc10_42.2 diff --git a/toolchain/check/testdata/class/init_as.carbon b/toolchain/check/testdata/class/init_as.carbon index 4a6cd6ef1e99..f6f15d213e96 100644 --- a/toolchain/check/testdata/class/init_as.carbon +++ b/toolchain/check/testdata/class/init_as.carbon @@ -39,10 +39,11 @@ fn F() -> i32 { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %Class.val: %Class = struct_value (%int_1.5d2, %int_2.ef8) [concrete] // CHECK:STDOUT: } @@ -103,16 +104,18 @@ fn F() -> i32 { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [concrete = constants.%Class] // CHECK:STDOUT: %impl.elem0.loc17_26.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc17_26.1: = bound_method %int_1, %impl.elem0.loc17_26.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc17_26.1: = specific_function %bound_method.loc17_26.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc17_26.1: init %i32 = call %specific_fn.loc17_26.1(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc17_26.1: = specific_function %impl.elem0.loc17_26.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc17_26.2: = bound_method %int_1, %specific_fn.loc17_26.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc17_26.1: init %i32 = call %bound_method.loc17_26.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc17_26.2: init %i32 = converted %int_1, %int.convert_checked.loc17_26.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc17_26.3: ref %Class = temporary_storage // CHECK:STDOUT: %.loc17_26.4: ref %i32 = class_element_access %.loc17_26.3, element0 // CHECK:STDOUT: %.loc17_26.5: init %i32 = initialize_from %.loc17_26.2 to %.loc17_26.4 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc17_26.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc17_26.2: = bound_method %int_2, %impl.elem0.loc17_26.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc17_26.2: = specific_function %bound_method.loc17_26.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc17_26.2: init %i32 = call %specific_fn.loc17_26.2(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc17_26.3: = bound_method %int_2, %impl.elem0.loc17_26.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc17_26.2: = specific_function %impl.elem0.loc17_26.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc17_26.4: = bound_method %int_2, %specific_fn.loc17_26.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc17_26.2: init %i32 = call %bound_method.loc17_26.4(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc17_26.6: init %i32 = converted %int_2, %int.convert_checked.loc17_26.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc17_26.7: ref %i32 = class_element_access %.loc17_26.3, element1 // CHECK:STDOUT: %.loc17_26.8: init %i32 = initialize_from %.loc17_26.6 to %.loc17_26.7 [concrete = constants.%int_2.ef8] diff --git a/toolchain/check/testdata/class/local.carbon b/toolchain/check/testdata/class/local.carbon index 4155c8b31bd8..f6e818030c1b 100644 --- a/toolchain/check/testdata/class/local.carbon +++ b/toolchain/check/testdata/class/local.carbon @@ -49,7 +49,8 @@ class A { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %B.val: %B = struct_value (%int_1.5d2) [concrete] // CHECK:STDOUT: } @@ -136,9 +137,10 @@ class A { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc15_39.1: %struct_type.n.44a = struct_literal (%int_1) // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc15_39.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc15_39.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc15_39.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc15_39.2: init %i32 = converted %int_1, %int.convert_checked [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc15_39.3: ref %i32 = class_element_access %return, element0 // CHECK:STDOUT: %.loc15_39.4: init %i32 = initialize_from %.loc15_39.2 to %.loc15_39.3 [concrete = constants.%int_1.5d2] diff --git a/toolchain/check/testdata/class/method.carbon b/toolchain/check/testdata/class/method.carbon index 7b2c37d684cd..3f6e77056cb0 100644 --- a/toolchain/check/testdata/class/method.carbon +++ b/toolchain/check/testdata/class/method.carbon @@ -88,7 +88,8 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Class.val: %Class = struct_value (%int_1.5d2) [concrete] // CHECK:STDOUT: %CallWithAddr.type: type = fn_type @CallWithAddr [concrete] @@ -342,9 +343,10 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %.loc35_18.1: %struct_type.k.240 = struct_literal (%int_1) // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [concrete = constants.%Class] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc35_18.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc35_18.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc35_18.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc35_18.2: init %i32 = converted %int_1, %int.convert_checked [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc35_18.3: ref %Class = temporary_storage // CHECK:STDOUT: %.loc35_18.4: ref %i32 = class_element_access %.loc35_18.3, element0 diff --git a/toolchain/check/testdata/class/reorder.carbon b/toolchain/check/testdata/class/reorder.carbon index 0085b7cc7715..b52a0b456ece 100644 --- a/toolchain/check/testdata/class/reorder.carbon +++ b/toolchain/check/testdata/class/reorder.carbon @@ -39,7 +39,8 @@ class Class { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -104,9 +105,10 @@ class Class { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc17_13.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc17_13.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc17_13.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc17_13.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc17_13.2: %i32 = converted %int_1, %.loc17_13.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: return %.loc17_13.2 diff --git a/toolchain/check/testdata/class/reorder_qualified.carbon b/toolchain/check/testdata/class/reorder_qualified.carbon index 654b680aca0c..73aa1c77d6da 100644 --- a/toolchain/check/testdata/class/reorder_qualified.carbon +++ b/toolchain/check/testdata/class/reorder_qualified.carbon @@ -88,25 +88,26 @@ class A { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %A.val: %A = struct_value (%int_1.5d2) [concrete] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %struct_type.b.a15: type = struct_type {.b: Core.IntLiteral} [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %B.val: %B = struct_value (%int_2.ef8) [concrete] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete] // CHECK:STDOUT: %struct_type.c.5b8: type = struct_type {.c: Core.IntLiteral} [concrete] // CHECK:STDOUT: %Convert.bound.b30: = bound_method %int_3.1ba, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.b42: = specific_function %Convert.bound.b30, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.047: = bound_method %int_3.1ba, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %C.val: %C = struct_value (%int_3.822) [concrete] // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [concrete] // CHECK:STDOUT: %struct_type.d.3ea: type = struct_type {.d: Core.IntLiteral} [concrete] // CHECK:STDOUT: %Convert.bound.ac3: = bound_method %int_4.0c1, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.450: = specific_function %Convert.bound.ac3, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.1da: = bound_method %int_4.0c1, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete] // CHECK:STDOUT: %D.val: %D = struct_value (%int_4.940) [concrete] // CHECK:STDOUT: } @@ -233,9 +234,10 @@ class A { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc29_25.1: %struct_type.a.a6c = struct_literal (%int_1) // CHECK:STDOUT: %impl.elem0.loc29: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc29: = bound_method %int_1, %impl.elem0.loc29 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc29: = specific_function %bound_method.loc29, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc29: init %i32 = call %specific_fn.loc29(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc29_25.1: = bound_method %int_1, %impl.elem0.loc29 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc29: = specific_function %impl.elem0.loc29, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc29_25.2: = bound_method %int_1, %specific_fn.loc29 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc29: init %i32 = call %bound_method.loc29_25.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc29_25.2: init %i32 = converted %int_1, %int.convert_checked.loc29 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc29_25.3: ref %i32 = class_element_access %a.var, element0 // CHECK:STDOUT: %.loc29_25.4: init %i32 = initialize_from %.loc29_25.2 to %.loc29_25.3 [concrete = constants.%int_1.5d2] @@ -252,9 +254,10 @@ class A { // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %.loc30_25.1: %struct_type.b.a15 = struct_literal (%int_2) // CHECK:STDOUT: %impl.elem0.loc30: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc30: = bound_method %int_2, %impl.elem0.loc30 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc30: = specific_function %bound_method.loc30, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc30: init %i32 = call %specific_fn.loc30(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc30_25.1: = bound_method %int_2, %impl.elem0.loc30 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc30: = specific_function %impl.elem0.loc30, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc30_25.2: = bound_method %int_2, %specific_fn.loc30 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc30: init %i32 = call %bound_method.loc30_25.2(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc30_25.2: init %i32 = converted %int_2, %int.convert_checked.loc30 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc30_25.3: ref %i32 = class_element_access %b.var, element0 // CHECK:STDOUT: %.loc30_25.4: init %i32 = initialize_from %.loc30_25.2 to %.loc30_25.3 [concrete = constants.%int_2.ef8] @@ -271,9 +274,10 @@ class A { // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %.loc31_25.1: %struct_type.c.5b8 = struct_literal (%int_3) // CHECK:STDOUT: %impl.elem0.loc31: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc31: = bound_method %int_3, %impl.elem0.loc31 [concrete = constants.%Convert.bound.b30] -// CHECK:STDOUT: %specific_fn.loc31: = specific_function %bound_method.loc31, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc31: init %i32 = call %specific_fn.loc31(%int_3) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %bound_method.loc31_25.1: = bound_method %int_3, %impl.elem0.loc31 [concrete = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc31: = specific_function %impl.elem0.loc31, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc31_25.2: = bound_method %int_3, %specific_fn.loc31 [concrete = constants.%bound_method.047] +// CHECK:STDOUT: %int.convert_checked.loc31: init %i32 = call %bound_method.loc31_25.2(%int_3) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc31_25.2: init %i32 = converted %int_3, %int.convert_checked.loc31 [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc31_25.3: ref %i32 = class_element_access %c.var, element0 // CHECK:STDOUT: %.loc31_25.4: init %i32 = initialize_from %.loc31_25.2 to %.loc31_25.3 [concrete = constants.%int_3.822] @@ -290,9 +294,10 @@ class A { // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1] // CHECK:STDOUT: %.loc32_25.1: %struct_type.d.3ea = struct_literal (%int_4) // CHECK:STDOUT: %impl.elem0.loc32: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc32: = bound_method %int_4, %impl.elem0.loc32 [concrete = constants.%Convert.bound.ac3] -// CHECK:STDOUT: %specific_fn.loc32: = specific_function %bound_method.loc32, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.450] -// CHECK:STDOUT: %int.convert_checked.loc32: init %i32 = call %specific_fn.loc32(%int_4) [concrete = constants.%int_4.940] +// CHECK:STDOUT: %bound_method.loc32_25.1: = bound_method %int_4, %impl.elem0.loc32 [concrete = constants.%Convert.bound.ac3] +// CHECK:STDOUT: %specific_fn.loc32: = specific_function %impl.elem0.loc32, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc32_25.2: = bound_method %int_4, %specific_fn.loc32 [concrete = constants.%bound_method.1da] +// CHECK:STDOUT: %int.convert_checked.loc32: init %i32 = call %bound_method.loc32_25.2(%int_4) [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc32_25.2: init %i32 = converted %int_4, %int.convert_checked.loc32 [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc32_25.3: ref %i32 = class_element_access %d.var, element0 // CHECK:STDOUT: %.loc32_25.4: init %i32 = initialize_from %.loc32_25.2 to %.loc32_25.3 [concrete = constants.%int_4.940] diff --git a/toolchain/check/testdata/class/scope.carbon b/toolchain/check/testdata/class/scope.carbon index f172b0aaabf3..60dc778e2e88 100644 --- a/toolchain/check/testdata/class/scope.carbon +++ b/toolchain/check/testdata/class/scope.carbon @@ -48,13 +48,14 @@ fn Run() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %F.type.b25: type = fn_type @F.2 [concrete] // CHECK:STDOUT: %F.c41: %F.type.b25 = struct_value () [concrete] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %Run.type: type = fn_type @Run [concrete] // CHECK:STDOUT: %Run: %Run.type = struct_value () [concrete] @@ -122,9 +123,10 @@ fn Run() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc13_13.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_13.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc13_13.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_13.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_13.2: %i32 = converted %int_1, %.loc13_13.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: return %.loc13_13.2 @@ -143,9 +145,10 @@ fn Run() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_2, %impl.elem0 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc22_11.1: = bound_method %int_2, %impl.elem0 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc22_11.2: = bound_method %int_2, %specific_fn [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc22_11.2(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc22_11.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc22_11.2: %i32 = converted %int_2, %.loc22_11.1 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: return %.loc22_11.2 diff --git a/toolchain/check/testdata/class/self_conversion.carbon b/toolchain/check/testdata/class/self_conversion.carbon index e98781fb1eae..c72a25a3a09f 100644 --- a/toolchain/check/testdata/class/self_conversion.carbon +++ b/toolchain/check/testdata/class/self_conversion.carbon @@ -60,7 +60,8 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %ptr.404: type = ptr_type %Derived [concrete] // CHECK:STDOUT: %Call.type: type = fn_type @Call [concrete] @@ -204,9 +205,10 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: %.loc27_10: ref %i32 = class_element_access %.loc27_4, element0 // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc27_13.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc27_13.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc27_13.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc27_13: init %i32 = converted %int_1, %int.convert_checked [concrete = constants.%int_1.5d2] // CHECK:STDOUT: assign %.loc27_10, %.loc27_13 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/class/syntactic_merge_literal.carbon b/toolchain/check/testdata/class/syntactic_merge_literal.carbon index e4d1184c23d8..0b61ea04344f 100644 --- a/toolchain/check/testdata/class/syntactic_merge_literal.carbon +++ b/toolchain/check/testdata/class/syntactic_merge_literal.carbon @@ -52,7 +52,8 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1000.ff9, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1000.ff9, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1000.1b6: %i32 = int_value 1000 [concrete] // CHECK:STDOUT: %C.262: type = class_type @C, @C(%int_1000.1b6) [concrete] // CHECK:STDOUT: %b: %C.262 = bind_symbolic_name b, 0 [symbolic] @@ -94,9 +95,10 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %C.ref.loc5: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic] // CHECK:STDOUT: %int_1000.loc5: Core.IntLiteral = int_value 1000 [concrete = constants.%int_1000.ff9] // CHECK:STDOUT: %impl.elem0.loc5: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc5: = bound_method %int_1000.loc5, %impl.elem0.loc5 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc5: = specific_function %bound_method.loc5, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc5: init %i32 = call %specific_fn.loc5(%int_1000.loc5) [concrete = constants.%int_1000.1b6] +// CHECK:STDOUT: %bound_method.loc5_20.1: = bound_method %int_1000.loc5, %impl.elem0.loc5 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc5: = specific_function %impl.elem0.loc5, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc5_20.2: = bound_method %int_1000.loc5, %specific_fn.loc5 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc5: init %i32 = call %bound_method.loc5_20.2(%int_1000.loc5) [concrete = constants.%int_1000.1b6] // CHECK:STDOUT: %.loc5_20.2: %i32 = value_of_initializer %int.convert_checked.loc5 [concrete = constants.%int_1000.1b6] // CHECK:STDOUT: %.loc5_20.3: %i32 = converted %int_1000.loc5, %.loc5_20.2 [concrete = constants.%int_1000.1b6] // CHECK:STDOUT: %C.loc5: type = class_type @C, @C(constants.%int_1000.1b6) [concrete = constants.%C.262] @@ -110,9 +112,10 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %C.ref.loc6: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic] // CHECK:STDOUT: %int_1000.loc6: Core.IntLiteral = int_value 1000 [concrete = constants.%int_1000.ff9] // CHECK:STDOUT: %impl.elem0.loc6: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc6: = bound_method %int_1000.loc6, %impl.elem0.loc6 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc6: = specific_function %bound_method.loc6, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %specific_fn.loc6(%int_1000.loc6) [concrete = constants.%int_1000.1b6] +// CHECK:STDOUT: %bound_method.loc6_20.1: = bound_method %int_1000.loc6, %impl.elem0.loc6 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc6: = specific_function %impl.elem0.loc6, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_20.2: = bound_method %int_1000.loc6, %specific_fn.loc6 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %bound_method.loc6_20.2(%int_1000.loc6) [concrete = constants.%int_1000.1b6] // CHECK:STDOUT: %.loc6_20.2: %i32 = value_of_initializer %int.convert_checked.loc6 [concrete = constants.%int_1000.1b6] // CHECK:STDOUT: %.loc6_20.3: %i32 = converted %int_1000.loc6, %.loc6_20.2 [concrete = constants.%int_1000.1b6] // CHECK:STDOUT: %C.loc6: type = class_type @C, @C(constants.%int_1000.1b6) [concrete = constants.%C.262] @@ -187,7 +190,8 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1000.ff9, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1000.ff9, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1000.1b6: %i32 = int_value 1000 [concrete] // CHECK:STDOUT: %C.262: type = class_type @C, @C(%int_1000.1b6) [concrete] // CHECK:STDOUT: %b: %C.262 = bind_symbolic_name b, 0 [symbolic] @@ -231,9 +235,10 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic] // CHECK:STDOUT: %int_1000: Core.IntLiteral = int_value 1000 [concrete = constants.%int_1000.ff9] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_1000, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1000) [concrete = constants.%int_1000.1b6] +// CHECK:STDOUT: %bound_method.loc5_19.1: = bound_method %int_1000, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc5_19.2: = bound_method %int_1000, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc5_19.2(%int_1000) [concrete = constants.%int_1000.1b6] // CHECK:STDOUT: %.loc5_19.2: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_1000.1b6] // CHECK:STDOUT: %.loc5_19.3: %i32 = converted %int_1000, %.loc5_19.2 [concrete = constants.%int_1000.1b6] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_1000.1b6) [concrete = constants.%C.262] @@ -247,9 +252,10 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic] // CHECK:STDOUT: %int_1000: Core.IntLiteral = int_value 1000 [concrete = constants.%int_1000.ff9] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_1000, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1000) [concrete = constants.%int_1000.1b6] +// CHECK:STDOUT: %bound_method.loc13_20.1: = bound_method %int_1000, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_20.2: = bound_method %int_1000, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc13_20.2(%int_1000) [concrete = constants.%int_1000.1b6] // CHECK:STDOUT: %.loc13_20.2: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_1000.1b6] // CHECK:STDOUT: %.loc13_20.3: %i32 = converted %int_1000, %.loc13_20.2 [concrete = constants.%int_1000.1b6] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_1000.1b6) [concrete = constants.%C.262] diff --git a/toolchain/check/testdata/class/virtual_modifiers.carbon b/toolchain/check/testdata/class/virtual_modifiers.carbon index d36c07485d57..51b4f2de2ea2 100644 --- a/toolchain/check/testdata/class/virtual_modifiers.carbon +++ b/toolchain/check/testdata/class/virtual_modifiers.carbon @@ -868,17 +868,18 @@ class T2 { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.b30: = bound_method %int_3.1ba, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.b42: = specific_function %Convert.bound.b30, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.047: = bound_method %int_3.1ba, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %struct_type.m2.m1.68c: type = struct_type {.m2: %i32, .m1: %i32} [concrete] // CHECK:STDOUT: %int_5.64b: Core.IntLiteral = int_value 5 [concrete] // CHECK:STDOUT: %struct_type.m2.m1.5f2: type = struct_type {.m2: Core.IntLiteral, .m1: Core.IntLiteral} [concrete] // CHECK:STDOUT: %Convert.bound.4e6: = bound_method %int_5.64b, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.ba9: = specific_function %Convert.bound.4e6, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.a25: = bound_method %int_5.64b, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_5.0f6: %i32 = int_value 5 [concrete] // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [concrete] // CHECK:STDOUT: %Convert.bound.ac3: = bound_method %int_4.0c1, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.450: = specific_function %Convert.bound.ac3, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.1da: = bound_method %int_4.0c1, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -943,9 +944,10 @@ class T2 { // CHECK:STDOUT: %i.var: ref %i32 = var i // CHECK:STDOUT: %int_3.loc12: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %impl.elem0.loc12: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc12: = bound_method %int_3.loc12, %impl.elem0.loc12 [concrete = constants.%Convert.bound.b30] -// CHECK:STDOUT: %specific_fn.loc12: = specific_function %bound_method.loc12, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %specific_fn.loc12(%int_3.loc12) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %bound_method.loc12_3.1: = bound_method %int_3.loc12, %impl.elem0.loc12 [concrete = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc12: = specific_function %impl.elem0.loc12, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_3.2: = bound_method %int_3.loc12, %specific_fn.loc12 [concrete = constants.%bound_method.047] +// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %bound_method.loc12_3.2(%int_3.loc12) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc12_3.2: init %i32 = converted %int_3.loc12, %int.convert_checked.loc12 [concrete = constants.%int_3.822] // CHECK:STDOUT: assign %i.var, %.loc12_3.2 // CHECK:STDOUT: %.loc12_10: type = splice_block %i32 [concrete = constants.%i32] { @@ -988,15 +990,17 @@ class T2 { // CHECK:STDOUT: %.loc15_35.4: init %ptr.454 = initialize_from %.loc15_35.3 to %.loc15_35.2 // CHECK:STDOUT: %impl.elem0.loc15_35.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc15_35.1: = bound_method %int_5, %impl.elem0.loc15_35.1 [concrete = constants.%Convert.bound.4e6] -// CHECK:STDOUT: %specific_fn.loc15_35.1: = specific_function %bound_method.loc15_35.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.ba9] -// CHECK:STDOUT: %int.convert_checked.loc15_35.1: init %i32 = call %specific_fn.loc15_35.1(%int_5) [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %specific_fn.loc15_35.1: = specific_function %impl.elem0.loc15_35.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc15_35.2: = bound_method %int_5, %specific_fn.loc15_35.1 [concrete = constants.%bound_method.a25] +// CHECK:STDOUT: %int.convert_checked.loc15_35.1: init %i32 = call %bound_method.loc15_35.2(%int_5) [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc15_35.5: init %i32 = converted %int_5, %int.convert_checked.loc15_35.1 [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc15_35.6: ref %i32 = class_element_access %b2.var, element2 // CHECK:STDOUT: %.loc15_35.7: init %i32 = initialize_from %.loc15_35.5 to %.loc15_35.6 [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %impl.elem0.loc15_35.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc15_35.2: = bound_method %int_3.loc15, %impl.elem0.loc15_35.2 [concrete = constants.%Convert.bound.b30] -// CHECK:STDOUT: %specific_fn.loc15_35.2: = specific_function %bound_method.loc15_35.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc15_35.2: init %i32 = call %specific_fn.loc15_35.2(%int_3.loc15) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %bound_method.loc15_35.3: = bound_method %int_3.loc15, %impl.elem0.loc15_35.2 [concrete = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc15_35.2: = specific_function %impl.elem0.loc15_35.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc15_35.4: = bound_method %int_3.loc15, %specific_fn.loc15_35.2 [concrete = constants.%bound_method.047] +// CHECK:STDOUT: %int.convert_checked.loc15_35.2: init %i32 = call %bound_method.loc15_35.4(%int_3.loc15) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc15_35.8: init %i32 = converted %int_3.loc15, %int.convert_checked.loc15_35.2 [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc15_35.9: ref %i32 = class_element_access %b2.var, element1 // CHECK:STDOUT: %.loc15_35.10: init %i32 = initialize_from %.loc15_35.8 to %.loc15_35.9 [concrete = constants.%int_3.822] @@ -1010,9 +1014,10 @@ class T2 { // CHECK:STDOUT: %.loc18_5: ref %i32 = class_element_access %b1.ref, element2 // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1] // CHECK:STDOUT: %impl.elem0.loc18: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc18: = bound_method %int_4, %impl.elem0.loc18 [concrete = constants.%Convert.bound.ac3] -// CHECK:STDOUT: %specific_fn.loc18: = specific_function %bound_method.loc18, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.450] -// CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %specific_fn.loc18(%int_4) [concrete = constants.%int_4.940] +// CHECK:STDOUT: %bound_method.loc18_9.1: = bound_method %int_4, %impl.elem0.loc18 [concrete = constants.%Convert.bound.ac3] +// CHECK:STDOUT: %specific_fn.loc18: = specific_function %impl.elem0.loc18, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc18_9.2: = bound_method %int_4, %specific_fn.loc18 [concrete = constants.%bound_method.1da] +// CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %bound_method.loc18_9.2(%int_4) [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc18_9: init %i32 = converted %int_4, %int.convert_checked.loc18 [concrete = constants.%int_4.940] // CHECK:STDOUT: assign %.loc18_5, %.loc18_9 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/deduce/array.carbon b/toolchain/check/testdata/deduce/array.carbon index e76762d6e812..f7ce987ca181 100644 --- a/toolchain/check/testdata/deduce/array.carbon +++ b/toolchain/check/testdata/deduce/array.carbon @@ -146,7 +146,8 @@ fn G() -> i32 { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] @@ -231,9 +232,10 @@ fn G() -> i32 { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc6_48.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_48.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc6_48.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_48.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_48.2: %i32 = converted %int_0, %.loc6_48.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_49.1: ref @F.%array_type.loc6_29.2 (%array_type.743) = value_as_ref %a.ref @@ -324,8 +326,9 @@ fn G() -> i32 { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.41f: = bound_method %N, %Convert.956 [symbolic] -// CHECK:STDOUT: %Convert.specific_fn.122: = specific_function %Convert.bound.41f, @Convert.2(%int_32) [symbolic] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn.122(%N) [symbolic] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.ad4: = bound_method %N, %Convert.specific_fn [symbolic] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.ad4(%N) [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete] @@ -339,7 +342,7 @@ fn G() -> i32 { // CHECK:STDOUT: %F.specific_fn: = specific_function %F, @F(%int_3.1ba) [concrete] // CHECK:STDOUT: %complete_type.dd1: = complete_type_witness %array_type.002 [concrete] // CHECK:STDOUT: %Convert.bound.b30: = bound_method %int_3.1ba, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.b42: = specific_function %Convert.bound.b30, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.047: = bound_method %int_3.1ba, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -417,16 +420,17 @@ fn G() -> i32 { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type @F.%array_type.loc6_42.2 (%array_type.6a2) [symbolic = %require_complete (constants.%require_complete.d82)] // CHECK:STDOUT: %Convert.bound: = bound_method %N.loc6_6.2, constants.%Convert.956 [symbolic = %Convert.bound (constants.%Convert.bound.41f)] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [symbolic = %Convert.specific_fn (constants.%Convert.specific_fn.122)] -// CHECK:STDOUT: %int.convert_checked.loc6_62.2: init %i32 = call %Convert.specific_fn(%N.loc6_6.2) [symbolic = %int.convert_checked.loc6_62.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %bound_method.loc6_62.3: = bound_method %N.loc6_6.2, constants.%Convert.specific_fn [symbolic = %bound_method.loc6_62.3 (constants.%bound_method.ad4)] +// CHECK:STDOUT: %int.convert_checked.loc6_62.2: init %i32 = call %bound_method.loc6_62.3(%N.loc6_6.2) [symbolic = %int.convert_checked.loc6_62.2 (constants.%int.convert_checked)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%N.patt.loc6_6.1: Core.IntLiteral](%a.param_patt: @F.%array_type.loc6_42.2 (%array_type.6a2)) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %N.ref.loc6_61: Core.IntLiteral = name_ref N, %N.loc6_6.1 [symbolic = %N.loc6_6.2 (constants.%N)] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %N.ref.loc6_61, %impl.elem0 [symbolic = %Convert.bound (constants.%Convert.bound.41f)] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [symbolic = %Convert.specific_fn (constants.%Convert.specific_fn.122)] -// CHECK:STDOUT: %int.convert_checked.loc6_62.1: init %i32 = call %specific_fn(%N.ref.loc6_61) [symbolic = %int.convert_checked.loc6_62.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %bound_method.loc6_62.1: = bound_method %N.ref.loc6_61, %impl.elem0 [symbolic = %Convert.bound (constants.%Convert.bound.41f)] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_62.2: = bound_method %N.ref.loc6_61, %specific_fn [symbolic = %bound_method.loc6_62.3 (constants.%bound_method.ad4)] +// CHECK:STDOUT: %int.convert_checked.loc6_62.1: init %i32 = call %bound_method.loc6_62.2(%N.ref.loc6_61) [symbolic = %int.convert_checked.loc6_62.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc6_62.1: %i32 = value_of_initializer %int.convert_checked.loc6_62.1 [symbolic = %int.convert_checked.loc6_62.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc6_62.2: %i32 = converted %N.ref.loc6_61, %.loc6_62.1 [symbolic = %int.convert_checked.loc6_62.2 (constants.%int.convert_checked)] // CHECK:STDOUT: return %.loc6_62.2 @@ -489,7 +493,7 @@ fn G() -> i32 { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type.dd1 // CHECK:STDOUT: %Convert.bound => constants.%Convert.bound.b30 -// CHECK:STDOUT: %Convert.specific_fn => constants.%Convert.specific_fn.b42 +// CHECK:STDOUT: %bound_method.loc6_62.3 => constants.%bound_method.047 // CHECK:STDOUT: %int.convert_checked.loc6_62.2 => constants.%int_3.822 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -676,7 +680,8 @@ fn G() -> i32 { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] @@ -762,9 +767,10 @@ fn G() -> i32 { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc6_48.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_48.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc6_48.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_48.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_48.2: %i32 = converted %int_0, %.loc6_48.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_49.1: ref @F.%array_type.loc6_29.2 (%array_type.9d4) = value_as_ref %a.ref @@ -856,8 +862,9 @@ fn G() -> i32 { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.41f: = bound_method %N, %Convert.956 [symbolic] -// CHECK:STDOUT: %Convert.specific_fn.122: = specific_function %Convert.bound.41f, @Convert.2(%int_32) [symbolic] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn.122(%N) [symbolic] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.ad4: = bound_method %N, %Convert.specific_fn [symbolic] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.ad4(%N) [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete] @@ -872,7 +879,7 @@ fn G() -> i32 { // CHECK:STDOUT: %F.specific_fn: = specific_function %F, @F(%int_3.1ba) [concrete] // CHECK:STDOUT: %complete_type.dd1: = complete_type_witness %array_type.002 [concrete] // CHECK:STDOUT: %Convert.bound.b30: = bound_method %int_3.1ba, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.b42: = specific_function %Convert.bound.b30, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.047: = bound_method %int_3.1ba, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -960,16 +967,17 @@ fn G() -> i32 { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type @F.%array_type.loc7_42.2 (%array_type.6a2) [symbolic = %require_complete (constants.%require_complete.d82)] // CHECK:STDOUT: %Convert.bound: = bound_method %N.loc7_6.2, constants.%Convert.956 [symbolic = %Convert.bound (constants.%Convert.bound.41f)] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [symbolic = %Convert.specific_fn (constants.%Convert.specific_fn.122)] -// CHECK:STDOUT: %int.convert_checked.loc7_62.2: init %i32 = call %Convert.specific_fn(%N.loc7_6.2) [symbolic = %int.convert_checked.loc7_62.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %bound_method.loc7_62.3: = bound_method %N.loc7_6.2, constants.%Convert.specific_fn [symbolic = %bound_method.loc7_62.3 (constants.%bound_method.ad4)] +// CHECK:STDOUT: %int.convert_checked.loc7_62.2: init %i32 = call %bound_method.loc7_62.3(%N.loc7_6.2) [symbolic = %int.convert_checked.loc7_62.2 (constants.%int.convert_checked)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%N.patt.loc7_6.1: Core.IntLiteral](%a.param_patt: @F.%array_type.loc7_42.2 (%array_type.6a2)) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %N.ref.loc7_61: Core.IntLiteral = name_ref N, %N.loc7_6.1 [symbolic = %N.loc7_6.2 (constants.%N)] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %N.ref.loc7_61, %impl.elem0 [symbolic = %Convert.bound (constants.%Convert.bound.41f)] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [symbolic = %Convert.specific_fn (constants.%Convert.specific_fn.122)] -// CHECK:STDOUT: %int.convert_checked.loc7_62.1: init %i32 = call %specific_fn(%N.ref.loc7_61) [symbolic = %int.convert_checked.loc7_62.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %bound_method.loc7_62.1: = bound_method %N.ref.loc7_61, %impl.elem0 [symbolic = %Convert.bound (constants.%Convert.bound.41f)] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc7_62.2: = bound_method %N.ref.loc7_61, %specific_fn [symbolic = %bound_method.loc7_62.3 (constants.%bound_method.ad4)] +// CHECK:STDOUT: %int.convert_checked.loc7_62.1: init %i32 = call %bound_method.loc7_62.2(%N.ref.loc7_61) [symbolic = %int.convert_checked.loc7_62.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc7_62.1: %i32 = value_of_initializer %int.convert_checked.loc7_62.1 [symbolic = %int.convert_checked.loc7_62.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc7_62.2: %i32 = converted %N.ref.loc7_61, %.loc7_62.1 [symbolic = %int.convert_checked.loc7_62.2 (constants.%int.convert_checked)] // CHECK:STDOUT: return %.loc7_62.2 @@ -1032,7 +1040,7 @@ fn G() -> i32 { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type.dd1 // CHECK:STDOUT: %Convert.bound => constants.%Convert.bound.b30 -// CHECK:STDOUT: %Convert.specific_fn => constants.%Convert.specific_fn.b42 +// CHECK:STDOUT: %bound_method.loc7_62.3 => constants.%bound_method.047 // CHECK:STDOUT: %int.convert_checked.loc7_62.2 => constants.%int_3.822 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1054,12 +1062,13 @@ fn G() -> i32 { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.2fd = facet_value %i32, %impl_witness.023 [concrete] // CHECK:STDOUT: %.10e: type = fn_type_with_self_type %Convert.type.71e, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %N.51e, %Convert.960 [symbolic] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.3(%int_32) [symbolic] -// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn(%N.51e) [symbolic] -// CHECK:STDOUT: %array_type.c13: type = array_type %int.convert_checked, %C [symbolic] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.960, @Convert.3(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %N.51e, %Convert.specific_fn [symbolic] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %bound_method(%N.51e) [symbolic] +// CHECK:STDOUT: %array_type.b2f: type = array_type %int.convert_checked, %C [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] -// CHECK:STDOUT: %require_complete.303: = require_complete_type %array_type.c13 [symbolic] +// CHECK:STDOUT: %require_complete.cde: = require_complete_type %array_type.b2f [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete] @@ -1092,8 +1101,8 @@ fn G() -> i32 { // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { // CHECK:STDOUT: %N.patt.loc6_6.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc6_6.2 (constants.%N.patt.8e2)] -// CHECK:STDOUT: %a.patt: @F.%array_type.loc6_28.2 (%array_type.c13) = binding_pattern a -// CHECK:STDOUT: %a.param_patt: @F.%array_type.loc6_28.2 (%array_type.c13) = value_param_pattern %a.patt, call_param0 +// CHECK:STDOUT: %a.patt: @F.%array_type.loc6_28.2 (%array_type.b2f) = binding_pattern a +// CHECK:STDOUT: %a.param_patt: @F.%array_type.loc6_28.2 (%array_type.b2f) = value_param_pattern %a.patt, call_param0 // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, call_param1 // CHECK:STDOUT: } { @@ -1104,19 +1113,20 @@ fn G() -> i32 { // CHECK:STDOUT: %i32.loc6_10: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %N.loc6_6.1: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc6_6.2 (constants.%N.51e)] -// CHECK:STDOUT: %a.param: @F.%array_type.loc6_28.2 (%array_type.c13) = value_param call_param0 -// CHECK:STDOUT: %.loc6_28: type = splice_block %array_type.loc6_28.1 [symbolic = %array_type.loc6_28.2 (constants.%array_type.c13)] { +// CHECK:STDOUT: %a.param: @F.%array_type.loc6_28.2 (%array_type.b2f) = value_param call_param0 +// CHECK:STDOUT: %.loc6_28: type = splice_block %array_type.loc6_28.1 [symbolic = %array_type.loc6_28.2 (constants.%array_type.b2f)] { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %N.ref.loc6_27: %i32 = name_ref N, %N.loc6_6.1 [symbolic = %N.loc6_6.2 (constants.%N.51e)] // CHECK:STDOUT: %impl.elem0: %.10e = impl_witness_access constants.%impl_witness.023, element0 [concrete = constants.%Convert.960] -// CHECK:STDOUT: %bound_method: = bound_method %N.ref.loc6_27, %impl.elem0 [symbolic = %Convert.bound (constants.%Convert.bound)] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn (constants.%Convert.specific_fn)] -// CHECK:STDOUT: %int.convert_checked.loc6_27.1: init Core.IntLiteral = call %specific_fn(%N.ref.loc6_27) [symbolic = %int.convert_checked.loc6_27.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %bound_method.loc6_27.1: = bound_method %N.ref.loc6_27, %impl.elem0 [symbolic = %Convert.bound (constants.%Convert.bound)] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_27.2: = bound_method %N.ref.loc6_27, %specific_fn [symbolic = %bound_method.loc6_27.3 (constants.%bound_method)] +// CHECK:STDOUT: %int.convert_checked.loc6_27.1: init Core.IntLiteral = call %bound_method.loc6_27.2(%N.ref.loc6_27) [symbolic = %int.convert_checked.loc6_27.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc6_27.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc6_27.1 [symbolic = %int.convert_checked.loc6_27.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc6_27.2: Core.IntLiteral = converted %N.ref.loc6_27, %.loc6_27.1 [symbolic = %int.convert_checked.loc6_27.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %array_type.loc6_28.1: type = array_type %.loc6_27.2, %C [symbolic = %array_type.loc6_28.2 (constants.%array_type.c13)] +// CHECK:STDOUT: %array_type.loc6_28.1: type = array_type %.loc6_27.2, %C [symbolic = %array_type.loc6_28.2 (constants.%array_type.b2f)] // CHECK:STDOUT: } -// CHECK:STDOUT: %a: @F.%array_type.loc6_28.2 (%array_type.c13) = bind_name a, %a.param +// CHECK:STDOUT: %a: @F.%array_type.loc6_28.2 (%array_type.b2f) = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -1143,14 +1153,14 @@ fn G() -> i32 { // CHECK:STDOUT: %N.loc6_6.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc6_6.2 (constants.%N.51e)] // CHECK:STDOUT: %N.patt.loc6_6.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc6_6.2 (constants.%N.patt.8e2)] // CHECK:STDOUT: %Convert.bound: = bound_method %N.loc6_6.2, constants.%Convert.960 [symbolic = %Convert.bound (constants.%Convert.bound)] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn (constants.%Convert.specific_fn)] -// CHECK:STDOUT: %int.convert_checked.loc6_27.2: init Core.IntLiteral = call %Convert.specific_fn(%N.loc6_6.2) [symbolic = %int.convert_checked.loc6_27.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %array_type.loc6_28.2: type = array_type %int.convert_checked.loc6_27.2, %C [symbolic = %array_type.loc6_28.2 (constants.%array_type.c13)] +// CHECK:STDOUT: %bound_method.loc6_27.3: = bound_method %N.loc6_6.2, constants.%Convert.specific_fn [symbolic = %bound_method.loc6_27.3 (constants.%bound_method)] +// CHECK:STDOUT: %int.convert_checked.loc6_27.2: init Core.IntLiteral = call %bound_method.loc6_27.3(%N.loc6_6.2) [symbolic = %int.convert_checked.loc6_27.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %array_type.loc6_28.2: type = array_type %int.convert_checked.loc6_27.2, %C [symbolic = %array_type.loc6_28.2 (constants.%array_type.b2f)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @F.%array_type.loc6_28.2 (%array_type.c13) [symbolic = %require_complete (constants.%require_complete.303)] +// CHECK:STDOUT: %require_complete: = require_complete_type @F.%array_type.loc6_28.2 (%array_type.b2f) [symbolic = %require_complete (constants.%require_complete.cde)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%N.patt.loc6_6.1: %i32](%a.param_patt: @F.%array_type.loc6_28.2 (%array_type.c13)) -> %i32 { +// CHECK:STDOUT: fn[%N.patt.loc6_6.1: %i32](%a.param_patt: @F.%array_type.loc6_28.2 (%array_type.b2f)) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %N.ref.loc6_47: %i32 = name_ref N, %N.loc6_6.1 [symbolic = %N.loc6_6.2 (constants.%N.51e)] // CHECK:STDOUT: return %N.ref.loc6_47 @@ -1198,8 +1208,8 @@ fn G() -> i32 { // CHECK:STDOUT: %N.loc6_6.2 => constants.%N.51e // CHECK:STDOUT: %N.patt.loc6_6.2 => constants.%N.51e // CHECK:STDOUT: %Convert.bound => constants.%Convert.bound -// CHECK:STDOUT: %Convert.specific_fn => constants.%Convert.specific_fn +// CHECK:STDOUT: %bound_method.loc6_27.3 => constants.%bound_method // CHECK:STDOUT: %int.convert_checked.loc6_27.2 => constants.%int.convert_checked -// CHECK:STDOUT: %array_type.loc6_28.2 => constants.%array_type.c13 +// CHECK:STDOUT: %array_type.loc6_28.2 => constants.%array_type.b2f // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/deduce/generic_type.carbon b/toolchain/check/testdata/deduce/generic_type.carbon index 630b7d73b37d..f067db7d1c60 100644 --- a/toolchain/check/testdata/deduce/generic_type.carbon +++ b/toolchain/check/testdata/deduce/generic_type.carbon @@ -741,7 +741,8 @@ fn G() -> i32 { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %WithNontype.b82: type = class_type @WithNontype, @WithNontype(%int_0.6a9) [concrete] // CHECK:STDOUT: %WithNontype.val: %WithNontype.b82 = struct_value () [concrete] @@ -846,9 +847,10 @@ fn G() -> i32 { // CHECK:STDOUT: %WithNontype.ref: %WithNontype.type = name_ref WithNontype, file.%WithNontype.decl [concrete = constants.%WithNontype.generic] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc9_31.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_31.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc9_31.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc9_31.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc9_31.2: %i32 = converted %int_0, %.loc9_31.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %WithNontype: type = class_type @WithNontype, @WithNontype(constants.%int_0.6a9) [concrete = constants.%WithNontype.b82] diff --git a/toolchain/check/testdata/deduce/tuple.carbon b/toolchain/check/testdata/deduce/tuple.carbon index 305b114eb84a..c908bb748520 100644 --- a/toolchain/check/testdata/deduce/tuple.carbon +++ b/toolchain/check/testdata/deduce/tuple.carbon @@ -250,10 +250,11 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %tuple.21c: %tuple.type.d07 = tuple_value (%int_1.5d2, %int_2.ef8) [concrete] // CHECK:STDOUT: %HasPair.369: type = class_type @HasPair, @HasPair(%tuple.21c) [concrete] @@ -342,14 +343,16 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %.loc8_22.1: %tuple.type.f94 = tuple_literal (%int_1, %int_2) // CHECK:STDOUT: %impl.elem0.loc8_22.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc8_22.1: = bound_method %int_1, %impl.elem0.loc8_22.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc8_22.1: = specific_function %bound_method.loc8_22.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc8_22.1: init %i32 = call %specific_fn.loc8_22.1(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc8_22.1: = specific_function %impl.elem0.loc8_22.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_22.2: = bound_method %int_1, %specific_fn.loc8_22.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc8_22.1: init %i32 = call %bound_method.loc8_22.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc8_22.2: %i32 = value_of_initializer %int.convert_checked.loc8_22.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc8_22.3: %i32 = converted %int_1, %.loc8_22.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc8_22.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc8_22.2: = bound_method %int_2, %impl.elem0.loc8_22.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc8_22.2: = specific_function %bound_method.loc8_22.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc8_22.2: init %i32 = call %specific_fn.loc8_22.2(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc8_22.3: = bound_method %int_2, %impl.elem0.loc8_22.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc8_22.2: = specific_function %impl.elem0.loc8_22.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_22.4: = bound_method %int_2, %specific_fn.loc8_22.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc8_22.2: init %i32 = call %bound_method.loc8_22.4(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc8_22.4: %i32 = value_of_initializer %int.convert_checked.loc8_22.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc8_22.5: %i32 = converted %int_2, %.loc8_22.4 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%.loc8_22.3, %.loc8_22.5) [concrete = constants.%tuple.21c] diff --git a/toolchain/check/testdata/eval/aggregate.carbon b/toolchain/check/testdata/eval/aggregate.carbon index ce64ccdd9e3a..32422d04b2cd 100644 --- a/toolchain/check/testdata/eval/aggregate.carbon +++ b/toolchain/check/testdata/eval/aggregate.carbon @@ -34,10 +34,11 @@ var struct_access: array(i32, 1) = (0,) as array(i32, {.a = 3, .b = 1}.b); // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %tuple.21c: %tuple.type.d07 = tuple_value (%int_1.5d2, %int_2.ef8) [concrete] // CHECK:STDOUT: %struct_type.a.b.c: type = struct_type {.a: %i32, .b: %i32, .c: %i32} [concrete] @@ -45,7 +46,7 @@ var struct_access: array(i32, 1) = (0,) as array(i32, {.a = 3, .b = 1}.b); // CHECK:STDOUT: %struct_type.c.b.a: type = struct_type {.c: Core.IntLiteral, .b: Core.IntLiteral, .a: Core.IntLiteral} [concrete] // CHECK:STDOUT: %struct_type.b.a.c: type = struct_type {.b: %i32, .a: %i32, .c: %i32} [concrete] // CHECK:STDOUT: %Convert.bound.b30: = bound_method %int_3.1ba, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.b42: = specific_function %Convert.bound.b30, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.047: = bound_method %int_3.1ba, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %struct.21d: %struct_type.b.a.c = struct_value (%int_2.ef8, %int_1.5d2, %int_3.822) [concrete] // CHECK:STDOUT: %struct.cff: %struct_type.a.b.c = struct_value (%int_1.5d2, %int_2.ef8, %int_3.822) [concrete] @@ -58,7 +59,7 @@ var struct_access: array(i32, 1) = (0,) as array(i32, {.a = 3, .b = 1}.b); // CHECK:STDOUT: %tuple.type.d46: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [concrete] // CHECK:STDOUT: %tuple.869: %tuple.type.d46 = tuple_value (%int_5, %int_7, %int_1.5b8, %int_9) [concrete] // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b6e: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_0.6a9) [concrete] // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [concrete] @@ -151,14 +152,16 @@ var struct_access: array(i32, 1) = (0,) as array(i32, {.a = 3, .b = 1}.b); // CHECK:STDOUT: %.loc11_49.2: type = converted %.loc11_49.1, constants.%tuple.type.d07 [concrete = constants.%tuple.type.d07] // CHECK:STDOUT: %impl.elem0.loc11_35.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc11_35.1: = bound_method %int_1.loc11, %impl.elem0.loc11_35.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc11_35.1: = specific_function %bound_method.loc11_35.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc11_35.1: init %i32 = call %specific_fn.loc11_35.1(%int_1.loc11) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc11_35.1: = specific_function %impl.elem0.loc11_35.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_35.2: = bound_method %int_1.loc11, %specific_fn.loc11_35.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc11_35.1: init %i32 = call %bound_method.loc11_35.2(%int_1.loc11) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_35.2: %i32 = value_of_initializer %int.convert_checked.loc11_35.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_35.3: %i32 = converted %int_1.loc11, %.loc11_35.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc11_35.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11_35.2: = bound_method %int_2.loc11, %impl.elem0.loc11_35.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc11_35.2: = specific_function %bound_method.loc11_35.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc11_35.2: init %i32 = call %specific_fn.loc11_35.2(%int_2.loc11) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc11_35.3: = bound_method %int_2.loc11, %impl.elem0.loc11_35.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc11_35.2: = specific_function %impl.elem0.loc11_35.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_35.4: = bound_method %int_2.loc11, %specific_fn.loc11_35.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc11_35.2: init %i32 = call %bound_method.loc11_35.4(%int_2.loc11) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc11_35.4: %i32 = value_of_initializer %int.convert_checked.loc11_35.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc11_35.5: %i32 = converted %int_2.loc11, %.loc11_35.4 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %tuple.loc11: %tuple.type.d07 = tuple_value (%.loc11_35.3, %.loc11_35.5) [concrete = constants.%tuple.21c] @@ -185,20 +188,23 @@ var struct_access: array(i32, 1) = (0,) as array(i32, {.a = 3, .b = 1}.b); // CHECK:STDOUT: %struct_type.b.a.c: type = struct_type {.b: %i32, .a: %i32, .c: %i32} [concrete = constants.%struct_type.b.a.c] // CHECK:STDOUT: %impl.elem0.loc13_71.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc13_71.1: = bound_method %int_2.loc13, %impl.elem0.loc13_71.1 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc13_71.1: = specific_function %bound_method.loc13_71.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc13_71.1: init %i32 = call %specific_fn.loc13_71.1(%int_2.loc13) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %specific_fn.loc13_71.1: = specific_function %impl.elem0.loc13_71.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_71.2: = bound_method %int_2.loc13, %specific_fn.loc13_71.1 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc13_71.1: init %i32 = call %bound_method.loc13_71.2(%int_2.loc13) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_71.2: %i32 = value_of_initializer %int.convert_checked.loc13_71.1 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_71.3: %i32 = converted %int_2.loc13, %.loc13_71.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %impl.elem0.loc13_71.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc13_71.2: = bound_method %int_1.loc13, %impl.elem0.loc13_71.2 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc13_71.2: = specific_function %bound_method.loc13_71.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc13_71.2: init %i32 = call %specific_fn.loc13_71.2(%int_1.loc13) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc13_71.3: = bound_method %int_1.loc13, %impl.elem0.loc13_71.2 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc13_71.2: = specific_function %impl.elem0.loc13_71.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_71.4: = bound_method %int_1.loc13, %specific_fn.loc13_71.2 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc13_71.2: init %i32 = call %bound_method.loc13_71.4(%int_1.loc13) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_71.4: %i32 = value_of_initializer %int.convert_checked.loc13_71.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_71.5: %i32 = converted %int_1.loc13, %.loc13_71.4 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc13_71.3: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc13_71.3: = bound_method %int_3.loc13, %impl.elem0.loc13_71.3 [concrete = constants.%Convert.bound.b30] -// CHECK:STDOUT: %specific_fn.loc13_71.3: = specific_function %bound_method.loc13_71.3, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc13_71.3: init %i32 = call %specific_fn.loc13_71.3(%int_3.loc13) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %bound_method.loc13_71.5: = bound_method %int_3.loc13, %impl.elem0.loc13_71.3 [concrete = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc13_71.3: = specific_function %impl.elem0.loc13_71.3, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_71.6: = bound_method %int_3.loc13, %specific_fn.loc13_71.3 [concrete = constants.%bound_method.047] +// CHECK:STDOUT: %int.convert_checked.loc13_71.3: init %i32 = call %bound_method.loc13_71.6(%int_3.loc13) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc13_71.6: %i32 = value_of_initializer %int.convert_checked.loc13_71.3 [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc13_71.7: %i32 = converted %int_3.loc13, %.loc13_71.6 [concrete = constants.%int_3.822] // CHECK:STDOUT: %struct.loc13: %struct_type.b.a.c = struct_value (%.loc13_71.3, %.loc13_71.5, %.loc13_71.7) [concrete = constants.%struct.21d] @@ -230,9 +236,10 @@ var struct_access: array(i32, 1) = (0,) as array(i32, {.a = 3, .b = 1}.b); // CHECK:STDOUT: %tuple.elem2: Core.IntLiteral = tuple_access %.loc15_64.2, element2 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %array_type.loc15: type = array_type %tuple.elem2, %i32 [concrete = constants.%array_type] // CHECK:STDOUT: %impl.elem0.loc15: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc15: = bound_method %int_0.loc15_35, %impl.elem0.loc15 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn.loc15: = specific_function %bound_method.loc15, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %specific_fn.loc15(%int_0.loc15_35) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc15_37.1: = bound_method %int_0.loc15_35, %impl.elem0.loc15 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc15: = specific_function %impl.elem0.loc15, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc15_37.2: = bound_method %int_0.loc15_35, %specific_fn.loc15 [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %bound_method.loc15_37.2(%int_0.loc15_35) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc15_37.2: init %i32 = converted %int_0.loc15_35, %int.convert_checked.loc15 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc15_1: ref %array_type = splice_block file.%tuple_index.var {} // CHECK:STDOUT: %int_0.loc15_37: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] @@ -253,9 +260,10 @@ var struct_access: array(i32, 1) = (0,) as array(i32, {.a = 3, .b = 1}.b); // CHECK:STDOUT: %.loc17_71: Core.IntLiteral = struct_access %.loc17_70.2, element1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %array_type.loc17: type = array_type %.loc17_71, %i32 [concrete = constants.%array_type] // CHECK:STDOUT: %impl.elem0.loc17: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc17: = bound_method %int_0.loc17_37, %impl.elem0.loc17 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn.loc17: = specific_function %bound_method.loc17, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %specific_fn.loc17(%int_0.loc17_37) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc17_39.1: = bound_method %int_0.loc17_37, %impl.elem0.loc17 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc17: = specific_function %impl.elem0.loc17, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc17_39.2: = bound_method %int_0.loc17_37, %specific_fn.loc17 [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %bound_method.loc17_39.2(%int_0.loc17_37) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc17_39.2: init %i32 = converted %int_0.loc17_37, %int.convert_checked.loc17 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc17_1: ref %array_type = splice_block file.%struct_access.var {} // CHECK:STDOUT: %int_0.loc17_39: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] diff --git a/toolchain/check/testdata/eval/fail_aggregate.carbon b/toolchain/check/testdata/eval/fail_aggregate.carbon index 14ac8a867eda..e2b0eab3b4f1 100644 --- a/toolchain/check/testdata/eval/fail_aggregate.carbon +++ b/toolchain/check/testdata/eval/fail_aggregate.carbon @@ -39,22 +39,23 @@ var array_index: array(i32, 1) = (0,) as array(i32, ((5, 7, 1, 9) as array(i32, // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.4e6: = bound_method %int_5.64b, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.ba9: = specific_function %Convert.bound.4e6, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.a25: = bound_method %int_5.64b, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_5.0f6: %i32 = int_value 5 [concrete] // CHECK:STDOUT: %Convert.bound.208: = bound_method %int_7.29f, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.c12: = specific_function %Convert.bound.208, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.3bd: = bound_method %int_7.29f, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_7.0b1: %i32 = int_value 7 [concrete] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete] // CHECK:STDOUT: %Convert.bound.9e2: = bound_method %int_9.988, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.b02: = specific_function %Convert.bound.9e2, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.cd3: = bound_method %int_9.988, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_9.f88: %i32 = int_value 9 [concrete] // CHECK:STDOUT: %array: %array_type.f32 = tuple_value (%int_5.0f6, %int_7.0b1, %int_1.5d2, %int_9.f88) [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -104,33 +105,37 @@ var array_index: array(i32, 1) = (0,) as array(i32, ((5, 7, 1, 9) as array(i32, // CHECK:STDOUT: %array_type: type = array_type %int_4, %i32 [concrete = constants.%array_type.f32] // CHECK:STDOUT: %impl.elem0.loc17_65.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc17_65.1: = bound_method %int_5, %impl.elem0.loc17_65.1 [concrete = constants.%Convert.bound.4e6] -// CHECK:STDOUT: %specific_fn.loc17_65.1: = specific_function %bound_method.loc17_65.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.ba9] -// CHECK:STDOUT: %int.convert_checked.loc17_65.1: init %i32 = call %specific_fn.loc17_65.1(%int_5) [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %specific_fn.loc17_65.1: = specific_function %impl.elem0.loc17_65.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc17_65.2: = bound_method %int_5, %specific_fn.loc17_65.1 [concrete = constants.%bound_method.a25] +// CHECK:STDOUT: %int.convert_checked.loc17_65.1: init %i32 = call %bound_method.loc17_65.2(%int_5) [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc17_65.2: init %i32 = converted %int_5, %int.convert_checked.loc17_65.1 [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc17_65.3: ref %array_type.f32 = temporary_storage // CHECK:STDOUT: %int_0.loc17_65: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc17_65.4: ref %i32 = array_index %.loc17_65.3, %int_0.loc17_65 // CHECK:STDOUT: %.loc17_65.5: init %i32 = initialize_from %.loc17_65.2 to %.loc17_65.4 [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %impl.elem0.loc17_65.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc17_65.2: = bound_method %int_7, %impl.elem0.loc17_65.2 [concrete = constants.%Convert.bound.208] -// CHECK:STDOUT: %specific_fn.loc17_65.2: = specific_function %bound_method.loc17_65.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.c12] -// CHECK:STDOUT: %int.convert_checked.loc17_65.2: init %i32 = call %specific_fn.loc17_65.2(%int_7) [concrete = constants.%int_7.0b1] +// CHECK:STDOUT: %bound_method.loc17_65.3: = bound_method %int_7, %impl.elem0.loc17_65.2 [concrete = constants.%Convert.bound.208] +// CHECK:STDOUT: %specific_fn.loc17_65.2: = specific_function %impl.elem0.loc17_65.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc17_65.4: = bound_method %int_7, %specific_fn.loc17_65.2 [concrete = constants.%bound_method.3bd] +// CHECK:STDOUT: %int.convert_checked.loc17_65.2: init %i32 = call %bound_method.loc17_65.4(%int_7) [concrete = constants.%int_7.0b1] // CHECK:STDOUT: %.loc17_65.6: init %i32 = converted %int_7, %int.convert_checked.loc17_65.2 [concrete = constants.%int_7.0b1] // CHECK:STDOUT: %int_1.loc17_65: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc17_65.7: ref %i32 = array_index %.loc17_65.3, %int_1.loc17_65 // CHECK:STDOUT: %.loc17_65.8: init %i32 = initialize_from %.loc17_65.6 to %.loc17_65.7 [concrete = constants.%int_7.0b1] // CHECK:STDOUT: %impl.elem0.loc17_65.3: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc17_65.3: = bound_method %int_1.loc17_61, %impl.elem0.loc17_65.3 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc17_65.3: = specific_function %bound_method.loc17_65.3, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc17_65.3: init %i32 = call %specific_fn.loc17_65.3(%int_1.loc17_61) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc17_65.5: = bound_method %int_1.loc17_61, %impl.elem0.loc17_65.3 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc17_65.3: = specific_function %impl.elem0.loc17_65.3, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc17_65.6: = bound_method %int_1.loc17_61, %specific_fn.loc17_65.3 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc17_65.3: init %i32 = call %bound_method.loc17_65.6(%int_1.loc17_61) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc17_65.9: init %i32 = converted %int_1.loc17_61, %int.convert_checked.loc17_65.3 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %int_2.loc17_65: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %.loc17_65.10: ref %i32 = array_index %.loc17_65.3, %int_2.loc17_65 // CHECK:STDOUT: %.loc17_65.11: init %i32 = initialize_from %.loc17_65.9 to %.loc17_65.10 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc17_65.4: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc17_65.4: = bound_method %int_9, %impl.elem0.loc17_65.4 [concrete = constants.%Convert.bound.9e2] -// CHECK:STDOUT: %specific_fn.loc17_65.4: = specific_function %bound_method.loc17_65.4, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b02] -// CHECK:STDOUT: %int.convert_checked.loc17_65.4: init %i32 = call %specific_fn.loc17_65.4(%int_9) [concrete = constants.%int_9.f88] +// CHECK:STDOUT: %bound_method.loc17_65.7: = bound_method %int_9, %impl.elem0.loc17_65.4 [concrete = constants.%Convert.bound.9e2] +// CHECK:STDOUT: %specific_fn.loc17_65.4: = specific_function %impl.elem0.loc17_65.4, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc17_65.8: = bound_method %int_9, %specific_fn.loc17_65.4 [concrete = constants.%bound_method.cd3] +// CHECK:STDOUT: %int.convert_checked.loc17_65.4: init %i32 = call %bound_method.loc17_65.8(%int_9) [concrete = constants.%int_9.f88] // CHECK:STDOUT: %.loc17_65.12: init %i32 = converted %int_9, %int.convert_checked.loc17_65.4 [concrete = constants.%int_9.f88] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3] // CHECK:STDOUT: %.loc17_65.13: ref %i32 = array_index %.loc17_65.3, %int_3 @@ -142,9 +147,10 @@ var array_index: array(i32, 1) = (0,) as array(i32, ((5, 7, 1, 9) as array(i32, // CHECK:STDOUT: %int_32.loc17_86: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc17_86: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0.loc17_85: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc17_85: = bound_method %int_2.loc17_85, %impl.elem0.loc17_85 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc17_85: = specific_function %bound_method.loc17_85, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc17_85: init %i32 = call %specific_fn.loc17_85(%int_2.loc17_85) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc17_85.1: = bound_method %int_2.loc17_85, %impl.elem0.loc17_85 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc17_85: = specific_function %impl.elem0.loc17_85, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc17_85.2: = bound_method %int_2.loc17_85, %specific_fn.loc17_85 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc17_85: init %i32 = call %bound_method.loc17_85.2(%int_2.loc17_85) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc17_85.1: %i32 = value_of_initializer %int.convert_checked.loc17_85 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc17_85.2: %i32 = converted %int_2.loc17_85, %.loc17_85.1 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc17_86.1: ref %i32 = array_index %.loc17_67.2, %.loc17_85.2 diff --git a/toolchain/check/testdata/eval/symbolic.carbon b/toolchain/check/testdata/eval/symbolic.carbon index 5b4b6d886ea2..ee05cb8bb3ff 100644 --- a/toolchain/check/testdata/eval/symbolic.carbon +++ b/toolchain/check/testdata/eval/symbolic.carbon @@ -50,10 +50,11 @@ fn G(N:! i32) { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.2fd = facet_value %i32, %impl_witness.023 [concrete] // CHECK:STDOUT: %.10e: type = fn_type_with_self_type %Convert.type.71e, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %N.51e, %Convert.960 [symbolic] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.3(%int_32) [symbolic] -// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn(%N.51e) [symbolic] -// CHECK:STDOUT: %array_type.b04: type = array_type %int.convert_checked, %i32 [symbolic] -// CHECK:STDOUT: %require_complete.9dc: = require_complete_type %array_type.b04 [symbolic] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.960, @Convert.3(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %N.51e, %Convert.specific_fn [symbolic] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %bound_method(%N.51e) [symbolic] +// CHECK:STDOUT: %array_type.c7c: type = array_type %int.convert_checked, %i32 [symbolic] +// CHECK:STDOUT: %require_complete.7cb: = require_complete_type %array_type.c7c [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -149,31 +150,32 @@ fn G(N:! i32) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Convert.bound: = bound_method %N.loc18_6.2, constants.%Convert.960 [symbolic = %Convert.bound (constants.%Convert.bound)] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn (constants.%Convert.specific_fn)] -// CHECK:STDOUT: %int.convert_checked.loc19_21.2: init Core.IntLiteral = call %Convert.specific_fn(%N.loc18_6.2) [symbolic = %int.convert_checked.loc19_21.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %array_type.loc19_22.2: type = array_type %int.convert_checked.loc19_21.2, %i32 [symbolic = %array_type.loc19_22.2 (constants.%array_type.b04)] -// CHECK:STDOUT: %require_complete: = require_complete_type @G.%array_type.loc19_22.2 (%array_type.b04) [symbolic = %require_complete (constants.%require_complete.9dc)] +// CHECK:STDOUT: %bound_method.loc19_21.3: = bound_method %N.loc18_6.2, constants.%Convert.specific_fn [symbolic = %bound_method.loc19_21.3 (constants.%bound_method)] +// CHECK:STDOUT: %int.convert_checked.loc19_21.2: init Core.IntLiteral = call %bound_method.loc19_21.3(%N.loc18_6.2) [symbolic = %int.convert_checked.loc19_21.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %array_type.loc19_22.2: type = array_type %int.convert_checked.loc19_21.2, %i32 [symbolic = %array_type.loc19_22.2 (constants.%array_type.c7c)] +// CHECK:STDOUT: %require_complete: = require_complete_type @G.%array_type.loc19_22.2 (%array_type.c7c) [symbolic = %require_complete (constants.%require_complete.7cb)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%N.patt.loc18_6.1: %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %k.patt: @G.%array_type.loc19_22.2 (%array_type.b04) = binding_pattern k -// CHECK:STDOUT: %.loc19_3: @G.%array_type.loc19_22.2 (%array_type.b04) = var_pattern %k.patt +// CHECK:STDOUT: %k.patt: @G.%array_type.loc19_22.2 (%array_type.c7c) = binding_pattern k +// CHECK:STDOUT: %.loc19_3: @G.%array_type.loc19_22.2 (%array_type.c7c) = var_pattern %k.patt // CHECK:STDOUT: } -// CHECK:STDOUT: %k.var: ref @G.%array_type.loc19_22.2 (%array_type.b04) = var k -// CHECK:STDOUT: %.loc19_22: type = splice_block %array_type.loc19_22.1 [symbolic = %array_type.loc19_22.2 (constants.%array_type.b04)] { +// CHECK:STDOUT: %k.var: ref @G.%array_type.loc19_22.2 (%array_type.c7c) = var k +// CHECK:STDOUT: %.loc19_22: type = splice_block %array_type.loc19_22.1 [symbolic = %array_type.loc19_22.2 (constants.%array_type.c7c)] { // CHECK:STDOUT: %int_32.loc19: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc19: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc18_6.1 [symbolic = %N.loc18_6.2 (constants.%N.51e)] // CHECK:STDOUT: %impl.elem0: %.10e = impl_witness_access constants.%impl_witness.023, element0 [concrete = constants.%Convert.960] -// CHECK:STDOUT: %bound_method: = bound_method %N.ref, %impl.elem0 [symbolic = %Convert.bound (constants.%Convert.bound)] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn (constants.%Convert.specific_fn)] -// CHECK:STDOUT: %int.convert_checked.loc19_21.1: init Core.IntLiteral = call %specific_fn(%N.ref) [symbolic = %int.convert_checked.loc19_21.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %bound_method.loc19_21.1: = bound_method %N.ref, %impl.elem0 [symbolic = %Convert.bound (constants.%Convert.bound)] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc19_21.2: = bound_method %N.ref, %specific_fn [symbolic = %bound_method.loc19_21.3 (constants.%bound_method)] +// CHECK:STDOUT: %int.convert_checked.loc19_21.1: init Core.IntLiteral = call %bound_method.loc19_21.2(%N.ref) [symbolic = %int.convert_checked.loc19_21.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc19_21.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc19_21.1 [symbolic = %int.convert_checked.loc19_21.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc19_21.2: Core.IntLiteral = converted %N.ref, %.loc19_21.1 [symbolic = %int.convert_checked.loc19_21.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %array_type.loc19_22.1: type = array_type %.loc19_21.2, %i32 [symbolic = %array_type.loc19_22.2 (constants.%array_type.b04)] +// CHECK:STDOUT: %array_type.loc19_22.1: type = array_type %.loc19_21.2, %i32 [symbolic = %array_type.loc19_22.2 (constants.%array_type.c7c)] // CHECK:STDOUT: } -// CHECK:STDOUT: %k: ref @G.%array_type.loc19_22.2 (%array_type.b04) = bind_name k, %k.var +// CHECK:STDOUT: %k: ref @G.%array_type.loc19_22.2 (%array_type.c7c) = bind_name k, %k.var // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/facet/no_prelude/access.carbon b/toolchain/check/testdata/facet/no_prelude/access.carbon index aa5c046f0ed0..f1af24b7f225 100644 --- a/toolchain/check/testdata/facet/no_prelude/access.carbon +++ b/toolchain/check/testdata/facet/no_prelude/access.carbon @@ -308,6 +308,7 @@ var v: ().(Id(I.T)); // CHECK:STDOUT: %I.facet: %I.type = facet_value %T.as_type, %T.as_wit [symbolic] // CHECK:STDOUT: %.4ef: type = fn_type_with_self_type %Copy.type, %I.facet [symbolic] // CHECK:STDOUT: %impl.elem0: %.4ef = impl_witness_access %T.as_wit, element0 [symbolic] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Copy(%I.facet) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -387,6 +388,7 @@ var v: ().(Id(I.T)); // CHECK:STDOUT: %I.facet: %I.type = facet_value %T.as_type.loc8_18.2, %T.as_wit.loc9_11.2 [symbolic = %I.facet (constants.%I.facet)] // CHECK:STDOUT: %.loc9_11.2: type = fn_type_with_self_type constants.%Copy.type, %I.facet [symbolic = %.loc9_11.2 (constants.%.4ef)] // CHECK:STDOUT: %impl.elem0.loc9_11.2: @Use.%.loc9_11.2 (%.4ef) = impl_witness_access %T.as_wit.loc9_11.2, element0 [symbolic = %impl.elem0.loc9_11.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %specific_fn.loc9_11.2: = specific_function %impl.elem0.loc9_11.2, @Copy(%I.facet) [symbolic = %specific_fn.loc9_11.2 (constants.%specific_fn)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.patt.loc8_8.1: %I.type](%x.param_patt: @Use.%T.as_type.loc8_18.2 (%T.as_type)) -> @Use.%T.as_type.loc8_18.2 (%T.as_type) { // CHECK:STDOUT: !entry: @@ -396,9 +398,10 @@ var v: ().(Id(I.T)); // CHECK:STDOUT: %.loc9_11.1: type = converted constants.%T, %T.as_type.loc9 [symbolic = %T.as_type.loc8_18.2 (constants.%T.as_type)] // CHECK:STDOUT: %T.as_wit.loc9_11.1: = facet_access_witness constants.%T [symbolic = %T.as_wit.loc9_11.2 (constants.%T.as_wit)] // CHECK:STDOUT: %impl.elem0.loc9_11.1: @Use.%.loc9_11.2 (%.4ef) = impl_witness_access %T.as_wit.loc9_11.1, element0 [symbolic = %impl.elem0.loc9_11.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %bound_method: = bound_method %x.ref, %impl.elem0.loc9_11.1 -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Copy(constants.%I.facet) -// CHECK:STDOUT: %Copy.call: init @Use.%T.as_type.loc8_18.2 (%T.as_type) = call %specific_fn(%x.ref) +// CHECK:STDOUT: %bound_method.loc9_11: = bound_method %x.ref, %impl.elem0.loc9_11.1 +// CHECK:STDOUT: %specific_fn.loc9_11.1: = specific_function %impl.elem0.loc9_11.1, @Copy(constants.%I.facet) [symbolic = %specific_fn.loc9_11.2 (constants.%specific_fn)] +// CHECK:STDOUT: %bound_method.loc9_17: = bound_method %x.ref, %specific_fn.loc9_11.1 +// CHECK:STDOUT: %Copy.call: init @Use.%T.as_type.loc8_18.2 (%T.as_type) = call %bound_method.loc9_17(%x.ref) // CHECK:STDOUT: %.loc9_18.1: @Use.%T.as_type.loc8_18.2 (%T.as_type) = value_of_initializer %Copy.call // CHECK:STDOUT: %.loc9_18.2: @Use.%T.as_type.loc8_18.2 (%T.as_type) = converted %Copy.call, %.loc9_18.1 // CHECK:STDOUT: return %.loc9_18.2 @@ -421,6 +424,8 @@ var v: ().(Id(I.T)); // CHECK:STDOUT: %Self.as_type.loc5_17.1 => constants.%T.as_type // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @Copy(@Use.%I.facet) {} +// CHECK:STDOUT: // CHECK:STDOUT: --- access_selfless_method.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -541,6 +546,7 @@ var v: ().(Id(I.T)); // CHECK:STDOUT: %I.facet: %I.type = facet_value %T.as_type, %T.as_wit [symbolic] // CHECK:STDOUT: %.4ef: type = fn_type_with_self_type %Copy.type, %I.facet [symbolic] // CHECK:STDOUT: %impl.elem0: %.4ef = impl_witness_access %T.as_wit, element0 [symbolic] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Copy(%I.facet) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -620,6 +626,7 @@ var v: ().(Id(I.T)); // CHECK:STDOUT: %I.facet: %I.type = facet_value %T.as_type.loc8_26.2, %T.as_wit.loc9_14.2 [symbolic = %I.facet (constants.%I.facet)] // CHECK:STDOUT: %.loc9_14.2: type = fn_type_with_self_type constants.%Copy.type, %I.facet [symbolic = %.loc9_14.2 (constants.%.4ef)] // CHECK:STDOUT: %impl.elem0.loc9_14.2: @UseIndirect.%.loc9_14.2 (%.4ef) = impl_witness_access %T.as_wit.loc9_14.2, element0 [symbolic = %impl.elem0.loc9_14.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %specific_fn.loc9_14.2: = specific_function %impl.elem0.loc9_14.2, @Copy(%I.facet) [symbolic = %specific_fn.loc9_14.2 (constants.%specific_fn)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.patt.loc8_16.1: %I.type](%x.param_patt: @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type)) -> @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) { // CHECK:STDOUT: !entry: @@ -630,9 +637,10 @@ var v: ().(Id(I.T)); // CHECK:STDOUT: %.loc9_14.1: type = converted %T.ref.loc9, %T.as_type.loc9 [symbolic = %T.as_type.loc8_26.2 (constants.%T.as_type)] // CHECK:STDOUT: %T.as_wit.loc9_14.1: = facet_access_witness %T.ref.loc9 [symbolic = %T.as_wit.loc9_14.2 (constants.%T.as_wit)] // CHECK:STDOUT: %impl.elem0.loc9_14.1: @UseIndirect.%.loc9_14.2 (%.4ef) = impl_witness_access %T.as_wit.loc9_14.1, element0 [symbolic = %impl.elem0.loc9_14.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %bound_method: = bound_method %x.ref, %impl.elem0.loc9_14.1 -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Copy(constants.%I.facet) -// CHECK:STDOUT: %Copy.call: init @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = call %specific_fn(%x.ref) +// CHECK:STDOUT: %bound_method.loc9_11: = bound_method %x.ref, %impl.elem0.loc9_14.1 +// CHECK:STDOUT: %specific_fn.loc9_14.1: = specific_function %impl.elem0.loc9_14.1, @Copy(constants.%I.facet) [symbolic = %specific_fn.loc9_14.2 (constants.%specific_fn)] +// CHECK:STDOUT: %bound_method.loc9_21: = bound_method %x.ref, %specific_fn.loc9_14.1 +// CHECK:STDOUT: %Copy.call: init @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = call %bound_method.loc9_21(%x.ref) // CHECK:STDOUT: %.loc9_22.1: @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = value_of_initializer %Copy.call // CHECK:STDOUT: %.loc9_22.2: @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = converted %Copy.call, %.loc9_22.1 // CHECK:STDOUT: return %.loc9_22.2 @@ -655,6 +663,8 @@ var v: ().(Id(I.T)); // CHECK:STDOUT: %Self.as_type.loc5_17.1 => constants.%T.as_type // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @Copy(@UseIndirect.%I.facet) {} +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_non_const_associated.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { diff --git a/toolchain/check/testdata/facet/no_prelude/fail_todo_call_combined_impl_witness.carbon b/toolchain/check/testdata/facet/no_prelude/fail_todo_call_combined_impl_witness.carbon index b3c4b92abd2c..3719d1972e65 100644 --- a/toolchain/check/testdata/facet/no_prelude/fail_todo_call_combined_impl_witness.carbon +++ b/toolchain/check/testdata/facet/no_prelude/fail_todo_call_combined_impl_witness.carbon @@ -459,10 +459,11 @@ fn F() { // CHECK:STDOUT: %BitAnd.facet: %BitAnd.type = facet_value type, %impl_witness.3ea [concrete] // CHECK:STDOUT: %.d4d: type = fn_type_with_self_type %Op.type.27a, %BitAnd.facet [concrete] // CHECK:STDOUT: %Op.bound.6b1: = bound_method %A.type, %Op.444 [concrete] -// CHECK:STDOUT: %Op.specific_fn.b4b: = specific_function %Op.bound.6b1, @Op.2(type) [concrete] +// CHECK:STDOUT: %Op.specific_fn: = specific_function %Op.444, @Op.2(type) [concrete] +// CHECK:STDOUT: %bound_method.96c: = bound_method %A.type, %Op.specific_fn [concrete] // CHECK:STDOUT: %facet_type.d5f: type = facet_type <@Empty & @A> [concrete] // CHECK:STDOUT: %Op.bound.b5b: = bound_method %facet_type.d5f, %Op.444 [concrete] -// CHECK:STDOUT: %Op.specific_fn.165: = specific_function %Op.bound.b5b, @Op.2(type) [concrete] +// CHECK:STDOUT: %bound_method.cb6: = bound_method %facet_type.d5f, %Op.specific_fn [concrete] // CHECK:STDOUT: %facet_type.242: type = facet_type <@Empty & @A & @B> [concrete] // CHECK:STDOUT: %T.2df: %facet_type.242 = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt.fd9: %facet_type.242 = symbolic_binding_pattern T, 0 [symbolic] @@ -574,16 +575,18 @@ fn F() { // CHECK:STDOUT: %A.ref.loc24: type = name_ref A, file.%A.decl [concrete = constants.%A.type] // CHECK:STDOUT: %Empty.ref: type = name_ref Empty, file.%Empty.decl [concrete = constants.%Empty.type] // CHECK:STDOUT: %impl.elem0.loc24_12: %.d4d = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] -// CHECK:STDOUT: %bound_method.loc24_12: = bound_method %A.ref.loc24, %impl.elem0.loc24_12 [concrete = constants.%Op.bound.6b1] -// CHECK:STDOUT: %specific_fn.loc24_12: = specific_function %bound_method.loc24_12, @Op.2(type) [concrete = constants.%Op.specific_fn.b4b] -// CHECK:STDOUT: %type.and.loc24_12: init type = call %specific_fn.loc24_12(%A.ref.loc24, %Empty.ref) [concrete = constants.%facet_type.d5f] +// CHECK:STDOUT: %bound_method.loc24_12.1: = bound_method %A.ref.loc24, %impl.elem0.loc24_12 [concrete = constants.%Op.bound.6b1] +// CHECK:STDOUT: %specific_fn.loc24_12: = specific_function %impl.elem0.loc24_12, @Op.2(type) [concrete = constants.%Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc24_12.2: = bound_method %A.ref.loc24, %specific_fn.loc24_12 [concrete = constants.%bound_method.96c] +// CHECK:STDOUT: %type.and.loc24_12: init type = call %bound_method.loc24_12.2(%A.ref.loc24, %Empty.ref) [concrete = constants.%facet_type.d5f] // CHECK:STDOUT: %B.ref.loc24: type = name_ref B, file.%B.decl [concrete = constants.%B.type] // CHECK:STDOUT: %impl.elem0.loc24_20: %.d4d = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] -// CHECK:STDOUT: %bound_method.loc24_20: = bound_method %type.and.loc24_12, %impl.elem0.loc24_20 [concrete = constants.%Op.bound.b5b] -// CHECK:STDOUT: %specific_fn.loc24_20: = specific_function %bound_method.loc24_20, @Op.2(type) [concrete = constants.%Op.specific_fn.165] +// CHECK:STDOUT: %bound_method.loc24_20.1: = bound_method %type.and.loc24_12, %impl.elem0.loc24_20 [concrete = constants.%Op.bound.b5b] +// CHECK:STDOUT: %specific_fn.loc24_20: = specific_function %impl.elem0.loc24_20, @Op.2(type) [concrete = constants.%Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc24_20.2: = bound_method %type.and.loc24_12, %specific_fn.loc24_20 [concrete = constants.%bound_method.cb6] // CHECK:STDOUT: %.loc24_12.1: type = value_of_initializer %type.and.loc24_12 [concrete = constants.%facet_type.d5f] // CHECK:STDOUT: %.loc24_12.2: type = converted %type.and.loc24_12, %.loc24_12.1 [concrete = constants.%facet_type.d5f] -// CHECK:STDOUT: %type.and.loc24_20: init type = call %specific_fn.loc24_20(%.loc24_12.2, %B.ref.loc24) [concrete = constants.%facet_type.242] +// CHECK:STDOUT: %type.and.loc24_20: init type = call %bound_method.loc24_20.2(%.loc24_12.2, %B.ref.loc24) [concrete = constants.%facet_type.242] // CHECK:STDOUT: %.loc24_20.2: type = value_of_initializer %type.and.loc24_20 [concrete = constants.%facet_type.242] // CHECK:STDOUT: %.loc24_20.3: type = converted %type.and.loc24_20, %.loc24_20.2 [concrete = constants.%facet_type.242] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/builtin/call.carbon b/toolchain/check/testdata/function/builtin/call.carbon index c1a29d488b68..0c5c2dcdcf0f 100644 --- a/toolchain/check/testdata/function/builtin/call.carbon +++ b/toolchain/check/testdata/function/builtin/call.carbon @@ -35,10 +35,11 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %ImplicitAs.facet.f7f: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet.f7f [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn.b6f: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn.b6f [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn.b6f [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %impl_witness.023: = impl_witness (imports.%Core.import_ref.85c), @impl.971(%int_32) [concrete] @@ -47,7 +48,8 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %ImplicitAs.facet.e25: %ImplicitAs.type.2fd = facet_value %i32, %impl_witness.023 [concrete] // CHECK:STDOUT: %.10e: type = fn_type_with_self_type %Convert.type.71e, %ImplicitAs.facet.e25 [concrete] // CHECK:STDOUT: %Convert.bound.2d6: = bound_method %int_3.822, %Convert.960 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.377: = specific_function %Convert.bound.2d6, @Convert.3(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn.8a8: = specific_function %Convert.960, @Convert.3(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.c6f: = bound_method %int_3.822, %Convert.specific_fn.8a8 [concrete] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete] // CHECK:STDOUT: %array_type: type = array_type %int_3.1ba, %i32 [concrete] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [concrete] @@ -108,24 +110,27 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // 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: %impl.elem0.loc13_25: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc13_25: = bound_method %int_1, %impl.elem0.loc13_25 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc13_25: = specific_function %bound_method.loc13_25, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc13_25: init %i32 = call %specific_fn.loc13_25(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc13_25.1: = bound_method %int_1, %impl.elem0.loc13_25 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc13_25: = specific_function %impl.elem0.loc13_25, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b6f] +// CHECK:STDOUT: %bound_method.loc13_25.2: = bound_method %int_1, %specific_fn.loc13_25 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc13_25: init %i32 = call %bound_method.loc13_25.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_25.1: %i32 = value_of_initializer %int.convert_checked.loc13_25 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_25.2: %i32 = converted %int_1, %.loc13_25.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc13_28: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc13_28: = bound_method %int_2, %impl.elem0.loc13_28 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc13_28: = specific_function %bound_method.loc13_28, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc13_28: init %i32 = call %specific_fn.loc13_28(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc13_28.1: = bound_method %int_2, %impl.elem0.loc13_28 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc13_28: = specific_function %impl.elem0.loc13_28, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b6f] +// CHECK:STDOUT: %bound_method.loc13_28.2: = bound_method %int_2, %specific_fn.loc13_28 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc13_28: init %i32 = call %bound_method.loc13_28.2(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_28.1: %i32 = value_of_initializer %int.convert_checked.loc13_28 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_28.2: %i32 = converted %int_2, %.loc13_28.1 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %int.sadd: init %i32 = call %Add.ref(%.loc13_25.2, %.loc13_28.2) [concrete = constants.%int_3.822] // CHECK:STDOUT: %impl.elem0.loc13_29: %.10e = impl_witness_access constants.%impl_witness.023, element0 [concrete = constants.%Convert.960] -// CHECK:STDOUT: %bound_method.loc13_29: = bound_method %int.sadd, %impl.elem0.loc13_29 [concrete = constants.%Convert.bound.2d6] -// CHECK:STDOUT: %specific_fn.loc13_29: = specific_function %bound_method.loc13_29, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn.377] +// CHECK:STDOUT: %bound_method.loc13_29.1: = bound_method %int.sadd, %impl.elem0.loc13_29 [concrete = constants.%Convert.bound.2d6] +// CHECK:STDOUT: %specific_fn.loc13_29: = specific_function %impl.elem0.loc13_29, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn.8a8] +// CHECK:STDOUT: %bound_method.loc13_29.2: = bound_method %int.sadd, %specific_fn.loc13_29 [concrete = constants.%bound_method.c6f] // CHECK:STDOUT: %.loc13_29.1: %i32 = value_of_initializer %int.sadd [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc13_29.2: %i32 = converted %int.sadd, %.loc13_29.1 [concrete = constants.%int_3.822] -// CHECK:STDOUT: %int.convert_checked.loc13_29: init Core.IntLiteral = call %specific_fn.loc13_29(%.loc13_29.2) [concrete = constants.%int_3.1ba] +// CHECK:STDOUT: %int.convert_checked.loc13_29: init Core.IntLiteral = call %bound_method.loc13_29.2(%.loc13_29.2) [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %.loc13_29.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc13_29 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %.loc13_29.4: Core.IntLiteral = converted %int.sadd, %.loc13_29.3 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %array_type: type = array_type %.loc13_29.4, %i32 [concrete = constants.%array_type] diff --git a/toolchain/check/testdata/function/builtin/method.carbon b/toolchain/check/testdata/function/builtin/method.carbon index d74910ffb5b5..62202d21ac62 100644 --- a/toolchain/check/testdata/function/builtin/method.carbon +++ b/toolchain/check/testdata/function/builtin/method.carbon @@ -45,7 +45,8 @@ var arr: array(i32, (1 as i32).(I.F)(2)); // CHECK:STDOUT: %As.facet: %As.type.fd4 = facet_value Core.IntLiteral, %impl_witness.882 [concrete] // CHECK:STDOUT: %.214: type = fn_type_with_self_type %Convert.type.99b, %As.facet [concrete] // CHECK:STDOUT: %Convert.bound.c1b: = bound_method %int_1.5b8, %Convert.197 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.f9a: = specific_function %Convert.bound.c1b, @Convert.5(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn.aad: = specific_function %Convert.197, @Convert.5(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.082: = bound_method %int_1.5b8, %Convert.specific_fn.aad [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %.c3e: type = fn_type_with_self_type %F.type.cf0, %I.facet [concrete] // CHECK:STDOUT: %F.bound: = bound_method %int_1.5d2, %F.9ec [concrete] @@ -58,7 +59,8 @@ var arr: array(i32, (1 as i32).(I.F)(2)); // CHECK:STDOUT: %ImplicitAs.facet.f7f: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet.f7f [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.3(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn.b6f: = specific_function %Convert.956, @Convert.3(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn.b6f [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %impl_witness.023: = impl_witness (imports.%Core.import_ref.85c), @impl.971(%int_32) [concrete] @@ -67,7 +69,8 @@ var arr: array(i32, (1 as i32).(I.F)(2)); // CHECK:STDOUT: %ImplicitAs.facet.e25: %ImplicitAs.type.2fd = facet_value %i32, %impl_witness.023 [concrete] // CHECK:STDOUT: %.10e: type = fn_type_with_self_type %Convert.type.71e, %ImplicitAs.facet.e25 [concrete] // CHECK:STDOUT: %Convert.bound.2d6: = bound_method %int_3.822, %Convert.960 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.377: = specific_function %Convert.bound.2d6, @Convert.4(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn.8a8: = specific_function %Convert.960, @Convert.4(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.c6f: = bound_method %int_3.822, %Convert.specific_fn.8a8 [concrete] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete] // CHECK:STDOUT: %array_type: type = array_type %int_3.1ba, %i32 [concrete] // CHECK:STDOUT: } @@ -108,9 +111,10 @@ var arr: array(i32, (1 as i32).(I.F)(2)); // CHECK:STDOUT: %int_32.loc19_27: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc19_27: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0.loc19_24: %.214 = impl_witness_access constants.%impl_witness.882, element0 [concrete = constants.%Convert.197] -// CHECK:STDOUT: %bound_method.loc19_24: = bound_method %int_1, %impl.elem0.loc19_24 [concrete = constants.%Convert.bound.c1b] -// CHECK:STDOUT: %specific_fn.loc19_24: = specific_function %bound_method.loc19_24, @Convert.5(constants.%int_32) [concrete = constants.%Convert.specific_fn.f9a] -// CHECK:STDOUT: %int.convert_checked.loc19_24: init %i32 = call %specific_fn.loc19_24(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc19_24.1: = bound_method %int_1, %impl.elem0.loc19_24 [concrete = constants.%Convert.bound.c1b] +// CHECK:STDOUT: %specific_fn.loc19_24: = specific_function %impl.elem0.loc19_24, @Convert.5(constants.%int_32) [concrete = constants.%Convert.specific_fn.aad] +// CHECK:STDOUT: %bound_method.loc19_24.2: = bound_method %int_1, %specific_fn.loc19_24 [concrete = constants.%bound_method.082] +// CHECK:STDOUT: %int.convert_checked.loc19_24: init %i32 = call %bound_method.loc19_24.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc19_24.1: %i32 = value_of_initializer %int.convert_checked.loc19_24 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc19_24.2: %i32 = converted %int_1, %.loc19_24.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %I.ref: type = name_ref I, %I.decl [concrete = constants.%I.type] @@ -119,18 +123,20 @@ var arr: array(i32, (1 as i32).(I.F)(2)); // CHECK:STDOUT: %bound_method.loc19_31: = bound_method %.loc19_24.2, %impl.elem0.loc19_31 [concrete = constants.%F.bound] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %impl.elem0.loc19_38: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc19_38: = bound_method %int_2, %impl.elem0.loc19_38 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc19_38: = specific_function %bound_method.loc19_38, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc19_38: init %i32 = call %specific_fn.loc19_38(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc19_38.1: = bound_method %int_2, %impl.elem0.loc19_38 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc19_38: = specific_function %impl.elem0.loc19_38, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn.b6f] +// CHECK:STDOUT: %bound_method.loc19_38.2: = bound_method %int_2, %specific_fn.loc19_38 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc19_38: init %i32 = call %bound_method.loc19_38.2(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc19_38.1: %i32 = value_of_initializer %int.convert_checked.loc19_38 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc19_38.2: %i32 = converted %int_2, %.loc19_38.1 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %int.sadd: init %i32 = call %bound_method.loc19_31(%.loc19_24.2, %.loc19_38.2) [concrete = constants.%int_3.822] // CHECK:STDOUT: %impl.elem0.loc19_39: %.10e = impl_witness_access constants.%impl_witness.023, element0 [concrete = constants.%Convert.960] -// CHECK:STDOUT: %bound_method.loc19_39: = bound_method %int.sadd, %impl.elem0.loc19_39 [concrete = constants.%Convert.bound.2d6] -// CHECK:STDOUT: %specific_fn.loc19_39: = specific_function %bound_method.loc19_39, @Convert.4(constants.%int_32) [concrete = constants.%Convert.specific_fn.377] +// CHECK:STDOUT: %bound_method.loc19_39.1: = bound_method %int.sadd, %impl.elem0.loc19_39 [concrete = constants.%Convert.bound.2d6] +// CHECK:STDOUT: %specific_fn.loc19_39: = specific_function %impl.elem0.loc19_39, @Convert.4(constants.%int_32) [concrete = constants.%Convert.specific_fn.8a8] +// CHECK:STDOUT: %bound_method.loc19_39.2: = bound_method %int.sadd, %specific_fn.loc19_39 [concrete = constants.%bound_method.c6f] // CHECK:STDOUT: %.loc19_39.1: %i32 = value_of_initializer %int.sadd [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc19_39.2: %i32 = converted %int.sadd, %.loc19_39.1 [concrete = constants.%int_3.822] -// CHECK:STDOUT: %int.convert_checked.loc19_39: init Core.IntLiteral = call %specific_fn.loc19_39(%.loc19_39.2) [concrete = constants.%int_3.1ba] +// CHECK:STDOUT: %int.convert_checked.loc19_39: init Core.IntLiteral = call %bound_method.loc19_39.2(%.loc19_39.2) [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %.loc19_39.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc19_39 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %.loc19_39.4: Core.IntLiteral = converted %int.sadd, %.loc19_39.3 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %array_type: type = array_type %.loc19_39.4, %i32 [concrete = constants.%array_type] diff --git a/toolchain/check/testdata/function/call/i32.carbon b/toolchain/check/testdata/function/call/i32.carbon index ff857b3c3ea5..9d17d517adc2 100644 --- a/toolchain/check/testdata/function/call/i32.carbon +++ b/toolchain/check/testdata/function/call/i32.carbon @@ -34,7 +34,8 @@ fn Main() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -90,9 +91,10 @@ fn Main() { // CHECK:STDOUT: %Echo.ref: %Echo.type = name_ref Echo, file.%Echo.decl [concrete = constants.%Echo] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc16_21.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc16_21.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc16_21.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc16_21.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc16_21.2: %i32 = converted %int_1, %.loc16_21.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %Echo.call: init %i32 = call %Echo.ref(%.loc16_21.2) diff --git a/toolchain/check/testdata/function/call/more_param_ir.carbon b/toolchain/check/testdata/function/call/more_param_ir.carbon index de22e605ccfe..0df85f95ee7a 100644 --- a/toolchain/check/testdata/function/call/more_param_ir.carbon +++ b/toolchain/check/testdata/function/call/more_param_ir.carbon @@ -38,13 +38,14 @@ fn Main() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%int_1.5d2) [concrete] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %int_6.462: Core.IntLiteral = int_value 6 [concrete] // CHECK:STDOUT: %Convert.bound.ce9: = bound_method %int_6.462, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.631: = specific_function %Convert.bound.ce9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.efa: = bound_method %int_6.462, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_6.e56: %i32 = int_value 6 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -101,9 +102,10 @@ fn Main() { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc14_22.1: %tuple.type.985 = tuple_literal (%int_1) // CHECK:STDOUT: %impl.elem0.loc14: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc14: = bound_method %int_1, %impl.elem0.loc14 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc14: = specific_function %bound_method.loc14, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc14: init %i32 = call %specific_fn.loc14(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc14_22.1: = bound_method %int_1, %impl.elem0.loc14 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc14: = specific_function %impl.elem0.loc14, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_22.2: = bound_method %int_1, %specific_fn.loc14 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc14: init %i32 = call %bound_method.loc14_22.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_22.2: init %i32 = converted %int_1, %int.convert_checked.loc14 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_22.3: init %tuple.type.a1c = tuple_init (%.loc14_22.2) to %x.var [concrete = constants.%tuple] // CHECK:STDOUT: %.loc14_3.2: init %tuple.type.a1c = converted %.loc14_22.1, %.loc14_22.3 [concrete = constants.%tuple] @@ -122,9 +124,10 @@ fn Main() { // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [concrete = constants.%int_6.462] // CHECK:STDOUT: %.loc16_8: %i32 = bind_value %tuple.elem0 // CHECK:STDOUT: %impl.elem0.loc16: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc16: = bound_method %int_6, %impl.elem0.loc16 [concrete = constants.%Convert.bound.ce9] -// CHECK:STDOUT: %specific_fn.loc16: = specific_function %bound_method.loc16, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.631] -// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %specific_fn.loc16(%int_6) [concrete = constants.%int_6.e56] +// CHECK:STDOUT: %bound_method.loc16_12.1: = bound_method %int_6, %impl.elem0.loc16 [concrete = constants.%Convert.bound.ce9] +// CHECK:STDOUT: %specific_fn.loc16: = specific_function %impl.elem0.loc16, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc16_12.2: = bound_method %int_6, %specific_fn.loc16 [concrete = constants.%bound_method.efa] +// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %bound_method.loc16_12.2(%int_6) [concrete = constants.%int_6.e56] // CHECK:STDOUT: %.loc16_12.1: %i32 = value_of_initializer %int.convert_checked.loc16 [concrete = constants.%int_6.e56] // CHECK:STDOUT: %.loc16_12.2: %i32 = converted %int_6, %.loc16_12.1 [concrete = constants.%int_6.e56] // CHECK:STDOUT: %Foo.call: init %empty_tuple.type = call %Foo.ref(%.loc16_8, %.loc16_12.2) diff --git a/toolchain/check/testdata/function/call/params_one.carbon b/toolchain/check/testdata/function/call/params_one.carbon index c1f9b651f0c5..d62bcb19d8c6 100644 --- a/toolchain/check/testdata/function/call/params_one.carbon +++ b/toolchain/check/testdata/function/call/params_one.carbon @@ -33,7 +33,8 @@ fn Main() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -77,9 +78,10 @@ fn Main() { // CHECK:STDOUT: %Foo.ref: %Foo.type = name_ref Foo, file.%Foo.decl [concrete = constants.%Foo] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc14_7.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_7.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc14_7.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_7.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_7.2: %i32 = converted %int_1, %.loc14_7.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %Foo.call: init %empty_tuple.type = call %Foo.ref(%.loc14_7.2) diff --git a/toolchain/check/testdata/function/call/params_one_comma.carbon b/toolchain/check/testdata/function/call/params_one_comma.carbon index 0135adace737..dad189c417e2 100644 --- a/toolchain/check/testdata/function/call/params_one_comma.carbon +++ b/toolchain/check/testdata/function/call/params_one_comma.carbon @@ -34,7 +34,8 @@ fn Main() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -78,18 +79,20 @@ fn Main() { // CHECK:STDOUT: %Foo.ref.loc14: %Foo.type = name_ref Foo, file.%Foo.decl [concrete = constants.%Foo] // CHECK:STDOUT: %int_1.loc14: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0.loc14: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc14: = bound_method %int_1.loc14, %impl.elem0.loc14 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc14: = specific_function %bound_method.loc14, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc14: init %i32 = call %specific_fn.loc14(%int_1.loc14) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc14_7.1: = bound_method %int_1.loc14, %impl.elem0.loc14 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc14: = specific_function %impl.elem0.loc14, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_7.2: = bound_method %int_1.loc14, %specific_fn.loc14 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc14: init %i32 = call %bound_method.loc14_7.2(%int_1.loc14) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_7.1: %i32 = value_of_initializer %int.convert_checked.loc14 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_7.2: %i32 = converted %int_1.loc14, %.loc14_7.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %Foo.call.loc14: init %empty_tuple.type = call %Foo.ref.loc14(%.loc14_7.2) // CHECK:STDOUT: %Foo.ref.loc15: %Foo.type = name_ref Foo, file.%Foo.decl [concrete = constants.%Foo] // CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0.loc15: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc15: = bound_method %int_1.loc15, %impl.elem0.loc15 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc15: = specific_function %bound_method.loc15, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %specific_fn.loc15(%int_1.loc15) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc15_7.1: = bound_method %int_1.loc15, %impl.elem0.loc15 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc15: = specific_function %impl.elem0.loc15, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc15_7.2: = bound_method %int_1.loc15, %specific_fn.loc15 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %bound_method.loc15_7.2(%int_1.loc15) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc15_7.1: %i32 = value_of_initializer %int.convert_checked.loc15 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc15_7.2: %i32 = converted %int_1.loc15, %.loc15_7.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %Foo.call.loc15: init %empty_tuple.type = call %Foo.ref.loc15(%.loc15_7.2) diff --git a/toolchain/check/testdata/function/call/params_two.carbon b/toolchain/check/testdata/function/call/params_two.carbon index 8e8639645a93..fc9e60362772 100644 --- a/toolchain/check/testdata/function/call/params_two.carbon +++ b/toolchain/check/testdata/function/call/params_two.carbon @@ -34,10 +34,11 @@ fn Main() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -90,15 +91,17 @@ fn Main() { // 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: %impl.elem0.loc14_7: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc14_7: = bound_method %int_1, %impl.elem0.loc14_7 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc14_7: = specific_function %bound_method.loc14_7, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc14_7: init %i32 = call %specific_fn.loc14_7(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc14_7.1: = bound_method %int_1, %impl.elem0.loc14_7 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc14_7: = specific_function %impl.elem0.loc14_7, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_7.2: = bound_method %int_1, %specific_fn.loc14_7 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc14_7: init %i32 = call %bound_method.loc14_7.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_7.1: %i32 = value_of_initializer %int.convert_checked.loc14_7 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_7.2: %i32 = converted %int_1, %.loc14_7.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc14_10: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc14_10: = bound_method %int_2, %impl.elem0.loc14_10 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc14_10: = specific_function %bound_method.loc14_10, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc14_10: init %i32 = call %specific_fn.loc14_10(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc14_10.1: = bound_method %int_2, %impl.elem0.loc14_10 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc14_10: = specific_function %impl.elem0.loc14_10, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_10.2: = bound_method %int_2, %specific_fn.loc14_10 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc14_10: init %i32 = call %bound_method.loc14_10.2(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc14_10.1: %i32 = value_of_initializer %int.convert_checked.loc14_10 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc14_10.2: %i32 = converted %int_2, %.loc14_10.1 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %Foo.call: init %empty_tuple.type = call %Foo.ref(%.loc14_7.2, %.loc14_10.2) diff --git a/toolchain/check/testdata/function/call/params_two_comma.carbon b/toolchain/check/testdata/function/call/params_two_comma.carbon index a09d9e298c9f..95bfa2a16a67 100644 --- a/toolchain/check/testdata/function/call/params_two_comma.carbon +++ b/toolchain/check/testdata/function/call/params_two_comma.carbon @@ -35,10 +35,11 @@ fn Main() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -91,15 +92,17 @@ fn Main() { // CHECK:STDOUT: %int_1.loc14: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %int_2.loc14: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %impl.elem0.loc14_7: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc14_7: = bound_method %int_1.loc14, %impl.elem0.loc14_7 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc14_7: = specific_function %bound_method.loc14_7, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc14_7: init %i32 = call %specific_fn.loc14_7(%int_1.loc14) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc14_7.1: = bound_method %int_1.loc14, %impl.elem0.loc14_7 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc14_7: = specific_function %impl.elem0.loc14_7, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_7.2: = bound_method %int_1.loc14, %specific_fn.loc14_7 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc14_7: init %i32 = call %bound_method.loc14_7.2(%int_1.loc14) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_7.1: %i32 = value_of_initializer %int.convert_checked.loc14_7 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_7.2: %i32 = converted %int_1.loc14, %.loc14_7.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc14_10: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc14_10: = bound_method %int_2.loc14, %impl.elem0.loc14_10 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc14_10: = specific_function %bound_method.loc14_10, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc14_10: init %i32 = call %specific_fn.loc14_10(%int_2.loc14) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc14_10.1: = bound_method %int_2.loc14, %impl.elem0.loc14_10 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc14_10: = specific_function %impl.elem0.loc14_10, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_10.2: = bound_method %int_2.loc14, %specific_fn.loc14_10 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc14_10: init %i32 = call %bound_method.loc14_10.2(%int_2.loc14) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc14_10.1: %i32 = value_of_initializer %int.convert_checked.loc14_10 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc14_10.2: %i32 = converted %int_2.loc14, %.loc14_10.1 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %Foo.call.loc14: init %empty_tuple.type = call %Foo.ref.loc14(%.loc14_7.2, %.loc14_10.2) @@ -107,15 +110,17 @@ fn Main() { // CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %int_2.loc15: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %impl.elem0.loc15_7: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc15_7: = bound_method %int_1.loc15, %impl.elem0.loc15_7 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc15_7: = specific_function %bound_method.loc15_7, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc15_7: init %i32 = call %specific_fn.loc15_7(%int_1.loc15) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc15_7.1: = bound_method %int_1.loc15, %impl.elem0.loc15_7 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc15_7: = specific_function %impl.elem0.loc15_7, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc15_7.2: = bound_method %int_1.loc15, %specific_fn.loc15_7 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc15_7: init %i32 = call %bound_method.loc15_7.2(%int_1.loc15) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc15_7.1: %i32 = value_of_initializer %int.convert_checked.loc15_7 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc15_7.2: %i32 = converted %int_1.loc15, %.loc15_7.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc15_10: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc15_10: = bound_method %int_2.loc15, %impl.elem0.loc15_10 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc15_10: = specific_function %bound_method.loc15_10, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc15_10: init %i32 = call %specific_fn.loc15_10(%int_2.loc15) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc15_10.1: = bound_method %int_2.loc15, %impl.elem0.loc15_10 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc15_10: = specific_function %impl.elem0.loc15_10, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc15_10.2: = bound_method %int_2.loc15, %specific_fn.loc15_10 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc15_10: init %i32 = call %bound_method.loc15_10.2(%int_2.loc15) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc15_10.1: %i32 = value_of_initializer %int.convert_checked.loc15_10 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc15_10.2: %i32 = converted %int_2.loc15, %.loc15_10.1 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %Foo.call.loc15: init %empty_tuple.type = call %Foo.ref.loc15(%.loc15_7.2, %.loc15_10.2) diff --git a/toolchain/check/testdata/function/call/prefer_unqualified_lookup.carbon b/toolchain/check/testdata/function/call/prefer_unqualified_lookup.carbon index d086e0046924..f4cd1b23055d 100644 --- a/toolchain/check/testdata/function/call/prefer_unqualified_lookup.carbon +++ b/toolchain/check/testdata/function/call/prefer_unqualified_lookup.carbon @@ -50,7 +50,8 @@ fn Class(F:! type).Inner.G() -> i32 { return F(); } // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %F.specific_fn: = specific_function %F.3fa, @F(%F.8b3) [symbolic] // CHECK:STDOUT: } @@ -148,9 +149,10 @@ fn Class(F:! type).Inner.G() -> i32 { return F(); } // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc8_29.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_29.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc8_29.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc8_29.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc8_29.2: %i32 = converted %int_0, %.loc8_29.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: return %.loc8_29.2 diff --git a/toolchain/check/testdata/function/declaration/import.carbon b/toolchain/check/testdata/function/declaration/import.carbon index 513be6c08e5d..d8f0ecc78883 100644 --- a/toolchain/check/testdata/function/declaration/import.carbon +++ b/toolchain/check/testdata/function/declaration/import.carbon @@ -461,7 +461,8 @@ import library "extern_api"; // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [concrete] // CHECK:STDOUT: %C.type: type = fn_type @C [concrete] @@ -580,9 +581,10 @@ import library "extern_api"; // CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%Main.B [concrete = constants.%B] // CHECK:STDOUT: %int_1.loc7: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0.loc7: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc7: = bound_method %int_1.loc7, %impl.elem0.loc7 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc7: = specific_function %bound_method.loc7, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc7: init %i32 = call %specific_fn.loc7(%int_1.loc7) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc7_16.1: = bound_method %int_1.loc7, %impl.elem0.loc7 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc7: = specific_function %impl.elem0.loc7, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc7_16.2: = bound_method %int_1.loc7, %specific_fn.loc7 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc7: init %i32 = call %bound_method.loc7_16.2(%int_1.loc7) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc7_16.1: %i32 = value_of_initializer %int.convert_checked.loc7 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc7_16.2: %i32 = converted %int_1.loc7, %.loc7_16.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc7_16.2) @@ -591,9 +593,10 @@ import library "extern_api"; // CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc8_25.1: %tuple.type.985 = tuple_literal (%int_1.loc8) // CHECK:STDOUT: %impl.elem0.loc8: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc8: = bound_method %int_1.loc8, %impl.elem0.loc8 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc8: = specific_function %bound_method.loc8, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %specific_fn.loc8(%int_1.loc8) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc8_25.1: = bound_method %int_1.loc8, %impl.elem0.loc8 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc8: = specific_function %impl.elem0.loc8, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_25.2: = bound_method %int_1.loc8, %specific_fn.loc8 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %bound_method.loc8_25.2(%int_1.loc8) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc8_25.2: %i32 = value_of_initializer %int.convert_checked.loc8 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc8_25.3: %i32 = converted %int_1.loc8, %.loc8_25.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%.loc8_25.3) [concrete = constants.%tuple] @@ -638,7 +641,8 @@ import library "extern_api"; // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %tuple.type.985: type = tuple_type (Core.IntLiteral) [concrete] // CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%int_1.5d2) [concrete] @@ -774,9 +778,10 @@ import library "extern_api"; // CHECK:STDOUT: %B.ref: %B.type = name_ref B, file.%B.decl [concrete = constants.%B] // CHECK:STDOUT: %int_1.loc53: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0.loc53: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc53: = bound_method %int_1.loc53, %impl.elem0.loc53 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc53: = specific_function %bound_method.loc53, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc53: init %i32 = call %specific_fn.loc53(%int_1.loc53) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc53_16.1: = bound_method %int_1.loc53, %impl.elem0.loc53 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc53: = specific_function %impl.elem0.loc53, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc53_16.2: = bound_method %int_1.loc53, %specific_fn.loc53 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc53: init %i32 = call %bound_method.loc53_16.2(%int_1.loc53) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc53_16.1: %i32 = value_of_initializer %int.convert_checked.loc53 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc53_16.2: %i32 = converted %int_1.loc53, %.loc53_16.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc53_16.2) @@ -785,9 +790,10 @@ import library "extern_api"; // CHECK:STDOUT: %int_1.loc54: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc54_25.1: %tuple.type.985 = tuple_literal (%int_1.loc54) // CHECK:STDOUT: %impl.elem0.loc54: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc54: = bound_method %int_1.loc54, %impl.elem0.loc54 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc54: = specific_function %bound_method.loc54, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc54: init %i32 = call %specific_fn.loc54(%int_1.loc54) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc54_25.1: = bound_method %int_1.loc54, %impl.elem0.loc54 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc54: = specific_function %impl.elem0.loc54, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc54_25.2: = bound_method %int_1.loc54, %specific_fn.loc54 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc54: init %i32 = call %bound_method.loc54_25.2(%int_1.loc54) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc54_25.2: %i32 = value_of_initializer %int.convert_checked.loc54 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc54_25.3: %i32 = converted %int_1.loc54, %.loc54_25.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%.loc54_25.3) [concrete = constants.%tuple] @@ -832,7 +838,8 @@ import library "extern_api"; // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.9ba = facet_value Core.IntLiteral, %impl_witness.b97 [concrete] // CHECK:STDOUT: %.39b: type = fn_type_with_self_type %Convert.type.6da, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.16d [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.16d, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.47b: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %tuple.type.985: type = tuple_type (Core.IntLiteral) [concrete] // CHECK:STDOUT: %tuple: %tuple.type.dd4 = tuple_value (%int_1.47b) [concrete] @@ -968,9 +975,10 @@ import library "extern_api"; // CHECK:STDOUT: %B.ref: %B.type = name_ref B, file.%B.decl [concrete = constants.%B] // CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0.loc13: %.39b = impl_witness_access constants.%impl_witness.b97, element0 [concrete = constants.%Convert.16d] -// CHECK:STDOUT: %bound_method.loc13: = bound_method %int_1.loc13, %impl.elem0.loc13 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc13: = specific_function %bound_method.loc13, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %specific_fn.loc13(%int_1.loc13) [concrete = constants.%int_1.47b] +// CHECK:STDOUT: %bound_method.loc13_16.1: = bound_method %int_1.loc13, %impl.elem0.loc13 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc13: = specific_function %impl.elem0.loc13, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_16.2: = bound_method %int_1.loc13, %specific_fn.loc13 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %bound_method.loc13_16.2(%int_1.loc13) [concrete = constants.%int_1.47b] // CHECK:STDOUT: %.loc13_16.1: %i32 = value_of_initializer %int.convert_checked.loc13 [concrete = constants.%int_1.47b] // CHECK:STDOUT: %.loc13_16.2: %i32 = converted %int_1.loc13, %.loc13_16.1 [concrete = constants.%int_1.47b] // CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc13_16.2) @@ -979,9 +987,10 @@ import library "extern_api"; // CHECK:STDOUT: %int_1.loc14: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc14_25.1: %tuple.type.985 = tuple_literal (%int_1.loc14) // CHECK:STDOUT: %impl.elem0.loc14: %.39b = impl_witness_access constants.%impl_witness.b97, element0 [concrete = constants.%Convert.16d] -// CHECK:STDOUT: %bound_method.loc14: = bound_method %int_1.loc14, %impl.elem0.loc14 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc14: = specific_function %bound_method.loc14, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc14: init %i32 = call %specific_fn.loc14(%int_1.loc14) [concrete = constants.%int_1.47b] +// CHECK:STDOUT: %bound_method.loc14_25.1: = bound_method %int_1.loc14, %impl.elem0.loc14 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc14: = specific_function %impl.elem0.loc14, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_25.2: = bound_method %int_1.loc14, %specific_fn.loc14 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc14: init %i32 = call %bound_method.loc14_25.2(%int_1.loc14) [concrete = constants.%int_1.47b] // CHECK:STDOUT: %.loc14_25.2: %i32 = value_of_initializer %int.convert_checked.loc14 [concrete = constants.%int_1.47b] // CHECK:STDOUT: %.loc14_25.3: %i32 = converted %int_1.loc14, %.loc14_25.2 [concrete = constants.%int_1.47b] // CHECK:STDOUT: %tuple: %tuple.type.dd4 = tuple_value (%.loc14_25.3) [concrete = constants.%tuple] @@ -1017,7 +1026,8 @@ import library "extern_api"; // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [concrete] // CHECK:STDOUT: %C.type: type = fn_type @C [concrete] @@ -1136,9 +1146,10 @@ import library "extern_api"; // CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%Main.B [concrete = constants.%B] // CHECK:STDOUT: %int_1.loc53: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0.loc53: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc53: = bound_method %int_1.loc53, %impl.elem0.loc53 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc53: = specific_function %bound_method.loc53, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc53: init %i32 = call %specific_fn.loc53(%int_1.loc53) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc53_16.1: = bound_method %int_1.loc53, %impl.elem0.loc53 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc53: = specific_function %impl.elem0.loc53, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc53_16.2: = bound_method %int_1.loc53, %specific_fn.loc53 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc53: init %i32 = call %bound_method.loc53_16.2(%int_1.loc53) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc53_16.1: %i32 = value_of_initializer %int.convert_checked.loc53 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc53_16.2: %i32 = converted %int_1.loc53, %.loc53_16.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc53_16.2) @@ -1147,9 +1158,10 @@ import library "extern_api"; // CHECK:STDOUT: %int_1.loc54: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc54_25.1: %tuple.type.985 = tuple_literal (%int_1.loc54) // CHECK:STDOUT: %impl.elem0.loc54: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc54: = bound_method %int_1.loc54, %impl.elem0.loc54 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc54: = specific_function %bound_method.loc54, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc54: init %i32 = call %specific_fn.loc54(%int_1.loc54) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc54_25.1: = bound_method %int_1.loc54, %impl.elem0.loc54 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc54: = specific_function %impl.elem0.loc54, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc54_25.2: = bound_method %int_1.loc54, %specific_fn.loc54 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc54: init %i32 = call %bound_method.loc54_25.2(%int_1.loc54) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc54_25.2: %i32 = value_of_initializer %int.convert_checked.loc54 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc54_25.3: %i32 = converted %int_1.loc54, %.loc54_25.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%.loc54_25.3) [concrete = constants.%tuple] @@ -1185,7 +1197,8 @@ import library "extern_api"; // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [concrete] // CHECK:STDOUT: %C.type: type = fn_type @C [concrete] @@ -1304,9 +1317,10 @@ import library "extern_api"; // CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%Main.B [concrete = constants.%B] // CHECK:STDOUT: %int_1.loc53: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0.loc53: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc53: = bound_method %int_1.loc53, %impl.elem0.loc53 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc53: = specific_function %bound_method.loc53, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc53: init %i32 = call %specific_fn.loc53(%int_1.loc53) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc53_16.1: = bound_method %int_1.loc53, %impl.elem0.loc53 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc53: = specific_function %impl.elem0.loc53, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc53_16.2: = bound_method %int_1.loc53, %specific_fn.loc53 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc53: init %i32 = call %bound_method.loc53_16.2(%int_1.loc53) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc53_16.1: %i32 = value_of_initializer %int.convert_checked.loc53 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc53_16.2: %i32 = converted %int_1.loc53, %.loc53_16.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc53_16.2) @@ -1315,9 +1329,10 @@ import library "extern_api"; // CHECK:STDOUT: %int_1.loc54: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc54_25.1: %tuple.type.985 = tuple_literal (%int_1.loc54) // CHECK:STDOUT: %impl.elem0.loc54: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc54: = bound_method %int_1.loc54, %impl.elem0.loc54 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc54: = specific_function %bound_method.loc54, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc54: init %i32 = call %specific_fn.loc54(%int_1.loc54) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc54_25.1: = bound_method %int_1.loc54, %impl.elem0.loc54 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc54: = specific_function %impl.elem0.loc54, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc54_25.2: = bound_method %int_1.loc54, %specific_fn.loc54 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc54: init %i32 = call %bound_method.loc54_25.2(%int_1.loc54) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc54_25.2: %i32 = value_of_initializer %int.convert_checked.loc54 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc54_25.3: %i32 = converted %int_1.loc54, %.loc54_25.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%.loc54_25.3) [concrete = constants.%tuple] diff --git a/toolchain/check/testdata/function/definition/import.carbon b/toolchain/check/testdata/function/definition/import.carbon index e0661c123eaa..4766c2b73fca 100644 --- a/toolchain/check/testdata/function/definition/import.carbon +++ b/toolchain/check/testdata/function/definition/import.carbon @@ -255,7 +255,8 @@ fn D() {} // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [concrete] // CHECK:STDOUT: %C.type: type = fn_type @C [concrete] @@ -338,9 +339,10 @@ fn D() {} // CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%Main.B [concrete = constants.%B] // CHECK:STDOUT: %int_1.loc7: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0.loc7: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc7: = bound_method %int_1.loc7, %impl.elem0.loc7 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc7: = specific_function %bound_method.loc7, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc7: init %i32 = call %specific_fn.loc7(%int_1.loc7) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc7_16.1: = bound_method %int_1.loc7, %impl.elem0.loc7 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc7: = specific_function %impl.elem0.loc7, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc7_16.2: = bound_method %int_1.loc7, %specific_fn.loc7 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc7: init %i32 = call %bound_method.loc7_16.2(%int_1.loc7) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc7_16.1: %i32 = value_of_initializer %int.convert_checked.loc7 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc7_16.2: %i32 = converted %int_1.loc7, %.loc7_16.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc7_16.2) @@ -349,9 +351,10 @@ fn D() {} // CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc8_25.1: %tuple.type.985 = tuple_literal (%int_1.loc8) // CHECK:STDOUT: %impl.elem0.loc8: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc8: = bound_method %int_1.loc8, %impl.elem0.loc8 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc8: = specific_function %bound_method.loc8, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %specific_fn.loc8(%int_1.loc8) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc8_25.1: = bound_method %int_1.loc8, %impl.elem0.loc8 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc8: = specific_function %impl.elem0.loc8, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_25.2: = bound_method %int_1.loc8, %specific_fn.loc8 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %bound_method.loc8_25.2(%int_1.loc8) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc8_25.2: %i32 = value_of_initializer %int.convert_checked.loc8 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc8_25.3: %i32 = converted %int_1.loc8, %.loc8_25.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%.loc8_25.3) [concrete = constants.%tuple] diff --git a/toolchain/check/testdata/function/generic/deduce.carbon b/toolchain/check/testdata/function/generic/deduce.carbon index 1e100b65cf8b..c581fa544702 100644 --- a/toolchain/check/testdata/function/generic/deduce.carbon +++ b/toolchain/check/testdata/function/generic/deduce.carbon @@ -781,7 +781,8 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %tuple: %tuple.type.4c8 = tuple_value (%int_1, %int_2.ef8) [concrete] // CHECK:STDOUT: %complete_type.c49: = complete_type_witness %tuple.type.4c8 [concrete] @@ -844,9 +845,10 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %.loc7_19.1: %tuple.type.f94 = tuple_literal (%int_1, %int_2) // CHECK:STDOUT: %TupleParam.specific_fn: = specific_function %TupleParam.ref, @TupleParam(Core.IntLiteral) [concrete = constants.%TupleParam.specific_fn] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_2, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc7_19.1: = bound_method %int_2, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc7_19.2: = bound_method %int_2, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc7_19.2(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc7_19.2: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc7_19.3: %i32 = converted %int_2, %.loc7_19.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %tuple: %tuple.type.4c8 = tuple_value (%int_1, %.loc7_19.3) [concrete = constants.%tuple] @@ -897,7 +899,8 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %struct: %struct_type.a.b.a13 = struct_value (%int_1, %int_2.ef8) [concrete] // CHECK:STDOUT: %complete_type.a4a: = complete_type_witness %struct_type.a.b.a13 [concrete] @@ -959,9 +962,10 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %.loc7_30.1: %struct_type.a.b.cfd = struct_literal (%int_1, %int_2) // CHECK:STDOUT: %StructParam.specific_fn: = specific_function %StructParam.ref, @StructParam(Core.IntLiteral) [concrete = constants.%StructParam.specific_fn] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_2, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc7_30.1: = bound_method %int_2, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc7_30.2: = bound_method %int_2, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc7_30.2(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc7_30.2: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc7_30.3: %i32 = converted %int_2, %.loc7_30.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %struct: %struct_type.a.b.a13 = struct_value (%int_1, %.loc7_30.3) [concrete = constants.%struct] diff --git a/toolchain/check/testdata/function/generic/param_in_type.carbon b/toolchain/check/testdata/function/generic/param_in_type.carbon index 1ca588c7915b..b507c9c79a2b 100644 --- a/toolchain/check/testdata/function/generic/param_in_type.carbon +++ b/toolchain/check/testdata/function/generic/param_in_type.carbon @@ -25,8 +25,9 @@ fn F(N:! i32, a: array(i32, N)*); // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.2fd = facet_value %i32, %impl_witness.023 [concrete] // CHECK:STDOUT: %.10e: type = fn_type_with_self_type %Convert.type.71e, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %N.51e, %Convert.960 [symbolic] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.3(%int_32) [symbolic] -// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn(%N.51e) [symbolic] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.960, @Convert.3(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %N.51e, %Convert.specific_fn [symbolic] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %bound_method(%N.51e) [symbolic] // CHECK:STDOUT: %array_type: type = array_type %int.convert_checked, %i32 [symbolic] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] @@ -64,9 +65,10 @@ fn F(N:! i32, a: array(i32, N)*); // CHECK:STDOUT: %i32.loc11_24: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc11_6.1 [symbolic = %N.loc11_6.2 (constants.%N.51e)] // CHECK:STDOUT: %impl.elem0: %.10e = impl_witness_access constants.%impl_witness.023, element0 [concrete = constants.%Convert.960] -// CHECK:STDOUT: %bound_method: = bound_method %N.ref, %impl.elem0 [symbolic = %Convert.bound (constants.%Convert.bound)] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn (constants.%Convert.specific_fn)] -// CHECK:STDOUT: %int.convert_checked.loc11_29.1: init Core.IntLiteral = call %specific_fn(%N.ref) [symbolic = %int.convert_checked.loc11_29.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %bound_method.loc11_29.1: = bound_method %N.ref, %impl.elem0 [symbolic = %Convert.bound (constants.%Convert.bound)] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_29.2: = bound_method %N.ref, %specific_fn [symbolic = %bound_method.loc11_29.3 (constants.%bound_method)] +// CHECK:STDOUT: %int.convert_checked.loc11_29.1: init Core.IntLiteral = call %bound_method.loc11_29.2(%N.ref) [symbolic = %int.convert_checked.loc11_29.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc11_29.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc11_29.1 [symbolic = %int.convert_checked.loc11_29.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc11_29.2: Core.IntLiteral = converted %N.ref, %.loc11_29.1 [symbolic = %int.convert_checked.loc11_29.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %array_type.loc11_30.1: type = array_type %.loc11_29.2, %i32 [symbolic = %array_type.loc11_30.2 (constants.%array_type)] @@ -80,8 +82,8 @@ fn F(N:! i32, a: array(i32, N)*); // CHECK:STDOUT: %N.loc11_6.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc11_6.2 (constants.%N.51e)] // CHECK:STDOUT: %N.patt.loc11_6.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc11_6.2 (constants.%N.patt.8e2)] // CHECK:STDOUT: %Convert.bound: = bound_method %N.loc11_6.2, constants.%Convert.960 [symbolic = %Convert.bound (constants.%Convert.bound)] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn (constants.%Convert.specific_fn)] -// CHECK:STDOUT: %int.convert_checked.loc11_29.2: init Core.IntLiteral = call %Convert.specific_fn(%N.loc11_6.2) [symbolic = %int.convert_checked.loc11_29.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %bound_method.loc11_29.3: = bound_method %N.loc11_6.2, constants.%Convert.specific_fn [symbolic = %bound_method.loc11_29.3 (constants.%bound_method)] +// CHECK:STDOUT: %int.convert_checked.loc11_29.2: init Core.IntLiteral = call %bound_method.loc11_29.3(%N.loc11_6.2) [symbolic = %int.convert_checked.loc11_29.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %array_type.loc11_30.2: type = array_type %int.convert_checked.loc11_29.2, %i32 [symbolic = %array_type.loc11_30.2 (constants.%array_type)] // CHECK:STDOUT: %ptr.loc11_31.2: type = ptr_type @F.%array_type.loc11_30.2 (%array_type) [symbolic = %ptr.loc11_31.2 (constants.%ptr)] // CHECK:STDOUT: @@ -92,7 +94,7 @@ fn F(N:! i32, a: array(i32, N)*); // CHECK:STDOUT: %N.loc11_6.2 => constants.%N.51e // CHECK:STDOUT: %N.patt.loc11_6.2 => constants.%N.51e // CHECK:STDOUT: %Convert.bound => constants.%Convert.bound -// CHECK:STDOUT: %Convert.specific_fn => constants.%Convert.specific_fn +// CHECK:STDOUT: %bound_method.loc11_29.3 => constants.%bound_method // CHECK:STDOUT: %int.convert_checked.loc11_29.2 => constants.%int.convert_checked // CHECK:STDOUT: %array_type.loc11_30.2 => constants.%array_type // CHECK:STDOUT: %ptr.loc11_31.2 => constants.%ptr diff --git a/toolchain/check/testdata/function/generic/undefined.carbon b/toolchain/check/testdata/function/generic/undefined.carbon index 2d87f9ca34c9..bd55d34b6f11 100644 --- a/toolchain/check/testdata/function/generic/undefined.carbon +++ b/toolchain/check/testdata/function/generic/undefined.carbon @@ -74,7 +74,8 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %As.facet: %As.type.fd4 = facet_value Core.IntLiteral, %impl_witness.882 [concrete] // CHECK:STDOUT: %.214: type = fn_type_with_self_type %Convert.type.99b, %As.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.197 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.197, @Convert.5(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %Defined.specific_fn: = specific_function %Defined, @Defined(%i32) [concrete] // CHECK:STDOUT: } @@ -142,9 +143,10 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %int_32.loc9: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc9: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0: %.214 = impl_witness_access constants.%impl_witness.882, element0 [concrete = constants.%Convert.197] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.5(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc9_20.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.5(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_20.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc9_20.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc9_20.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc9_20.2: %i32 = converted %int_0, %.loc9_20.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %Defined.specific_fn: = specific_function %Defined.ref, @Defined(constants.%i32) [concrete = constants.%Defined.specific_fn] @@ -190,7 +192,8 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %As.facet: %As.type.fd4 = facet_value Core.IntLiteral, %impl_witness.882 [concrete] // CHECK:STDOUT: %.214: type = fn_type_with_self_type %Convert.type.99b, %As.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.197 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.197, @Convert.5(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %Defined.specific_fn: = specific_function %Defined, @Defined(%i32) [concrete] // CHECK:STDOUT: } @@ -273,9 +276,10 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0: %.214 = impl_witness_access constants.%impl_witness.882, element0 [concrete = constants.%Convert.197] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.5(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc7_20.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.5(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc7_20.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc7_20.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc7_20.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc7_20.2: %i32 = converted %int_0, %.loc7_20.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %Defined.specific_fn: = specific_function %Defined.ref, @Defined(constants.%i32) [concrete = constants.%Defined.specific_fn] @@ -318,7 +322,8 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %As.facet: %As.type.fd4 = facet_value Core.IntLiteral, %impl_witness.882 [concrete] // CHECK:STDOUT: %.214: type = fn_type_with_self_type %Convert.type.99b, %As.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.197 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.197, @Convert.5(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %Undefined.specific_fn: = specific_function %Undefined, @Undefined(%i32) [concrete] // CHECK:STDOUT: } @@ -379,9 +384,10 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0: %.214 = impl_witness_access constants.%impl_witness.882, element0 [concrete = constants.%Convert.197] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.5(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc14_22.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.5(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_22.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc14_22.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc14_22.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc14_22.2: %i32 = converted %int_0, %.loc14_22.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %Undefined.specific_fn: = specific_function %Undefined.ref, @Undefined(constants.%i32) [concrete = constants.%Undefined.specific_fn] diff --git a/toolchain/check/testdata/generic/call_basic_depth.carbon b/toolchain/check/testdata/generic/call_basic_depth.carbon index b1e3678ffaca..eb2a1c6660aa 100644 --- a/toolchain/check/testdata/generic/call_basic_depth.carbon +++ b/toolchain/check/testdata/generic/call_basic_depth.carbon @@ -8,6 +8,11 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/generic/call_basic_depth.carbon +class C { + fn Cfn[self: Self, T:! type](x: T) { + } +} + fn F[T:! type](x: T) { } @@ -20,6 +25,9 @@ fn H[T:! type](x: T) -> T { fn G[T:! type](x: T) -> T { H(x); F(x); + + var c: C; + c.Cfn(x); return x; } @@ -34,18 +42,24 @@ fn M() { // CHECK:STDOUT: --- call_basic_depth.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] -// CHECK:STDOUT: %F.type: type = fn_type @F [concrete] +// CHECK:STDOUT: %Cfn.type: type = fn_type @Cfn [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] -// CHECK:STDOUT: %F: %F.type = struct_value () [concrete] +// CHECK:STDOUT: %Cfn: %Cfn.type = struct_value () [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %require_complete.4ae: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %F.type: type = fn_type @F [concrete] +// CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %H.type: type = fn_type @H [concrete] // CHECK:STDOUT: %H: %H.type = struct_value () [concrete] // CHECK:STDOUT: %F.specific_fn.ef1: = specific_function %F, @F(%T) [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %H.specific_fn.1ed: = specific_function %H, @H(%T) [symbolic] +// CHECK:STDOUT: %Cfn.specific_fn.53f: = specific_function %Cfn, @Cfn(%T) [symbolic] // CHECK:STDOUT: %M.type: type = fn_type @M [concrete] // CHECK:STDOUT: %M: %M.type = struct_value () [concrete] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] @@ -61,11 +75,13 @@ fn M() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %F.specific_fn.501: = specific_function %F, @F(%i32) [concrete] // CHECK:STDOUT: %G.specific_fn: = specific_function %G, @G(%i32) [concrete] // CHECK:STDOUT: %H.specific_fn.aac: = specific_function %H, @H(%i32) [concrete] +// CHECK:STDOUT: %Cfn.specific_fn.7b2: = specific_function %Cfn, @Cfn(%i32) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -80,108 +96,163 @@ fn M() { // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: .H = %H.decl // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: .M = %M.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { -// CHECK:STDOUT: %T.patt.loc11_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)] -// CHECK:STDOUT: %x.patt: @F.%T.loc11_6.2 (%T) = binding_pattern x -// CHECK:STDOUT: %x.param_patt: @F.%T.loc11_6.2 (%T) = value_param_pattern %x.patt, call_param0 +// CHECK:STDOUT: %T.patt.loc16_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc16_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %x.patt: @F.%T.loc16_6.2 (%T) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @F.%T.loc16_6.2 (%T) = value_param_pattern %x.patt, call_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.loc11_6.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc11_6.2 (constants.%T)] -// CHECK:STDOUT: %x.param: @F.%T.loc11_6.2 (%T) = value_param call_param0 -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc11_6.1 [symbolic = %T.loc11_6.2 (constants.%T)] -// CHECK:STDOUT: %x: @F.%T.loc11_6.2 (%T) = bind_name x, %x.param +// CHECK:STDOUT: %T.loc16_6.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc16_6.2 (constants.%T)] +// CHECK:STDOUT: %x.param: @F.%T.loc16_6.2 (%T) = value_param call_param0 +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc16_6.1 [symbolic = %T.loc16_6.2 (constants.%T)] +// CHECK:STDOUT: %x: @F.%T.loc16_6.2 (%T) = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [concrete = constants.%H] { -// CHECK:STDOUT: %T.patt.loc14_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc14_6.2 (constants.%T.patt)] -// CHECK:STDOUT: %x.patt: @H.%T.loc14_6.2 (%T) = binding_pattern x -// CHECK:STDOUT: %x.param_patt: @H.%T.loc14_6.2 (%T) = value_param_pattern %x.patt, call_param0 -// CHECK:STDOUT: %return.patt: @H.%T.loc14_6.2 (%T) = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: @H.%T.loc14_6.2 (%T) = out_param_pattern %return.patt, call_param1 +// CHECK:STDOUT: %T.patt.loc19_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc19_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %x.patt: @H.%T.loc19_6.2 (%T) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @H.%T.loc19_6.2 (%T) = value_param_pattern %x.patt, call_param0 +// CHECK:STDOUT: %return.patt: @H.%T.loc19_6.2 (%T) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @H.%T.loc19_6.2 (%T) = out_param_pattern %return.patt, call_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc14_25: type = name_ref T, %T.loc14_6.1 [symbolic = %T.loc14_6.2 (constants.%T)] -// CHECK:STDOUT: %T.loc14_6.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc14_6.2 (constants.%T)] -// CHECK:STDOUT: %x.param: @H.%T.loc14_6.2 (%T) = value_param call_param0 -// CHECK:STDOUT: %T.ref.loc14_19: type = name_ref T, %T.loc14_6.1 [symbolic = %T.loc14_6.2 (constants.%T)] -// CHECK:STDOUT: %x: @H.%T.loc14_6.2 (%T) = bind_name x, %x.param -// CHECK:STDOUT: %return.param: ref @H.%T.loc14_6.2 (%T) = out_param call_param1 -// CHECK:STDOUT: %return: ref @H.%T.loc14_6.2 (%T) = return_slot %return.param +// CHECK:STDOUT: %T.ref.loc19_25: type = name_ref T, %T.loc19_6.1 [symbolic = %T.loc19_6.2 (constants.%T)] +// CHECK:STDOUT: %T.loc19_6.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc19_6.2 (constants.%T)] +// CHECK:STDOUT: %x.param: @H.%T.loc19_6.2 (%T) = value_param call_param0 +// CHECK:STDOUT: %T.ref.loc19_19: type = name_ref T, %T.loc19_6.1 [symbolic = %T.loc19_6.2 (constants.%T)] +// CHECK:STDOUT: %x: @H.%T.loc19_6.2 (%T) = bind_name x, %x.param +// CHECK:STDOUT: %return.param: ref @H.%T.loc19_6.2 (%T) = out_param call_param1 +// CHECK:STDOUT: %return: ref @H.%T.loc19_6.2 (%T) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] { -// CHECK:STDOUT: %T.patt.loc20_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc20_6.2 (constants.%T.patt)] -// CHECK:STDOUT: %x.patt: @G.%T.loc20_6.2 (%T) = binding_pattern x -// CHECK:STDOUT: %x.param_patt: @G.%T.loc20_6.2 (%T) = value_param_pattern %x.patt, call_param0 -// CHECK:STDOUT: %return.patt: @G.%T.loc20_6.2 (%T) = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: @G.%T.loc20_6.2 (%T) = out_param_pattern %return.patt, call_param1 +// CHECK:STDOUT: %T.patt.loc25_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc25_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %x.patt: @G.%T.loc25_6.2 (%T) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @G.%T.loc25_6.2 (%T) = value_param_pattern %x.patt, call_param0 +// CHECK:STDOUT: %return.patt: @G.%T.loc25_6.2 (%T) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @G.%T.loc25_6.2 (%T) = out_param_pattern %return.patt, call_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc20_25: type = name_ref T, %T.loc20_6.1 [symbolic = %T.loc20_6.2 (constants.%T)] -// CHECK:STDOUT: %T.loc20_6.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc20_6.2 (constants.%T)] -// CHECK:STDOUT: %x.param: @G.%T.loc20_6.2 (%T) = value_param call_param0 -// CHECK:STDOUT: %T.ref.loc20_19: type = name_ref T, %T.loc20_6.1 [symbolic = %T.loc20_6.2 (constants.%T)] -// CHECK:STDOUT: %x: @G.%T.loc20_6.2 (%T) = bind_name x, %x.param -// CHECK:STDOUT: %return.param: ref @G.%T.loc20_6.2 (%T) = out_param call_param1 -// CHECK:STDOUT: %return: ref @G.%T.loc20_6.2 (%T) = return_slot %return.param +// CHECK:STDOUT: %T.ref.loc25_25: type = name_ref T, %T.loc25_6.1 [symbolic = %T.loc25_6.2 (constants.%T)] +// CHECK:STDOUT: %T.loc25_6.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc25_6.2 (constants.%T)] +// CHECK:STDOUT: %x.param: @G.%T.loc25_6.2 (%T) = value_param call_param0 +// CHECK:STDOUT: %T.ref.loc25_19: type = name_ref T, %T.loc25_6.1 [symbolic = %T.loc25_6.2 (constants.%T)] +// CHECK:STDOUT: %x: @G.%T.loc25_6.2 (%T) = bind_name x, %x.param +// CHECK:STDOUT: %return.param: ref @G.%T.loc25_6.2 (%T) = out_param call_param1 +// CHECK:STDOUT: %return: ref @G.%T.loc25_6.2 (%T) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %M.decl: %M.type = fn_decl @M [concrete = constants.%M] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(%T.loc11_6.1: type) { -// CHECK:STDOUT: %T.loc11_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc11_6.2 (constants.%T)] -// CHECK:STDOUT: %T.patt.loc11_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)] +// CHECK:STDOUT: class @C { +// CHECK:STDOUT: %Cfn.decl: %Cfn.type = fn_decl @Cfn [concrete = constants.%Cfn] { +// CHECK:STDOUT: %self.patt: %C = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, call_param0 +// CHECK:STDOUT: %T.patt.loc12_22.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_22.2 (constants.%T.patt)] +// CHECK:STDOUT: %x.patt: @Cfn.%T.loc12_22.1 (%T) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @Cfn.%T.loc12_22.1 (%T) = value_param_pattern %x.patt, call_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: %C = value_param call_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C] +// CHECK:STDOUT: %self: %C = bind_name self, %self.param +// CHECK:STDOUT: %T.loc12_22.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc12_22.1 (constants.%T)] +// CHECK:STDOUT: %x.param: @Cfn.%T.loc12_22.1 (%T) = value_param call_param1 +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc12_22.2 [symbolic = %T.loc12_22.1 (constants.%T)] +// CHECK:STDOUT: %x: @Cfn.%T.loc12_22.1 (%T) = bind_name x, %x.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357] +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%C +// CHECK:STDOUT: .Cfn = %Cfn.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Cfn(%T.loc12_22.2: type) { +// CHECK:STDOUT: %T.loc12_22.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc12_22.1 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc12_22.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_22.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @F.%T.loc11_6.2 (%T) [symbolic = %require_complete (constants.%require_complete.4ae)] +// CHECK:STDOUT: %require_complete: = require_complete_type @Cfn.%T.loc12_22.1 (%T) [symbolic = %require_complete (constants.%require_complete.4ae)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.patt.loc11_6.1: type](%x.param_patt: @F.%T.loc11_6.2 (%T)) { +// CHECK:STDOUT: fn[%self.param_patt: %C, %T.patt.loc12_22.1: type](%x.param_patt: @Cfn.%T.loc12_22.1 (%T)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @H(%T.loc14_6.1: type) { -// CHECK:STDOUT: %T.loc14_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc14_6.2 (constants.%T)] -// CHECK:STDOUT: %T.patt.loc14_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc14_6.2 (constants.%T.patt)] +// CHECK:STDOUT: generic fn @F(%T.loc16_6.1: type) { +// CHECK:STDOUT: %T.loc16_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc16_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc16_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc16_6.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @H.%T.loc14_6.2 (%T) [symbolic = %require_complete (constants.%require_complete.4ae)] -// CHECK:STDOUT: %F.specific_fn.loc16_3.2: = specific_function constants.%F, @F(%T.loc14_6.2) [symbolic = %F.specific_fn.loc16_3.2 (constants.%F.specific_fn.ef1)] +// CHECK:STDOUT: %require_complete: = require_complete_type @F.%T.loc16_6.2 (%T) [symbolic = %require_complete (constants.%require_complete.4ae)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.patt.loc14_6.1: type](%x.param_patt: @H.%T.loc14_6.2 (%T)) -> @H.%T.loc14_6.2 (%T) { +// CHECK:STDOUT: fn[%T.patt.loc16_6.1: type](%x.param_patt: @F.%T.loc16_6.2 (%T)) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] -// CHECK:STDOUT: %x.ref.loc16: @H.%T.loc14_6.2 (%T) = name_ref x, %x -// CHECK:STDOUT: %F.specific_fn.loc16_3.1: = specific_function %F.ref, @F(constants.%T) [symbolic = %F.specific_fn.loc16_3.2 (constants.%F.specific_fn.ef1)] -// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn.loc16_3.1(%x.ref.loc16) -// CHECK:STDOUT: %x.ref.loc17: @H.%T.loc14_6.2 (%T) = name_ref x, %x -// CHECK:STDOUT: return %x.ref.loc17 +// CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @G(%T.loc20_6.1: type) { -// CHECK:STDOUT: %T.loc20_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc20_6.2 (constants.%T)] -// CHECK:STDOUT: %T.patt.loc20_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc20_6.2 (constants.%T.patt)] +// CHECK:STDOUT: generic fn @H(%T.loc19_6.1: type) { +// CHECK:STDOUT: %T.loc19_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc19_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc19_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc19_6.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @G.%T.loc20_6.2 (%T) [symbolic = %require_complete (constants.%require_complete.4ae)] -// CHECK:STDOUT: %H.specific_fn.loc21_3.2: = specific_function constants.%H, @H(%T.loc20_6.2) [symbolic = %H.specific_fn.loc21_3.2 (constants.%H.specific_fn.1ed)] -// CHECK:STDOUT: %F.specific_fn.loc22_3.2: = specific_function constants.%F, @F(%T.loc20_6.2) [symbolic = %F.specific_fn.loc22_3.2 (constants.%F.specific_fn.ef1)] +// CHECK:STDOUT: %require_complete: = require_complete_type @H.%T.loc19_6.2 (%T) [symbolic = %require_complete (constants.%require_complete.4ae)] +// CHECK:STDOUT: %F.specific_fn.loc21_3.2: = specific_function constants.%F, @F(%T.loc19_6.2) [symbolic = %F.specific_fn.loc21_3.2 (constants.%F.specific_fn.ef1)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.patt.loc20_6.1: type](%x.param_patt: @G.%T.loc20_6.2 (%T)) -> @G.%T.loc20_6.2 (%T) { +// CHECK:STDOUT: fn[%T.patt.loc19_6.1: type](%x.param_patt: @H.%T.loc19_6.2 (%T)) -> @H.%T.loc19_6.2 (%T) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] +// CHECK:STDOUT: %x.ref.loc21: @H.%T.loc19_6.2 (%T) = name_ref x, %x +// CHECK:STDOUT: %F.specific_fn.loc21_3.1: = specific_function %F.ref, @F(constants.%T) [symbolic = %F.specific_fn.loc21_3.2 (constants.%F.specific_fn.ef1)] +// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn.loc21_3.1(%x.ref.loc21) +// CHECK:STDOUT: %x.ref.loc22: @H.%T.loc19_6.2 (%T) = name_ref x, %x +// CHECK:STDOUT: return %x.ref.loc22 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @G(%T.loc25_6.1: type) { +// CHECK:STDOUT: %T.loc25_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc25_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc25_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc25_6.2 (constants.%T.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @G.%T.loc25_6.2 (%T) [symbolic = %require_complete (constants.%require_complete.4ae)] +// CHECK:STDOUT: %H.specific_fn.loc26_3.2: = specific_function constants.%H, @H(%T.loc25_6.2) [symbolic = %H.specific_fn.loc26_3.2 (constants.%H.specific_fn.1ed)] +// CHECK:STDOUT: %F.specific_fn.loc27_3.2: = specific_function constants.%F, @F(%T.loc25_6.2) [symbolic = %F.specific_fn.loc27_3.2 (constants.%F.specific_fn.ef1)] +// CHECK:STDOUT: %Cfn.specific_fn.loc30_4.2: = specific_function constants.%Cfn, @Cfn(%T.loc25_6.2) [symbolic = %Cfn.specific_fn.loc30_4.2 (constants.%Cfn.specific_fn.53f)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%T.patt.loc25_6.1: type](%x.param_patt: @G.%T.loc25_6.2 (%T)) -> @G.%T.loc25_6.2 (%T) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %H.ref: %H.type = name_ref H, file.%H.decl [concrete = constants.%H] -// CHECK:STDOUT: %x.ref.loc21: @G.%T.loc20_6.2 (%T) = name_ref x, %x -// CHECK:STDOUT: %H.specific_fn.loc21_3.1: = specific_function %H.ref, @H(constants.%T) [symbolic = %H.specific_fn.loc21_3.2 (constants.%H.specific_fn.1ed)] -// CHECK:STDOUT: %H.call: init @G.%T.loc20_6.2 (%T) = call %H.specific_fn.loc21_3.1(%x.ref.loc21) +// CHECK:STDOUT: %x.ref.loc26: @G.%T.loc25_6.2 (%T) = name_ref x, %x +// CHECK:STDOUT: %H.specific_fn.loc26_3.1: = specific_function %H.ref, @H(constants.%T) [symbolic = %H.specific_fn.loc26_3.2 (constants.%H.specific_fn.1ed)] +// CHECK:STDOUT: %H.call: init @G.%T.loc25_6.2 (%T) = call %H.specific_fn.loc26_3.1(%x.ref.loc26) // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] -// CHECK:STDOUT: %x.ref.loc22: @G.%T.loc20_6.2 (%T) = name_ref x, %x -// CHECK:STDOUT: %F.specific_fn.loc22_3.1: = specific_function %F.ref, @F(constants.%T) [symbolic = %F.specific_fn.loc22_3.2 (constants.%F.specific_fn.ef1)] -// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn.loc22_3.1(%x.ref.loc22) -// CHECK:STDOUT: %x.ref.loc23: @G.%T.loc20_6.2 (%T) = name_ref x, %x -// CHECK:STDOUT: return %x.ref.loc23 +// CHECK:STDOUT: %x.ref.loc27: @G.%T.loc25_6.2 (%T) = name_ref x, %x +// CHECK:STDOUT: %F.specific_fn.loc27_3.1: = specific_function %F.ref, @F(constants.%T) [symbolic = %F.specific_fn.loc27_3.2 (constants.%F.specific_fn.ef1)] +// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn.loc27_3.1(%x.ref.loc27) +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %c.patt: %C = binding_pattern c +// CHECK:STDOUT: %.loc29: %C = var_pattern %c.patt +// CHECK:STDOUT: } +// CHECK:STDOUT: %c.var: ref %C = var c +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %c: ref %C = bind_name c, %c.var +// CHECK:STDOUT: %c.ref: ref %C = name_ref c, %c +// CHECK:STDOUT: %Cfn.ref: %Cfn.type = name_ref Cfn, @C.%Cfn.decl [concrete = constants.%Cfn] +// CHECK:STDOUT: %Cfn.bound: = bound_method %c.ref, %Cfn.ref +// CHECK:STDOUT: %x.ref.loc30: @G.%T.loc25_6.2 (%T) = name_ref x, %x +// CHECK:STDOUT: %Cfn.specific_fn.loc30_4.1: = specific_function %Cfn.ref, @Cfn(constants.%T) [symbolic = %Cfn.specific_fn.loc30_4.2 (constants.%Cfn.specific_fn.53f)] +// CHECK:STDOUT: %bound_method: = bound_method %c.ref, %Cfn.specific_fn.loc30_4.1 +// CHECK:STDOUT: %.loc30: %C = bind_value %c.ref +// CHECK:STDOUT: %Cfn.call: init %empty_tuple.type = call %bound_method(%.loc30, %x.ref.loc30) +// CHECK:STDOUT: %x.ref.loc31: @G.%T.loc25_6.2 (%T) = name_ref x, %x +// CHECK:STDOUT: return %x.ref.loc31 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -189,94 +260,111 @@ fn M() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %n.patt: %i32 = binding_pattern n -// CHECK:STDOUT: %.loc27_3.1: %i32 = var_pattern %n.patt +// CHECK:STDOUT: %.loc35_3.1: %i32 = var_pattern %n.patt // CHECK:STDOUT: } // CHECK:STDOUT: %n.var: ref %i32 = var n // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] -// CHECK:STDOUT: %.loc27_3.2: init %i32 = converted %int_0, %int.convert_checked [concrete = constants.%int_0.6a9] -// CHECK:STDOUT: assign %n.var, %.loc27_3.2 -// CHECK:STDOUT: %.loc27_10: type = splice_block %i32.loc27 [concrete = constants.%i32] { -// CHECK:STDOUT: %int_32.loc27: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc27: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %bound_method.loc35_3.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc35_3.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc35_3.2(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc35_3.2: init %i32 = converted %int_0, %int.convert_checked [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: assign %n.var, %.loc35_3.2 +// CHECK:STDOUT: %.loc35_10: type = splice_block %i32.loc35 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc35: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc35: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %n: ref %i32 = bind_name n, %n.var // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %m.patt: %i32 = binding_pattern m -// CHECK:STDOUT: %.loc28_3: %i32 = var_pattern %m.patt +// CHECK:STDOUT: %.loc36_3: %i32 = var_pattern %m.patt // CHECK:STDOUT: } // CHECK:STDOUT: %m.var: ref %i32 = var m -// CHECK:STDOUT: %.loc28_10: type = splice_block %i32.loc28 [concrete = constants.%i32] { -// CHECK:STDOUT: %int_32.loc28: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc28: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc36_10: type = splice_block %i32.loc36 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc36: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc36: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %m: ref %i32 = bind_name m, %m.var // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] -// CHECK:STDOUT: %n.ref.loc30: ref %i32 = name_ref n, %n +// CHECK:STDOUT: %n.ref.loc38: ref %i32 = name_ref n, %n // CHECK:STDOUT: %F.specific_fn: = specific_function %F.ref, @F(constants.%i32) [concrete = constants.%F.specific_fn.501] -// CHECK:STDOUT: %.loc30: %i32 = bind_value %n.ref.loc30 -// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn(%.loc30) +// CHECK:STDOUT: %.loc38: %i32 = bind_value %n.ref.loc38 +// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn(%.loc38) // CHECK:STDOUT: %m.ref: ref %i32 = name_ref m, %m // CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [concrete = constants.%G] -// CHECK:STDOUT: %n.ref.loc31: ref %i32 = name_ref n, %n +// CHECK:STDOUT: %n.ref.loc39: ref %i32 = name_ref n, %n // CHECK:STDOUT: %G.specific_fn: = specific_function %G.ref, @G(constants.%i32) [concrete = constants.%G.specific_fn] -// CHECK:STDOUT: %.loc31: %i32 = bind_value %n.ref.loc31 -// CHECK:STDOUT: %G.call: init %i32 = call %G.specific_fn(%.loc31) +// CHECK:STDOUT: %.loc39: %i32 = bind_value %n.ref.loc39 +// CHECK:STDOUT: %G.call: init %i32 = call %G.specific_fn(%.loc39) // CHECK:STDOUT: assign %m.ref, %G.call // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @Cfn(constants.%T) { +// CHECK:STDOUT: %T.loc12_22.1 => constants.%T +// CHECK:STDOUT: %T.patt.loc12_22.2 => constants.%T +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%require_complete.4ae +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { -// CHECK:STDOUT: %T.loc11_6.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc11_6.2 => constants.%T +// CHECK:STDOUT: %T.loc16_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc16_6.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%require_complete.4ae // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @H(constants.%T) { -// CHECK:STDOUT: %T.loc14_6.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc14_6.2 => constants.%T +// CHECK:STDOUT: %T.loc19_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc19_6.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%require_complete.4ae -// CHECK:STDOUT: %F.specific_fn.loc16_3.2 => constants.%F.specific_fn.ef1 +// CHECK:STDOUT: %F.specific_fn.loc21_3.2 => constants.%F.specific_fn.ef1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(@H.%T.loc14_6.2) {} +// CHECK:STDOUT: specific @F(@H.%T.loc19_6.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%T) { -// CHECK:STDOUT: %T.loc20_6.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc20_6.2 => constants.%T +// CHECK:STDOUT: %T.loc25_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc25_6.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @H(@G.%T.loc20_6.2) {} +// CHECK:STDOUT: specific @H(@G.%T.loc25_6.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(@G.%T.loc20_6.2) {} +// CHECK:STDOUT: specific @F(@G.%T.loc25_6.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Cfn(@G.%T.loc25_6.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%i32) { -// CHECK:STDOUT: %T.loc11_6.2 => constants.%i32 -// CHECK:STDOUT: %T.patt.loc11_6.2 => constants.%i32 +// CHECK:STDOUT: %T.loc16_6.2 => constants.%i32 +// CHECK:STDOUT: %T.patt.loc16_6.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type.f8a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%i32) { -// CHECK:STDOUT: %T.loc20_6.2 => constants.%i32 -// CHECK:STDOUT: %T.patt.loc20_6.2 => constants.%i32 +// CHECK:STDOUT: %T.loc25_6.2 => constants.%i32 +// CHECK:STDOUT: %T.patt.loc25_6.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type.f8a -// CHECK:STDOUT: %H.specific_fn.loc21_3.2 => constants.%H.specific_fn.aac -// CHECK:STDOUT: %F.specific_fn.loc22_3.2 => constants.%F.specific_fn.501 +// CHECK:STDOUT: %H.specific_fn.loc26_3.2 => constants.%H.specific_fn.aac +// CHECK:STDOUT: %F.specific_fn.loc27_3.2 => constants.%F.specific_fn.501 +// CHECK:STDOUT: %Cfn.specific_fn.loc30_4.2 => constants.%Cfn.specific_fn.7b2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @H(constants.%i32) { -// CHECK:STDOUT: %T.loc14_6.2 => constants.%i32 -// CHECK:STDOUT: %T.patt.loc14_6.2 => constants.%i32 +// CHECK:STDOUT: %T.loc19_6.2 => constants.%i32 +// CHECK:STDOUT: %T.patt.loc19_6.2 => constants.%i32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Cfn(constants.%i32) { +// CHECK:STDOUT: %T.loc12_22.1 => constants.%i32 +// CHECK:STDOUT: %T.patt.loc12_22.2 => constants.%i32 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/generic/local.carbon b/toolchain/check/testdata/generic/local.carbon index 43b4752d3c96..fa35462d857f 100644 --- a/toolchain/check/testdata/generic/local.carbon +++ b/toolchain/check/testdata/generic/local.carbon @@ -75,7 +75,8 @@ class C(C:! type) { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %C.val: %C.d45 = struct_value (%int_1.5d2) [concrete] // CHECK:STDOUT: } @@ -140,9 +141,10 @@ class C(C:! type) { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc8_26.1: %struct_type.x.c96 = struct_literal (%int_1) // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc8_26.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_26.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc8_26.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc8_26.2: init %i32 = converted %int_1, %int.convert_checked [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc8_26.3: ref %i32 = class_element_access %v.var, element0 // CHECK:STDOUT: %.loc8_26.4: init %i32 = initialize_from %.loc8_26.2 to %.loc8_26.3 [concrete = constants.%int_1.5d2] diff --git a/toolchain/check/testdata/global/simple_init.carbon b/toolchain/check/testdata/global/simple_init.carbon index c8f2e78737c6..d17c4e7ef252 100644 --- a/toolchain/check/testdata/global/simple_init.carbon +++ b/toolchain/check/testdata/global/simple_init.carbon @@ -23,7 +23,8 @@ var a: i32 = 0; // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -58,9 +59,10 @@ var a: i32 = 0; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc10_1.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_1.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc10_1.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc10: init %i32 = converted %int_0, %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: assign file.%a.var, %.loc10 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/global/simple_with_fun.carbon b/toolchain/check/testdata/global/simple_with_fun.carbon index bb7535edaf14..717c1563710d 100644 --- a/toolchain/check/testdata/global/simple_with_fun.carbon +++ b/toolchain/check/testdata/global/simple_with_fun.carbon @@ -30,7 +30,8 @@ var a: i32 = test_a(); // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -75,9 +76,10 @@ var a: i32 = test_a(); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc12_11.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_11.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc12_11.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_11.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_11.2: %i32 = converted %int_0, %.loc12_11.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: return %.loc12_11.2 diff --git a/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon b/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon index d876d70a38ed..3aefa1c477cd 100644 --- a/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon +++ b/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon @@ -58,13 +58,14 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %If2.type: type = fn_type @If2 [concrete] // CHECK:STDOUT: %If2: %If2.type = struct_value () [concrete] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %If3.type: type = fn_type @If3 [concrete] // CHECK:STDOUT: %If3: %If3.type = struct_value () [concrete] @@ -152,9 +153,10 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: !if.then: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc13_13.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_13.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc13_13.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_13.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_13.2: %i32 = converted %int_1, %.loc13_13.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: return %.loc13_13.2 @@ -176,9 +178,10 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: !if.else: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_2, %impl.elem0 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc25_13.1: = bound_method %int_2, %impl.elem0 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc25_13.2: = bound_method %int_2, %specific_fn [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc25_13.2(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc25_13.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc25_13.2: %i32 = converted %int_2, %.loc25_13.1 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: return %.loc25_13.2 @@ -194,9 +197,10 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: !if.then: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc35_13.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc35_13.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc35_13.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc35_13.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc35_13.2: %i32 = converted %int_1, %.loc35_13.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: return %.loc35_13.2 diff --git a/toolchain/check/testdata/if/fail_scope.carbon b/toolchain/check/testdata/if/fail_scope.carbon index 7fbc959917f7..d66a09ba844b 100644 --- a/toolchain/check/testdata/if/fail_scope.carbon +++ b/toolchain/check/testdata/if/fail_scope.carbon @@ -38,7 +38,8 @@ fn VarScope(b: bool) -> i32 { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -92,9 +93,10 @@ fn VarScope(b: bool) -> i32 { // CHECK:STDOUT: %n.var: ref %i32 = var n // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_2, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc13_5.1: = bound_method %int_2, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_5.2: = bound_method %int_2, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc13_5.2(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_5.2: init %i32 = converted %int_2, %int.convert_checked [concrete = constants.%int_2.ef8] // CHECK:STDOUT: assign %n.var, %.loc13_5.2 // CHECK:STDOUT: %.loc13_12: type = splice_block %i32.loc13 [concrete = constants.%i32] { diff --git a/toolchain/check/testdata/if/unreachable_fallthrough.carbon b/toolchain/check/testdata/if/unreachable_fallthrough.carbon index f1d74a602427..301d3b390739 100644 --- a/toolchain/check/testdata/if/unreachable_fallthrough.carbon +++ b/toolchain/check/testdata/if/unreachable_fallthrough.carbon @@ -35,11 +35,12 @@ fn If(b: bool) -> i32 { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -87,9 +88,10 @@ fn If(b: bool) -> i32 { // CHECK:STDOUT: !if.then: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0.loc13: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc13: = bound_method %int_1, %impl.elem0.loc13 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc13: = specific_function %bound_method.loc13, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %specific_fn.loc13(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc13_13.1: = bound_method %int_1, %impl.elem0.loc13 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc13: = specific_function %impl.elem0.loc13, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_13.2: = bound_method %int_1, %specific_fn.loc13 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %bound_method.loc13_13.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_13.1: %i32 = value_of_initializer %int.convert_checked.loc13 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_13.2: %i32 = converted %int_1, %.loc13_13.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: return %.loc13_13.2 @@ -97,9 +99,10 @@ fn If(b: bool) -> i32 { // CHECK:STDOUT: !if.else: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %impl.elem0.loc15: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc15: = bound_method %int_2, %impl.elem0.loc15 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc15: = specific_function %bound_method.loc15, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %specific_fn.loc15(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc15_13.1: = bound_method %int_2, %impl.elem0.loc15 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc15: = specific_function %impl.elem0.loc15, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc15_13.2: = bound_method %int_2, %specific_fn.loc15 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %bound_method.loc15_13.2(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc15_13.1: %i32 = value_of_initializer %int.convert_checked.loc15 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc15_13.2: %i32 = converted %int_2, %.loc15_13.1 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: return %.loc15_13.2 diff --git a/toolchain/check/testdata/if_expr/basic.carbon b/toolchain/check/testdata/if_expr/basic.carbon index b5db905cef24..5cf378422996 100644 --- a/toolchain/check/testdata/if_expr/basic.carbon +++ b/toolchain/check/testdata/if_expr/basic.carbon @@ -34,7 +34,8 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_0.6a9) [concrete] // CHECK:STDOUT: } @@ -101,9 +102,10 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: %int_0.loc12_27: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %.loc12_29.1: %tuple.type = tuple_literal (%int_0.loc12_27) // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_0.loc12_27, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0.loc12_27) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc12_29.1: = bound_method %int_0.loc12_27, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_29.2: = bound_method %int_0.loc12_27, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc12_29.2(%int_0.loc12_27) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_29.2: init %i32 = converted %int_0.loc12_27, %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %int_0.loc12_29: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %.loc12_29.3: ref %i32 = array_index %x.var, %int_0.loc12_29 diff --git a/toolchain/check/testdata/if_expr/constant_condition.carbon b/toolchain/check/testdata/if_expr/constant_condition.carbon index f8deb7ca8097..48a382852aad 100644 --- a/toolchain/check/testdata/if_expr/constant_condition.carbon +++ b/toolchain/check/testdata/if_expr/constant_condition.carbon @@ -47,13 +47,14 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %B.type: type = fn_type @B [concrete] // CHECK:STDOUT: %B: %B.type = struct_value () [concrete] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] @@ -152,9 +153,10 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc11_25.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_25.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc11_25.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_25.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_25.2: %i32 = converted %int_1, %.loc11_25.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: return %.loc11_25.2 @@ -164,9 +166,10 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_2, %impl.elem0 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc12_25.1: = bound_method %int_2, %impl.elem0 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_25.2: = bound_method %int_2, %specific_fn [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc12_25.2(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc12_25.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc12_25.2: %i32 = converted %int_2, %.loc12_25.1 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: return %.loc12_25.2 @@ -229,9 +232,10 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc23_3.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc23_3.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc23_3.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc23_3.2: init %i32 = converted %int_1, %int.convert_checked [concrete = constants.%int_1.5d2] // CHECK:STDOUT: assign %v.var, %.loc23_3.2 // CHECK:STDOUT: br !.loc23_13 @@ -304,9 +308,10 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc29_3.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc29_3.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc29_3.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc29_3.2: init %i32 = converted %int_1, %int.convert_checked [concrete = constants.%int_1.5d2] // CHECK:STDOUT: assign %v.var, %.loc29_3.2 // CHECK:STDOUT: br !.loc29_13 diff --git a/toolchain/check/testdata/if_expr/control_flow.carbon b/toolchain/check/testdata/if_expr/control_flow.carbon index 31f1e15e65e6..69d80c19cbf1 100644 --- a/toolchain/check/testdata/if_expr/control_flow.carbon +++ b/toolchain/check/testdata/if_expr/control_flow.carbon @@ -31,13 +31,14 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %B.type: type = fn_type @B [concrete] // CHECK:STDOUT: %B: %B.type = struct_value () [concrete] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] @@ -105,9 +106,10 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc11_25.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_25.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc11_25.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_25.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_25.2: %i32 = converted %int_1, %.loc11_25.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: return %.loc11_25.2 @@ -117,9 +119,10 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_2, %impl.elem0 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc12_25.1: = bound_method %int_2, %impl.elem0 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_25.2: = bound_method %int_2, %specific_fn [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc12_25.2(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc12_25.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc12_25.2: %i32 = converted %int_2, %.loc12_25.1 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: return %.loc12_25.2 diff --git a/toolchain/check/testdata/if_expr/fail_not_in_function.carbon b/toolchain/check/testdata/if_expr/fail_not_in_function.carbon index 633214ee10f8..c9d1a572a1d3 100644 --- a/toolchain/check/testdata/if_expr/fail_not_in_function.carbon +++ b/toolchain/check/testdata/if_expr/fail_not_in_function.carbon @@ -94,7 +94,7 @@ class C { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %x: %i32 = bind_name x, .inst1077.loc27_14 +// CHECK:STDOUT: %x: %i32 = bind_name x, .inst1080.loc27_14 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %y.patt: %i32 = binding_pattern y // CHECK:STDOUT: %.loc37: %i32 = var_pattern %y.patt diff --git a/toolchain/check/testdata/if_expr/nested.carbon b/toolchain/check/testdata/if_expr/nested.carbon index ecab0a712bec..1c391c85d641 100644 --- a/toolchain/check/testdata/if_expr/nested.carbon +++ b/toolchain/check/testdata/if_expr/nested.carbon @@ -30,19 +30,20 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete] // CHECK:STDOUT: %Convert.bound.b30: = bound_method %int_3.1ba, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.b42: = specific_function %Convert.bound.b30, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.047: = bound_method %int_3.1ba, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [concrete] // CHECK:STDOUT: %Convert.bound.ac3: = bound_method %int_4.0c1, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.450: = specific_function %Convert.bound.ac3, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.1da: = bound_method %int_4.0c1, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -114,9 +115,10 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: %int_32.loc12_25: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc12_25: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0.loc12_25: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc12_25: = bound_method %int_1, %impl.elem0.loc12_25 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc12_25: = specific_function %bound_method.loc12_25, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc12_25: init %i32 = call %specific_fn.loc12_25(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc12_25.1: = bound_method %int_1, %impl.elem0.loc12_25 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc12_25: = specific_function %impl.elem0.loc12_25, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_25.2: = bound_method %int_1, %specific_fn.loc12_25 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc12_25: init %i32 = call %bound_method.loc12_25.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc12_25.1: %i32 = value_of_initializer %int.convert_checked.loc12_25 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc12_25.2: %i32 = converted %int_1, %.loc12_25.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: br !if.expr.result.loc12_20(%.loc12_25.2) @@ -124,9 +126,10 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: !if.expr.else.loc12_20: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %impl.elem0.loc12_32: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc12_32: = bound_method %int_2, %impl.elem0.loc12_32 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc12_32: = specific_function %bound_method.loc12_32, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc12_32: init %i32 = call %specific_fn.loc12_32(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc12_32.1: = bound_method %int_2, %impl.elem0.loc12_32 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc12_32: = specific_function %impl.elem0.loc12_32, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_32.2: = bound_method %int_2, %specific_fn.loc12_32 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc12_32: init %i32 = call %bound_method.loc12_32.2(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc12_32.1: %i32 = value_of_initializer %int.convert_checked.loc12_32 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc12_32.2: %i32 = converted %int_2, %.loc12_32.1 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: br !if.expr.result.loc12_20(%.loc12_32.2) @@ -144,9 +147,10 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: %int_32.loc12_49: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc12_49: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0.loc12_49: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc12_49: = bound_method %int_3, %impl.elem0.loc12_49 [concrete = constants.%Convert.bound.b30] -// CHECK:STDOUT: %specific_fn.loc12_49: = specific_function %bound_method.loc12_49, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc12_49: init %i32 = call %specific_fn.loc12_49(%int_3) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %bound_method.loc12_49.1: = bound_method %int_3, %impl.elem0.loc12_49 [concrete = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc12_49: = specific_function %impl.elem0.loc12_49, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_49.2: = bound_method %int_3, %specific_fn.loc12_49 [concrete = constants.%bound_method.047] +// CHECK:STDOUT: %int.convert_checked.loc12_49: init %i32 = call %bound_method.loc12_49.2(%int_3) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc12_49.1: %i32 = value_of_initializer %int.convert_checked.loc12_49 [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc12_49.2: %i32 = converted %int_3, %.loc12_49.1 [concrete = constants.%int_3.822] // CHECK:STDOUT: br !if.expr.result.loc12_44(%.loc12_49.2) @@ -154,9 +158,10 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: !if.expr.else.loc12_44: // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1] // CHECK:STDOUT: %impl.elem0.loc12_56: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc12_56: = bound_method %int_4, %impl.elem0.loc12_56 [concrete = constants.%Convert.bound.ac3] -// CHECK:STDOUT: %specific_fn.loc12_56: = specific_function %bound_method.loc12_56, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.450] -// CHECK:STDOUT: %int.convert_checked.loc12_56: init %i32 = call %specific_fn.loc12_56(%int_4) [concrete = constants.%int_4.940] +// CHECK:STDOUT: %bound_method.loc12_56.1: = bound_method %int_4, %impl.elem0.loc12_56 [concrete = constants.%Convert.bound.ac3] +// CHECK:STDOUT: %specific_fn.loc12_56: = specific_function %impl.elem0.loc12_56, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_56.2: = bound_method %int_4, %specific_fn.loc12_56 [concrete = constants.%bound_method.1da] +// CHECK:STDOUT: %int.convert_checked.loc12_56: init %i32 = call %bound_method.loc12_56.2(%int_4) [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc12_56.1: %i32 = value_of_initializer %int.convert_checked.loc12_56 [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc12_56.2: %i32 = converted %int_4, %.loc12_56.1 [concrete = constants.%int_4.940] // CHECK:STDOUT: br !if.expr.result.loc12_44(%.loc12_56.2) diff --git a/toolchain/check/testdata/if_expr/struct.carbon b/toolchain/check/testdata/if_expr/struct.carbon index 4e67ce38836a..07d6a0d413ae 100644 --- a/toolchain/check/testdata/if_expr/struct.carbon +++ b/toolchain/check/testdata/if_expr/struct.carbon @@ -39,10 +39,11 @@ fn F(cond: bool) { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %struct: %struct_type.a.b.501 = struct_value (%int_1.5d2, %int_2.ef8) [concrete] // CHECK:STDOUT: } @@ -106,15 +107,17 @@ fn F(cond: bool) { // CHECK:STDOUT: %.loc14_46.1: %struct_type.a.b.cfd = struct_literal (%int_1, %int_2) // CHECK:STDOUT: %impl.elem0.loc14_46.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc14_46.1: = bound_method %int_1, %impl.elem0.loc14_46.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc14_46.1: = specific_function %bound_method.loc14_46.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc14_46.1: init %i32 = call %specific_fn.loc14_46.1(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc14_46.1: = specific_function %impl.elem0.loc14_46.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_46.2: = bound_method %int_1, %specific_fn.loc14_46.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc14_46.1: init %i32 = call %bound_method.loc14_46.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_46.2: init %i32 = converted %int_1, %int.convert_checked.loc14_46.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_46.3: ref %i32 = struct_access %a.var, element0 // CHECK:STDOUT: %.loc14_46.4: init %i32 = initialize_from %.loc14_46.2 to %.loc14_46.3 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc14_46.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc14_46.2: = bound_method %int_2, %impl.elem0.loc14_46.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc14_46.2: = specific_function %bound_method.loc14_46.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc14_46.2: init %i32 = call %specific_fn.loc14_46.2(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc14_46.3: = bound_method %int_2, %impl.elem0.loc14_46.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc14_46.2: = specific_function %impl.elem0.loc14_46.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_46.4: = bound_method %int_2, %specific_fn.loc14_46.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc14_46.2: init %i32 = call %bound_method.loc14_46.4(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc14_46.5: init %i32 = converted %int_2, %int.convert_checked.loc14_46.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc14_46.6: ref %i32 = struct_access %a.var, element1 // CHECK:STDOUT: %.loc14_46.7: init %i32 = initialize_from %.loc14_46.5 to %.loc14_46.6 [concrete = constants.%int_2.ef8] diff --git a/toolchain/check/testdata/impl/assoc_const_self.carbon b/toolchain/check/testdata/impl/assoc_const_self.carbon index 9e02d74cfb7a..081739404156 100644 --- a/toolchain/check/testdata/impl/assoc_const_self.carbon +++ b/toolchain/check/testdata/impl/assoc_const_self.carbon @@ -136,7 +136,8 @@ fn CallF() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -193,9 +194,10 @@ fn CallF() { // CHECK:STDOUT: } // CHECK:STDOUT: %impl_witness.loc10: = impl_witness (constants.%int_0.6a9) [concrete = constants.%impl_witness.6f4] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method constants.%int_0.5c6, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(constants.%int_0.5c6) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc10_15.1: = bound_method constants.%int_0.5c6, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_15.2: = bound_method constants.%int_0.5c6, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc10_15.2(constants.%int_0.5c6) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc10_15.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc10_15.2: %i32 = converted constants.%int_0.5c6, %.loc10_15.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/extend_impl_generic.carbon b/toolchain/check/testdata/impl/extend_impl_generic.carbon index c7b876b0e43c..5e37756f2fac 100644 --- a/toolchain/check/testdata/impl/extend_impl_generic.carbon +++ b/toolchain/check/testdata/impl/extend_impl_generic.carbon @@ -88,7 +88,8 @@ class X(U:! type) { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %Param.val: %Param = struct_value (%int_2.ef8) [concrete] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] @@ -224,9 +225,10 @@ class X(U:! type) { // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %.loc15_21.1: %struct_type.x.c96 = struct_literal (%int_2) // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_2, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc15_21.1: = bound_method %int_2, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc15_21.2: = bound_method %int_2, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc15_21.2(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc15_21.2: init %i32 = converted %int_2, %int.convert_checked [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc15_21.3: ref %i32 = class_element_access %return, element0 // CHECK:STDOUT: %.loc15_21.4: init %i32 = initialize_from %.loc15_21.2 to %.loc15_21.3 [concrete = constants.%int_2.ef8] diff --git a/toolchain/check/testdata/impl/fail_todo_use_assoc_const.carbon b/toolchain/check/testdata/impl/fail_todo_use_assoc_const.carbon index ecae3e12fe77..fd80aef0dfc0 100644 --- a/toolchain/check/testdata/impl/fail_todo_use_assoc_const.carbon +++ b/toolchain/check/testdata/impl/fail_todo_use_assoc_const.carbon @@ -743,7 +743,8 @@ impl () as I where .N = 2 { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %int_2.ef8> [concrete] // CHECK:STDOUT: %impl_witness.2c9: = impl_witness (%int_2.ef8, ) [concrete] @@ -789,9 +790,10 @@ impl () as I where .N = 2 { // CHECK:STDOUT: %impl.elem0.loc15_20: %i32 = impl_witness_access %.Self.as_wit, element0 [symbolic_self = constants.%impl.elem0] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %impl.elem0.loc15_25: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_2, %impl.elem0.loc15_25 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc15_25.1: = bound_method %int_2, %impl.elem0.loc15_25 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc15_25, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc15_25.2: = bound_method %int_2, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc15_25.2(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc15_25.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc15_25.2: %i32 = converted %int_2, %.loc15_25.1 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc15_14: type = where_expr %.Self [concrete = constants.%I_where.type] { diff --git a/toolchain/check/testdata/impl/lookup/generic.carbon b/toolchain/check/testdata/impl/lookup/generic.carbon index 5bd4ec090573..07aa8412471c 100644 --- a/toolchain/check/testdata/impl/lookup/generic.carbon +++ b/toolchain/check/testdata/impl/lookup/generic.carbon @@ -148,6 +148,7 @@ fn G(x: A) { // CHECK:STDOUT: %F.f13: %F.type.2e4 = struct_value () [concrete] // CHECK:STDOUT: %HasF.facet.18f: %HasF.type = facet_value %empty_struct_type, %impl_witness.d9b [concrete] // CHECK:STDOUT: %.658: type = fn_type_with_self_type %F.type.b7b, %HasF.facet.18f [concrete] +// CHECK:STDOUT: %F.specific_fn: = specific_function %F.f13, @F.2(%empty_struct_type) [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -259,9 +260,10 @@ fn G(x: A) { // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.type] // CHECK:STDOUT: %F.ref: %HasF.assoc_type = name_ref F, @HasF.%assoc0 [concrete = constants.%assoc0] // CHECK:STDOUT: %impl.elem0: %.658 = impl_witness_access constants.%impl_witness.d9b, element0 [concrete = constants.%F.f13] -// CHECK:STDOUT: %bound_method: = bound_method %x.ref, %impl.elem0 -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @F.2(constants.%empty_struct_type) -// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %specific_fn(%x.ref) +// CHECK:STDOUT: %bound_method.loc13_4: = bound_method %x.ref, %impl.elem0 +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @F.2(constants.%empty_struct_type) [concrete = constants.%F.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_14: = bound_method %x.ref, %specific_fn +// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %bound_method.loc13_14(%x.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -333,6 +335,7 @@ fn G(x: A) { // CHECK:STDOUT: %F.f13: %F.type.2e4 = struct_value () [concrete] // CHECK:STDOUT: %HasF.facet.18f: %HasF.type = facet_value %empty_struct_type, %impl_witness.d9b [concrete] // CHECK:STDOUT: %.658: type = fn_type_with_self_type %F.type.b7b, %HasF.facet.18f [concrete] +// CHECK:STDOUT: %F.specific_fn: = specific_function %F.f13, @F.2(%empty_struct_type) [concrete] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: } @@ -465,9 +468,10 @@ fn G(x: A) { // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.type] // CHECK:STDOUT: %F.ref: %HasF.assoc_type = name_ref F, @HasF.%assoc0 [concrete = constants.%assoc0] // CHECK:STDOUT: %impl.elem0: %.658 = impl_witness_access constants.%impl_witness.d9b, element0 [concrete = constants.%F.f13] -// CHECK:STDOUT: %bound_method: = bound_method %x.ref, %impl.elem0 -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @F.2(constants.%empty_struct_type) -// CHECK:STDOUT: %F.call: init %empty_struct_type = call %specific_fn(%x.ref) +// CHECK:STDOUT: %bound_method.loc13_11: = bound_method %x.ref, %impl.elem0 +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @F.2(constants.%empty_struct_type) [concrete = constants.%F.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_21: = bound_method %x.ref, %specific_fn +// CHECK:STDOUT: %F.call: init %empty_struct_type = call %bound_method.loc13_21(%x.ref) // CHECK:STDOUT: %.loc13_21.1: ref %empty_struct_type = temporary_storage // CHECK:STDOUT: %.loc13_21.2: ref %empty_struct_type = temporary %.loc13_21.1, %F.call // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete = constants.%empty_struct] @@ -549,6 +553,7 @@ fn G(x: A) { // CHECK:STDOUT: %F.c77: %F.type.2e5 = struct_value () [concrete] // CHECK:STDOUT: %HasF.facet.007: %HasF.type = facet_value %C.7a7, %impl_witness.770 [concrete] // CHECK:STDOUT: %.4df: type = fn_type_with_self_type %F.type.b7b, %HasF.facet.007 [concrete] +// CHECK:STDOUT: %F.specific_fn: = specific_function %F.c77, @F.2(%empty_struct_type) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -686,9 +691,10 @@ fn G(x: A) { // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.type] // CHECK:STDOUT: %F.ref: %HasF.assoc_type = name_ref F, @HasF.%assoc0 [concrete = constants.%assoc0] // CHECK:STDOUT: %impl.elem0: %.4df = impl_witness_access constants.%impl_witness.770, element0 [concrete = constants.%F.c77] -// CHECK:STDOUT: %bound_method: = bound_method %x.ref, %impl.elem0 -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @F.2(constants.%empty_struct_type) -// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %specific_fn(%x.ref) +// CHECK:STDOUT: %bound_method.loc15_4: = bound_method %x.ref, %impl.elem0 +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @F.2(constants.%empty_struct_type) [concrete = constants.%F.specific_fn] +// CHECK:STDOUT: %bound_method.loc15_14: = bound_method %x.ref, %specific_fn +// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %bound_method.loc15_14(%x.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -791,6 +797,7 @@ fn G(x: A) { // CHECK:STDOUT: %F.8c6: %F.type.a13 = struct_value () [concrete] // CHECK:STDOUT: %HasF.facet.075: %HasF.type.072 = facet_value %empty_struct_type, %impl_witness.221 [concrete] // CHECK:STDOUT: %.a00: type = fn_type_with_self_type %F.type.b0b, %HasF.facet.075 [concrete] +// CHECK:STDOUT: %F.specific_fn: = specific_function %F.8c6, @F.2(%empty_struct_type) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -927,9 +934,10 @@ fn G(x: A) { // CHECK:STDOUT: %.loc13_14: %HasF.assoc_type.60b = specific_constant @HasF.%assoc0.loc5_21.1, @HasF(constants.%empty_struct_type) [concrete = constants.%assoc0.46d] // CHECK:STDOUT: %F.ref: %HasF.assoc_type.60b = name_ref F, %.loc13_14 [concrete = constants.%assoc0.46d] // CHECK:STDOUT: %impl.elem0: %.a00 = impl_witness_access constants.%impl_witness.221, element0 [concrete = constants.%F.8c6] -// CHECK:STDOUT: %bound_method: = bound_method %x.ref, %impl.elem0 -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @F.2(constants.%empty_struct_type) -// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %specific_fn(%x.ref) +// CHECK:STDOUT: %bound_method.loc13_4: = bound_method %x.ref, %impl.elem0 +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @F.2(constants.%empty_struct_type) [concrete = constants.%F.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_18: = bound_method %x.ref, %specific_fn +// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %bound_method.loc13_18(%x.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/lookup/no_prelude/impl_forall.carbon b/toolchain/check/testdata/impl/lookup/no_prelude/impl_forall.carbon index 0af823d49280..61fe21a4ed1d 100644 --- a/toolchain/check/testdata/impl/lookup/no_prelude/impl_forall.carbon +++ b/toolchain/check/testdata/impl/lookup/no_prelude/impl_forall.carbon @@ -95,6 +95,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %F.d6ae34.2: %F.type.0fea45.2 = struct_value () [symbolic] // CHECK:STDOUT: %I.facet.5b0ece.2: %I.type.325e65.3 = facet_value %A.13025a.3, %impl_witness.ab3b51.2 [symbolic] // CHECK:STDOUT: %.051: type = fn_type_with_self_type %F.type.2aef59.3, %I.facet.5b0ece.2 [symbolic] +// CHECK:STDOUT: %F.specific_fn.e98: = specific_function %F.d6ae34.2, @F.2(%W) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %A.235: type = class_type @A, @A(%empty_struct_type) [concrete] // CHECK:STDOUT: %TestSpecific.type: type = fn_type @TestSpecific [concrete] @@ -114,6 +115,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %F.158: %F.type.875 = struct_value () [concrete] // CHECK:STDOUT: %I.facet.f67: %I.type.885 = facet_value %A.235, %impl_witness.f35 [concrete] // CHECK:STDOUT: %.f01: type = fn_type_with_self_type %F.type.684, %I.facet.f67 [concrete] +// CHECK:STDOUT: %F.specific_fn.72f: = specific_function %F.158, @F.2(%empty_struct_type) [concrete] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -335,6 +337,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %.loc18_11: type = fn_type_with_self_type %F.type.loc18_11.1, %I.facet [symbolic = %.loc18_11 (constants.%.051)] // CHECK:STDOUT: %F.type.loc18_11.2: type = fn_type @F.2, @impl(%W.loc17_16.2) [symbolic = %F.type.loc18_11.2 (constants.%F.type.0fea45.2)] // CHECK:STDOUT: %F: @TestGeneric.%F.type.loc18_11.2 (%F.type.0fea45.2) = struct_value () [symbolic = %F (constants.%F.d6ae34.2)] +// CHECK:STDOUT: %F.specific_fn: = specific_function %F, @F.2(%W.loc17_16.2) [symbolic = %F.specific_fn (constants.%F.specific_fn.e98)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%W.patt.loc17_16.1: type](%a.param_patt: @TestGeneric.%A.loc17_32.2 (%A.13025a.3)) -> @TestGeneric.%W.loc17_16.2 (%W) { // CHECK:STDOUT: !entry: @@ -345,9 +348,10 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %.loc18_17: @TestGeneric.%I.assoc_type (%I.assoc_type.955255.3) = specific_constant @I.%assoc0.loc8_26.1, @I(constants.%W) [symbolic = %assoc0 (constants.%assoc0.fef501.3)] // CHECK:STDOUT: %F.ref: @TestGeneric.%I.assoc_type (%I.assoc_type.955255.3) = name_ref F, %.loc18_17 [symbolic = %assoc0 (constants.%assoc0.fef501.3)] // CHECK:STDOUT: %impl.elem0: @TestGeneric.%.loc18_11 (%.051) = impl_witness_access constants.%impl_witness.ab3b51.2, element0 [symbolic = %F (constants.%F.d6ae34.2)] -// CHECK:STDOUT: %bound_method: = bound_method %a.ref, %impl.elem0 -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @F.2(constants.%W) -// CHECK:STDOUT: %F.call: init @TestGeneric.%W.loc17_16.2 (%W) = call %specific_fn(%a.ref) +// CHECK:STDOUT: %bound_method.loc18_11: = bound_method %a.ref, %impl.elem0 +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @F.2(constants.%W) [symbolic = %F.specific_fn (constants.%F.specific_fn.e98)] +// CHECK:STDOUT: %bound_method.loc18_21: = bound_method %a.ref, %specific_fn +// CHECK:STDOUT: %F.call: init @TestGeneric.%W.loc17_16.2 (%W) = call %bound_method.loc18_21(%a.ref) // CHECK:STDOUT: %.loc18_22.1: @TestGeneric.%W.loc17_16.2 (%W) = value_of_initializer %F.call // CHECK:STDOUT: %.loc18_22.2: @TestGeneric.%W.loc17_16.2 (%W) = converted %F.call, %.loc18_22.1 // CHECK:STDOUT: return %.loc18_22.2 @@ -364,9 +368,10 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %.loc22_18: %I.assoc_type.67f = specific_constant @I.%assoc0.loc8_26.1, @I(constants.%empty_struct_type) [concrete = constants.%assoc0.639] // CHECK:STDOUT: %F.ref: %I.assoc_type.67f = name_ref F, %.loc22_18 [concrete = constants.%assoc0.639] // CHECK:STDOUT: %impl.elem0: %.f01 = impl_witness_access constants.%impl_witness.f35, element0 [concrete = constants.%F.158] -// CHECK:STDOUT: %bound_method: = bound_method %a.ref, %impl.elem0 -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @F.2(constants.%empty_struct_type) -// CHECK:STDOUT: %F.call: init %empty_struct_type = call %specific_fn(%a.ref) +// CHECK:STDOUT: %bound_method.loc22_11: = bound_method %a.ref, %impl.elem0 +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @F.2(constants.%empty_struct_type) [concrete = constants.%F.specific_fn.72f] +// CHECK:STDOUT: %bound_method.loc22_22: = bound_method %a.ref, %specific_fn +// CHECK:STDOUT: %F.call: init %empty_struct_type = call %bound_method.loc22_22(%a.ref) // CHECK:STDOUT: %.loc22_22.1: ref %empty_struct_type = temporary_storage // CHECK:STDOUT: %.loc22_22.2: ref %empty_struct_type = temporary %.loc22_22.1, %F.call // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete = constants.%empty_struct] @@ -515,6 +520,8 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(@TestGeneric.%W.loc17_16.2) {} // CHECK:STDOUT: +// CHECK:STDOUT: specific @F.2(@TestGeneric.%W.loc17_16.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @A(constants.%empty_struct_type) { // CHECK:STDOUT: %T.loc3_9.2 => constants.%empty_struct_type // CHECK:STDOUT: %T.patt.loc3_9.2 => constants.%empty_struct_type diff --git a/toolchain/check/testdata/impl/no_prelude/import_builtin_call.carbon b/toolchain/check/testdata/impl/no_prelude/import_builtin_call.carbon index a5f22c78c12c..1be38ab0d9d2 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_builtin_call.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_builtin_call.carbon @@ -106,6 +106,7 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %Double.type: type = fn_type @Double [concrete] // CHECK:STDOUT: %Double: %Double.type = struct_value () [concrete] // CHECK:STDOUT: %.dcc: type = fn_type_with_self_type %Op.type.31b, %Add.facet [symbolic] +// CHECK:STDOUT: %Op.specific_fn: = specific_function %Op.8bc, @Op.2(%N) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -330,6 +331,7 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %.loc20_11: type = fn_type_with_self_type constants.%Op.type.31b, %Add.facet [symbolic = %.loc20_11 (constants.%.dcc)] // CHECK:STDOUT: %Op.type: type = fn_type @Op.2, @impl(%N.loc19_11.2) [symbolic = %Op.type (constants.%Op.type.883)] // CHECK:STDOUT: %Op: @Double.%Op.type (%Op.type.883) = struct_value () [symbolic = %Op (constants.%Op.8bc)] +// CHECK:STDOUT: %Op.specific_fn: = specific_function %Op, @Op.2(%N.loc19_11.2) [symbolic = %Op.specific_fn (constants.%Op.specific_fn)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%N.patt.loc19_11.1: Core.IntLiteral](%x.param_patt: @Double.%MyInt.loc19_39.2 (%MyInt)) -> @Double.%MyInt.loc19_39.2 (%MyInt) { // CHECK:STDOUT: !entry: @@ -337,10 +339,11 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %Add.ref: type = name_ref Add, file.%Add.decl [concrete = constants.%Add.type] // CHECK:STDOUT: %Op.ref: %Add.assoc_type = name_ref Op, @Add.%assoc0 [concrete = constants.%assoc0] // CHECK:STDOUT: %impl.elem0: @Double.%.loc20_11 (%.dcc) = impl_witness_access constants.%impl_witness, element0 [symbolic = %Op (constants.%Op.8bc)] -// CHECK:STDOUT: %bound_method: = bound_method %x.ref.loc20_10, %impl.elem0 +// CHECK:STDOUT: %bound_method.loc20_11: = bound_method %x.ref.loc20_10, %impl.elem0 // CHECK:STDOUT: %x.ref.loc20_21: @Double.%MyInt.loc19_39.2 (%MyInt) = name_ref x, %x -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Op.2(constants.%N) -// CHECK:STDOUT: %int.sadd: init @Double.%MyInt.loc19_39.2 (%MyInt) = call %specific_fn(%x.ref.loc20_10, %x.ref.loc20_21) +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Op.2(constants.%N) [symbolic = %Op.specific_fn (constants.%Op.specific_fn)] +// CHECK:STDOUT: %bound_method.loc20_22: = bound_method %x.ref.loc20_10, %specific_fn +// CHECK:STDOUT: %int.sadd: init @Double.%MyInt.loc19_39.2 (%MyInt) = call %bound_method.loc20_22(%x.ref.loc20_10, %x.ref.loc20_21) // CHECK:STDOUT: %.loc20_23.1: @Double.%MyInt.loc19_39.2 (%MyInt) = value_of_initializer %int.sadd // CHECK:STDOUT: %.loc20_23.2: @Double.%MyInt.loc19_39.2 (%MyInt) = converted %int.sadd, %.loc20_23.1 // CHECK:STDOUT: return %.loc20_23.2 @@ -402,6 +405,8 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(@Double.%N.loc19_11.2) {} // CHECK:STDOUT: +// CHECK:STDOUT: specific @Op.2(@Double.%N.loc19_11.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: --- use_generic_impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -436,6 +441,7 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %Op.cf9: %Op.type.5a6 = struct_value () [concrete] // CHECK:STDOUT: %Add.facet.3ca: %Add.type = facet_value %MyInt.f30, %impl_witness.8d6 [concrete] // CHECK:STDOUT: %.3ca: type = fn_type_with_self_type %Op.type.31b, %Add.facet.3ca [concrete] +// CHECK:STDOUT: %Op.specific_fn.16a: = specific_function %Op.cf9, @Op.2(%int_64) [concrete] // CHECK:STDOUT: %CallImportedDouble.type: type = fn_type @CallImportedDouble [concrete] // CHECK:STDOUT: %CallImportedDouble: %CallImportedDouble.type = struct_value () [concrete] // CHECK:STDOUT: %Double.type: type = fn_type @Double [concrete] @@ -443,6 +449,7 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %impl_witness.7e5be3.2: = impl_witness (imports.%Main.import_ref.464c51.2), @impl(%N) [symbolic] // CHECK:STDOUT: %Add.facet.9a8: %Add.type = facet_value %MyInt.09f, %impl_witness.7e5be3.2 [symbolic] // CHECK:STDOUT: %.72d: type = fn_type_with_self_type %Op.type.31b, %Add.facet.9a8 [symbolic] +// CHECK:STDOUT: %Op.specific_fn.6c0: = specific_function %Op.8bc, @Op.2(%N) [symbolic] // CHECK:STDOUT: %Double.specific_fn: = specific_function %Double, @Double(%int_64) [concrete] // CHECK:STDOUT: %impl_witness.bb3: = impl_witness (imports.%Main.import_ref.464c51.2), @impl(%int_64) [concrete] // CHECK:STDOUT: %Add.facet.22c: %Add.type = facet_value %MyInt.f30, %impl_witness.bb3 [concrete] @@ -570,10 +577,11 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%Main.Add [concrete = constants.%Add.type] // CHECK:STDOUT: %Op.ref: %Add.assoc_type = name_ref Op, imports.%Main.import_ref.db7 [concrete = constants.%assoc0] // CHECK:STDOUT: %impl.elem0: %.3ca = impl_witness_access constants.%impl_witness.8d6, element0 [concrete = constants.%Op.cf9] -// CHECK:STDOUT: %bound_method: = bound_method %x.ref.loc9_10, %impl.elem0 +// CHECK:STDOUT: %bound_method.loc9_11: = bound_method %x.ref.loc9_10, %impl.elem0 // CHECK:STDOUT: %x.ref.loc9_21: %MyInt.f30 = name_ref x, %x -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Op.2(constants.%int_64) -// CHECK:STDOUT: %int.sadd: init %MyInt.f30 = call %specific_fn(%x.ref.loc9_10, %x.ref.loc9_21) +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Op.2(constants.%int_64) [concrete = constants.%Op.specific_fn.16a] +// CHECK:STDOUT: %bound_method.loc9_22: = bound_method %x.ref.loc9_10, %specific_fn +// CHECK:STDOUT: %int.sadd: init %MyInt.f30 = call %bound_method.loc9_22(%x.ref.loc9_10, %x.ref.loc9_21) // CHECK:STDOUT: %.loc9_23.1: %MyInt.f30 = value_of_initializer %int.sadd // CHECK:STDOUT: %.loc9_23.2: %MyInt.f30 = converted %int.sadd, %.loc9_23.1 // CHECK:STDOUT: return %.loc9_23.2 @@ -618,6 +626,7 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %.1: type = fn_type_with_self_type constants.%Op.type.31b, %Add.facet [symbolic = %.1 (constants.%.72d)] // CHECK:STDOUT: %Op.type: type = fn_type @Op.2, @impl(%N) [symbolic = %Op.type (constants.%Op.type.883)] // CHECK:STDOUT: %Op: @Double.%Op.type (%Op.type.883) = struct_value () [symbolic = %Op (constants.%Op.8bc)] +// CHECK:STDOUT: %Op.specific_fn: = specific_function %Op, @Op.2(%N) [symbolic = %Op.specific_fn (constants.%Op.specific_fn.6c0)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%N.patt.1: Core.IntLiteral](%x.param_patt: @Double.%MyInt (%MyInt.09f)) -> @Double.%MyInt (%MyInt.09f); // CHECK:STDOUT: } @@ -701,6 +710,8 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(@Double.%N) {} // CHECK:STDOUT: +// CHECK:STDOUT: specific @Op.2(@Double.%N) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @Double(constants.%int_64) { // CHECK:STDOUT: %N => constants.%int_64 // CHECK:STDOUT: %N.patt.2 => constants.%int_64 @@ -713,6 +724,7 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %.1 => constants.%.41c // CHECK:STDOUT: %Op.type => constants.%Op.type.5a6 // CHECK:STDOUT: %Op => constants.%Op.cf9 +// CHECK:STDOUT: %Op.specific_fn => constants.%Op.specific_fn.16a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- convert_symbolic.carbon diff --git a/toolchain/check/testdata/index/array_element_access.carbon b/toolchain/check/testdata/index/array_element_access.carbon index cb94806e2cad..4d26848fbbb2 100644 --- a/toolchain/check/testdata/index/array_element_access.carbon +++ b/toolchain/check/testdata/index/array_element_access.carbon @@ -32,18 +32,19 @@ var d: i32 = a[b]; // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.221: = bound_method %int_12.6a3, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.9a9: = specific_function %Convert.bound.221, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.dae: = bound_method %int_12.6a3, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ef4: = bound_method %int_24.e3c, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.c4e: = specific_function %Convert.bound.ef4, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.477: = bound_method %int_24.e3c, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_24.365: %i32 = int_value 24 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_12.1e1, %int_24.365) [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b6e: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -116,16 +117,18 @@ var d: i32 = a[b]; // CHECK:STDOUT: %.loc11_31.1: %tuple.type = tuple_literal (%int_12, %int_24) // CHECK:STDOUT: %impl.elem0.loc11_31.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc11_31.1: = bound_method %int_12, %impl.elem0.loc11_31.1 [concrete = constants.%Convert.bound.221] -// CHECK:STDOUT: %specific_fn.loc11_31.1: = specific_function %bound_method.loc11_31.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.9a9] -// CHECK:STDOUT: %int.convert_checked.loc11_31.1: init %i32 = call %specific_fn.loc11_31.1(%int_12) [concrete = constants.%int_12.1e1] +// CHECK:STDOUT: %specific_fn.loc11_31.1: = specific_function %impl.elem0.loc11_31.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_31.2: = bound_method %int_12, %specific_fn.loc11_31.1 [concrete = constants.%bound_method.dae] +// CHECK:STDOUT: %int.convert_checked.loc11_31.1: init %i32 = call %bound_method.loc11_31.2(%int_12) [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %.loc11_31.2: init %i32 = converted %int_12, %int.convert_checked.loc11_31.1 [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %int_0.loc11: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %.loc11_31.3: ref %i32 = array_index file.%a.var, %int_0.loc11 // CHECK:STDOUT: %.loc11_31.4: init %i32 = initialize_from %.loc11_31.2 to %.loc11_31.3 [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %impl.elem0.loc11_31.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11_31.2: = bound_method %int_24, %impl.elem0.loc11_31.2 [concrete = constants.%Convert.bound.ef4] -// CHECK:STDOUT: %specific_fn.loc11_31.2: = specific_function %bound_method.loc11_31.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.c4e] -// CHECK:STDOUT: %int.convert_checked.loc11_31.2: init %i32 = call %specific_fn.loc11_31.2(%int_24) [concrete = constants.%int_24.365] +// CHECK:STDOUT: %bound_method.loc11_31.3: = bound_method %int_24, %impl.elem0.loc11_31.2 [concrete = constants.%Convert.bound.ef4] +// CHECK:STDOUT: %specific_fn.loc11_31.2: = specific_function %impl.elem0.loc11_31.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_31.4: = bound_method %int_24, %specific_fn.loc11_31.2 [concrete = constants.%bound_method.477] +// CHECK:STDOUT: %int.convert_checked.loc11_31.2: init %i32 = call %bound_method.loc11_31.4(%int_24) [concrete = constants.%int_24.365] // CHECK:STDOUT: %.loc11_31.5: init %i32 = converted %int_24, %int.convert_checked.loc11_31.2 [concrete = constants.%int_24.365] // CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc11_31.6: ref %i32 = array_index file.%a.var, %int_1.loc11 @@ -135,9 +138,10 @@ var d: i32 = a[b]; // CHECK:STDOUT: assign file.%a.var, %.loc11_1 // CHECK:STDOUT: %int_1.loc12: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0.loc12: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc12: = bound_method %int_1.loc12, %impl.elem0.loc12 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc12: = specific_function %bound_method.loc12, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %specific_fn.loc12(%int_1.loc12) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc12_1.1: = bound_method %int_1.loc12, %impl.elem0.loc12 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc12: = specific_function %impl.elem0.loc12, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_1.2: = bound_method %int_1.loc12, %specific_fn.loc12 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %bound_method.loc12_1.2(%int_1.loc12) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc12: init %i32 = converted %int_1.loc12, %int.convert_checked.loc12 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: assign file.%b.var, %.loc12 // CHECK:STDOUT: %a.ref.loc13: ref %array_type = name_ref a, file.%a @@ -145,9 +149,10 @@ var d: i32 = a[b]; // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0.loc13: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc13: = bound_method %int_0.loc13, %impl.elem0.loc13 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn.loc13: = specific_function %bound_method.loc13, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %specific_fn.loc13(%int_0.loc13) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc13_16.1: = bound_method %int_0.loc13, %impl.elem0.loc13 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc13: = specific_function %impl.elem0.loc13, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_16.2: = bound_method %int_0.loc13, %specific_fn.loc13 [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %bound_method.loc13_16.2(%int_0.loc13) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc13_16.1: %i32 = value_of_initializer %int.convert_checked.loc13 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc13_16.2: %i32 = converted %int_0.loc13, %.loc13_16.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc13_17.1: ref %i32 = array_index %a.ref.loc13, %.loc13_16.2 diff --git a/toolchain/check/testdata/index/expr_category.carbon b/toolchain/check/testdata/index/expr_category.carbon index c06f1034dfcc..8b145b161be3 100644 --- a/toolchain/check/testdata/index/expr_category.carbon +++ b/toolchain/check/testdata/index/expr_category.carbon @@ -51,22 +51,23 @@ fn ValueBinding(b: array(i32, 3)) { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %Convert.bound.b30: = bound_method %int_3.1ba, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.b42: = specific_function %Convert.bound.b30, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.047: = bound_method %int_3.1ba, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_1.5d2, %int_2.ef8, %int_3.822) [concrete] // CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [concrete] // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b6e: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [concrete] // CHECK:STDOUT: %Convert.bound.ac3: = bound_method %int_4.0c1, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.450: = specific_function %Convert.bound.ac3, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.1da: = bound_method %int_4.0c1, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete] // CHECK:STDOUT: %ValueBinding.type: type = fn_type @ValueBinding [concrete] // CHECK:STDOUT: %ValueBinding: %ValueBinding.type = struct_value () [concrete] @@ -143,24 +144,27 @@ fn ValueBinding(b: array(i32, 3)) { // CHECK:STDOUT: %.loc14_34.1: %tuple.type = tuple_literal (%int_1.loc14_27, %int_2.loc14_30, %int_3.loc14_33) // CHECK:STDOUT: %impl.elem0.loc14_34.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc14_34.1: = bound_method %int_1.loc14_27, %impl.elem0.loc14_34.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc14_34.1: = specific_function %bound_method.loc14_34.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc14_34.1: init %i32 = call %specific_fn.loc14_34.1(%int_1.loc14_27) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc14_34.1: = specific_function %impl.elem0.loc14_34.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_34.2: = bound_method %int_1.loc14_27, %specific_fn.loc14_34.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc14_34.1: init %i32 = call %bound_method.loc14_34.2(%int_1.loc14_27) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_34.2: init %i32 = converted %int_1.loc14_27, %int.convert_checked.loc14_34.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %int_0.loc14: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %.loc14_34.3: ref %i32 = array_index %a.var, %int_0.loc14 // CHECK:STDOUT: %.loc14_34.4: init %i32 = initialize_from %.loc14_34.2 to %.loc14_34.3 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc14_34.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc14_34.2: = bound_method %int_2.loc14_30, %impl.elem0.loc14_34.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc14_34.2: = specific_function %bound_method.loc14_34.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc14_34.2: init %i32 = call %specific_fn.loc14_34.2(%int_2.loc14_30) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc14_34.3: = bound_method %int_2.loc14_30, %impl.elem0.loc14_34.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc14_34.2: = specific_function %impl.elem0.loc14_34.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_34.4: = bound_method %int_2.loc14_30, %specific_fn.loc14_34.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc14_34.2: init %i32 = call %bound_method.loc14_34.4(%int_2.loc14_30) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc14_34.5: init %i32 = converted %int_2.loc14_30, %int.convert_checked.loc14_34.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %int_1.loc14_34: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc14_34.6: ref %i32 = array_index %a.var, %int_1.loc14_34 // CHECK:STDOUT: %.loc14_34.7: init %i32 = initialize_from %.loc14_34.5 to %.loc14_34.6 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %impl.elem0.loc14_34.3: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc14_34.3: = bound_method %int_3.loc14_33, %impl.elem0.loc14_34.3 [concrete = constants.%Convert.bound.b30] -// CHECK:STDOUT: %specific_fn.loc14_34.3: = specific_function %bound_method.loc14_34.3, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc14_34.3: init %i32 = call %specific_fn.loc14_34.3(%int_3.loc14_33) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %bound_method.loc14_34.5: = bound_method %int_3.loc14_33, %impl.elem0.loc14_34.3 [concrete = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc14_34.3: = specific_function %impl.elem0.loc14_34.3, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_34.6: = bound_method %int_3.loc14_33, %specific_fn.loc14_34.3 [concrete = constants.%bound_method.047] +// CHECK:STDOUT: %int.convert_checked.loc14_34.3: init %i32 = call %bound_method.loc14_34.6(%int_3.loc14_33) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc14_34.8: init %i32 = converted %int_3.loc14_33, %int.convert_checked.loc14_34.3 [concrete = constants.%int_3.822] // CHECK:STDOUT: %int_2.loc14_34: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %.loc14_34.9: ref %i32 = array_index %a.var, %int_2.loc14_34 @@ -185,9 +189,10 @@ fn ValueBinding(b: array(i32, 3)) { // CHECK:STDOUT: %int_32.loc17_22: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc17_22: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0.loc17: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc17: = bound_method %int_0.loc17, %impl.elem0.loc17 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn.loc17: = specific_function %bound_method.loc17, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %specific_fn.loc17(%int_0.loc17) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc17_21.1: = bound_method %int_0.loc17, %impl.elem0.loc17 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc17: = specific_function %impl.elem0.loc17, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc17_21.2: = bound_method %int_0.loc17, %specific_fn.loc17 [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %bound_method.loc17_21.2(%int_0.loc17) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc17_21.1: %i32 = value_of_initializer %int.convert_checked.loc17 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc17_21.2: %i32 = converted %int_0.loc17, %.loc17_21.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc17_22: ref %i32 = array_index %a.ref.loc17, %.loc17_21.2 @@ -204,17 +209,19 @@ fn ValueBinding(b: array(i32, 3)) { // CHECK:STDOUT: %int_32.loc18: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc18: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0.loc18_5: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc18_5: = bound_method %int_0.loc18, %impl.elem0.loc18_5 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn.loc18_5: = specific_function %bound_method.loc18_5, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc18_5: init %i32 = call %specific_fn.loc18_5(%int_0.loc18) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc18_5.1: = bound_method %int_0.loc18, %impl.elem0.loc18_5 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc18_5: = specific_function %impl.elem0.loc18_5, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc18_5.2: = bound_method %int_0.loc18, %specific_fn.loc18_5 [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked.loc18_5: init %i32 = call %bound_method.loc18_5.2(%int_0.loc18) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc18_5.1: %i32 = value_of_initializer %int.convert_checked.loc18_5 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc18_5.2: %i32 = converted %int_0.loc18, %.loc18_5.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc18_6: ref %i32 = array_index %a.ref.loc18, %.loc18_5.2 // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1] // CHECK:STDOUT: %impl.elem0.loc18_8: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc18_8: = bound_method %int_4, %impl.elem0.loc18_8 [concrete = constants.%Convert.bound.ac3] -// CHECK:STDOUT: %specific_fn.loc18_8: = specific_function %bound_method.loc18_8, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.450] -// CHECK:STDOUT: %int.convert_checked.loc18_8: init %i32 = call %specific_fn.loc18_8(%int_4) [concrete = constants.%int_4.940] +// CHECK:STDOUT: %bound_method.loc18_8.1: = bound_method %int_4, %impl.elem0.loc18_8 [concrete = constants.%Convert.bound.ac3] +// CHECK:STDOUT: %specific_fn.loc18_8: = specific_function %impl.elem0.loc18_8, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc18_8.2: = bound_method %int_4, %specific_fn.loc18_8 [concrete = constants.%bound_method.1da] +// CHECK:STDOUT: %int.convert_checked.loc18_8: init %i32 = call %bound_method.loc18_8.2(%int_4) [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc18_8: init %i32 = converted %int_4, %int.convert_checked.loc18_8 [concrete = constants.%int_4.940] // CHECK:STDOUT: assign %.loc18_6, %.loc18_8 // CHECK:STDOUT: return @@ -233,24 +240,27 @@ fn ValueBinding(b: array(i32, 3)) { // CHECK:STDOUT: %.loc22_34.1: %tuple.type = tuple_literal (%int_1.loc22_27, %int_2.loc22_30, %int_3.loc22_33) // CHECK:STDOUT: %impl.elem0.loc22_34.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc22_34.1: = bound_method %int_1.loc22_27, %impl.elem0.loc22_34.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc22_34.1: = specific_function %bound_method.loc22_34.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc22_34.1: init %i32 = call %specific_fn.loc22_34.1(%int_1.loc22_27) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc22_34.1: = specific_function %impl.elem0.loc22_34.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc22_34.2: = bound_method %int_1.loc22_27, %specific_fn.loc22_34.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc22_34.1: init %i32 = call %bound_method.loc22_34.2(%int_1.loc22_27) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc22_34.2: init %i32 = converted %int_1.loc22_27, %int.convert_checked.loc22_34.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %int_0.loc22: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %.loc22_34.3: ref %i32 = array_index %a.var, %int_0.loc22 // CHECK:STDOUT: %.loc22_34.4: init %i32 = initialize_from %.loc22_34.2 to %.loc22_34.3 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc22_34.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc22_34.2: = bound_method %int_2.loc22_30, %impl.elem0.loc22_34.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc22_34.2: = specific_function %bound_method.loc22_34.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc22_34.2: init %i32 = call %specific_fn.loc22_34.2(%int_2.loc22_30) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc22_34.3: = bound_method %int_2.loc22_30, %impl.elem0.loc22_34.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc22_34.2: = specific_function %impl.elem0.loc22_34.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc22_34.4: = bound_method %int_2.loc22_30, %specific_fn.loc22_34.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc22_34.2: init %i32 = call %bound_method.loc22_34.4(%int_2.loc22_30) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc22_34.5: init %i32 = converted %int_2.loc22_30, %int.convert_checked.loc22_34.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %int_1.loc22_34: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc22_34.6: ref %i32 = array_index %a.var, %int_1.loc22_34 // CHECK:STDOUT: %.loc22_34.7: init %i32 = initialize_from %.loc22_34.5 to %.loc22_34.6 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %impl.elem0.loc22_34.3: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc22_34.3: = bound_method %int_3.loc22_33, %impl.elem0.loc22_34.3 [concrete = constants.%Convert.bound.b30] -// CHECK:STDOUT: %specific_fn.loc22_34.3: = specific_function %bound_method.loc22_34.3, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc22_34.3: init %i32 = call %specific_fn.loc22_34.3(%int_3.loc22_33) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %bound_method.loc22_34.5: = bound_method %int_3.loc22_33, %impl.elem0.loc22_34.3 [concrete = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc22_34.3: = specific_function %impl.elem0.loc22_34.3, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc22_34.6: = bound_method %int_3.loc22_33, %specific_fn.loc22_34.3 [concrete = constants.%bound_method.047] +// CHECK:STDOUT: %int.convert_checked.loc22_34.3: init %i32 = call %bound_method.loc22_34.6(%int_3.loc22_33) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc22_34.8: init %i32 = converted %int_3.loc22_33, %int.convert_checked.loc22_34.3 [concrete = constants.%int_3.822] // CHECK:STDOUT: %int_2.loc22_34: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %.loc22_34.9: ref %i32 = array_index %a.var, %int_2.loc22_34 @@ -270,9 +280,10 @@ fn ValueBinding(b: array(i32, 3)) { // CHECK:STDOUT: %int_32.loc26: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc26: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0.loc26: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc26: = bound_method %int_0.loc26, %impl.elem0.loc26 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn.loc26: = specific_function %bound_method.loc26, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc26: init %i32 = call %specific_fn.loc26(%int_0.loc26) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc26_5.1: = bound_method %int_0.loc26, %impl.elem0.loc26 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc26: = specific_function %impl.elem0.loc26, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc26_5.2: = bound_method %int_0.loc26, %specific_fn.loc26 [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked.loc26: init %i32 = call %bound_method.loc26_5.2(%int_0.loc26) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc26_5.1: %i32 = value_of_initializer %int.convert_checked.loc26 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc26_5.2: %i32 = converted %int_0.loc26, %.loc26_5.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc26_6: ref %i32 = array_index %a.ref, %.loc26_5.2 @@ -281,9 +292,10 @@ fn ValueBinding(b: array(i32, 3)) { // CHECK:STDOUT: %int_32.loc27: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc27: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0.loc27: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc27: = bound_method %int_0.loc27, %impl.elem0.loc27 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn.loc27: = specific_function %bound_method.loc27, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc27: init %i32 = call %specific_fn.loc27(%int_0.loc27) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc27_5.1: = bound_method %int_0.loc27, %impl.elem0.loc27 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc27: = specific_function %impl.elem0.loc27, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc27_5.2: = bound_method %int_0.loc27, %specific_fn.loc27 [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked.loc27: init %i32 = call %bound_method.loc27_5.2(%int_0.loc27) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc27_5.1: %i32 = value_of_initializer %int.convert_checked.loc27 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc27_5.2: %i32 = converted %int_0.loc27, %.loc27_5.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc27_6.1: ref %array_type = value_as_ref %b.ref @@ -297,9 +309,10 @@ fn ValueBinding(b: array(i32, 3)) { // CHECK:STDOUT: %int_32.loc28: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc28: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0.loc28: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc28: = bound_method %int_0.loc28, %impl.elem0.loc28 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn.loc28: = specific_function %bound_method.loc28, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc28: init %i32 = call %specific_fn.loc28(%int_0.loc28) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc28_7.1: = bound_method %int_0.loc28, %impl.elem0.loc28 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc28: = specific_function %impl.elem0.loc28, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc28_7.2: = bound_method %int_0.loc28, %specific_fn.loc28 [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked.loc28: init %i32 = call %bound_method.loc28_7.2(%int_0.loc28) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc28_7.1: %i32 = value_of_initializer %int.convert_checked.loc28 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc28_7.2: %i32 = converted %int_0.loc28, %.loc28_7.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc28_8.1: ref %i32 = array_index %.loc28_5.2, %.loc28_7.2 diff --git a/toolchain/check/testdata/index/fail_array_large_index.carbon b/toolchain/check/testdata/index/fail_array_large_index.carbon index 0c3dd9d7013b..d1de80c4143a 100644 --- a/toolchain/check/testdata/index/fail_array_large_index.carbon +++ b/toolchain/check/testdata/index/fail_array_large_index.carbon @@ -40,15 +40,16 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.221: = bound_method %int_12.6a3, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.9a9: = specific_function %Convert.bound.221, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.dae: = bound_method %int_12.6a3, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_12.1e1) [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %int_2147483647.d89: Core.IntLiteral = int_value 2147483647 [concrete] // CHECK:STDOUT: %Convert.bound.f38: = bound_method %int_2147483647.d89, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.221: = specific_function %Convert.bound.f38, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.8e1: = bound_method %int_2147483647.d89, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2147483647.a74: %i32 = int_value 2147483647 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -108,9 +109,10 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [concrete = constants.%int_12.6a3] // CHECK:STDOUT: %.loc11_28.1: %tuple.type = tuple_literal (%int_12) // CHECK:STDOUT: %impl.elem0.loc11: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11: = bound_method %int_12, %impl.elem0.loc11 [concrete = constants.%Convert.bound.221] -// CHECK:STDOUT: %specific_fn.loc11: = specific_function %bound_method.loc11, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.9a9] -// CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %specific_fn.loc11(%int_12) [concrete = constants.%int_12.1e1] +// CHECK:STDOUT: %bound_method.loc11_28.1: = bound_method %int_12, %impl.elem0.loc11 [concrete = constants.%Convert.bound.221] +// CHECK:STDOUT: %specific_fn.loc11: = specific_function %impl.elem0.loc11, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_28.2: = bound_method %int_12, %specific_fn.loc11 [concrete = constants.%bound_method.dae] +// CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %bound_method.loc11_28.2(%int_12) [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %.loc11_28.2: init %i32 = converted %int_12, %int.convert_checked.loc11 [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc11_28.3: ref %i32 = array_index file.%a.var, %int_0 @@ -123,9 +125,10 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0.loc17: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc17: = bound_method %int_1, %impl.elem0.loc17 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc17: = specific_function %bound_method.loc17, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %specific_fn.loc17(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc17_16.1: = bound_method %int_1, %impl.elem0.loc17 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc17: = specific_function %impl.elem0.loc17, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc17_16.2: = bound_method %int_1, %specific_fn.loc17 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %bound_method.loc17_16.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc17_16.1: %i32 = value_of_initializer %int.convert_checked.loc17 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc17_16.2: %i32 = converted %int_1, %.loc17_16.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc17_17.1: ref %i32 = array_index %a.ref.loc17, %.loc17_16.2 [concrete = ] @@ -136,9 +139,10 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: %int_32.loc23: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc23: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0.loc23: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc23: = bound_method %int_2147483647, %impl.elem0.loc23 [concrete = constants.%Convert.bound.f38] -// CHECK:STDOUT: %specific_fn.loc23: = specific_function %bound_method.loc23, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.221] -// CHECK:STDOUT: %int.convert_checked.loc23: init %i32 = call %specific_fn.loc23(%int_2147483647) [concrete = constants.%int_2147483647.a74] +// CHECK:STDOUT: %bound_method.loc23_16.1: = bound_method %int_2147483647, %impl.elem0.loc23 [concrete = constants.%Convert.bound.f38] +// CHECK:STDOUT: %specific_fn.loc23: = specific_function %impl.elem0.loc23, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc23_16.2: = bound_method %int_2147483647, %specific_fn.loc23 [concrete = constants.%bound_method.8e1] +// CHECK:STDOUT: %int.convert_checked.loc23: init %i32 = call %bound_method.loc23_16.2(%int_2147483647) [concrete = constants.%int_2147483647.a74] // CHECK:STDOUT: %.loc23_16.1: %i32 = value_of_initializer %int.convert_checked.loc23 [concrete = constants.%int_2147483647.a74] // CHECK:STDOUT: %.loc23_16.2: %i32 = converted %int_2147483647, %.loc23_16.1 [concrete = constants.%int_2147483647.a74] // CHECK:STDOUT: %.loc23_27.1: ref %i32 = array_index %a.ref.loc23, %.loc23_16.2 [concrete = ] diff --git a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon index 582013bf5be4..f275560a39c8 100644 --- a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon +++ b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon @@ -36,7 +36,8 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_12.6a3, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_12.6a3, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_12.1e1) [concrete] // CHECK:STDOUT: %float: f64 = float_literal 2.6000000000000001 [concrete] @@ -87,9 +88,10 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [concrete = constants.%int_12.6a3] // CHECK:STDOUT: %.loc11_28.1: %tuple.type = tuple_literal (%int_12) // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_12, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_12) [concrete = constants.%int_12.1e1] +// CHECK:STDOUT: %bound_method.loc11_28.1: = bound_method %int_12, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_28.2: = bound_method %int_12, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc11_28.2(%int_12) [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %.loc11_28.2: init %i32 = converted %int_12, %int.convert_checked [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc11_28.3: ref %i32 = array_index file.%a.var, %int_0 diff --git a/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon b/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon index bffad62875a2..3013b15769ce 100644 --- a/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon +++ b/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon @@ -33,11 +33,12 @@ var b: i32 = a[1]; // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.221: = bound_method %int_12.6a3, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.9a9: = specific_function %Convert.bound.221, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.dae: = bound_method %int_12.6a3, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_12.1e1) [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -86,9 +87,10 @@ var b: i32 = a[1]; // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [concrete = constants.%int_12.6a3] // CHECK:STDOUT: %.loc11_28.1: %tuple.type = tuple_literal (%int_12) // CHECK:STDOUT: %impl.elem0.loc11: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11: = bound_method %int_12, %impl.elem0.loc11 [concrete = constants.%Convert.bound.221] -// CHECK:STDOUT: %specific_fn.loc11: = specific_function %bound_method.loc11, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.9a9] -// CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %specific_fn.loc11(%int_12) [concrete = constants.%int_12.1e1] +// CHECK:STDOUT: %bound_method.loc11_28.1: = bound_method %int_12, %impl.elem0.loc11 [concrete = constants.%Convert.bound.221] +// CHECK:STDOUT: %specific_fn.loc11: = specific_function %impl.elem0.loc11, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_28.2: = bound_method %int_12, %specific_fn.loc11 [concrete = constants.%bound_method.dae] +// CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %bound_method.loc11_28.2(%int_12) [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %.loc11_28.2: init %i32 = converted %int_12, %int.convert_checked.loc11 [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc11_28.3: ref %i32 = array_index file.%a.var, %int_0 @@ -101,9 +103,10 @@ var b: i32 = a[1]; // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0.loc16: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc16: = bound_method %int_1, %impl.elem0.loc16 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc16: = specific_function %bound_method.loc16, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %specific_fn.loc16(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc16_16.1: = bound_method %int_1, %impl.elem0.loc16 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc16: = specific_function %impl.elem0.loc16, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc16_16.2: = bound_method %int_1, %specific_fn.loc16 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %bound_method.loc16_16.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc16_16.1: %i32 = value_of_initializer %int.convert_checked.loc16 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc16_16.2: %i32 = converted %int_1, %.loc16_16.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc16_17.1: ref %i32 = array_index %a.ref, %.loc16_16.2 [concrete = ] diff --git a/toolchain/check/testdata/index/fail_expr_category.carbon b/toolchain/check/testdata/index/fail_expr_category.carbon index cb71571d569f..01bdbf64beda 100644 --- a/toolchain/check/testdata/index/fail_expr_category.carbon +++ b/toolchain/check/testdata/index/fail_expr_category.carbon @@ -58,11 +58,12 @@ fn G(b: array(i32, 3)) { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b6e: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [concrete] // CHECK:STDOUT: %Convert.bound.ac3: = bound_method %int_4.0c1, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.450: = specific_function %Convert.bound.ac3, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.1da: = bound_method %int_4.0c1, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -122,9 +123,10 @@ fn G(b: array(i32, 3)) { // CHECK:STDOUT: %int_32.loc19_22: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc19_22: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0.loc19: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc19: = bound_method %int_0.loc19, %impl.elem0.loc19 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn.loc19: = specific_function %bound_method.loc19, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc19: init %i32 = call %specific_fn.loc19(%int_0.loc19) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc19_21.1: = bound_method %int_0.loc19, %impl.elem0.loc19 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc19: = specific_function %impl.elem0.loc19, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc19_21.2: = bound_method %int_0.loc19, %specific_fn.loc19 [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked.loc19: init %i32 = call %bound_method.loc19_21.2(%int_0.loc19) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc19_21.1: %i32 = value_of_initializer %int.convert_checked.loc19 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc19_21.2: %i32 = converted %int_0.loc19, %.loc19_21.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc19_22.1: ref %array_type = value_as_ref %b.ref.loc19 @@ -143,9 +145,10 @@ fn G(b: array(i32, 3)) { // CHECK:STDOUT: %int_32.loc24: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc24: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0.loc24_5: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc24_5: = bound_method %int_0.loc24, %impl.elem0.loc24_5 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn.loc24_5: = specific_function %bound_method.loc24_5, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc24_5: init %i32 = call %specific_fn.loc24_5(%int_0.loc24) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc24_5.1: = bound_method %int_0.loc24, %impl.elem0.loc24_5 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc24_5: = specific_function %impl.elem0.loc24_5, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc24_5.2: = bound_method %int_0.loc24, %specific_fn.loc24_5 [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked.loc24_5: init %i32 = call %bound_method.loc24_5.2(%int_0.loc24) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc24_5.1: %i32 = value_of_initializer %int.convert_checked.loc24_5 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc24_5.2: %i32 = converted %int_0.loc24, %.loc24_5.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc24_6.1: ref %array_type = value_as_ref %b.ref.loc24 @@ -153,9 +156,10 @@ fn G(b: array(i32, 3)) { // CHECK:STDOUT: %.loc24_6.3: %i32 = bind_value %.loc24_6.2 // CHECK:STDOUT: %int_4.loc24: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1] // CHECK:STDOUT: %impl.elem0.loc24_8: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc24_8: = bound_method %int_4.loc24, %impl.elem0.loc24_8 [concrete = constants.%Convert.bound.ac3] -// CHECK:STDOUT: %specific_fn.loc24_8: = specific_function %bound_method.loc24_8, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.450] -// CHECK:STDOUT: %int.convert_checked.loc24_8: init %i32 = call %specific_fn.loc24_8(%int_4.loc24) [concrete = constants.%int_4.940] +// CHECK:STDOUT: %bound_method.loc24_8.1: = bound_method %int_4.loc24, %impl.elem0.loc24_8 [concrete = constants.%Convert.bound.ac3] +// CHECK:STDOUT: %specific_fn.loc24_8: = specific_function %impl.elem0.loc24_8, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc24_8.2: = bound_method %int_4.loc24, %specific_fn.loc24_8 [concrete = constants.%bound_method.1da] +// CHECK:STDOUT: %int.convert_checked.loc24_8: init %i32 = call %bound_method.loc24_8.2(%int_4.loc24) [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc24_8: init %i32 = converted %int_4.loc24, %int.convert_checked.loc24_8 [concrete = constants.%int_4.940] // CHECK:STDOUT: assign %.loc24_6.3, %.loc24_8 // CHECK:STDOUT: name_binding_decl { @@ -171,9 +175,10 @@ fn G(b: array(i32, 3)) { // CHECK:STDOUT: %int_32.loc32_24: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc32_24: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0.loc32: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc32: = bound_method %int_0.loc32, %impl.elem0.loc32 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn.loc32: = specific_function %bound_method.loc32, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc32: init %i32 = call %specific_fn.loc32(%int_0.loc32) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc32_23.1: = bound_method %int_0.loc32, %impl.elem0.loc32 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc32: = specific_function %impl.elem0.loc32, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc32_23.2: = bound_method %int_0.loc32, %specific_fn.loc32 [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked.loc32: init %i32 = call %bound_method.loc32_23.2(%int_0.loc32) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc32_23.1: %i32 = value_of_initializer %int.convert_checked.loc32 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc32_23.2: %i32 = converted %int_0.loc32, %.loc32_23.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc32_24.1: ref %i32 = array_index %.loc32_21.2, %.loc32_23.2 @@ -194,18 +199,20 @@ fn G(b: array(i32, 3)) { // CHECK:STDOUT: %int_32.loc37: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc37: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0.loc37_7: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc37_7: = bound_method %int_0.loc37, %impl.elem0.loc37_7 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn.loc37_7: = specific_function %bound_method.loc37_7, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc37_7: init %i32 = call %specific_fn.loc37_7(%int_0.loc37) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc37_7.1: = bound_method %int_0.loc37, %impl.elem0.loc37_7 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc37_7: = specific_function %impl.elem0.loc37_7, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc37_7.2: = bound_method %int_0.loc37, %specific_fn.loc37_7 [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked.loc37_7: init %i32 = call %bound_method.loc37_7.2(%int_0.loc37) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc37_7.1: %i32 = value_of_initializer %int.convert_checked.loc37_7 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc37_7.2: %i32 = converted %int_0.loc37, %.loc37_7.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc37_8.1: ref %i32 = array_index %.loc37_5.2, %.loc37_7.2 // CHECK:STDOUT: %.loc37_8.2: %i32 = bind_value %.loc37_8.1 // CHECK:STDOUT: %int_4.loc37: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1] // CHECK:STDOUT: %impl.elem0.loc37_10: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc37_10: = bound_method %int_4.loc37, %impl.elem0.loc37_10 [concrete = constants.%Convert.bound.ac3] -// CHECK:STDOUT: %specific_fn.loc37_10: = specific_function %bound_method.loc37_10, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.450] -// CHECK:STDOUT: %int.convert_checked.loc37_10: init %i32 = call %specific_fn.loc37_10(%int_4.loc37) [concrete = constants.%int_4.940] +// CHECK:STDOUT: %bound_method.loc37_10.1: = bound_method %int_4.loc37, %impl.elem0.loc37_10 [concrete = constants.%Convert.bound.ac3] +// CHECK:STDOUT: %specific_fn.loc37_10: = specific_function %impl.elem0.loc37_10, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc37_10.2: = bound_method %int_4.loc37, %specific_fn.loc37_10 [concrete = constants.%bound_method.1da] +// CHECK:STDOUT: %int.convert_checked.loc37_10: init %i32 = call %bound_method.loc37_10.2(%int_4.loc37) [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc37_10: init %i32 = converted %int_4.loc37, %int.convert_checked.loc37_10 [concrete = constants.%int_4.940] // CHECK:STDOUT: assign %.loc37_8.2, %.loc37_10 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/index/fail_negative_indexing.carbon b/toolchain/check/testdata/index/fail_negative_indexing.carbon index 28f5ab8d361b..37338abf968f 100644 --- a/toolchain/check/testdata/index/fail_negative_indexing.carbon +++ b/toolchain/check/testdata/index/fail_negative_indexing.carbon @@ -35,7 +35,8 @@ var d: i32 = c[-10]; // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.132: = bound_method %int_42.20e, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.2f6: = specific_function %Convert.bound.132, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.8c1: = bound_method %int_42.20e, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_42.c68: %i32 = int_value 42 [concrete] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_42.c68, %int_42.c68) [concrete] @@ -49,7 +50,7 @@ var d: i32 = c[-10]; // CHECK:STDOUT: %Op.bound: = bound_method %int_10, %Op.bba [concrete] // CHECK:STDOUT: %int_-10.06d: Core.IntLiteral = int_value -10 [concrete] // CHECK:STDOUT: %Convert.bound.1ca: = bound_method %int_-10.06d, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.4be: = specific_function %Convert.bound.1ca, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.af0: = bound_method %int_-10.06d, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_-10.c17: %i32 = int_value -10 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -101,16 +102,18 @@ var d: i32 = c[-10]; // CHECK:STDOUT: %.loc11_31.1: %tuple.type = tuple_literal (%int_42.loc11_25, %int_42.loc11_29) // CHECK:STDOUT: %impl.elem0.loc11_31.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc11_31.1: = bound_method %int_42.loc11_25, %impl.elem0.loc11_31.1 [concrete = constants.%Convert.bound.132] -// CHECK:STDOUT: %specific_fn.loc11_31.1: = specific_function %bound_method.loc11_31.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.2f6] -// CHECK:STDOUT: %int.convert_checked.loc11_31.1: init %i32 = call %specific_fn.loc11_31.1(%int_42.loc11_25) [concrete = constants.%int_42.c68] +// CHECK:STDOUT: %specific_fn.loc11_31.1: = specific_function %impl.elem0.loc11_31.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_31.2: = bound_method %int_42.loc11_25, %specific_fn.loc11_31.1 [concrete = constants.%bound_method.8c1] +// CHECK:STDOUT: %int.convert_checked.loc11_31.1: init %i32 = call %bound_method.loc11_31.2(%int_42.loc11_25) [concrete = constants.%int_42.c68] // CHECK:STDOUT: %.loc11_31.2: init %i32 = converted %int_42.loc11_25, %int.convert_checked.loc11_31.1 [concrete = constants.%int_42.c68] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc11_31.3: ref %i32 = array_index file.%c.var, %int_0 // CHECK:STDOUT: %.loc11_31.4: init %i32 = initialize_from %.loc11_31.2 to %.loc11_31.3 [concrete = constants.%int_42.c68] // CHECK:STDOUT: %impl.elem0.loc11_31.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11_31.2: = bound_method %int_42.loc11_29, %impl.elem0.loc11_31.2 [concrete = constants.%Convert.bound.132] -// CHECK:STDOUT: %specific_fn.loc11_31.2: = specific_function %bound_method.loc11_31.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.2f6] -// CHECK:STDOUT: %int.convert_checked.loc11_31.2: init %i32 = call %specific_fn.loc11_31.2(%int_42.loc11_29) [concrete = constants.%int_42.c68] +// CHECK:STDOUT: %bound_method.loc11_31.3: = bound_method %int_42.loc11_29, %impl.elem0.loc11_31.2 [concrete = constants.%Convert.bound.132] +// CHECK:STDOUT: %specific_fn.loc11_31.2: = specific_function %impl.elem0.loc11_31.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_31.4: = bound_method %int_42.loc11_29, %specific_fn.loc11_31.2 [concrete = constants.%bound_method.8c1] +// CHECK:STDOUT: %int.convert_checked.loc11_31.2: init %i32 = call %bound_method.loc11_31.4(%int_42.loc11_29) [concrete = constants.%int_42.c68] // CHECK:STDOUT: %.loc11_31.5: init %i32 = converted %int_42.loc11_29, %int.convert_checked.loc11_31.2 [concrete = constants.%int_42.c68] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] // CHECK:STDOUT: %.loc11_31.6: ref %i32 = array_index file.%c.var, %int_1 @@ -127,10 +130,11 @@ var d: i32 = c[-10]; // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0.loc16_16.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc16_16.2: = bound_method %int.snegate, %impl.elem0.loc16_16.2 [concrete = constants.%Convert.bound.1ca] -// CHECK:STDOUT: %specific_fn.loc16: = specific_function %bound_method.loc16_16.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.4be] +// CHECK:STDOUT: %specific_fn.loc16: = specific_function %impl.elem0.loc16_16.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc16_16.3: = bound_method %int.snegate, %specific_fn.loc16 [concrete = constants.%bound_method.af0] // CHECK:STDOUT: %.loc16_16.1: Core.IntLiteral = value_of_initializer %int.snegate [concrete = constants.%int_-10.06d] // CHECK:STDOUT: %.loc16_16.2: Core.IntLiteral = converted %int.snegate, %.loc16_16.1 [concrete = constants.%int_-10.06d] -// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %specific_fn.loc16(%.loc16_16.2) [concrete = constants.%int_-10.c17] +// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %bound_method.loc16_16.3(%.loc16_16.2) [concrete = constants.%int_-10.c17] // CHECK:STDOUT: %.loc16_16.3: %i32 = value_of_initializer %int.convert_checked.loc16 [concrete = constants.%int_-10.c17] // CHECK:STDOUT: %.loc16_16.4: %i32 = converted %int.snegate, %.loc16_16.3 [concrete = constants.%int_-10.c17] // CHECK:STDOUT: %.loc16_19.1: ref %i32 = array_index %c.ref, %.loc16_16.4 [concrete = ] diff --git a/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon b/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon index 779c8529a09c..a38739780281 100644 --- a/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon +++ b/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon @@ -42,7 +42,8 @@ interface I { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_42.20e, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_42.20e, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_42.c68: %i32 = int_value 42 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -79,9 +80,10 @@ interface I { // CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, @I.%N [concrete = constants.%assoc1] // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [concrete = constants.%int_42.20e] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_42, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_42) [concrete = constants.%int_42.c68] +// CHECK:STDOUT: %bound_method.loc21_27.1: = bound_method %int_42, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc21_27.2: = bound_method %int_42, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc21_27.2(%int_42) [concrete = constants.%int_42.c68] // CHECK:STDOUT: %.loc21_27.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_42.c68] // CHECK:STDOUT: %.loc21_27.2: %i32 = converted %int_42, %.loc21_27.1 [concrete = constants.%int_42.c68] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/no_prelude/compound_member_access.carbon b/toolchain/check/testdata/interface/no_prelude/compound_member_access.carbon index e265ccf76e69..f00f45860459 100644 --- a/toolchain/check/testdata/interface/no_prelude/compound_member_access.carbon +++ b/toolchain/check/testdata/interface/no_prelude/compound_member_access.carbon @@ -1134,9 +1134,11 @@ fn Works() { // CHECK:STDOUT: %L1.facet: %L1.type = facet_value %T.as_type, %T.as_wit [symbolic] // CHECK:STDOUT: %.1e8: type = fn_type_with_self_type %R1.type, %L1.facet [symbolic] // CHECK:STDOUT: %impl.elem0: %.1e8 = impl_witness_access %T.as_wit, element0 [symbolic] +// CHECK:STDOUT: %specific_fn.510: = specific_function %impl.elem0, @R1(%L1.facet) [symbolic] // CHECK:STDOUT: %.d0e: type = fn_type_with_self_type %S1.type, %L1.facet [symbolic] // CHECK:STDOUT: %impl.elem1: %.d0e = impl_witness_access %T.as_wit, element1 [symbolic] // CHECK:STDOUT: %ptr.72f01d.2: type = ptr_type %T.as_type [symbolic] +// CHECK:STDOUT: %specific_fn.c9e: = specific_function %impl.elem1, @S1(%L1.facet) [symbolic] // CHECK:STDOUT: %require_complete.932: = require_complete_type %ptr.72f01d.2 [symbolic] // CHECK:STDOUT: %V: %L1.type = bind_symbolic_name V, 0 [symbolic] // CHECK:STDOUT: %V.patt: %L1.type = symbolic_binding_pattern V, 0 [symbolic] @@ -1249,8 +1251,10 @@ fn Works() { // CHECK:STDOUT: %L1.facet: %L1.type = facet_value %T.as_type.loc10_23.2, %T.as_wit.loc11_4.2 [symbolic = %L1.facet (constants.%L1.facet)] // CHECK:STDOUT: %.loc11_4.2: type = fn_type_with_self_type constants.%R1.type, %L1.facet [symbolic = %.loc11_4.2 (constants.%.1e8)] // CHECK:STDOUT: %impl.elem0.loc11_4.2: @Simple4.%.loc11_4.2 (%.1e8) = impl_witness_access %T.as_wit.loc11_4.2, element0 [symbolic = %impl.elem0.loc11_4.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %specific_fn.loc11_4.2: = specific_function %impl.elem0.loc11_4.2, @R1(%L1.facet) [symbolic = %specific_fn.loc11_4.2 (constants.%specific_fn.510)] // CHECK:STDOUT: %.loc13_8.2: type = fn_type_with_self_type constants.%S1.type, %L1.facet [symbolic = %.loc13_8.2 (constants.%.d0e)] // CHECK:STDOUT: %impl.elem1.loc13_8.2: @Simple4.%.loc13_8.2 (%.d0e) = impl_witness_access %T.as_wit.loc11_4.2, element1 [symbolic = %impl.elem1.loc13_8.2 (constants.%impl.elem1)] +// CHECK:STDOUT: %specific_fn.loc13_8.2: = specific_function %impl.elem1.loc13_8.2, @S1(%L1.facet) [symbolic = %specific_fn.loc13_8.2 (constants.%specific_fn.c9e)] // CHECK:STDOUT: %ptr: type = ptr_type @Simple4.%T.as_type.loc10_23.2 (%T.as_type) [symbolic = %ptr (constants.%ptr.72f01d.2)] // CHECK:STDOUT: %require_complete.loc13: = require_complete_type @Simple4.%ptr (%ptr.72f01d.2) [symbolic = %require_complete.loc13 (constants.%require_complete.932)] // CHECK:STDOUT: @@ -1262,9 +1266,10 @@ fn Works() { // CHECK:STDOUT: %.loc11_4.1: type = converted constants.%T, %T.as_type.loc11 [symbolic = %T.as_type.loc10_23.2 (constants.%T.as_type)] // CHECK:STDOUT: %T.as_wit.loc11_4.1: = facet_access_witness constants.%T [symbolic = %T.as_wit.loc11_4.2 (constants.%T.as_wit)] // CHECK:STDOUT: %impl.elem0.loc11_4.1: @Simple4.%.loc11_4.2 (%.1e8) = impl_witness_access %T.as_wit.loc11_4.1, element0 [symbolic = %impl.elem0.loc11_4.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %bound_method.loc11: = bound_method %x.ref.loc11, %impl.elem0.loc11_4.1 -// CHECK:STDOUT: %specific_fn.loc11: = specific_function %bound_method.loc11, @R1(constants.%L1.facet) -// CHECK:STDOUT: %R1.call: init %empty_tuple.type = call %specific_fn.loc11(%x.ref.loc11) +// CHECK:STDOUT: %bound_method.loc11_4: = bound_method %x.ref.loc11, %impl.elem0.loc11_4.1 +// CHECK:STDOUT: %specific_fn.loc11_4.1: = specific_function %impl.elem0.loc11_4.1, @R1(constants.%L1.facet) [symbolic = %specific_fn.loc11_4.2 (constants.%specific_fn.510)] +// CHECK:STDOUT: %bound_method.loc11_8: = bound_method %x.ref.loc11, %specific_fn.loc11_4.1 +// CHECK:STDOUT: %R1.call: init %empty_tuple.type = call %bound_method.loc11_8(%x.ref.loc11) // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %xcopy.patt: @Simple4.%T.as_type.loc10_23.2 (%T.as_type) = binding_pattern xcopy // CHECK:STDOUT: %.loc12_3: @Simple4.%T.as_type.loc10_23.2 (%T.as_type) = var_pattern %xcopy.patt @@ -1284,10 +1289,11 @@ fn Works() { // CHECK:STDOUT: %.loc13_8.1: type = converted constants.%T, %T.as_type.loc13 [symbolic = %T.as_type.loc10_23.2 (constants.%T.as_type)] // CHECK:STDOUT: %T.as_wit.loc13: = facet_access_witness constants.%T [symbolic = %T.as_wit.loc11_4.2 (constants.%T.as_wit)] // CHECK:STDOUT: %impl.elem1.loc13_8.1: @Simple4.%.loc13_8.2 (%.d0e) = impl_witness_access %T.as_wit.loc13, element1 [symbolic = %impl.elem1.loc13_8.2 (constants.%impl.elem1)] -// CHECK:STDOUT: %bound_method.loc13: = bound_method %xcopy.ref, %impl.elem1.loc13_8.1 -// CHECK:STDOUT: %specific_fn.loc13: = specific_function %bound_method.loc13, @S1(constants.%L1.facet) +// CHECK:STDOUT: %bound_method.loc13_8: = bound_method %xcopy.ref, %impl.elem1.loc13_8.1 +// CHECK:STDOUT: %specific_fn.loc13_8.1: = specific_function %impl.elem1.loc13_8.1, @S1(constants.%L1.facet) [symbolic = %specific_fn.loc13_8.2 (constants.%specific_fn.c9e)] +// CHECK:STDOUT: %bound_method.loc13_12: = bound_method %xcopy.ref, %specific_fn.loc13_8.1 // CHECK:STDOUT: %addr: @Simple4.%ptr (%ptr.72f01d.2) = addr_of %xcopy.ref -// CHECK:STDOUT: %S1.call: init %empty_tuple.type = call %specific_fn.loc13(%addr) +// CHECK:STDOUT: %S1.call: init %empty_tuple.type = call %bound_method.loc13_12(%addr) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -1353,6 +1359,10 @@ fn Works() { // CHECK:STDOUT: %ptr.loc5_24.1 => constants.%ptr.72f01d.2 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @R1(@Simple4.%L1.facet) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @S1(@Simple4.%L1.facet) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @Compound4(constants.%V) { // CHECK:STDOUT: %V.loc17_14.2 => constants.%V // CHECK:STDOUT: %V.patt.loc17_14.2 => constants.%V @@ -1600,7 +1610,8 @@ fn Works() { // CHECK:STDOUT: %BitAnd.facet: %BitAnd.type = facet_value type, %impl_witness.3ea [concrete] // CHECK:STDOUT: %.d4d: type = fn_type_with_self_type %Op.type.27a, %BitAnd.facet [concrete] // CHECK:STDOUT: %Op.bound: = bound_method %A.type, %Op.444 [concrete] -// CHECK:STDOUT: %Op.specific_fn: = specific_function %Op.bound, @Op.2(type) [concrete] +// CHECK:STDOUT: %Op.specific_fn: = specific_function %Op.444, @Op.2(type) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %A.type, %Op.specific_fn [concrete] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.d62: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] // CHECK:STDOUT: %Self.519: %ImplicitAs.type.d62 = bind_symbolic_name Self, 1 [symbolic] @@ -1751,9 +1762,10 @@ fn Works() { // CHECK:STDOUT: %A.ref.loc24_15: type = name_ref A, file.%A.decl [concrete = constants.%A.type] // CHECK:STDOUT: %A.ref.loc24_19: type = name_ref A, file.%A.decl [concrete = constants.%A.type] // CHECK:STDOUT: %impl.elem0.loc24: %.d4d = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] -// CHECK:STDOUT: %bound_method.loc24: = bound_method %A.ref.loc24_15, %impl.elem0.loc24 [concrete = constants.%Op.bound] -// CHECK:STDOUT: %specific_fn.loc24: = specific_function %bound_method.loc24, @Op.2(type) [concrete = constants.%Op.specific_fn] -// CHECK:STDOUT: %type.and.loc24: init type = call %specific_fn.loc24(%A.ref.loc24_15, %A.ref.loc24_19) [concrete = constants.%A.type] +// CHECK:STDOUT: %bound_method.loc24_17.1: = bound_method %A.ref.loc24_15, %impl.elem0.loc24 [concrete = constants.%Op.bound] +// CHECK:STDOUT: %specific_fn.loc24: = specific_function %impl.elem0.loc24, @Op.2(type) [concrete = constants.%Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc24_17.2: = bound_method %A.ref.loc24_15, %specific_fn.loc24 [concrete = constants.%bound_method] +// CHECK:STDOUT: %type.and.loc24: init type = call %bound_method.loc24_17.2(%A.ref.loc24_15, %A.ref.loc24_19) [concrete = constants.%A.type] // CHECK:STDOUT: %G.ref.loc24: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.773] // CHECK:STDOUT: %.loc24_12: %A.type = converted %.loc24_7, [concrete = ] // CHECK:STDOUT: %.loc32_6.1: %empty_struct_type = struct_literal () @@ -1766,9 +1778,10 @@ fn Works() { // CHECK:STDOUT: %A.ref.loc32_24: type = name_ref A, file.%A.decl [concrete = constants.%A.type] // CHECK:STDOUT: %A.ref.loc32_28: type = name_ref A, file.%A.decl [concrete = constants.%A.type] // CHECK:STDOUT: %impl.elem0.loc32_26: %.d4d = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] -// CHECK:STDOUT: %bound_method.loc32_26: = bound_method %A.ref.loc32_24, %impl.elem0.loc32_26 [concrete = constants.%Op.bound] -// CHECK:STDOUT: %specific_fn.loc32_26: = specific_function %bound_method.loc32_26, @Op.2(type) [concrete = constants.%Op.specific_fn] -// CHECK:STDOUT: %type.and.loc32_26: init type = call %specific_fn.loc32_26(%A.ref.loc32_24, %A.ref.loc32_28) [concrete = constants.%A.type] +// CHECK:STDOUT: %bound_method.loc32_26.1: = bound_method %A.ref.loc32_24, %impl.elem0.loc32_26 [concrete = constants.%Op.bound] +// CHECK:STDOUT: %specific_fn.loc32_26: = specific_function %impl.elem0.loc32_26, @Op.2(type) [concrete = constants.%Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc32_26.2: = bound_method %A.ref.loc32_24, %specific_fn.loc32_26 [concrete = constants.%bound_method] +// CHECK:STDOUT: %type.and.loc32_26: init type = call %bound_method.loc32_26.2(%A.ref.loc32_24, %A.ref.loc32_28) [concrete = constants.%A.type] // CHECK:STDOUT: %.loc32_29.1: type = value_of_initializer %type.and.loc32_26 [concrete = constants.%A.type] // CHECK:STDOUT: %.loc32_29.2: type = converted %type.and.loc32_26, %.loc32_29.1 [concrete = constants.%A.type] // CHECK:STDOUT: %A.facet.loc32: %A.type = facet_value constants.%C, constants.%impl_witness.a7a [concrete = constants.%A.facet] @@ -1778,9 +1791,10 @@ fn Works() { // CHECK:STDOUT: %A.ref.loc32_35: type = name_ref A, file.%A.decl [concrete = constants.%A.type] // CHECK:STDOUT: %A.ref.loc32_39: type = name_ref A, file.%A.decl [concrete = constants.%A.type] // CHECK:STDOUT: %impl.elem0.loc32_37: %.d4d = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] -// CHECK:STDOUT: %bound_method.loc32_37: = bound_method %A.ref.loc32_35, %impl.elem0.loc32_37 [concrete = constants.%Op.bound] -// CHECK:STDOUT: %specific_fn.loc32_37: = specific_function %bound_method.loc32_37, @Op.2(type) [concrete = constants.%Op.specific_fn] -// CHECK:STDOUT: %type.and.loc32_37: init type = call %specific_fn.loc32_37(%A.ref.loc32_35, %A.ref.loc32_39) [concrete = constants.%A.type] +// CHECK:STDOUT: %bound_method.loc32_37.1: = bound_method %A.ref.loc32_35, %impl.elem0.loc32_37 [concrete = constants.%Op.bound] +// CHECK:STDOUT: %specific_fn.loc32_37: = specific_function %impl.elem0.loc32_37, @Op.2(type) [concrete = constants.%Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc32_37.2: = bound_method %A.ref.loc32_35, %specific_fn.loc32_37 [concrete = constants.%bound_method] +// CHECK:STDOUT: %type.and.loc32_37: init type = call %bound_method.loc32_37.2(%A.ref.loc32_35, %A.ref.loc32_39) [concrete = constants.%A.type] // CHECK:STDOUT: %G.ref.loc32: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.773] // CHECK:STDOUT: %.loc32_32: %A.type = converted %.loc32_8, [concrete = ] // CHECK:STDOUT: %.loc40_6.1: %empty_struct_type = struct_literal () @@ -1793,9 +1807,10 @@ fn Works() { // CHECK:STDOUT: %A.ref.loc40_24: type = name_ref A, file.%A.decl [concrete = constants.%A.type] // CHECK:STDOUT: %A.ref.loc40_28: type = name_ref A, file.%A.decl [concrete = constants.%A.type] // CHECK:STDOUT: %impl.elem0.loc40: %.d4d = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] -// CHECK:STDOUT: %bound_method.loc40: = bound_method %A.ref.loc40_24, %impl.elem0.loc40 [concrete = constants.%Op.bound] -// CHECK:STDOUT: %specific_fn.loc40: = specific_function %bound_method.loc40, @Op.2(type) [concrete = constants.%Op.specific_fn] -// CHECK:STDOUT: %type.and.loc40: init type = call %specific_fn.loc40(%A.ref.loc40_24, %A.ref.loc40_28) [concrete = constants.%A.type] +// CHECK:STDOUT: %bound_method.loc40_26.1: = bound_method %A.ref.loc40_24, %impl.elem0.loc40 [concrete = constants.%Op.bound] +// CHECK:STDOUT: %specific_fn.loc40: = specific_function %impl.elem0.loc40, @Op.2(type) [concrete = constants.%Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc40_26.2: = bound_method %A.ref.loc40_24, %specific_fn.loc40 [concrete = constants.%bound_method] +// CHECK:STDOUT: %type.and.loc40: init type = call %bound_method.loc40_26.2(%A.ref.loc40_24, %A.ref.loc40_28) [concrete = constants.%A.type] // CHECK:STDOUT: %.loc40_29.1: type = value_of_initializer %type.and.loc40 [concrete = constants.%A.type] // CHECK:STDOUT: %.loc40_29.2: type = converted %type.and.loc40, %.loc40_29.1 [concrete = constants.%A.type] // CHECK:STDOUT: %A.facet.loc40: %A.type = facet_value constants.%C, constants.%impl_witness.a7a [concrete = constants.%A.facet] @@ -1939,7 +1954,8 @@ fn Works() { // CHECK:STDOUT: %BitAnd.facet: %BitAnd.type = facet_value type, %impl_witness.3ea [concrete] // CHECK:STDOUT: %.d4d: type = fn_type_with_self_type %Op.type.27a, %BitAnd.facet [concrete] // CHECK:STDOUT: %Op.bound: = bound_method %A.type, %Op.444 [concrete] -// CHECK:STDOUT: %Op.specific_fn: = specific_function %Op.bound, @Op.2(type) [concrete] +// CHECK:STDOUT: %Op.specific_fn: = specific_function %Op.444, @Op.2(type) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %A.type, %Op.specific_fn [concrete] // CHECK:STDOUT: %.faa: type = fn_type_with_self_type %G.type.c3a, %A.facet [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2043,9 +2059,10 @@ fn Works() { // CHECK:STDOUT: %A.ref.loc15_7: type = name_ref A, file.%A.decl [concrete = constants.%A.type] // CHECK:STDOUT: %A.ref.loc15_11: type = name_ref A, file.%A.decl [concrete = constants.%A.type] // CHECK:STDOUT: %impl.elem0.loc15_9: %.d4d = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] -// CHECK:STDOUT: %bound_method.loc15: = bound_method %A.ref.loc15_7, %impl.elem0.loc15_9 [concrete = constants.%Op.bound] -// CHECK:STDOUT: %specific_fn.loc15: = specific_function %bound_method.loc15, @Op.2(type) [concrete = constants.%Op.specific_fn] -// CHECK:STDOUT: %type.and.loc15: init type = call %specific_fn.loc15(%A.ref.loc15_7, %A.ref.loc15_11) [concrete = constants.%A.type] +// CHECK:STDOUT: %bound_method.loc15_9.1: = bound_method %A.ref.loc15_7, %impl.elem0.loc15_9 [concrete = constants.%Op.bound] +// CHECK:STDOUT: %specific_fn.loc15: = specific_function %impl.elem0.loc15_9, @Op.2(type) [concrete = constants.%Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc15_9.2: = bound_method %A.ref.loc15_7, %specific_fn.loc15 [concrete = constants.%bound_method] +// CHECK:STDOUT: %type.and.loc15: init type = call %bound_method.loc15_9.2(%A.ref.loc15_7, %A.ref.loc15_11) [concrete = constants.%A.type] // CHECK:STDOUT: %G.ref.loc15: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.773] // CHECK:STDOUT: %A.facet.loc15: %A.type = facet_value constants.%C, constants.%impl_witness.a7a [concrete = constants.%A.facet] // CHECK:STDOUT: %.loc15: %A.type = converted %C.ref.loc15, %A.facet.loc15 [concrete = constants.%A.facet] @@ -2056,9 +2073,10 @@ fn Works() { // CHECK:STDOUT: %A.ref.loc16_10: type = name_ref A, file.%A.decl [concrete = constants.%A.type] // CHECK:STDOUT: %A.ref.loc16_14: type = name_ref A, file.%A.decl [concrete = constants.%A.type] // CHECK:STDOUT: %impl.elem0.loc16_12: %.d4d = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] -// CHECK:STDOUT: %bound_method.loc16_12: = bound_method %A.ref.loc16_10, %impl.elem0.loc16_12 [concrete = constants.%Op.bound] -// CHECK:STDOUT: %specific_fn.loc16_12: = specific_function %bound_method.loc16_12, @Op.2(type) [concrete = constants.%Op.specific_fn] -// CHECK:STDOUT: %type.and.loc16_12: init type = call %specific_fn.loc16_12(%A.ref.loc16_10, %A.ref.loc16_14) [concrete = constants.%A.type] +// CHECK:STDOUT: %bound_method.loc16_12.1: = bound_method %A.ref.loc16_10, %impl.elem0.loc16_12 [concrete = constants.%Op.bound] +// CHECK:STDOUT: %specific_fn.loc16_12: = specific_function %impl.elem0.loc16_12, @Op.2(type) [concrete = constants.%Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc16_12.2: = bound_method %A.ref.loc16_10, %specific_fn.loc16_12 [concrete = constants.%bound_method] +// CHECK:STDOUT: %type.and.loc16_12: init type = call %bound_method.loc16_12.2(%A.ref.loc16_10, %A.ref.loc16_14) [concrete = constants.%A.type] // CHECK:STDOUT: %.loc16_15.1: type = value_of_initializer %type.and.loc16_12 [concrete = constants.%A.type] // CHECK:STDOUT: %.loc16_15.2: type = converted %type.and.loc16_12, %.loc16_15.1 [concrete = constants.%A.type] // CHECK:STDOUT: %A.facet.loc16: %A.type = facet_value constants.%C, constants.%impl_witness.a7a [concrete = constants.%A.facet] @@ -2066,9 +2084,10 @@ fn Works() { // CHECK:STDOUT: %A.ref.loc16_20: type = name_ref A, file.%A.decl [concrete = constants.%A.type] // CHECK:STDOUT: %A.ref.loc16_24: type = name_ref A, file.%A.decl [concrete = constants.%A.type] // CHECK:STDOUT: %impl.elem0.loc16_22: %.d4d = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] -// CHECK:STDOUT: %bound_method.loc16_22: = bound_method %A.ref.loc16_20, %impl.elem0.loc16_22 [concrete = constants.%Op.bound] -// CHECK:STDOUT: %specific_fn.loc16_22: = specific_function %bound_method.loc16_22, @Op.2(type) [concrete = constants.%Op.specific_fn] -// CHECK:STDOUT: %type.and.loc16_22: init type = call %specific_fn.loc16_22(%A.ref.loc16_20, %A.ref.loc16_24) [concrete = constants.%A.type] +// CHECK:STDOUT: %bound_method.loc16_22.1: = bound_method %A.ref.loc16_20, %impl.elem0.loc16_22 [concrete = constants.%Op.bound] +// CHECK:STDOUT: %specific_fn.loc16_22: = specific_function %impl.elem0.loc16_22, @Op.2(type) [concrete = constants.%Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc16_22.2: = bound_method %A.ref.loc16_20, %specific_fn.loc16_22 [concrete = constants.%bound_method] +// CHECK:STDOUT: %type.and.loc16_22: init type = call %bound_method.loc16_22.2(%A.ref.loc16_20, %A.ref.loc16_24) [concrete = constants.%A.type] // CHECK:STDOUT: %G.ref.loc16: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.773] // CHECK:STDOUT: %as_wit.loc16: = facet_access_witness %.loc16_6 [concrete = constants.%impl_witness.a7a] // CHECK:STDOUT: %impl.elem0.loc16_17: %.faa = impl_witness_access %as_wit.loc16, element0 [concrete = constants.%G.001] @@ -2077,9 +2096,10 @@ fn Works() { // CHECK:STDOUT: %A.ref.loc17_10: type = name_ref A, file.%A.decl [concrete = constants.%A.type] // CHECK:STDOUT: %A.ref.loc17_14: type = name_ref A, file.%A.decl [concrete = constants.%A.type] // CHECK:STDOUT: %impl.elem0.loc17_12: %.d4d = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] -// CHECK:STDOUT: %bound_method.loc17: = bound_method %A.ref.loc17_10, %impl.elem0.loc17_12 [concrete = constants.%Op.bound] -// CHECK:STDOUT: %specific_fn.loc17: = specific_function %bound_method.loc17, @Op.2(type) [concrete = constants.%Op.specific_fn] -// CHECK:STDOUT: %type.and.loc17: init type = call %specific_fn.loc17(%A.ref.loc17_10, %A.ref.loc17_14) [concrete = constants.%A.type] +// CHECK:STDOUT: %bound_method.loc17_12.1: = bound_method %A.ref.loc17_10, %impl.elem0.loc17_12 [concrete = constants.%Op.bound] +// CHECK:STDOUT: %specific_fn.loc17: = specific_function %impl.elem0.loc17_12, @Op.2(type) [concrete = constants.%Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc17_12.2: = bound_method %A.ref.loc17_10, %specific_fn.loc17 [concrete = constants.%bound_method] +// CHECK:STDOUT: %type.and.loc17: init type = call %bound_method.loc17_12.2(%A.ref.loc17_10, %A.ref.loc17_14) [concrete = constants.%A.type] // CHECK:STDOUT: %.loc17_15.1: type = value_of_initializer %type.and.loc17 [concrete = constants.%A.type] // CHECK:STDOUT: %.loc17_15.2: type = converted %type.and.loc17, %.loc17_15.1 [concrete = constants.%A.type] // CHECK:STDOUT: %A.facet.loc17: %A.type = facet_value constants.%C, constants.%impl_witness.a7a [concrete = constants.%A.facet] diff --git a/toolchain/check/testdata/interface/todo_define_not_default.carbon b/toolchain/check/testdata/interface/todo_define_not_default.carbon index f776a36c81c6..d2b2157e6956 100644 --- a/toolchain/check/testdata/interface/todo_define_not_default.carbon +++ b/toolchain/check/testdata/interface/todo_define_not_default.carbon @@ -46,7 +46,8 @@ interface I { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_42.20e, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_42.20e, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_42.c68: %i32 = int_value 42 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -111,9 +112,10 @@ interface I { // CHECK:STDOUT: %assoc3: %I.assoc_type = assoc_entity element3, @I.%N [concrete = constants.%assoc3] // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [concrete = constants.%int_42.20e] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_42, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_42) [concrete = constants.%int_42.c68] +// CHECK:STDOUT: %bound_method.loc19_19.1: = bound_method %int_42, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc19_19.2: = bound_method %int_42, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc19_19.2(%int_42) [concrete = constants.%int_42.c68] // CHECK:STDOUT: %.loc19_19.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_42.c68] // CHECK:STDOUT: %.loc19_19.2: %i32 = converted %int_42, %.loc19_19.1 [concrete = constants.%int_42.c68] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/ir/duplicate_name_same_line.carbon b/toolchain/check/testdata/ir/duplicate_name_same_line.carbon index 4e70ef127478..722fb9727c24 100644 --- a/toolchain/check/testdata/ir/duplicate_name_same_line.carbon +++ b/toolchain/check/testdata/ir/duplicate_name_same_line.carbon @@ -27,11 +27,12 @@ fn A() { if (true) { var n: i32 = 1; } if (true) { var n: i32 = 2; } } // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -66,9 +67,10 @@ fn A() { if (true) { var n: i32 = 1; } if (true) { var n: i32 = 2; } } // CHECK:STDOUT: %n.var.loc11_22: ref %i32 = var n // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0.loc11_22: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11_22: = bound_method %int_1, %impl.elem0.loc11_22 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc11_22: = specific_function %bound_method.loc11_22, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc11_22: init %i32 = call %specific_fn.loc11_22(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc11_22.1: = bound_method %int_1, %impl.elem0.loc11_22 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc11_22: = specific_function %impl.elem0.loc11_22, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_22.2: = bound_method %int_1, %specific_fn.loc11_22 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc11_22: init %i32 = call %bound_method.loc11_22.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_22.2: init %i32 = converted %int_1, %int.convert_checked.loc11_22 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: assign %n.var.loc11_22, %.loc11_22.2 // CHECK:STDOUT: %.loc11_29: type = splice_block %i32.loc11_29 [concrete = constants.%i32] { @@ -90,9 +92,10 @@ fn A() { if (true) { var n: i32 = 1; } if (true) { var n: i32 = 2; } } // CHECK:STDOUT: %n.var.loc11_52: ref %i32 = var n // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %impl.elem0.loc11_52: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11_52: = bound_method %int_2, %impl.elem0.loc11_52 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc11_52: = specific_function %bound_method.loc11_52, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc11_52: init %i32 = call %specific_fn.loc11_52(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc11_52.1: = bound_method %int_2, %impl.elem0.loc11_52 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc11_52: = specific_function %impl.elem0.loc11_52, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_52.2: = bound_method %int_2, %specific_fn.loc11_52 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc11_52: init %i32 = call %bound_method.loc11_52.2(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc11_52.2: init %i32 = converted %int_2, %int.convert_checked.loc11_52 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: assign %n.var.loc11_52, %.loc11_52.2 // CHECK:STDOUT: %.loc11_59: type = splice_block %i32.loc11_59 [concrete = constants.%i32] { diff --git a/toolchain/check/testdata/let/compile_time_bindings.carbon b/toolchain/check/testdata/let/compile_time_bindings.carbon index 3fe83af1031a..50f409898962 100644 --- a/toolchain/check/testdata/let/compile_time_bindings.carbon +++ b/toolchain/check/testdata/let/compile_time_bindings.carbon @@ -599,7 +599,8 @@ impl i32 as Empty { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -640,9 +641,10 @@ impl i32 as Empty { // CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc5_20.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc5_20.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc5_20.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc5_20.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc5_20.2: %i32 = converted %int_0, %.loc5_20.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %Zero: %i32 = bind_symbolic_name Zero, 0, %.loc5_20.2 [symbolic = constants.%Zero] @@ -669,11 +671,12 @@ impl i32 as Empty { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b6e: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -718,9 +721,10 @@ impl i32 as Empty { // CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0.loc6: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc6: = bound_method %int_0, %impl.elem0.loc6 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn.loc6: = specific_function %bound_method.loc6, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %specific_fn.loc6(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc6_22.1: = bound_method %int_0, %impl.elem0.loc6 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc6: = specific_function %impl.elem0.loc6, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_22.2: = bound_method %int_0, %specific_fn.loc6 [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %bound_method.loc6_22.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_22.1: %i32 = value_of_initializer %int.convert_checked.loc6 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_22.2: %i32 = converted %int_0, %.loc6_22.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %Zero: %i32 = bind_symbolic_name Zero, 0, %.loc6_22.2 [symbolic = constants.%Zero] @@ -730,9 +734,10 @@ impl i32 as Empty { // CHECK:STDOUT: !if.else: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0.loc9: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc9: = bound_method %int_1, %impl.elem0.loc9 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc9: = specific_function %bound_method.loc9, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc9: init %i32 = call %specific_fn.loc9(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc9_11.1: = bound_method %int_1, %impl.elem0.loc9 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc9: = specific_function %impl.elem0.loc9, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_11.2: = bound_method %int_1, %specific_fn.loc9 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc9: init %i32 = call %bound_method.loc9_11.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc9_11.1: %i32 = value_of_initializer %int.convert_checked.loc9 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc9_11.2: %i32 = converted %int_1, %.loc9_11.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: return %.loc9_11.2 @@ -928,7 +933,8 @@ impl i32 as Empty { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -974,9 +980,10 @@ impl i32 as Empty { // CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc11_20.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_20.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc11_20.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc11_20.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc11_20.2: %i32 = converted %int_0, %.loc11_20.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %Zero: %i32 = bind_name Zero, %.loc11_20.2 diff --git a/toolchain/check/testdata/let/convert.carbon b/toolchain/check/testdata/let/convert.carbon index 082d7c1fb1db..6e4e42f9d1ac 100644 --- a/toolchain/check/testdata/let/convert.carbon +++ b/toolchain/check/testdata/let/convert.carbon @@ -36,13 +36,14 @@ fn F() -> i32 { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %Convert.bound.b30: = bound_method %int_3.1ba, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.b42: = specific_function %Convert.bound.b30, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.047: = bound_method %int_3.1ba, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %tuple: %tuple.type.189 = tuple_value (%int_1.5d2, %int_2.ef8, %int_3.822) [concrete] // CHECK:STDOUT: } @@ -86,22 +87,25 @@ fn F() -> i32 { // CHECK:STDOUT: %.loc12_36.1: %tuple.type.37f = tuple_literal (%int_1.loc12, %int_2, %int_3) // CHECK:STDOUT: %impl.elem0.loc12_36.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc12_36.1: = bound_method %int_1.loc12, %impl.elem0.loc12_36.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc12_36.1: = specific_function %bound_method.loc12_36.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc12_36.1: init %i32 = call %specific_fn.loc12_36.1(%int_1.loc12) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc12_36.1: = specific_function %impl.elem0.loc12_36.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_36.2: = bound_method %int_1.loc12, %specific_fn.loc12_36.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc12_36.1: init %i32 = call %bound_method.loc12_36.2(%int_1.loc12) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc12_36.2: init %i32 = converted %int_1.loc12, %int.convert_checked.loc12_36.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %v.var, element0 // CHECK:STDOUT: %.loc12_36.3: init %i32 = initialize_from %.loc12_36.2 to %tuple.elem0 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc12_36.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc12_36.2: = bound_method %int_2, %impl.elem0.loc12_36.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc12_36.2: = specific_function %bound_method.loc12_36.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc12_36.2: init %i32 = call %specific_fn.loc12_36.2(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc12_36.3: = bound_method %int_2, %impl.elem0.loc12_36.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc12_36.2: = specific_function %impl.elem0.loc12_36.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_36.4: = bound_method %int_2, %specific_fn.loc12_36.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc12_36.2: init %i32 = call %bound_method.loc12_36.4(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc12_36.4: init %i32 = converted %int_2, %int.convert_checked.loc12_36.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %tuple.elem1.loc12: ref %i32 = tuple_access %v.var, element1 // CHECK:STDOUT: %.loc12_36.5: init %i32 = initialize_from %.loc12_36.4 to %tuple.elem1.loc12 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %impl.elem0.loc12_36.3: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc12_36.3: = bound_method %int_3, %impl.elem0.loc12_36.3 [concrete = constants.%Convert.bound.b30] -// CHECK:STDOUT: %specific_fn.loc12_36.3: = specific_function %bound_method.loc12_36.3, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc12_36.3: init %i32 = call %specific_fn.loc12_36.3(%int_3) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %bound_method.loc12_36.5: = bound_method %int_3, %impl.elem0.loc12_36.3 [concrete = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc12_36.3: = specific_function %impl.elem0.loc12_36.3, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_36.6: = bound_method %int_3, %specific_fn.loc12_36.3 [concrete = constants.%bound_method.047] +// CHECK:STDOUT: %int.convert_checked.loc12_36.3: init %i32 = call %bound_method.loc12_36.6(%int_3) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc12_36.6: init %i32 = converted %int_3, %int.convert_checked.loc12_36.3 [concrete = constants.%int_3.822] // CHECK:STDOUT: %tuple.elem2: ref %i32 = tuple_access %v.var, element2 // CHECK:STDOUT: %.loc12_36.7: init %i32 = initialize_from %.loc12_36.6 to %tuple.elem2 [concrete = constants.%int_3.822] diff --git a/toolchain/check/testdata/let/fail_duplicate_decl.carbon b/toolchain/check/testdata/let/fail_duplicate_decl.carbon index fa3d6252062a..2a1040e1264b 100644 --- a/toolchain/check/testdata/let/fail_duplicate_decl.carbon +++ b/toolchain/check/testdata/let/fail_duplicate_decl.carbon @@ -36,11 +36,12 @@ fn F() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -73,9 +74,10 @@ fn F() { // CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0.loc12: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc12: = bound_method %int_1, %impl.elem0.loc12 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc12: = specific_function %bound_method.loc12, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %specific_fn.loc12(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc12_16.1: = bound_method %int_1, %impl.elem0.loc12 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc12: = specific_function %impl.elem0.loc12, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_16.2: = bound_method %int_1, %specific_fn.loc12 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %bound_method.loc12_16.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc12_16.1: %i32 = value_of_initializer %int.convert_checked.loc12 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc12_16.2: %i32 = converted %int_1, %.loc12_16.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %a.loc12: %i32 = bind_name a, %.loc12_16.2 @@ -88,9 +90,10 @@ fn F() { // CHECK:STDOUT: %i32.loc20: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0.loc20: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc20: = bound_method %int_2, %impl.elem0.loc20 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc20: = specific_function %bound_method.loc20, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc20: init %i32 = call %specific_fn.loc20(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc20_16.1: = bound_method %int_2, %impl.elem0.loc20 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc20: = specific_function %impl.elem0.loc20, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc20_16.2: = bound_method %int_2, %specific_fn.loc20 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc20: init %i32 = call %bound_method.loc20_16.2(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc20_16.1: %i32 = value_of_initializer %int.convert_checked.loc20 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc20_16.2: %i32 = converted %int_2, %.loc20_16.1 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %a.loc20: %i32 = bind_name a, %.loc20_16.2 diff --git a/toolchain/check/testdata/let/fail_modifiers.carbon b/toolchain/check/testdata/let/fail_modifiers.carbon index eb354b9e4fab..9cd35c861971 100644 --- a/toolchain/check/testdata/let/fail_modifiers.carbon +++ b/toolchain/check/testdata/let/fail_modifiers.carbon @@ -98,7 +98,8 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -132,9 +133,10 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0.loc15: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc15: = bound_method @__global_init.%int_1.loc15, %impl.elem0.loc15 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc15: = specific_function %bound_method.loc15, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %specific_fn.loc15(@__global_init.%int_1.loc15) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc15_24.1: = bound_method @__global_init.%int_1.loc15, %impl.elem0.loc15 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc15: = specific_function %impl.elem0.loc15, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc15_24.2: = bound_method @__global_init.%int_1.loc15, %specific_fn.loc15 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %bound_method.loc15_24.2(@__global_init.%int_1.loc15) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc15_24.1: %i32 = value_of_initializer %int.convert_checked.loc15 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc15_24.2: %i32 = converted @__global_init.%int_1.loc15, %.loc15_24.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %b: %i32 = bind_name b, %.loc15_24.2 @@ -146,9 +148,10 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0.loc21: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc21: = bound_method @__global_init.%int_1.loc21, %impl.elem0.loc21 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc21: = specific_function %bound_method.loc21, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc21: init %i32 = call %specific_fn.loc21(@__global_init.%int_1.loc21) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc21_22.1: = bound_method @__global_init.%int_1.loc21, %impl.elem0.loc21 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc21: = specific_function %impl.elem0.loc21, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc21_22.2: = bound_method @__global_init.%int_1.loc21, %specific_fn.loc21 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc21: init %i32 = call %bound_method.loc21_22.2(@__global_init.%int_1.loc21) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc21_22.1: %i32 = value_of_initializer %int.convert_checked.loc21 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc21_22.2: %i32 = converted @__global_init.%int_1.loc21, %.loc21_22.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %c: %i32 = bind_name c, %.loc21_22.2 @@ -160,9 +163,10 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %i32.loc27: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0.loc27: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc27: = bound_method @__global_init.%int_1.loc27, %impl.elem0.loc27 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc27: = specific_function %bound_method.loc27, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc27: init %i32 = call %specific_fn.loc27(@__global_init.%int_1.loc27) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc27_20.1: = bound_method @__global_init.%int_1.loc27, %impl.elem0.loc27 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc27: = specific_function %impl.elem0.loc27, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc27_20.2: = bound_method @__global_init.%int_1.loc27, %specific_fn.loc27 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc27: init %i32 = call %bound_method.loc27_20.2(@__global_init.%int_1.loc27) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc27_20.1: %i32 = value_of_initializer %int.convert_checked.loc27 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc27_20.2: %i32 = converted @__global_init.%int_1.loc27, %.loc27_20.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %d: %i32 = bind_name d, %.loc27_20.2 @@ -174,9 +178,10 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %i32.loc33: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0.loc33: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc33: = bound_method @__global_init.%int_1.loc33, %impl.elem0.loc33 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc33: = specific_function %bound_method.loc33, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc33: init %i32 = call %specific_fn.loc33(@__global_init.%int_1.loc33) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc33_22.1: = bound_method @__global_init.%int_1.loc33, %impl.elem0.loc33 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc33: = specific_function %impl.elem0.loc33, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc33_22.2: = bound_method @__global_init.%int_1.loc33, %specific_fn.loc33 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc33: init %i32 = call %bound_method.loc33_22.2(@__global_init.%int_1.loc33) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc33_22.1: %i32 = value_of_initializer %int.convert_checked.loc33 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc33_22.2: %i32 = converted @__global_init.%int_1.loc33, %.loc33_22.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %e: %i32 = bind_name e, %.loc33_22.2 @@ -188,9 +193,10 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %i32.loc46: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0.loc46: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc46: = bound_method @__global_init.%int_1.loc46, %impl.elem0.loc46 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc46: = specific_function %bound_method.loc46, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc46: init %i32 = call %specific_fn.loc46(@__global_init.%int_1.loc46) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc46_28.1: = bound_method @__global_init.%int_1.loc46, %impl.elem0.loc46 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc46: = specific_function %impl.elem0.loc46, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc46_28.2: = bound_method @__global_init.%int_1.loc46, %specific_fn.loc46 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc46: init %i32 = call %bound_method.loc46_28.2(@__global_init.%int_1.loc46) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc46_28.1: %i32 = value_of_initializer %int.convert_checked.loc46 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc46_28.2: %i32 = converted @__global_init.%int_1.loc46, %.loc46_28.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %f: %i32 = bind_name f, %.loc46_28.2 @@ -202,9 +208,10 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %i32.loc59: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0.loc59: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc59: = bound_method @__global_init.%int_1.loc59, %impl.elem0.loc59 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc59: = specific_function %bound_method.loc59, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc59: init %i32 = call %specific_fn.loc59(@__global_init.%int_1.loc59) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc59_30.1: = bound_method @__global_init.%int_1.loc59, %impl.elem0.loc59 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc59: = specific_function %impl.elem0.loc59, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc59_30.2: = bound_method @__global_init.%int_1.loc59, %specific_fn.loc59 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc59: init %i32 = call %bound_method.loc59_30.2(@__global_init.%int_1.loc59) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc59_30.1: %i32 = value_of_initializer %int.convert_checked.loc59 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc59_30.2: %i32 = converted @__global_init.%int_1.loc59, %.loc59_30.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %g: %i32 = bind_name g, %.loc59_30.2 @@ -216,9 +223,10 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %i32.loc72: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0.loc72: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc72: = bound_method @__global_init.%int_1.loc72, %impl.elem0.loc72 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc72: = specific_function %bound_method.loc72, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc72: init %i32 = call %specific_fn.loc72(@__global_init.%int_1.loc72) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc72_32.1: = bound_method @__global_init.%int_1.loc72, %impl.elem0.loc72 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc72: = specific_function %impl.elem0.loc72, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc72_32.2: = bound_method @__global_init.%int_1.loc72, %specific_fn.loc72 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc72: init %i32 = call %bound_method.loc72_32.2(@__global_init.%int_1.loc72) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc72_32.1: %i32 = value_of_initializer %int.convert_checked.loc72 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc72_32.2: %i32 = converted @__global_init.%int_1.loc72, %.loc72_32.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %h: %i32 = bind_name h, %.loc72_32.2 @@ -230,9 +238,10 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %i32.loc85: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0.loc85: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc85: = bound_method @__global_init.%int_1.loc85, %impl.elem0.loc85 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc85: = specific_function %bound_method.loc85, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc85: init %i32 = call %specific_fn.loc85(@__global_init.%int_1.loc85) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc85_34.1: = bound_method @__global_init.%int_1.loc85, %impl.elem0.loc85 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc85: = specific_function %impl.elem0.loc85, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc85_34.2: = bound_method @__global_init.%int_1.loc85, %specific_fn.loc85 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc85: init %i32 = call %bound_method.loc85_34.2(@__global_init.%int_1.loc85) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc85_34.1: %i32 = value_of_initializer %int.convert_checked.loc85 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc85_34.2: %i32 = converted @__global_init.%int_1.loc85, %.loc85_34.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %i: %i32 = bind_name i, %.loc85_34.2 diff --git a/toolchain/check/testdata/let/global.carbon b/toolchain/check/testdata/let/global.carbon index 6457de2973e1..83a675c9d14f 100644 --- a/toolchain/check/testdata/let/global.carbon +++ b/toolchain/check/testdata/let/global.carbon @@ -26,7 +26,8 @@ fn F() -> i32 { return n; } // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] @@ -56,9 +57,10 @@ fn F() -> i32 { return n; } // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method @__global_init.%int_1, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(@__global_init.%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc11_14.1: = bound_method @__global_init.%int_1, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_14.2: = bound_method @__global_init.%int_1, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc11_14.2(@__global_init.%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_14.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_14.2: %i32 = converted @__global_init.%int_1, %.loc11_14.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %n: %i32 = bind_name n, %.loc11_14.2 diff --git a/toolchain/check/testdata/let/shadowed_decl.carbon b/toolchain/check/testdata/let/shadowed_decl.carbon index ce7b5f48ffeb..9e874943a91a 100644 --- a/toolchain/check/testdata/let/shadowed_decl.carbon +++ b/toolchain/check/testdata/let/shadowed_decl.carbon @@ -30,7 +30,8 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -79,9 +80,10 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc12_16.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_16.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc12_16.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc12_16.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc12_16.2: %i32 = converted %int_1, %.loc12_16.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %a.loc12: %i32 = bind_name a, %.loc12_16.2 diff --git a/toolchain/check/testdata/namespace/add_to_import.carbon b/toolchain/check/testdata/namespace/add_to_import.carbon index d5f458dcdeeb..9ffa7ac2853d 100644 --- a/toolchain/check/testdata/namespace/add_to_import.carbon +++ b/toolchain/check/testdata/namespace/add_to_import.carbon @@ -56,7 +56,8 @@ var a: i32 = NS.A(); // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -107,9 +108,10 @@ var a: i32 = NS.A(); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc4_28.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc4_28.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc4_28.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc4_28.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc4_28.2: %i32 = converted %int_0, %.loc4_28.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: return %.loc4_28.2 diff --git a/toolchain/check/testdata/namespace/alias.carbon b/toolchain/check/testdata/namespace/alias.carbon index 5909d9ecb47b..2ba296e38f2e 100644 --- a/toolchain/check/testdata/namespace/alias.carbon +++ b/toolchain/check/testdata/namespace/alias.carbon @@ -36,7 +36,8 @@ fn D() -> i32 { return C(); } // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %B.type: type = fn_type @B [concrete] // CHECK:STDOUT: %B: %B.type = struct_value () [concrete] @@ -104,9 +105,10 @@ fn D() -> i32 { return C(); } // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc15_28.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc15_28.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc15_28.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc15_28.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc15_28.2: %i32 = converted %int_0, %.loc15_28.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: return %.loc15_28.2 diff --git a/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon b/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon index eabc5ee2e6a6..0c7713b0d146 100644 --- a/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon +++ b/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon @@ -38,7 +38,8 @@ fn ns.A() -> i32 { return 0; } // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -76,9 +77,10 @@ fn ns.A() -> i32 { return 0; } // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc23_28.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc23_28.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc23_28.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc23_28.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc23_28.2: %i32 = converted %int_0, %.loc23_28.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: return %.loc23_28.2 diff --git a/toolchain/check/testdata/namespace/shadow.carbon b/toolchain/check/testdata/namespace/shadow.carbon index 47c39cf79728..1c17c2da8329 100644 --- a/toolchain/check/testdata/namespace/shadow.carbon +++ b/toolchain/check/testdata/namespace/shadow.carbon @@ -49,7 +49,8 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -109,9 +110,10 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: %A.var: ref %i32 = var A // CHECK:STDOUT: %int_0.loc22: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0.loc22: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc22: = bound_method %int_0.loc22, %impl.elem0.loc22 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc22: = specific_function %bound_method.loc22, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc22: init %i32 = call %specific_fn.loc22(%int_0.loc22) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc22_5.1: = bound_method %int_0.loc22, %impl.elem0.loc22 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc22: = specific_function %impl.elem0.loc22, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc22_5.2: = bound_method %int_0.loc22, %specific_fn.loc22 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc22: init %i32 = call %bound_method.loc22_5.2(%int_0.loc22) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc22_5.2: init %i32 = converted %int_0.loc22, %int.convert_checked.loc22 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: assign %A.var, %.loc22_5.2 // CHECK:STDOUT: %.loc22_12: type = splice_block %i32.loc22 [concrete = constants.%i32] { @@ -126,9 +128,10 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: !if.else: // CHECK:STDOUT: %int_0.loc27: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0.loc27: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc27: = bound_method %int_0.loc27, %impl.elem0.loc27 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc27: = specific_function %bound_method.loc27, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc27: init %i32 = call %specific_fn.loc27(%int_0.loc27) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc27_11.1: = bound_method %int_0.loc27, %impl.elem0.loc27 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc27: = specific_function %impl.elem0.loc27, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc27_11.2: = bound_method %int_0.loc27, %specific_fn.loc27 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc27: init %i32 = call %bound_method.loc27_11.2(%int_0.loc27) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc27_11.1: %i32 = value_of_initializer %int.convert_checked.loc27 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc27_11.2: %i32 = converted %int_0.loc27, %.loc27_11.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: return %.loc27_11.2 diff --git a/toolchain/check/testdata/operators/builtin/assignment.carbon b/toolchain/check/testdata/operators/builtin/assignment.carbon index a51b14c67a10..13088a3c0c86 100644 --- a/toolchain/check/testdata/operators/builtin/assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/assignment.carbon @@ -42,11 +42,12 @@ fn Main() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.221: = bound_method %int_12.6a3, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.9a9: = specific_function %Convert.bound.221, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.dae: = bound_method %int_12.6a3, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [concrete] // CHECK:STDOUT: %int_9.988: Core.IntLiteral = int_value 9 [concrete] // CHECK:STDOUT: %Convert.bound.9e2: = bound_method %int_9.988, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.b02: = specific_function %Convert.bound.9e2, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.cd3: = bound_method %int_9.988, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_9.f88: %i32 = int_value 9 [concrete] // CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete] // CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [concrete] @@ -54,20 +55,20 @@ fn Main() { // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%int_1.5d2, %int_2.ef8) [concrete] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete] // CHECK:STDOUT: %Convert.bound.b30: = bound_method %int_3.1ba, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.b42: = specific_function %Convert.bound.b30, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.047: = bound_method %int_3.1ba, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [concrete] // CHECK:STDOUT: %Convert.bound.ac3: = bound_method %int_4.0c1, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.450: = specific_function %Convert.bound.ac3, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.1da: = bound_method %int_4.0c1, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete] // CHECK:STDOUT: %struct_type.a.b.501: type = struct_type {.a: %i32, .b: %i32} [concrete] // CHECK:STDOUT: %struct_type.a.b.cfd: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [concrete] @@ -75,12 +76,12 @@ fn Main() { // CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [concrete] // CHECK:STDOUT: %int_5.64b: Core.IntLiteral = int_value 5 [concrete] // CHECK:STDOUT: %Convert.bound.4e6: = bound_method %int_5.64b, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.ba9: = specific_function %Convert.bound.4e6, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.a25: = bound_method %int_5.64b, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_5.0f6: %i32 = int_value 5 [concrete] // CHECK:STDOUT: %true: bool = bool_literal true [concrete] // CHECK:STDOUT: %int_10.64f: Core.IntLiteral = int_value 10 [concrete] // CHECK:STDOUT: %Convert.bound.491: = bound_method %int_10.64f, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.e67: = specific_function %Convert.bound.491, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.5ba: = bound_method %int_10.64f, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_10.265: %i32 = int_value 10 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -111,9 +112,10 @@ fn Main() { // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [concrete = constants.%int_12.6a3] // CHECK:STDOUT: %impl.elem0.loc12: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc12: = bound_method %int_12, %impl.elem0.loc12 [concrete = constants.%Convert.bound.221] -// CHECK:STDOUT: %specific_fn.loc12: = specific_function %bound_method.loc12, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.9a9] -// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %specific_fn.loc12(%int_12) [concrete = constants.%int_12.1e1] +// CHECK:STDOUT: %bound_method.loc12_3.1: = bound_method %int_12, %impl.elem0.loc12 [concrete = constants.%Convert.bound.221] +// CHECK:STDOUT: %specific_fn.loc12: = specific_function %impl.elem0.loc12, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_3.2: = bound_method %int_12, %specific_fn.loc12 [concrete = constants.%bound_method.dae] +// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %bound_method.loc12_3.2(%int_12) [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %.loc12_3.2: init %i32 = converted %int_12, %int.convert_checked.loc12 [concrete = constants.%int_12.1e1] // CHECK:STDOUT: assign %a.var, %.loc12_3.2 // CHECK:STDOUT: %.loc12_10: type = splice_block %i32.loc12 [concrete = constants.%i32] { @@ -124,9 +126,10 @@ fn Main() { // CHECK:STDOUT: %a.ref.loc13: ref %i32 = name_ref a, %a // CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [concrete = constants.%int_9.988] // CHECK:STDOUT: %impl.elem0.loc13: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc13: = bound_method %int_9, %impl.elem0.loc13 [concrete = constants.%Convert.bound.9e2] -// CHECK:STDOUT: %specific_fn.loc13: = specific_function %bound_method.loc13, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b02] -// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %specific_fn.loc13(%int_9) [concrete = constants.%int_9.f88] +// CHECK:STDOUT: %bound_method.loc13_5.1: = bound_method %int_9, %impl.elem0.loc13 [concrete = constants.%Convert.bound.9e2] +// CHECK:STDOUT: %specific_fn.loc13: = specific_function %impl.elem0.loc13, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_5.2: = bound_method %int_9, %specific_fn.loc13 [concrete = constants.%bound_method.cd3] +// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %bound_method.loc13_5.2(%int_9) [concrete = constants.%int_9.f88] // CHECK:STDOUT: %.loc13: init %i32 = converted %int_9, %int.convert_checked.loc13 [concrete = constants.%int_9.f88] // CHECK:STDOUT: assign %a.ref.loc13, %.loc13 // CHECK:STDOUT: name_binding_decl { @@ -139,15 +142,17 @@ fn Main() { // CHECK:STDOUT: %.loc15_28.1: %tuple.type.f94 = tuple_literal (%int_1.loc15, %int_2.loc15) // CHECK:STDOUT: %impl.elem0.loc15_28.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc15_28.1: = bound_method %int_1.loc15, %impl.elem0.loc15_28.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc15_28.1: = specific_function %bound_method.loc15_28.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc15_28.1: init %i32 = call %specific_fn.loc15_28.1(%int_1.loc15) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc15_28.1: = specific_function %impl.elem0.loc15_28.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc15_28.2: = bound_method %int_1.loc15, %specific_fn.loc15_28.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc15_28.1: init %i32 = call %bound_method.loc15_28.2(%int_1.loc15) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc15_28.2: init %i32 = converted %int_1.loc15, %int.convert_checked.loc15_28.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %tuple.elem0.loc15: ref %i32 = tuple_access %b.var, element0 // CHECK:STDOUT: %.loc15_28.3: init %i32 = initialize_from %.loc15_28.2 to %tuple.elem0.loc15 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc15_28.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc15_28.2: = bound_method %int_2.loc15, %impl.elem0.loc15_28.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc15_28.2: = specific_function %bound_method.loc15_28.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc15_28.2: init %i32 = call %specific_fn.loc15_28.2(%int_2.loc15) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc15_28.3: = bound_method %int_2.loc15, %impl.elem0.loc15_28.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc15_28.2: = specific_function %impl.elem0.loc15_28.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc15_28.4: = bound_method %int_2.loc15, %specific_fn.loc15_28.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc15_28.2: init %i32 = call %bound_method.loc15_28.4(%int_2.loc15) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc15_28.4: init %i32 = converted %int_2.loc15, %int.convert_checked.loc15_28.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %tuple.elem1.loc15: ref %i32 = tuple_access %b.var, element1 // CHECK:STDOUT: %.loc15_28.5: init %i32 = initialize_from %.loc15_28.4 to %tuple.elem1.loc15 [concrete = constants.%int_2.ef8] @@ -168,9 +173,10 @@ fn Main() { // CHECK:STDOUT: %tuple.elem0.loc16: ref %i32 = tuple_access %b.ref.loc16, element0 // CHECK:STDOUT: %int_3.loc16: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %impl.elem0.loc16: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc16: = bound_method %int_3.loc16, %impl.elem0.loc16 [concrete = constants.%Convert.bound.b30] -// CHECK:STDOUT: %specific_fn.loc16: = specific_function %bound_method.loc16, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %specific_fn.loc16(%int_3.loc16) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %bound_method.loc16_7.1: = bound_method %int_3.loc16, %impl.elem0.loc16 [concrete = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc16: = specific_function %impl.elem0.loc16, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc16_7.2: = bound_method %int_3.loc16, %specific_fn.loc16 [concrete = constants.%bound_method.047] +// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %bound_method.loc16_7.2(%int_3.loc16) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc16: init %i32 = converted %int_3.loc16, %int.convert_checked.loc16 [concrete = constants.%int_3.822] // CHECK:STDOUT: assign %tuple.elem0.loc16, %.loc16 // CHECK:STDOUT: %b.ref.loc17: ref %tuple.type.d07 = name_ref b, %b @@ -178,9 +184,10 @@ fn Main() { // CHECK:STDOUT: %tuple.elem1.loc17: ref %i32 = tuple_access %b.ref.loc17, element1 // CHECK:STDOUT: %int_4.loc17: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1] // CHECK:STDOUT: %impl.elem0.loc17: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc17: = bound_method %int_4.loc17, %impl.elem0.loc17 [concrete = constants.%Convert.bound.ac3] -// CHECK:STDOUT: %specific_fn.loc17: = specific_function %bound_method.loc17, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.450] -// CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %specific_fn.loc17(%int_4.loc17) [concrete = constants.%int_4.940] +// CHECK:STDOUT: %bound_method.loc17_7.1: = bound_method %int_4.loc17, %impl.elem0.loc17 [concrete = constants.%Convert.bound.ac3] +// CHECK:STDOUT: %specific_fn.loc17: = specific_function %impl.elem0.loc17, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc17_7.2: = bound_method %int_4.loc17, %specific_fn.loc17 [concrete = constants.%bound_method.1da] +// CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %bound_method.loc17_7.2(%int_4.loc17) [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc17: init %i32 = converted %int_4.loc17, %int.convert_checked.loc17 [concrete = constants.%int_4.940] // CHECK:STDOUT: assign %tuple.elem1.loc17, %.loc17 // CHECK:STDOUT: name_binding_decl { @@ -193,15 +200,17 @@ fn Main() { // CHECK:STDOUT: %.loc19_46.1: %struct_type.a.b.cfd = struct_literal (%int_1.loc19, %int_2.loc19) // CHECK:STDOUT: %impl.elem0.loc19_46.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc19_46.1: = bound_method %int_1.loc19, %impl.elem0.loc19_46.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc19_46.1: = specific_function %bound_method.loc19_46.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc19_46.1: init %i32 = call %specific_fn.loc19_46.1(%int_1.loc19) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc19_46.1: = specific_function %impl.elem0.loc19_46.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc19_46.2: = bound_method %int_1.loc19, %specific_fn.loc19_46.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc19_46.1: init %i32 = call %bound_method.loc19_46.2(%int_1.loc19) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc19_46.2: init %i32 = converted %int_1.loc19, %int.convert_checked.loc19_46.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc19_46.3: ref %i32 = struct_access %c.var, element0 // CHECK:STDOUT: %.loc19_46.4: init %i32 = initialize_from %.loc19_46.2 to %.loc19_46.3 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc19_46.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc19_46.2: = bound_method %int_2.loc19, %impl.elem0.loc19_46.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc19_46.2: = specific_function %bound_method.loc19_46.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc19_46.2: init %i32 = call %specific_fn.loc19_46.2(%int_2.loc19) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc19_46.3: = bound_method %int_2.loc19, %impl.elem0.loc19_46.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc19_46.2: = specific_function %impl.elem0.loc19_46.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc19_46.4: = bound_method %int_2.loc19, %specific_fn.loc19_46.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc19_46.2: init %i32 = call %bound_method.loc19_46.4(%int_2.loc19) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc19_46.5: init %i32 = converted %int_2.loc19, %int.convert_checked.loc19_46.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc19_46.6: ref %i32 = struct_access %c.var, element1 // CHECK:STDOUT: %.loc19_46.7: init %i32 = initialize_from %.loc19_46.5 to %.loc19_46.6 [concrete = constants.%int_2.ef8] @@ -220,18 +229,20 @@ fn Main() { // CHECK:STDOUT: %.loc20_4: ref %i32 = struct_access %c.ref.loc20, element0 // CHECK:STDOUT: %int_3.loc20: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %impl.elem0.loc20: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc20: = bound_method %int_3.loc20, %impl.elem0.loc20 [concrete = constants.%Convert.bound.b30] -// CHECK:STDOUT: %specific_fn.loc20: = specific_function %bound_method.loc20, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc20: init %i32 = call %specific_fn.loc20(%int_3.loc20) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %bound_method.loc20_7.1: = bound_method %int_3.loc20, %impl.elem0.loc20 [concrete = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc20: = specific_function %impl.elem0.loc20, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc20_7.2: = bound_method %int_3.loc20, %specific_fn.loc20 [concrete = constants.%bound_method.047] +// CHECK:STDOUT: %int.convert_checked.loc20: init %i32 = call %bound_method.loc20_7.2(%int_3.loc20) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc20_7: init %i32 = converted %int_3.loc20, %int.convert_checked.loc20 [concrete = constants.%int_3.822] // CHECK:STDOUT: assign %.loc20_4, %.loc20_7 // CHECK:STDOUT: %c.ref.loc21: ref %struct_type.a.b.501 = name_ref c, %c // CHECK:STDOUT: %.loc21_4: ref %i32 = struct_access %c.ref.loc21, element1 // CHECK:STDOUT: %int_4.loc21: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1] // CHECK:STDOUT: %impl.elem0.loc21: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc21: = bound_method %int_4.loc21, %impl.elem0.loc21 [concrete = constants.%Convert.bound.ac3] -// CHECK:STDOUT: %specific_fn.loc21: = specific_function %bound_method.loc21, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.450] -// CHECK:STDOUT: %int.convert_checked.loc21: init %i32 = call %specific_fn.loc21(%int_4.loc21) [concrete = constants.%int_4.940] +// CHECK:STDOUT: %bound_method.loc21_7.1: = bound_method %int_4.loc21, %impl.elem0.loc21 [concrete = constants.%Convert.bound.ac3] +// CHECK:STDOUT: %specific_fn.loc21: = specific_function %impl.elem0.loc21, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc21_7.2: = bound_method %int_4.loc21, %specific_fn.loc21 [concrete = constants.%bound_method.1da] +// CHECK:STDOUT: %int.convert_checked.loc21: init %i32 = call %bound_method.loc21_7.2(%int_4.loc21) [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc21_7: init %i32 = converted %int_4.loc21, %int.convert_checked.loc21 [concrete = constants.%int_4.940] // CHECK:STDOUT: assign %.loc21_4, %.loc21_7 // CHECK:STDOUT: name_binding_decl { @@ -253,9 +264,10 @@ fn Main() { // CHECK:STDOUT: %.loc24_3: ref %i32 = deref %.loc24_4 // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete = constants.%int_5.64b] // CHECK:STDOUT: %impl.elem0.loc24: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc24: = bound_method %int_5, %impl.elem0.loc24 [concrete = constants.%Convert.bound.4e6] -// CHECK:STDOUT: %specific_fn.loc24: = specific_function %bound_method.loc24, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.ba9] -// CHECK:STDOUT: %int.convert_checked.loc24: init %i32 = call %specific_fn.loc24(%int_5) [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %bound_method.loc24_6.1: = bound_method %int_5, %impl.elem0.loc24 [concrete = constants.%Convert.bound.4e6] +// CHECK:STDOUT: %specific_fn.loc24: = specific_function %impl.elem0.loc24, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc24_6.2: = bound_method %int_5, %specific_fn.loc24 [concrete = constants.%bound_method.a25] +// CHECK:STDOUT: %int.convert_checked.loc24: init %i32 = call %bound_method.loc24_6.2(%int_5) [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc24_6: init %i32 = converted %int_5, %int.convert_checked.loc24 [concrete = constants.%int_5.0f6] // CHECK:STDOUT: assign %.loc24_3, %.loc24_6 // CHECK:STDOUT: %true: bool = bool_literal true [concrete = constants.%true] @@ -276,9 +288,10 @@ fn Main() { // CHECK:STDOUT: %.loc26_3: ref %i32 = deref %.loc26_5 // CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [concrete = constants.%int_10.64f] // CHECK:STDOUT: %impl.elem0.loc26: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc26: = bound_method %int_10, %impl.elem0.loc26 [concrete = constants.%Convert.bound.491] -// CHECK:STDOUT: %specific_fn.loc26: = specific_function %bound_method.loc26, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.e67] -// CHECK:STDOUT: %int.convert_checked.loc26: init %i32 = call %specific_fn.loc26(%int_10) [concrete = constants.%int_10.265] +// CHECK:STDOUT: %bound_method.loc26_29.1: = bound_method %int_10, %impl.elem0.loc26 [concrete = constants.%Convert.bound.491] +// CHECK:STDOUT: %specific_fn.loc26: = specific_function %impl.elem0.loc26, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc26_29.2: = bound_method %int_10, %specific_fn.loc26 [concrete = constants.%bound_method.5ba] +// CHECK:STDOUT: %int.convert_checked.loc26: init %i32 = call %bound_method.loc26_29.2(%int_10) [concrete = constants.%int_10.265] // CHECK:STDOUT: %.loc26_29: init %i32 = converted %int_10, %int.convert_checked.loc26 [concrete = constants.%int_10.265] // CHECK:STDOUT: assign %.loc26_3, %.loc26_29 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon b/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon index e1f2df63d94f..e75665c8b3e6 100644 --- a/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon @@ -76,7 +76,8 @@ fn Main() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete] @@ -85,11 +86,11 @@ fn Main() { // CHECK:STDOUT: %tuple.ad8: %tuple.type.f94 = tuple_value (%int_1.5b8, %int_2.ecc) [concrete] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b6e: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %tuple.21c: %tuple.type.d07 = tuple_value (%int_1.5d2, %int_2.ef8) [concrete] // CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [concrete] @@ -98,11 +99,11 @@ fn Main() { // CHECK:STDOUT: %struct.004: %struct_type.x.y = struct_value (%int_1.5b8, %int_2.ecc) [concrete] // CHECK:STDOUT: %true: bool = bool_literal true [concrete] // CHECK:STDOUT: %Convert.bound.b30: = bound_method %int_3.1ba, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.b42: = specific_function %Convert.bound.b30, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.047: = bound_method %int_3.1ba, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %int_10.64f: Core.IntLiteral = int_value 10 [concrete] // CHECK:STDOUT: %Convert.bound.491: = bound_method %int_10.64f, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.e67: = specific_function %Convert.bound.491, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.5ba: = bound_method %int_10.64f, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_10.265: %i32 = int_value 10 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -145,9 +146,10 @@ fn Main() { // CHECK:STDOUT: %F.call: init %i32 = call %F.ref() // CHECK:STDOUT: %int_1.loc23: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0.loc23: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc23: = bound_method %int_1.loc23, %impl.elem0.loc23 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc23: = specific_function %bound_method.loc23, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc23: init %i32 = call %specific_fn.loc23(%int_1.loc23) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc23_7.1: = bound_method %int_1.loc23, %impl.elem0.loc23 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc23: = specific_function %impl.elem0.loc23, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc23_7.2: = bound_method %int_1.loc23, %specific_fn.loc23 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc23: init %i32 = call %bound_method.loc23_7.2(%int_1.loc23) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc23: init %i32 = converted %int_1.loc23, %int.convert_checked.loc23 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: assign %F.call, %.loc23 // CHECK:STDOUT: %int_1.loc28: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] @@ -172,9 +174,10 @@ fn Main() { // CHECK:STDOUT: %n.var: ref %i32 = var n // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0.loc29: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc29: = bound_method %int_0, %impl.elem0.loc29 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn.loc29: = specific_function %bound_method.loc29, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc29: init %i32 = call %specific_fn.loc29(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc29_3.1: = bound_method %int_0, %impl.elem0.loc29 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc29: = specific_function %impl.elem0.loc29, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc29_3.2: = bound_method %int_0, %specific_fn.loc29 [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked.loc29: init %i32 = call %bound_method.loc29_3.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc29_3.2: init %i32 = converted %int_0, %int.convert_checked.loc29 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: assign %n.var, %.loc29_3.2 // CHECK:STDOUT: %.loc29_10: type = splice_block %i32.loc29 [concrete = constants.%i32] { @@ -190,15 +193,17 @@ fn Main() { // CHECK:STDOUT: %.loc34_17.1: %tuple.type.f94 = tuple_literal (%int_1.loc34, %int_2.loc34) // CHECK:STDOUT: %impl.elem0.loc34_17.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc34_17.1: = bound_method %int_1.loc34, %impl.elem0.loc34_17.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc34_17.1: = specific_function %bound_method.loc34_17.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc34_17.1: init %i32 = call %specific_fn.loc34_17.1(%int_1.loc34) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc34_17.1: = specific_function %impl.elem0.loc34_17.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc34_17.2: = bound_method %int_1.loc34, %specific_fn.loc34_17.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc34_17.1: init %i32 = call %bound_method.loc34_17.2(%int_1.loc34) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc34_17.2: init %i32 = converted %int_1.loc34, %int.convert_checked.loc34_17.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %tuple.elem0.loc34: %i32 = tuple_access %.loc34_8.1, element0 // CHECK:STDOUT: %.loc34_17.3: init %i32 = initialize_from %.loc34_17.2 to %tuple.elem0.loc34 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc34_17.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc34_17.2: = bound_method %int_2.loc34, %impl.elem0.loc34_17.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc34_17.2: = specific_function %bound_method.loc34_17.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc34_17.2: init %i32 = call %specific_fn.loc34_17.2(%int_2.loc34) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc34_17.3: = bound_method %int_2.loc34, %impl.elem0.loc34_17.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc34_17.2: = specific_function %impl.elem0.loc34_17.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc34_17.4: = bound_method %int_2.loc34, %specific_fn.loc34_17.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc34_17.2: init %i32 = call %bound_method.loc34_17.4(%int_2.loc34) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc34_17.4: init %i32 = converted %int_2.loc34, %int.convert_checked.loc34_17.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %tuple.elem1.loc34: %i32 = tuple_access %.loc34_8.1, element1 // CHECK:STDOUT: %.loc34_17.5: init %i32 = initialize_from %.loc34_17.4 to %tuple.elem1.loc34 [concrete = constants.%int_2.ef8] @@ -238,9 +243,10 @@ fn Main() { // CHECK:STDOUT: %int_32.loc49: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc49: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0.loc49_12: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc49_12: = bound_method %int_1.loc49, %impl.elem0.loc49_12 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc49_12: = specific_function %bound_method.loc49_12, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc49_12: init %i32 = call %specific_fn.loc49_12(%int_1.loc49) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc49_12.1: = bound_method %int_1.loc49, %impl.elem0.loc49_12 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc49_12: = specific_function %impl.elem0.loc49_12, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc49_12.2: = bound_method %int_1.loc49, %specific_fn.loc49_12 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc49_12: init %i32 = call %bound_method.loc49_12.2(%int_1.loc49) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc49_12.1: %i32 = value_of_initializer %int.convert_checked.loc49_12 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc49_12.2: %i32 = converted %int_1.loc49, %.loc49_12.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: br !if.expr.result.loc49(%.loc49_12.2) @@ -248,9 +254,10 @@ fn Main() { // CHECK:STDOUT: !if.expr.else.loc49: // CHECK:STDOUT: %int_2.loc49: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %impl.elem0.loc49_19: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc49_19: = bound_method %int_2.loc49, %impl.elem0.loc49_19 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc49_19: = specific_function %bound_method.loc49_19, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc49_19: init %i32 = call %specific_fn.loc49_19(%int_2.loc49) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc49_19.1: = bound_method %int_2.loc49, %impl.elem0.loc49_19 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc49_19: = specific_function %impl.elem0.loc49_19, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc49_19.2: = bound_method %int_2.loc49, %specific_fn.loc49_19 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc49_19: init %i32 = call %bound_method.loc49_19.2(%int_2.loc49) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc49_19.1: %i32 = value_of_initializer %int.convert_checked.loc49_19 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc49_19.2: %i32 = converted %int_2.loc49, %.loc49_19.1 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: br !if.expr.result.loc49(%.loc49_19.2) @@ -259,9 +266,10 @@ fn Main() { // CHECK:STDOUT: %.loc49_4: %i32 = block_arg !if.expr.result.loc49 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %int_3.loc49: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %impl.elem0.loc49_27: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc49_27: = bound_method %int_3.loc49, %impl.elem0.loc49_27 [concrete = constants.%Convert.bound.b30] -// CHECK:STDOUT: %specific_fn.loc49_27: = specific_function %bound_method.loc49_27, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc49_27: init %i32 = call %specific_fn.loc49_27(%int_3.loc49) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %bound_method.loc49_27.1: = bound_method %int_3.loc49, %impl.elem0.loc49_27 [concrete = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc49_27: = specific_function %impl.elem0.loc49_27, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc49_27.2: = bound_method %int_3.loc49, %specific_fn.loc49_27 [concrete = constants.%bound_method.047] +// CHECK:STDOUT: %int.convert_checked.loc49_27: init %i32 = call %bound_method.loc49_27.2(%int_3.loc49) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc49_27: init %i32 = converted %int_3.loc49, %int.convert_checked.loc49_27 [concrete = constants.%int_3.822] // CHECK:STDOUT: assign %.loc49_4, %.loc49_27 // CHECK:STDOUT: name_binding_decl { @@ -291,9 +299,10 @@ fn Main() { // CHECK:STDOUT: %.loc57_4: %i32 = block_arg !if.expr.result.loc57 // CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [concrete = constants.%int_10.64f] // CHECK:STDOUT: %impl.elem0.loc57: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc57: = bound_method %int_10, %impl.elem0.loc57 [concrete = constants.%Convert.bound.491] -// CHECK:STDOUT: %specific_fn.loc57: = specific_function %bound_method.loc57, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.e67] -// CHECK:STDOUT: %int.convert_checked.loc57: init %i32 = call %specific_fn.loc57(%int_10) [concrete = constants.%int_10.265] +// CHECK:STDOUT: %bound_method.loc57_27.1: = bound_method %int_10, %impl.elem0.loc57 [concrete = constants.%Convert.bound.491] +// CHECK:STDOUT: %specific_fn.loc57: = specific_function %impl.elem0.loc57, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc57_27.2: = bound_method %int_10, %specific_fn.loc57 [concrete = constants.%bound_method.5ba] +// CHECK:STDOUT: %int.convert_checked.loc57: init %i32 = call %bound_method.loc57_27.2(%int_10) [concrete = constants.%int_10.265] // CHECK:STDOUT: %.loc57_27: init %i32 = converted %int_10, %int.convert_checked.loc57 [concrete = constants.%int_10.265] // CHECK:STDOUT: assign %.loc57_4, %.loc57_27 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon b/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon index a036b9aa8336..ddf317f6ff98 100644 --- a/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon @@ -40,13 +40,14 @@ fn Main() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b6e: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %Main.type: type = fn_type @Main [concrete] // CHECK:STDOUT: %Main: %Main.type = struct_value () [concrete] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete] // CHECK:STDOUT: %Convert.bound.b30: = bound_method %int_3.1ba, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.b42: = specific_function %Convert.bound.b30, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.047: = bound_method %int_3.1ba, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -82,9 +83,10 @@ fn Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc11_25.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_25.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc11_25.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc11_25.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc11_25.2: %i32 = converted %int_0, %.loc11_25.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: return %.loc11_25.2 @@ -99,9 +101,10 @@ fn Main() { // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_3, %impl.elem0 [concrete = constants.%Convert.bound.b30] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_3) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %bound_method.loc14_3.1: = bound_method %int_3, %impl.elem0 [concrete = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_3.2: = bound_method %int_3, %specific_fn [concrete = constants.%bound_method.047] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc14_3.2(%int_3) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc14_3.2: init %i32 = converted %int_3, %int.convert_checked [concrete = constants.%int_3.822] // CHECK:STDOUT: assign %a.var, %.loc14_3.2 // CHECK:STDOUT: %.loc14_10: type = splice_block %i32 [concrete = constants.%i32] { diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon index c311eed268ed..106fbf93f930 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon @@ -36,7 +36,8 @@ fn Main() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_3.1ba, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_3.1ba, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %float: f64 = float_literal 5.6000000000000005 [concrete] // CHECK:STDOUT: } @@ -68,9 +69,10 @@ fn Main() { // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_3, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_3) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %bound_method.loc12_3.1: = bound_method %int_3, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_3.2: = bound_method %int_3, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc12_3.2(%int_3) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc12_3.2: init %i32 = converted %int_3, %int.convert_checked [concrete = constants.%int_3.822] // CHECK:STDOUT: assign %a.var, %.loc12_3.2 // CHECK:STDOUT: %.loc12_10: type = splice_block %i32 [concrete = constants.%i32] { diff --git a/toolchain/check/testdata/operators/overloaded/index.carbon b/toolchain/check/testdata/operators/overloaded/index.carbon index df1c3b9bb41c..b583384970bc 100644 --- a/toolchain/check/testdata/operators/overloaded/index.carbon +++ b/toolchain/check/testdata/operators/overloaded/index.carbon @@ -258,14 +258,15 @@ let x: i32 = c[0]; // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.4e6: = bound_method %int_5.64b, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.ba9: = specific_function %Convert.bound.4e6, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.a25: = bound_method %int_5.64b, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_5.0f6: %i32 = int_value 5 [concrete] // CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%int_1.5d2, %int_5.0f6) [concrete] // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b6e: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %.252: type = fn_type_with_self_type %At.type.d77, %IndexWith.facet [concrete] // CHECK:STDOUT: } @@ -317,14 +318,16 @@ let x: i32 = c[0]; // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0.loc10_26.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc10_26.1: = bound_method @__global_init.%int_1, %impl.elem0.loc10_26.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc10_26.1: = specific_function %bound_method.loc10_26.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc10_26.1: init %i32 = call %specific_fn.loc10_26.1(@__global_init.%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc10_26.1: = specific_function %impl.elem0.loc10_26.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_26.2: = bound_method @__global_init.%int_1, %specific_fn.loc10_26.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc10_26.1: init %i32 = call %bound_method.loc10_26.2(@__global_init.%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc10_26.1: %i32 = value_of_initializer %int.convert_checked.loc10_26.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc10_26.2: %i32 = converted @__global_init.%int_1, %.loc10_26.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc10_26.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc10_26.2: = bound_method @__global_init.%int_5, %impl.elem0.loc10_26.2 [concrete = constants.%Convert.bound.4e6] -// CHECK:STDOUT: %specific_fn.loc10_26.2: = specific_function %bound_method.loc10_26.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.ba9] -// CHECK:STDOUT: %int.convert_checked.loc10_26.2: init %i32 = call %specific_fn.loc10_26.2(@__global_init.%int_5) [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %bound_method.loc10_26.3: = bound_method @__global_init.%int_5, %impl.elem0.loc10_26.2 [concrete = constants.%Convert.bound.4e6] +// CHECK:STDOUT: %specific_fn.loc10_26.2: = specific_function %impl.elem0.loc10_26.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_26.4: = bound_method @__global_init.%int_5, %specific_fn.loc10_26.2 [concrete = constants.%bound_method.a25] +// CHECK:STDOUT: %int.convert_checked.loc10_26.2: init %i32 = call %bound_method.loc10_26.4(@__global_init.%int_5) [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc10_26.3: %i32 = value_of_initializer %int.convert_checked.loc10_26.2 [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc10_26.4: %i32 = converted @__global_init.%int_5, %.loc10_26.3 [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%.loc10_26.2, %.loc10_26.4) [concrete = constants.%tuple] @@ -388,13 +391,14 @@ let x: i32 = c[0]; // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0.loc11_17.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc11_17.1: = bound_method %int_0, %impl.elem0.loc11_17.1 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method.loc11_17.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc11_17.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_17.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc11_17.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc11_17.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc11_17.2: %i32 = converted %int_0, %.loc11_17.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %impl.elem0.loc11_17.2: %.252 = impl_witness_access constants.%impl_witness.123, element0 [concrete = constants.%At.642] -// CHECK:STDOUT: %bound_method.loc11_17.2: = bound_method %s.ref, %impl.elem0.loc11_17.2 -// CHECK:STDOUT: %At.call: init %i32 = call %bound_method.loc11_17.2(%s.ref, %.loc11_17.2) +// CHECK:STDOUT: %bound_method.loc11_17.3: = bound_method %s.ref, %impl.elem0.loc11_17.2 +// CHECK:STDOUT: %At.call: init %i32 = call %bound_method.loc11_17.3(%s.ref, %.loc11_17.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/package_expr/syntax.carbon b/toolchain/check/testdata/package_expr/syntax.carbon index d540b6841935..70663c9d6a64 100644 --- a/toolchain/check/testdata/package_expr/syntax.carbon +++ b/toolchain/check/testdata/package_expr/syntax.carbon @@ -55,7 +55,8 @@ fn Main() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -101,9 +102,10 @@ fn Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc4_1.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc4_1.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc4_1.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc4: init %i32 = converted %int_0, %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: assign file.%x.var, %.loc4 // CHECK:STDOUT: %package.ref: = name_ref package, package [concrete = package] @@ -127,13 +129,14 @@ fn Main() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b6e: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %Main.type: type = fn_type @Main [concrete] // CHECK:STDOUT: %Main: %Main.type = struct_value () [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -175,9 +178,10 @@ fn Main() { // CHECK:STDOUT: %x.var: ref %i32 = var x // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc7_3.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc7_3.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc7_3.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc7_3.2: init %i32 = converted %int_1, %int.convert_checked [concrete = constants.%int_1.5d2] // CHECK:STDOUT: assign %x.var, %.loc7_3.2 // CHECK:STDOUT: %.loc7_10: type = splice_block %i32.loc7 [concrete = constants.%i32] { @@ -206,9 +210,10 @@ fn Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc4_1.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc4_1.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc4_1.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc4: init %i32 = converted %int_0, %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: assign file.%x.var, %.loc4 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/packages/implicit_imports_prelude.carbon b/toolchain/check/testdata/packages/implicit_imports_prelude.carbon index 067148ecdedb..8c1ae734fc7b 100644 --- a/toolchain/check/testdata/packages/implicit_imports_prelude.carbon +++ b/toolchain/check/testdata/packages/implicit_imports_prelude.carbon @@ -36,7 +36,8 @@ var b: i32 = a; // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -71,9 +72,10 @@ var b: i32 = a; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc4_1.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc4_1.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc4_1.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc4: init %i32 = converted %int_0, %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: assign file.%a.var, %.loc4 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/packages/raw_core.carbon b/toolchain/check/testdata/packages/raw_core.carbon index f9117879c2a0..7bf2acfa5c5e 100644 --- a/toolchain/check/testdata/packages/raw_core.carbon +++ b/toolchain/check/testdata/packages/raw_core.carbon @@ -207,7 +207,8 @@ var c: r#Core = {.n = 0 as Core.Int(32)}; // CHECK:STDOUT: %As.facet: %As.type.fd4 = facet_value Core.IntLiteral, %impl_witness.882 [concrete] // CHECK:STDOUT: %.214: type = fn_type_with_self_type %Convert.type.99b, %As.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.197 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.197, @Convert.5(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %Core.val: %Core = struct_value (%int_0.6a9) [concrete] // CHECK:STDOUT: } @@ -261,9 +262,10 @@ var c: r#Core = {.n = 0 as Core.Int(32)}; // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0: %.214 = impl_witness_access constants.%impl_witness.882, element0 [concrete = constants.%Convert.197] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.5(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc6_25.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.5(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_25.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc6_25.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_25.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_25.2: %i32 = converted %int_0, %.loc6_25.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_40.1: %struct_type.n = struct_literal (%.loc6_25.2) diff --git a/toolchain/check/testdata/pointer/address_of_deref.carbon b/toolchain/check/testdata/pointer/address_of_deref.carbon index d8311f67963d..7c1b8118f042 100644 --- a/toolchain/check/testdata/pointer/address_of_deref.carbon +++ b/toolchain/check/testdata/pointer/address_of_deref.carbon @@ -29,7 +29,8 @@ fn F() -> i32 { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [concrete] // CHECK:STDOUT: } @@ -69,9 +70,10 @@ fn F() -> i32 { // CHECK:STDOUT: %n.var: ref %i32 = var n // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc12_3.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_3.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc12_3.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_3.2: init %i32 = converted %int_0, %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: assign %n.var, %.loc12_3.2 // CHECK:STDOUT: %.loc12_10: type = splice_block %i32.loc12 [concrete = constants.%i32] { diff --git a/toolchain/check/testdata/pointer/address_of_lvalue.carbon b/toolchain/check/testdata/pointer/address_of_lvalue.carbon index ae81ee9aabbf..1bf597221465 100644 --- a/toolchain/check/testdata/pointer/address_of_lvalue.carbon +++ b/toolchain/check/testdata/pointer/address_of_lvalue.carbon @@ -40,10 +40,11 @@ fn F() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %struct: %struct_type.a.b.501 = struct_value (%int_1.5d2, %int_2.ef8) [concrete] // CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [concrete] @@ -84,15 +85,17 @@ fn F() { // CHECK:STDOUT: %.loc12_46.1: %struct_type.a.b.cfd = struct_literal (%int_1.loc12, %int_2.loc12) // CHECK:STDOUT: %impl.elem0.loc12_46.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc12_46.1: = bound_method %int_1.loc12, %impl.elem0.loc12_46.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc12_46.1: = specific_function %bound_method.loc12_46.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc12_46.1: init %i32 = call %specific_fn.loc12_46.1(%int_1.loc12) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc12_46.1: = specific_function %impl.elem0.loc12_46.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_46.2: = bound_method %int_1.loc12, %specific_fn.loc12_46.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc12_46.1: init %i32 = call %bound_method.loc12_46.2(%int_1.loc12) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc12_46.2: init %i32 = converted %int_1.loc12, %int.convert_checked.loc12_46.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc12_46.3: ref %i32 = struct_access %s.var, element0 // CHECK:STDOUT: %.loc12_46.4: init %i32 = initialize_from %.loc12_46.2 to %.loc12_46.3 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc12_46.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc12_46.2: = bound_method %int_2.loc12, %impl.elem0.loc12_46.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc12_46.2: = specific_function %bound_method.loc12_46.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc12_46.2: init %i32 = call %specific_fn.loc12_46.2(%int_2.loc12) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc12_46.3: = bound_method %int_2.loc12, %impl.elem0.loc12_46.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc12_46.2: = specific_function %impl.elem0.loc12_46.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_46.4: = bound_method %int_2.loc12, %specific_fn.loc12_46.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc12_46.2: init %i32 = call %bound_method.loc12_46.4(%int_2.loc12) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc12_46.5: init %i32 = converted %int_2.loc12, %int.convert_checked.loc12_46.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc12_46.6: ref %i32 = struct_access %s.var, element1 // CHECK:STDOUT: %.loc12_46.7: init %i32 = initialize_from %.loc12_46.5 to %.loc12_46.6 [concrete = constants.%int_2.ef8] @@ -164,15 +167,17 @@ fn F() { // CHECK:STDOUT: %.loc18_28.1: %tuple.type.f94 = tuple_literal (%int_1.loc18, %int_2.loc18) // CHECK:STDOUT: %impl.elem0.loc18_28.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc18_28.1: = bound_method %int_1.loc18, %impl.elem0.loc18_28.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc18_28.1: = specific_function %bound_method.loc18_28.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc18_28.1: init %i32 = call %specific_fn.loc18_28.1(%int_1.loc18) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc18_28.1: = specific_function %impl.elem0.loc18_28.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc18_28.2: = bound_method %int_1.loc18, %specific_fn.loc18_28.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc18_28.1: init %i32 = call %bound_method.loc18_28.2(%int_1.loc18) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc18_28.2: init %i32 = converted %int_1.loc18, %int.convert_checked.loc18_28.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %tuple.elem0.loc18: ref %i32 = tuple_access %t.var, element0 // CHECK:STDOUT: %.loc18_28.3: init %i32 = initialize_from %.loc18_28.2 to %tuple.elem0.loc18 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc18_28.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc18_28.2: = bound_method %int_2.loc18, %impl.elem0.loc18_28.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc18_28.2: = specific_function %bound_method.loc18_28.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc18_28.2: init %i32 = call %specific_fn.loc18_28.2(%int_2.loc18) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc18_28.3: = bound_method %int_2.loc18, %impl.elem0.loc18_28.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc18_28.2: = specific_function %impl.elem0.loc18_28.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc18_28.4: = bound_method %int_2.loc18, %specific_fn.loc18_28.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc18_28.2: init %i32 = call %bound_method.loc18_28.4(%int_2.loc18) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc18_28.4: init %i32 = converted %int_2.loc18, %int.convert_checked.loc18_28.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %tuple.elem1.loc18: ref %i32 = tuple_access %t.var, element1 // CHECK:STDOUT: %.loc18_28.5: init %i32 = initialize_from %.loc18_28.4 to %tuple.elem1.loc18 [concrete = constants.%int_2.ef8] diff --git a/toolchain/check/testdata/pointer/basic.carbon b/toolchain/check/testdata/pointer/basic.carbon index 2c4cbcb96bc8..1e55a0881e66 100644 --- a/toolchain/check/testdata/pointer/basic.carbon +++ b/toolchain/check/testdata/pointer/basic.carbon @@ -31,7 +31,8 @@ fn F() -> i32 { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [concrete] // CHECK:STDOUT: } @@ -71,9 +72,10 @@ fn F() -> i32 { // CHECK:STDOUT: %n.var: ref %i32 = var n // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc12_3.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_3.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc12_3.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_3.2: init %i32 = converted %int_0, %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: assign %n.var, %.loc12_3.2 // CHECK:STDOUT: %.loc12_10: type = splice_block %i32.loc12 [concrete = constants.%i32] { diff --git a/toolchain/check/testdata/pointer/import.carbon b/toolchain/check/testdata/pointer/import.carbon index dbf6e59447ca..8d776b5ec9bb 100644 --- a/toolchain/check/testdata/pointer/import.carbon +++ b/toolchain/check/testdata/pointer/import.carbon @@ -35,7 +35,8 @@ var a: i32* = a_ref; // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [concrete] // CHECK:STDOUT: } @@ -83,9 +84,10 @@ var a: i32* = a_ref; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc4_1.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc4_1.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc4_1.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc4: init %i32 = converted %int_0, %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: assign file.%a_orig.var, %.loc4 // CHECK:STDOUT: %a_orig.ref: ref %i32 = name_ref a_orig, file.%a_orig diff --git a/toolchain/check/testdata/return/code_after_return_value.carbon b/toolchain/check/testdata/return/code_after_return_value.carbon index 4f327952986f..4c4b3f7302aa 100644 --- a/toolchain/check/testdata/return/code_after_return_value.carbon +++ b/toolchain/check/testdata/return/code_after_return_value.carbon @@ -38,7 +38,8 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b6e: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -82,9 +83,10 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc12_11.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_11.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc12_11.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_11.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_11.2: %i32 = converted %int_0, %.loc12_11.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: return %.loc12_11.2 diff --git a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon index 718b7647afa1..2c8f11416726 100644 --- a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon +++ b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon @@ -49,7 +49,8 @@ fn G() -> C { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b6e: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %C: type = class_type @C [concrete] @@ -61,10 +62,10 @@ fn G() -> C { // 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: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %C.val: %C = struct_value (%int_1.5d2, %int_2.ef8) [concrete] // CHECK:STDOUT: } @@ -135,9 +136,10 @@ fn G() -> C { // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc12_12.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_12.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc12_12.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_12.2: init %i32 = converted %int_0, %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: assign %v.var, %.loc12_12.2 // CHECK:STDOUT: %.loc12_19: type = splice_block %i32.loc12 [concrete = constants.%i32] { @@ -160,15 +162,17 @@ fn G() -> C { // CHECK:STDOUT: %.loc25_38.1: %struct_type.a.b.cfd = struct_literal (%int_1, %int_2) // CHECK:STDOUT: %impl.elem0.loc25_38.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc25_38.1: = bound_method %int_1, %impl.elem0.loc25_38.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc25_38.1: = specific_function %bound_method.loc25_38.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc25_38.1: init %i32 = call %specific_fn.loc25_38.1(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc25_38.1: = specific_function %impl.elem0.loc25_38.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc25_38.2: = bound_method %int_1, %specific_fn.loc25_38.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc25_38.1: init %i32 = call %bound_method.loc25_38.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc25_38.2: init %i32 = converted %int_1, %int.convert_checked.loc25_38.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc25_38.3: ref %i32 = class_element_access %return, element0 // CHECK:STDOUT: %.loc25_38.4: init %i32 = initialize_from %.loc25_38.2 to %.loc25_38.3 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc25_38.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc25_38.2: = bound_method %int_2, %impl.elem0.loc25_38.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc25_38.2: = specific_function %bound_method.loc25_38.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc25_38.2: init %i32 = call %specific_fn.loc25_38.2(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc25_38.3: = bound_method %int_2, %impl.elem0.loc25_38.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc25_38.2: = specific_function %impl.elem0.loc25_38.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc25_38.4: = bound_method %int_2, %specific_fn.loc25_38.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc25_38.2: init %i32 = call %bound_method.loc25_38.4(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc25_38.5: init %i32 = converted %int_2, %int.convert_checked.loc25_38.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc25_38.6: ref %i32 = class_element_access %return, element1 // CHECK:STDOUT: %.loc25_38.7: init %i32 = initialize_from %.loc25_38.5 to %.loc25_38.6 [concrete = constants.%int_2.ef8] diff --git a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon index 0e5c1e1fd0fb..ca4b214a640f 100644 --- a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon @@ -57,11 +57,12 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b6e: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %DifferentScopes.type: type = fn_type @DifferentScopes [concrete] // CHECK:STDOUT: %DifferentScopes: %DifferentScopes.type = struct_value () [concrete] @@ -116,9 +117,10 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %int_0.loc13: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0.loc13: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc13: = bound_method %int_0.loc13, %impl.elem0.loc13 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn.loc13: = specific_function %bound_method.loc13, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %specific_fn.loc13(%int_0.loc13) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc13_14.1: = bound_method %int_0.loc13, %impl.elem0.loc13 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc13: = specific_function %impl.elem0.loc13, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_14.2: = bound_method %int_0.loc13, %specific_fn.loc13 [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %bound_method.loc13_14.2(%int_0.loc13) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc13_14.2: init %i32 = converted %int_0.loc13, %int.convert_checked.loc13 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: assign %v.var, %.loc13_14.2 // CHECK:STDOUT: %.loc13_21: type = splice_block %i32.loc13 [concrete = constants.%i32] { @@ -133,9 +135,10 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: %w.var: ref %i32 = var w // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0.loc21: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc21: = bound_method %int_1, %impl.elem0.loc21 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc21: = specific_function %bound_method.loc21, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc21: init %i32 = call %specific_fn.loc21(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc21_14.1: = bound_method %int_1, %impl.elem0.loc21 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc21: = specific_function %impl.elem0.loc21, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc21_14.2: = bound_method %int_1, %specific_fn.loc21 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc21: init %i32 = call %bound_method.loc21_14.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc21_14.2: init %i32 = converted %int_1, %int.convert_checked.loc21 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: assign %w.var, %.loc21_14.2 // CHECK:STDOUT: %.loc21_21: type = splice_block %i32.loc21 [concrete = constants.%i32] { @@ -148,9 +151,10 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: !if.else: // CHECK:STDOUT: %int_0.loc23: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0.loc23: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc23: = bound_method %int_0.loc23, %impl.elem0.loc23 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn.loc23: = specific_function %bound_method.loc23, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc23: init %i32 = call %specific_fn.loc23(%int_0.loc23) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc23_11.1: = bound_method %int_0.loc23, %impl.elem0.loc23 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc23: = specific_function %impl.elem0.loc23, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc23_11.2: = bound_method %int_0.loc23, %specific_fn.loc23 [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked.loc23: init %i32 = call %bound_method.loc23_11.2(%int_0.loc23) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc23_11.1: %i32 = value_of_initializer %int.convert_checked.loc23 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc23_11.2: %i32 = converted %int_0.loc23, %.loc23_11.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: return %.loc23_11.2 @@ -169,9 +173,10 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %int_0.loc28: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0.loc28: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc28: = bound_method %int_0.loc28, %impl.elem0.loc28 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn.loc28: = specific_function %bound_method.loc28, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc28: init %i32 = call %specific_fn.loc28(%int_0.loc28) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc28_14.1: = bound_method %int_0.loc28, %impl.elem0.loc28 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc28: = specific_function %impl.elem0.loc28, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc28_14.2: = bound_method %int_0.loc28, %specific_fn.loc28 [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked.loc28: init %i32 = call %bound_method.loc28_14.2(%int_0.loc28) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc28_14.2: init %i32 = converted %int_0.loc28, %int.convert_checked.loc28 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: assign %v.var, %.loc28_14.2 // CHECK:STDOUT: %.loc28_21: type = splice_block %i32.loc28 [concrete = constants.%i32] { @@ -190,9 +195,10 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: %w.var: ref %i32 = var w // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0.loc37: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc37: = bound_method %int_1, %impl.elem0.loc37 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc37: = specific_function %bound_method.loc37, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc37: init %i32 = call %specific_fn.loc37(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc37_16.1: = bound_method %int_1, %impl.elem0.loc37 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc37: = specific_function %impl.elem0.loc37, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc37_16.2: = bound_method %int_1, %specific_fn.loc37 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc37: init %i32 = call %bound_method.loc37_16.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc37_16.2: init %i32 = converted %int_1, %int.convert_checked.loc37 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: assign %w.var, %.loc37_16.2 // CHECK:STDOUT: %.loc37_23: type = splice_block %i32.loc37 [concrete = constants.%i32] { @@ -208,9 +214,10 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: !if.else.loc27: // CHECK:STDOUT: %int_0.loc40: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0.loc40: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc40: = bound_method %int_0.loc40, %impl.elem0.loc40 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn.loc40: = specific_function %bound_method.loc40, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc40: init %i32 = call %specific_fn.loc40(%int_0.loc40) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc40_11.1: = bound_method %int_0.loc40, %impl.elem0.loc40 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc40: = specific_function %impl.elem0.loc40, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc40_11.2: = bound_method %int_0.loc40, %specific_fn.loc40 [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked.loc40: init %i32 = call %bound_method.loc40_11.2(%int_0.loc40) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc40_11.1: %i32 = value_of_initializer %int.convert_checked.loc40 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc40_11.2: %i32 = converted %int_0.loc40, %.loc40_11.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: return %.loc40_11.2 diff --git a/toolchain/check/testdata/return/returned_var.carbon b/toolchain/check/testdata/return/returned_var.carbon index ca05aaea6a98..6091073c5104 100644 --- a/toolchain/check/testdata/return/returned_var.carbon +++ b/toolchain/check/testdata/return/returned_var.carbon @@ -45,17 +45,18 @@ fn G() -> i32 { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %C.val: %C = struct_value (%int_1.5d2, %int_2.ef8) [concrete] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b6e: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -127,15 +128,17 @@ fn G() -> i32 { // CHECK:STDOUT: %.loc17_43.1: %struct_type.a.b.cfd = struct_literal (%int_1, %int_2) // CHECK:STDOUT: %impl.elem0.loc17_43.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc17_43.1: = bound_method %int_1, %impl.elem0.loc17_43.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc17_43.1: = specific_function %bound_method.loc17_43.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc17_43.1: init %i32 = call %specific_fn.loc17_43.1(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc17_43.1: = specific_function %impl.elem0.loc17_43.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc17_43.2: = bound_method %int_1, %specific_fn.loc17_43.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc17_43.1: init %i32 = call %bound_method.loc17_43.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc17_43.2: init %i32 = converted %int_1, %int.convert_checked.loc17_43.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc17_43.3: ref %i32 = class_element_access %return, element0 // CHECK:STDOUT: %.loc17_43.4: init %i32 = initialize_from %.loc17_43.2 to %.loc17_43.3 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc17_43.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc17_43.2: = bound_method %int_2, %impl.elem0.loc17_43.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc17_43.2: = specific_function %bound_method.loc17_43.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc17_43.2: init %i32 = call %specific_fn.loc17_43.2(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc17_43.3: = bound_method %int_2, %impl.elem0.loc17_43.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc17_43.2: = specific_function %impl.elem0.loc17_43.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc17_43.4: = bound_method %int_2, %specific_fn.loc17_43.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc17_43.2: init %i32 = call %bound_method.loc17_43.4(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc17_43.5: init %i32 = converted %int_2, %int.convert_checked.loc17_43.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc17_43.6: ref %i32 = class_element_access %return, element1 // CHECK:STDOUT: %.loc17_43.7: init %i32 = initialize_from %.loc17_43.5 to %.loc17_43.6 [concrete = constants.%int_2.ef8] @@ -156,9 +159,10 @@ fn G() -> i32 { // CHECK:STDOUT: %result.var: ref %i32 = var result // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc22_12.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc22_12.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc22_12.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc22_12.2: init %i32 = converted %int_0, %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: assign %result.var, %.loc22_12.2 // CHECK:STDOUT: %.loc22_24: type = splice_block %i32.loc22 [concrete = constants.%i32] { diff --git a/toolchain/check/testdata/return/returned_var_scope.carbon b/toolchain/check/testdata/return/returned_var_scope.carbon index fd90d611a0f8..88076e4bc913 100644 --- a/toolchain/check/testdata/return/returned_var_scope.carbon +++ b/toolchain/check/testdata/return/returned_var_scope.carbon @@ -44,11 +44,12 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b6e: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] @@ -115,9 +116,10 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %int_0.loc13: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0.loc13: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc13: = bound_method %int_0.loc13, %impl.elem0.loc13 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn.loc13: = specific_function %bound_method.loc13, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %specific_fn.loc13(%int_0.loc13) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc13_14.1: = bound_method %int_0.loc13, %impl.elem0.loc13 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc13: = specific_function %impl.elem0.loc13, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_14.2: = bound_method %int_0.loc13, %specific_fn.loc13 [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %bound_method.loc13_14.2(%int_0.loc13) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc13_14.2: init %i32 = converted %int_0.loc13, %int.convert_checked.loc13 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: assign %v.var, %.loc13_14.2 // CHECK:STDOUT: %.loc13_21: type = splice_block %i32.loc13 [concrete = constants.%i32] { @@ -139,9 +141,10 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %w.var: ref %i32 = var w // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0.loc16: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc16: = bound_method %int_1, %impl.elem0.loc16 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc16: = specific_function %bound_method.loc16, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %specific_fn.loc16(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc16_14.1: = bound_method %int_1, %impl.elem0.loc16 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc16: = specific_function %impl.elem0.loc16, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc16_14.2: = bound_method %int_1, %specific_fn.loc16 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %bound_method.loc16_14.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc16_14.2: init %i32 = converted %int_1, %int.convert_checked.loc16 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: assign %w.var, %.loc16_14.2 // CHECK:STDOUT: %.loc16_21: type = splice_block %i32.loc16 [concrete = constants.%i32] { @@ -154,9 +157,10 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: !if.else.loc15: // CHECK:STDOUT: %int_0.loc18: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0.loc18: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc18: = bound_method %int_0.loc18, %impl.elem0.loc18 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn.loc18: = specific_function %bound_method.loc18, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %specific_fn.loc18(%int_0.loc18) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc18_11.1: = bound_method %int_0.loc18, %impl.elem0.loc18 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc18: = specific_function %impl.elem0.loc18, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc18_11.2: = bound_method %int_0.loc18, %specific_fn.loc18 [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %bound_method.loc18_11.2(%int_0.loc18) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc18_11.1: %i32 = value_of_initializer %int.convert_checked.loc18 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc18_11.2: %i32 = converted %int_0.loc18, %.loc18_11.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: return %.loc18_11.2 @@ -175,9 +179,10 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0.loc23: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc23: = bound_method %int_0, %impl.elem0.loc23 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn.loc23: = specific_function %bound_method.loc23, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc23: init %i32 = call %specific_fn.loc23(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc23_14.1: = bound_method %int_0, %impl.elem0.loc23 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc23: = specific_function %impl.elem0.loc23, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc23_14.2: = bound_method %int_0, %specific_fn.loc23 [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked.loc23: init %i32 = call %bound_method.loc23_14.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc23_14.2: init %i32 = converted %int_0, %int.convert_checked.loc23 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: assign %v.var, %.loc23_14.2 // CHECK:STDOUT: %.loc23_21: type = splice_block %i32.loc23 [concrete = constants.%i32] { @@ -196,9 +201,10 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %w.var: ref %i32 = var w // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0.loc26: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc26: = bound_method %int_1, %impl.elem0.loc26 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc26: = specific_function %bound_method.loc26, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc26: init %i32 = call %specific_fn.loc26(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc26_12.1: = bound_method %int_1, %impl.elem0.loc26 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc26: = specific_function %impl.elem0.loc26, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc26_12.2: = bound_method %int_1, %specific_fn.loc26 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc26: init %i32 = call %bound_method.loc26_12.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc26_12.2: init %i32 = converted %int_1, %int.convert_checked.loc26 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: assign %w.var, %.loc26_12.2 // CHECK:STDOUT: %.loc26_19: type = splice_block %i32.loc26 [concrete = constants.%i32] { diff --git a/toolchain/check/testdata/return/struct.carbon b/toolchain/check/testdata/return/struct.carbon index cca4c6c794c4..0daa19c66bd7 100644 --- a/toolchain/check/testdata/return/struct.carbon +++ b/toolchain/check/testdata/return/struct.carbon @@ -30,7 +30,8 @@ fn Main() -> {.a: i32} { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_3.1ba, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_3.1ba, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %struct: %struct_type.a.ba9 = struct_value (%int_3.822) [concrete] // CHECK:STDOUT: } @@ -67,9 +68,10 @@ fn Main() -> {.a: i32} { // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %.loc12_17.1: %struct_type.a.a6c = struct_literal (%int_3) // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_3, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_3) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %bound_method.loc12_17.1: = bound_method %int_3, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_17.2: = bound_method %int_3, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc12_17.2(%int_3) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc12_17.2: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc12_17.3: %i32 = converted %int_3, %.loc12_17.2 [concrete = constants.%int_3.822] // CHECK:STDOUT: %struct: %struct_type.a.ba9 = struct_value (%.loc12_17.3) [concrete = constants.%struct] diff --git a/toolchain/check/testdata/return/tuple.carbon b/toolchain/check/testdata/return/tuple.carbon index f6721fb37528..4ab6225dd3c0 100644 --- a/toolchain/check/testdata/return/tuple.carbon +++ b/toolchain/check/testdata/return/tuple.carbon @@ -33,10 +33,11 @@ fn Main() -> (i32, i32) { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.75f: = bound_method %int_15.447, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.c46: = specific_function %Convert.bound.75f, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.984: = bound_method %int_15.447, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_15.7f7: %i32 = int_value 15 [concrete] // CHECK:STDOUT: %Convert.bound.76a: = bound_method %int_35.c79, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.9b5: = specific_function %Convert.bound.76a, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.231: = bound_method %int_35.c79, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_35.c78: %i32 = int_value 35 [concrete] // CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%int_15.7f7, %int_35.c78) [concrete] // CHECK:STDOUT: } @@ -78,15 +79,17 @@ fn Main() -> (i32, i32) { // CHECK:STDOUT: %.loc13_17.1: %tuple.type.f94 = tuple_literal (%int_15, %int_35) // CHECK:STDOUT: %impl.elem0.loc13_17.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc13_17.1: = bound_method %int_15, %impl.elem0.loc13_17.1 [concrete = constants.%Convert.bound.75f] -// CHECK:STDOUT: %specific_fn.loc13_17.1: = specific_function %bound_method.loc13_17.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.c46] -// CHECK:STDOUT: %int.convert_checked.loc13_17.1: init %i32 = call %specific_fn.loc13_17.1(%int_15) [concrete = constants.%int_15.7f7] +// CHECK:STDOUT: %specific_fn.loc13_17.1: = specific_function %impl.elem0.loc13_17.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_17.2: = bound_method %int_15, %specific_fn.loc13_17.1 [concrete = constants.%bound_method.984] +// CHECK:STDOUT: %int.convert_checked.loc13_17.1: init %i32 = call %bound_method.loc13_17.2(%int_15) [concrete = constants.%int_15.7f7] // CHECK:STDOUT: %.loc13_17.2: init %i32 = converted %int_15, %int.convert_checked.loc13_17.1 [concrete = constants.%int_15.7f7] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %return, element0 // CHECK:STDOUT: %.loc13_17.3: init %i32 = initialize_from %.loc13_17.2 to %tuple.elem0 [concrete = constants.%int_15.7f7] // CHECK:STDOUT: %impl.elem0.loc13_17.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc13_17.2: = bound_method %int_35, %impl.elem0.loc13_17.2 [concrete = constants.%Convert.bound.76a] -// CHECK:STDOUT: %specific_fn.loc13_17.2: = specific_function %bound_method.loc13_17.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.9b5] -// CHECK:STDOUT: %int.convert_checked.loc13_17.2: init %i32 = call %specific_fn.loc13_17.2(%int_35) [concrete = constants.%int_35.c78] +// CHECK:STDOUT: %bound_method.loc13_17.3: = bound_method %int_35, %impl.elem0.loc13_17.2 [concrete = constants.%Convert.bound.76a] +// CHECK:STDOUT: %specific_fn.loc13_17.2: = specific_function %impl.elem0.loc13_17.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_17.4: = bound_method %int_35, %specific_fn.loc13_17.2 [concrete = constants.%bound_method.231] +// CHECK:STDOUT: %int.convert_checked.loc13_17.2: init %i32 = call %bound_method.loc13_17.4(%int_35) [concrete = constants.%int_35.c78] // CHECK:STDOUT: %.loc13_17.4: init %i32 = converted %int_35, %int.convert_checked.loc13_17.2 [concrete = constants.%int_35.c78] // CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access %return, element1 // CHECK:STDOUT: %.loc13_17.5: init %i32 = initialize_from %.loc13_17.4 to %tuple.elem1 [concrete = constants.%int_35.c78] diff --git a/toolchain/check/testdata/return/value.carbon b/toolchain/check/testdata/return/value.carbon index 676e55c1ce5a..a8fe05ed31e5 100644 --- a/toolchain/check/testdata/return/value.carbon +++ b/toolchain/check/testdata/return/value.carbon @@ -28,7 +28,8 @@ fn Main() -> i32 { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -62,9 +63,10 @@ fn Main() -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc12_11.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_11.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc12_11.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_11.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_11.2: %i32 = converted %int_0, %.loc12_11.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: return %.loc12_11.2 diff --git a/toolchain/check/testdata/struct/fail_non_member_access.carbon b/toolchain/check/testdata/struct/fail_non_member_access.carbon index c4da54198f93..7b0e9937b5dc 100644 --- a/toolchain/check/testdata/struct/fail_non_member_access.carbon +++ b/toolchain/check/testdata/struct/fail_non_member_access.carbon @@ -31,7 +31,8 @@ var y: i32 = x.b; // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_4.0c1, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_4.0c1, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete] // CHECK:STDOUT: %struct: %struct_type.a.ba9 = struct_value (%int_4.940) [concrete] // CHECK:STDOUT: } @@ -80,9 +81,10 @@ var y: i32 = x.b; // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1] // CHECK:STDOUT: %.loc11_27.1: %struct_type.a.a6c = struct_literal (%int_4) // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_4, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_4) [concrete = constants.%int_4.940] +// CHECK:STDOUT: %bound_method.loc11_27.1: = bound_method %int_4, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_27.2: = bound_method %int_4, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc11_27.2(%int_4) [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_4, %int.convert_checked [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc11_27.3: init %struct_type.a.ba9 = struct_init (%.loc11_27.2) to file.%x.var [concrete = constants.%struct] // CHECK:STDOUT: %.loc11_1: init %struct_type.a.ba9 = converted %.loc11_27.1, %.loc11_27.3 [concrete = constants.%struct] diff --git a/toolchain/check/testdata/struct/import.carbon b/toolchain/check/testdata/struct/import.carbon index 14fb6631bb8e..3817638a3458 100644 --- a/toolchain/check/testdata/struct/import.carbon +++ b/toolchain/check/testdata/struct/import.carbon @@ -68,7 +68,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b6e: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %struct.92d: %struct_type.a.ba9 = struct_value (%int_0.6a9) [concrete] // CHECK:STDOUT: %tuple.type.85c: type = tuple_type (type) [concrete] @@ -93,10 +94,10 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // 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: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %struct.ed5: %struct_type.a.b.501 = struct_value (%int_1.5d2, %int_2.ef8) [concrete] // CHECK:STDOUT: %C.c8f: type = class_type @C, @C(%struct.ed5) [concrete] @@ -173,14 +174,16 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %.loc9_28.1: %struct_type.a.b.cfd = struct_literal (%int_1, %int_2) // CHECK:STDOUT: %impl.elem0.loc9_28.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc9_28.1: = bound_method %int_1, %impl.elem0.loc9_28.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc9_28.1: = specific_function %bound_method.loc9_28.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc9_28.1: init %i32 = call %specific_fn.loc9_28.1(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc9_28.1: = specific_function %impl.elem0.loc9_28.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_28.2: = bound_method %int_1, %specific_fn.loc9_28.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc9_28.1: init %i32 = call %bound_method.loc9_28.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc9_28.2: %i32 = value_of_initializer %int.convert_checked.loc9_28.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc9_28.3: %i32 = converted %int_1, %.loc9_28.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc9_28.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc9_28.2: = bound_method %int_2, %impl.elem0.loc9_28.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc9_28.2: = specific_function %bound_method.loc9_28.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc9_28.2: init %i32 = call %specific_fn.loc9_28.2(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc9_28.3: = bound_method %int_2, %impl.elem0.loc9_28.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc9_28.2: = specific_function %impl.elem0.loc9_28.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_28.4: = bound_method %int_2, %specific_fn.loc9_28.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc9_28.2: init %i32 = call %bound_method.loc9_28.4(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc9_28.4: %i32 = value_of_initializer %int.convert_checked.loc9_28.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc9_28.5: %i32 = converted %int_2, %.loc9_28.4 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %struct: %struct_type.a.b.501 = struct_value (%.loc9_28.3, %.loc9_28.5) [concrete = constants.%struct.ed5] @@ -213,9 +216,10 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %int_0.loc4: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %.loc4_31.1: %struct_type.a.a6c = struct_literal (%int_0.loc4) // CHECK:STDOUT: %impl.elem0.loc4: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc4: = bound_method %int_0.loc4, %impl.elem0.loc4 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn.loc4: = specific_function %bound_method.loc4, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc4: init %i32 = call %specific_fn.loc4(%int_0.loc4) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc4_31.1: = bound_method %int_0.loc4, %impl.elem0.loc4 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc4: = specific_function %impl.elem0.loc4, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc4_31.2: = bound_method %int_0.loc4, %specific_fn.loc4 [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked.loc4: init %i32 = call %bound_method.loc4_31.2(%int_0.loc4) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc4_31.2: init %i32 = converted %int_0.loc4, %int.convert_checked.loc4 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc4_31.3: init %struct_type.a.ba9 = struct_init (%.loc4_31.2) to file.%a_ref.var [concrete = constants.%struct.92d] // CHECK:STDOUT: %.loc4_1: init %struct_type.a.ba9 = converted %.loc4_31.1, %.loc4_31.3 [concrete = constants.%struct.92d] @@ -227,17 +231,19 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %int_0.loc6_37: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %.loc6_38.1: %struct_type.a.d.b82 = struct_literal (%.loc6_29.1, %int_0.loc6_37) // CHECK:STDOUT: %impl.elem0.loc6_29: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc6_29: = bound_method %int_0.loc6_17, %impl.elem0.loc6_29 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn.loc6_29: = specific_function %bound_method.loc6_29, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc6_29: init %i32 = call %specific_fn.loc6_29(%int_0.loc6_17) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc6_29.1: = bound_method %int_0.loc6_17, %impl.elem0.loc6_29 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc6_29: = specific_function %impl.elem0.loc6_29, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_29.2: = bound_method %int_0.loc6_17, %specific_fn.loc6_29 [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked.loc6_29: init %i32 = call %bound_method.loc6_29.2(%int_0.loc6_17) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_29.2: init %i32 = converted %int_0.loc6_17, %int.convert_checked.loc6_29 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_38.2: ref %struct_type.b.c.929 = struct_access file.%b_ref.var, element0 // CHECK:STDOUT: %.loc6_29.3: ref %i32 = struct_access %.loc6_38.2, element0 // CHECK:STDOUT: %.loc6_29.4: init %i32 = initialize_from %.loc6_29.2 to %.loc6_29.3 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %impl.elem0.loc6_28: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc6_28: = bound_method %int_0.loc6_26, %impl.elem0.loc6_28 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn.loc6_28: = specific_function %bound_method.loc6_28, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc6_28: init %i32 = call %specific_fn.loc6_28(%int_0.loc6_26) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc6_28.1: = bound_method %int_0.loc6_26, %impl.elem0.loc6_28 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc6_28: = specific_function %impl.elem0.loc6_28, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_28.2: = bound_method %int_0.loc6_26, %specific_fn.loc6_28 [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked.loc6_28: init %i32 = call %bound_method.loc6_28.2(%int_0.loc6_26) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_28.2: init %i32 = converted %int_0.loc6_26, %int.convert_checked.loc6_28 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_29.5: ref %tuple.type.a1c = struct_access %.loc6_38.2, element1 // CHECK:STDOUT: %.loc6_28.3: init %tuple.type.a1c = tuple_init (%.loc6_28.2) to %.loc6_29.5 [concrete = constants.%tuple] @@ -246,9 +252,10 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %.loc6_29.8: init %struct_type.b.c.929 = struct_init (%.loc6_29.4, %.loc6_29.7) to %.loc6_38.2 [concrete = constants.%struct.381] // CHECK:STDOUT: %.loc6_38.3: init %struct_type.b.c.929 = converted %.loc6_29.1, %.loc6_29.8 [concrete = constants.%struct.381] // CHECK:STDOUT: %impl.elem0.loc6_38: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc6_38: = bound_method %int_0.loc6_37, %impl.elem0.loc6_38 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn.loc6_38: = specific_function %bound_method.loc6_38, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc6_38: init %i32 = call %specific_fn.loc6_38(%int_0.loc6_37) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc6_38.1: = bound_method %int_0.loc6_37, %impl.elem0.loc6_38 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc6_38: = specific_function %impl.elem0.loc6_38, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_38.2: = bound_method %int_0.loc6_37, %specific_fn.loc6_38 [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked.loc6_38: init %i32 = call %bound_method.loc6_38.2(%int_0.loc6_37) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_38.4: init %i32 = converted %int_0.loc6_37, %int.convert_checked.loc6_38 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_38.5: ref %i32 = struct_access file.%b_ref.var, element1 // CHECK:STDOUT: %.loc6_38.6: init %i32 = initialize_from %.loc6_38.4 to %.loc6_38.5 [concrete = constants.%int_0.6a9] @@ -296,10 +303,11 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.b9e = facet_value Core.IntLiteral, %impl_witness.847 [concrete] // CHECK:STDOUT: %.088: type = fn_type_with_self_type %Convert.type.ea0, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.dc5: = bound_method %int_1.5b8, %Convert.4cb [concrete] -// CHECK:STDOUT: %Convert.specific_fn.51b: = specific_function %Convert.bound.dc5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.4cb, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.c37: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.47b: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.30f: = bound_method %int_2.ecc, %Convert.4cb [concrete] -// CHECK:STDOUT: %Convert.specific_fn.9b5: = specific_function %Convert.bound.30f, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.62b: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.d0d: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %struct: %struct_type.a.b.5ca = struct_value (%int_1.47b, %int_2.d0d) [concrete] // CHECK:STDOUT: %C.a8a: type = class_type @C, @C(%struct) [concrete] @@ -320,7 +328,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: } // CHECK:STDOUT: %Implicit.import_ref.c81: %struct_type.a.b.5ca = import_ref Implicit//default, loc8_9, loaded [symbolic = @C.%S (constants.%S)] // CHECK:STDOUT: %Implicit.import_ref.8f2: = import_ref Implicit//default, loc8_34, loaded [concrete = constants.%complete_type.357] -// CHECK:STDOUT: %Implicit.import_ref.b8b = import_ref Implicit//default, inst1150 [no loc], unloaded +// CHECK:STDOUT: %Implicit.import_ref.b8b = import_ref Implicit//default, inst1155 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -378,14 +386,16 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %.loc6_25.1: %struct_type.a.b.cfd = struct_literal (%int_1, %int_2) // CHECK:STDOUT: %impl.elem0.loc6_25.1: %.088 = impl_witness_access constants.%impl_witness.847, element0 [concrete = constants.%Convert.4cb] // CHECK:STDOUT: %bound_method.loc6_25.1: = bound_method %int_1, %impl.elem0.loc6_25.1 [concrete = constants.%Convert.bound.dc5] -// CHECK:STDOUT: %specific_fn.loc6_25.1: = specific_function %bound_method.loc6_25.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.51b] -// CHECK:STDOUT: %int.convert_checked.loc6_25.1: init %i32 = call %specific_fn.loc6_25.1(%int_1) [concrete = constants.%int_1.47b] +// CHECK:STDOUT: %specific_fn.loc6_25.1: = specific_function %impl.elem0.loc6_25.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_25.2: = bound_method %int_1, %specific_fn.loc6_25.1 [concrete = constants.%bound_method.c37] +// CHECK:STDOUT: %int.convert_checked.loc6_25.1: init %i32 = call %bound_method.loc6_25.2(%int_1) [concrete = constants.%int_1.47b] // CHECK:STDOUT: %.loc6_25.2: %i32 = value_of_initializer %int.convert_checked.loc6_25.1 [concrete = constants.%int_1.47b] // CHECK:STDOUT: %.loc6_25.3: %i32 = converted %int_1, %.loc6_25.2 [concrete = constants.%int_1.47b] // CHECK:STDOUT: %impl.elem0.loc6_25.2: %.088 = impl_witness_access constants.%impl_witness.847, element0 [concrete = constants.%Convert.4cb] -// CHECK:STDOUT: %bound_method.loc6_25.2: = bound_method %int_2, %impl.elem0.loc6_25.2 [concrete = constants.%Convert.bound.30f] -// CHECK:STDOUT: %specific_fn.loc6_25.2: = specific_function %bound_method.loc6_25.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.9b5] -// CHECK:STDOUT: %int.convert_checked.loc6_25.2: init %i32 = call %specific_fn.loc6_25.2(%int_2) [concrete = constants.%int_2.d0d] +// CHECK:STDOUT: %bound_method.loc6_25.3: = bound_method %int_2, %impl.elem0.loc6_25.2 [concrete = constants.%Convert.bound.30f] +// CHECK:STDOUT: %specific_fn.loc6_25.2: = specific_function %impl.elem0.loc6_25.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_25.4: = bound_method %int_2, %specific_fn.loc6_25.2 [concrete = constants.%bound_method.62b] +// CHECK:STDOUT: %int.convert_checked.loc6_25.2: init %i32 = call %bound_method.loc6_25.4(%int_2) [concrete = constants.%int_2.d0d] // CHECK:STDOUT: %.loc6_25.4: %i32 = value_of_initializer %int.convert_checked.loc6_25.2 [concrete = constants.%int_2.d0d] // CHECK:STDOUT: %.loc6_25.5: %i32 = converted %int_2, %.loc6_25.4 [concrete = constants.%int_2.d0d] // CHECK:STDOUT: %struct: %struct_type.a.b.5ca = struct_value (%.loc6_25.3, %.loc6_25.5) [concrete = constants.%struct] @@ -495,7 +505,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: } // CHECK:STDOUT: %Implicit.import_ref.c81: %struct_type.a.b = import_ref Implicit//default, loc8_9, loaded [symbolic = @C.%S (constants.%S)] // CHECK:STDOUT: %Implicit.import_ref.8f2: = import_ref Implicit//default, loc8_34, loaded [concrete = constants.%complete_type.357] -// CHECK:STDOUT: %Implicit.import_ref.b8b = import_ref Implicit//default, inst1150 [no loc], unloaded +// CHECK:STDOUT: %Implicit.import_ref.b8b = import_ref Implicit//default, inst1155 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -584,10 +594,11 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.b9e = facet_value Core.IntLiteral, %impl_witness.847 [concrete] // CHECK:STDOUT: %.088: type = fn_type_with_self_type %Convert.type.ea0, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.a00: = bound_method %int_3.1ba, %Convert.4cb [concrete] -// CHECK:STDOUT: %Convert.specific_fn.dec: = specific_function %Convert.bound.a00, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.4cb, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.fc5: = bound_method %int_3.1ba, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.d47: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %Convert.bound.694: = bound_method %int_4.0c1, %Convert.4cb [concrete] -// CHECK:STDOUT: %Convert.specific_fn.739: = specific_function %Convert.bound.694, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b6e: = bound_method %int_4.0c1, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_4.ea3: %i32 = int_value 4 [concrete] // CHECK:STDOUT: %struct.8e6: %struct_type.a.b.5ca = struct_value (%int_3.d47, %int_4.ea3) [concrete] // CHECK:STDOUT: %C.5a7: type = class_type @C, @C(%struct.8e6) [concrete] @@ -611,7 +622,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: } // CHECK:STDOUT: %Implicit.import_ref.c81: %struct_type.a.b.5ca = import_ref Implicit//default, loc8_9, loaded [symbolic = @C.%S (constants.%S)] // CHECK:STDOUT: %Implicit.import_ref.8f2: = import_ref Implicit//default, loc8_34, loaded [concrete = constants.%complete_type.357] -// CHECK:STDOUT: %Implicit.import_ref.b8b = import_ref Implicit//default, inst1150 [no loc], unloaded +// CHECK:STDOUT: %Implicit.import_ref.b8b = import_ref Implicit//default, inst1155 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -638,14 +649,16 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %.loc10_29.1: %struct_type.a.b.cfd = struct_literal (%int_3, %int_4) // CHECK:STDOUT: %impl.elem0.loc10_29.1: %.088 = impl_witness_access constants.%impl_witness.847, element0 [concrete = constants.%Convert.4cb] // CHECK:STDOUT: %bound_method.loc10_29.1: = bound_method %int_3, %impl.elem0.loc10_29.1 [concrete = constants.%Convert.bound.a00] -// CHECK:STDOUT: %specific_fn.loc10_29.1: = specific_function %bound_method.loc10_29.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.dec] -// CHECK:STDOUT: %int.convert_checked.loc10_29.1: init %i32 = call %specific_fn.loc10_29.1(%int_3) [concrete = constants.%int_3.d47] +// CHECK:STDOUT: %specific_fn.loc10_29.1: = specific_function %impl.elem0.loc10_29.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_29.2: = bound_method %int_3, %specific_fn.loc10_29.1 [concrete = constants.%bound_method.fc5] +// CHECK:STDOUT: %int.convert_checked.loc10_29.1: init %i32 = call %bound_method.loc10_29.2(%int_3) [concrete = constants.%int_3.d47] // CHECK:STDOUT: %.loc10_29.2: %i32 = value_of_initializer %int.convert_checked.loc10_29.1 [concrete = constants.%int_3.d47] // CHECK:STDOUT: %.loc10_29.3: %i32 = converted %int_3, %.loc10_29.2 [concrete = constants.%int_3.d47] // CHECK:STDOUT: %impl.elem0.loc10_29.2: %.088 = impl_witness_access constants.%impl_witness.847, element0 [concrete = constants.%Convert.4cb] -// CHECK:STDOUT: %bound_method.loc10_29.2: = bound_method %int_4, %impl.elem0.loc10_29.2 [concrete = constants.%Convert.bound.694] -// CHECK:STDOUT: %specific_fn.loc10_29.2: = specific_function %bound_method.loc10_29.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.739] -// CHECK:STDOUT: %int.convert_checked.loc10_29.2: init %i32 = call %specific_fn.loc10_29.2(%int_4) [concrete = constants.%int_4.ea3] +// CHECK:STDOUT: %bound_method.loc10_29.3: = bound_method %int_4, %impl.elem0.loc10_29.2 [concrete = constants.%Convert.bound.694] +// CHECK:STDOUT: %specific_fn.loc10_29.2: = specific_function %impl.elem0.loc10_29.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_29.4: = bound_method %int_4, %specific_fn.loc10_29.2 [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked.loc10_29.2: init %i32 = call %bound_method.loc10_29.4(%int_4) [concrete = constants.%int_4.ea3] // CHECK:STDOUT: %.loc10_29.4: %i32 = value_of_initializer %int.convert_checked.loc10_29.2 [concrete = constants.%int_4.ea3] // CHECK:STDOUT: %.loc10_29.5: %i32 = converted %int_4, %.loc10_29.4 [concrete = constants.%int_4.ea3] // CHECK:STDOUT: %struct: %struct_type.a.b.5ca = struct_value (%.loc10_29.3, %.loc10_29.5) [concrete = constants.%struct.8e6] diff --git a/toolchain/check/testdata/struct/member_access.carbon b/toolchain/check/testdata/struct/member_access.carbon index 1495e6a4ba29..3a9145a48ace 100644 --- a/toolchain/check/testdata/struct/member_access.carbon +++ b/toolchain/check/testdata/struct/member_access.carbon @@ -32,7 +32,8 @@ var z: i32 = y; // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %struct: %struct_type.a.b.ddf = struct_value (%float, %int_1.5d2) [concrete] // CHECK:STDOUT: } @@ -100,9 +101,10 @@ var z: i32 = y; // CHECK:STDOUT: %.loc11_46.2: ref f64 = struct_access file.%x.var, element0 // CHECK:STDOUT: %.loc11_46.3: init f64 = initialize_from %float to %.loc11_46.2 [concrete = constants.%float] // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc11_46.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_46.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc11_46.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_46.4: init %i32 = converted %int_1, %int.convert_checked [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_46.5: ref %i32 = struct_access file.%x.var, element1 // CHECK:STDOUT: %.loc11_46.6: init %i32 = initialize_from %.loc11_46.4 to %.loc11_46.5 [concrete = constants.%int_1.5d2] diff --git a/toolchain/check/testdata/struct/one_entry.carbon b/toolchain/check/testdata/struct/one_entry.carbon index 796108c18ca0..15ab1c6231c0 100644 --- a/toolchain/check/testdata/struct/one_entry.carbon +++ b/toolchain/check/testdata/struct/one_entry.carbon @@ -27,7 +27,8 @@ var y: {.a: i32} = x; // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_4.0c1, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_4.0c1, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete] // CHECK:STDOUT: %struct: %struct_type.a.ba9 = struct_value (%int_4.940) [concrete] // CHECK:STDOUT: } @@ -77,9 +78,10 @@ var y: {.a: i32} = x; // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1] // CHECK:STDOUT: %.loc11_27.1: %struct_type.a.a6c = struct_literal (%int_4) // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_4, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_4) [concrete = constants.%int_4.940] +// CHECK:STDOUT: %bound_method.loc11_27.1: = bound_method %int_4, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_27.2: = bound_method %int_4, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc11_27.2(%int_4) [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_4, %int.convert_checked [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc11_27.3: init %struct_type.a.ba9 = struct_init (%.loc11_27.2) to file.%x.var [concrete = constants.%struct] // CHECK:STDOUT: %.loc11_1: init %struct_type.a.ba9 = converted %.loc11_27.1, %.loc11_27.3 [concrete = constants.%struct] diff --git a/toolchain/check/testdata/struct/partially_const.carbon b/toolchain/check/testdata/struct/partially_const.carbon index 03d52ce4dc3a..a282d310e6c3 100644 --- a/toolchain/check/testdata/struct/partially_const.carbon +++ b/toolchain/check/testdata/struct/partially_const.carbon @@ -30,7 +30,8 @@ fn Make(n: i32) -> {.a: i32, .b: i32, .c: i32} { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -81,17 +82,19 @@ fn Make(n: i32) -> {.a: i32, .b: i32, .c: i32} { // CHECK:STDOUT: %.loc12_33.1: %struct_type.a.b.c.1ee = struct_literal (%int_0.loc12_16, %n.ref, %int_0.loc12_32) // CHECK:STDOUT: %impl.elem0.loc12_33.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc12_33.1: = bound_method %int_0.loc12_16, %impl.elem0.loc12_33.1 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc12_33.1: = specific_function %bound_method.loc12_33.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc12_33.1: init %i32 = call %specific_fn.loc12_33.1(%int_0.loc12_16) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %specific_fn.loc12_33.1: = specific_function %impl.elem0.loc12_33.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_33.2: = bound_method %int_0.loc12_16, %specific_fn.loc12_33.1 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc12_33.1: init %i32 = call %bound_method.loc12_33.2(%int_0.loc12_16) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_33.2: init %i32 = converted %int_0.loc12_16, %int.convert_checked.loc12_33.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_33.3: ref %i32 = struct_access %return, element0 // CHECK:STDOUT: %.loc12_33.4: init %i32 = initialize_from %.loc12_33.2 to %.loc12_33.3 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_33.5: ref %i32 = struct_access %return, element1 // CHECK:STDOUT: %.loc12_33.6: init %i32 = initialize_from %n.ref to %.loc12_33.5 // CHECK:STDOUT: %impl.elem0.loc12_33.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc12_33.2: = bound_method %int_0.loc12_32, %impl.elem0.loc12_33.2 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc12_33.2: = specific_function %bound_method.loc12_33.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc12_33.2: init %i32 = call %specific_fn.loc12_33.2(%int_0.loc12_32) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc12_33.3: = bound_method %int_0.loc12_32, %impl.elem0.loc12_33.2 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc12_33.2: = specific_function %impl.elem0.loc12_33.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_33.4: = bound_method %int_0.loc12_32, %specific_fn.loc12_33.2 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc12_33.2: init %i32 = call %bound_method.loc12_33.4(%int_0.loc12_32) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_33.7: init %i32 = converted %int_0.loc12_32, %int.convert_checked.loc12_33.2 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12_33.8: ref %i32 = struct_access %return, element2 // CHECK:STDOUT: %.loc12_33.9: init %i32 = initialize_from %.loc12_33.7 to %.loc12_33.8 [concrete = constants.%int_0.6a9] diff --git a/toolchain/check/testdata/struct/tuple_as_element.carbon b/toolchain/check/testdata/struct/tuple_as_element.carbon index afa27a0f583d..f17b2b8f2238 100644 --- a/toolchain/check/testdata/struct/tuple_as_element.carbon +++ b/toolchain/check/testdata/struct/tuple_as_element.carbon @@ -31,10 +31,11 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%int_2.ef8) [concrete] // CHECK:STDOUT: %struct: %struct_type.a.b.3d5 = struct_value (%int_1.5d2, %tuple) [concrete] @@ -95,16 +96,18 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: %.loc11_49.1: %tuple.type.985 = tuple_literal (%int_2) // CHECK:STDOUT: %.loc11_50.1: %struct_type.a.b.057 = struct_literal (%int_1, %.loc11_49.1) // CHECK:STDOUT: %impl.elem0.loc11_50: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11_50: = bound_method %int_1, %impl.elem0.loc11_50 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc11_50: = specific_function %bound_method.loc11_50, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc11_50: init %i32 = call %specific_fn.loc11_50(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc11_50.1: = bound_method %int_1, %impl.elem0.loc11_50 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc11_50: = specific_function %impl.elem0.loc11_50, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_50.2: = bound_method %int_1, %specific_fn.loc11_50 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc11_50: init %i32 = call %bound_method.loc11_50.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_50.2: init %i32 = converted %int_1, %int.convert_checked.loc11_50 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_50.3: ref %i32 = struct_access file.%x.var, element0 // CHECK:STDOUT: %.loc11_50.4: init %i32 = initialize_from %.loc11_50.2 to %.loc11_50.3 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc11_49: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11_49: = bound_method %int_2, %impl.elem0.loc11_49 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc11_49: = specific_function %bound_method.loc11_49, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc11_49: init %i32 = call %specific_fn.loc11_49(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc11_49.1: = bound_method %int_2, %impl.elem0.loc11_49 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc11_49: = specific_function %impl.elem0.loc11_49, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_49.2: = bound_method %int_2, %specific_fn.loc11_49 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc11_49: init %i32 = call %bound_method.loc11_49.2(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc11_49.2: init %i32 = converted %int_2, %int.convert_checked.loc11_49 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc11_50.5: ref %tuple.type.a1c = struct_access file.%x.var, element1 // CHECK:STDOUT: %.loc11_49.3: init %tuple.type.a1c = tuple_init (%.loc11_49.2) to %.loc11_50.5 [concrete = constants.%tuple] diff --git a/toolchain/check/testdata/struct/two_entries.carbon b/toolchain/check/testdata/struct/two_entries.carbon index e3bc259dc996..e80daec8385c 100644 --- a/toolchain/check/testdata/struct/two_entries.carbon +++ b/toolchain/check/testdata/struct/two_entries.carbon @@ -31,10 +31,11 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %struct: %struct_type.a.b.501 = struct_value (%int_1.5d2, %int_2.ef8) [concrete] // CHECK:STDOUT: } @@ -69,14 +70,16 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0.loc11_44.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc11_44.1: = bound_method @__global_init.%int_1.loc11, %impl.elem0.loc11_44.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc11_44.1: = specific_function %bound_method.loc11_44.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc11_44.1: init %i32 = call %specific_fn.loc11_44.1(@__global_init.%int_1.loc11) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc11_44.1: = specific_function %impl.elem0.loc11_44.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_44.2: = bound_method @__global_init.%int_1.loc11, %specific_fn.loc11_44.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc11_44.1: init %i32 = call %bound_method.loc11_44.2(@__global_init.%int_1.loc11) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_44.1: %i32 = value_of_initializer %int.convert_checked.loc11_44.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc11_44.2: %i32 = converted @__global_init.%int_1.loc11, %.loc11_44.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc11_44.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11_44.2: = bound_method @__global_init.%int_2.loc11, %impl.elem0.loc11_44.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc11_44.2: = specific_function %bound_method.loc11_44.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc11_44.2: init %i32 = call %specific_fn.loc11_44.2(@__global_init.%int_2.loc11) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc11_44.3: = bound_method @__global_init.%int_2.loc11, %impl.elem0.loc11_44.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc11_44.2: = specific_function %impl.elem0.loc11_44.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_44.4: = bound_method @__global_init.%int_2.loc11, %specific_fn.loc11_44.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc11_44.2: init %i32 = call %bound_method.loc11_44.4(@__global_init.%int_2.loc11) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc11_44.3: %i32 = value_of_initializer %int.convert_checked.loc11_44.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc11_44.4: %i32 = converted @__global_init.%int_2.loc11, %.loc11_44.3 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %struct: %struct_type.a.b.501 = struct_value (%.loc11_44.2, %.loc11_44.4) [concrete = constants.%struct] @@ -132,15 +135,17 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: %.loc14_44.1: %struct_type.a.b.cfd = struct_literal (%int_1.loc14, %int_2.loc14) // CHECK:STDOUT: %impl.elem0.loc14_44.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc14_44.1: = bound_method %int_1.loc14, %impl.elem0.loc14_44.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc14_44.1: = specific_function %bound_method.loc14_44.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc14_44.1: init %i32 = call %specific_fn.loc14_44.1(%int_1.loc14) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc14_44.1: = specific_function %impl.elem0.loc14_44.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_44.2: = bound_method %int_1.loc14, %specific_fn.loc14_44.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc14_44.1: init %i32 = call %bound_method.loc14_44.2(%int_1.loc14) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_44.2: init %i32 = converted %int_1.loc14, %int.convert_checked.loc14_44.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_44.3: ref %i32 = struct_access file.%x.var, element0 // CHECK:STDOUT: %.loc14_44.4: init %i32 = initialize_from %.loc14_44.2 to %.loc14_44.3 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc14_44.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc14_44.2: = bound_method %int_2.loc14, %impl.elem0.loc14_44.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc14_44.2: = specific_function %bound_method.loc14_44.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc14_44.2: init %i32 = call %specific_fn.loc14_44.2(%int_2.loc14) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc14_44.3: = bound_method %int_2.loc14, %impl.elem0.loc14_44.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc14_44.2: = specific_function %impl.elem0.loc14_44.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_44.4: = bound_method %int_2.loc14, %specific_fn.loc14_44.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc14_44.2: init %i32 = call %bound_method.loc14_44.4(%int_2.loc14) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc14_44.5: init %i32 = converted %int_2.loc14, %int.convert_checked.loc14_44.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc14_44.6: ref %i32 = struct_access file.%x.var, element1 // CHECK:STDOUT: %.loc14_44.7: init %i32 = initialize_from %.loc14_44.5 to %.loc14_44.6 [concrete = constants.%int_2.ef8] diff --git a/toolchain/check/testdata/tuple/access/element_access.carbon b/toolchain/check/testdata/tuple/access/element_access.carbon index 6f1db14be642..2ccbcd130e5f 100644 --- a/toolchain/check/testdata/tuple/access/element_access.carbon +++ b/toolchain/check/testdata/tuple/access/element_access.carbon @@ -29,7 +29,8 @@ var c: i32 = b.0; // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_12.6a3, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_12.6a3, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [concrete] // CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%int_12.1e1) [concrete] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] @@ -93,9 +94,10 @@ var c: i32 = b.0; // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [concrete = constants.%int_12.6a3] // CHECK:STDOUT: %.loc11_21.1: %tuple.type.985 = tuple_literal (%int_12) // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_12, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_12) [concrete = constants.%int_12.1e1] +// CHECK:STDOUT: %bound_method.loc11_21.1: = bound_method %int_12, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_21.2: = bound_method %int_12, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc11_21.2(%int_12) [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %.loc11_21.2: init %i32 = converted %int_12, %int.convert_checked [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %.loc11_21.3: init %tuple.type.a1c = tuple_init (%.loc11_21.2) to file.%a.var [concrete = constants.%tuple] // CHECK:STDOUT: %.loc11_1: init %tuple.type.a1c = converted %.loc11_21.1, %.loc11_21.3 [concrete = constants.%tuple] diff --git a/toolchain/check/testdata/tuple/access/fail_access_error.carbon b/toolchain/check/testdata/tuple/access/fail_access_error.carbon index dbf509ebe703..f2416eed30e7 100644 --- a/toolchain/check/testdata/tuple/access/fail_access_error.carbon +++ b/toolchain/check/testdata/tuple/access/fail_access_error.carbon @@ -33,10 +33,11 @@ var b: i32 = a.(oops); // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.221: = bound_method %int_12.6a3, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.9a9: = specific_function %Convert.bound.221, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.dae: = bound_method %int_12.6a3, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [concrete] // CHECK:STDOUT: %Convert.bound.ce9: = bound_method %int_6.462, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.631: = specific_function %Convert.bound.ce9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.efa: = bound_method %int_6.462, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_6.e56: %i32 = int_value 6 [concrete] // CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%int_12.1e1, %int_6.e56) [concrete] // CHECK:STDOUT: } @@ -91,15 +92,17 @@ var b: i32 = a.(oops); // CHECK:STDOUT: %.loc11_27.1: %tuple.type.f94 = tuple_literal (%int_12, %int_6) // CHECK:STDOUT: %impl.elem0.loc11_27.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc11_27.1: = bound_method %int_12, %impl.elem0.loc11_27.1 [concrete = constants.%Convert.bound.221] -// CHECK:STDOUT: %specific_fn.loc11_27.1: = specific_function %bound_method.loc11_27.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.9a9] -// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %specific_fn.loc11_27.1(%int_12) [concrete = constants.%int_12.1e1] +// CHECK:STDOUT: %specific_fn.loc11_27.1: = specific_function %impl.elem0.loc11_27.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_27.2: = bound_method %int_12, %specific_fn.loc11_27.1 [concrete = constants.%bound_method.dae] +// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %bound_method.loc11_27.2(%int_12) [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_12, %int.convert_checked.loc11_27.1 [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 // CHECK:STDOUT: %.loc11_27.3: init %i32 = initialize_from %.loc11_27.2 to %tuple.elem0 [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %impl.elem0.loc11_27.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11_27.2: = bound_method %int_6, %impl.elem0.loc11_27.2 [concrete = constants.%Convert.bound.ce9] -// CHECK:STDOUT: %specific_fn.loc11_27.2: = specific_function %bound_method.loc11_27.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.631] -// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %specific_fn.loc11_27.2(%int_6) [concrete = constants.%int_6.e56] +// CHECK:STDOUT: %bound_method.loc11_27.3: = bound_method %int_6, %impl.elem0.loc11_27.2 [concrete = constants.%Convert.bound.ce9] +// CHECK:STDOUT: %specific_fn.loc11_27.2: = specific_function %impl.elem0.loc11_27.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_27.4: = bound_method %int_6, %specific_fn.loc11_27.2 [concrete = constants.%bound_method.efa] +// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %bound_method.loc11_27.4(%int_6) [concrete = constants.%int_6.e56] // CHECK:STDOUT: %.loc11_27.4: init %i32 = converted %int_6, %int.convert_checked.loc11_27.2 [concrete = constants.%int_6.e56] // CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access file.%a.var, element1 // CHECK:STDOUT: %.loc11_27.5: init %i32 = initialize_from %.loc11_27.4 to %tuple.elem1 [concrete = constants.%int_6.e56] diff --git a/toolchain/check/testdata/tuple/access/fail_large_index.carbon b/toolchain/check/testdata/tuple/access/fail_large_index.carbon index 6f7571a34180..941e09926112 100644 --- a/toolchain/check/testdata/tuple/access/fail_large_index.carbon +++ b/toolchain/check/testdata/tuple/access/fail_large_index.carbon @@ -38,7 +38,8 @@ var d: i32 = b.(0x7FFF_FFFF); // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_12.6a3, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_12.6a3, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [concrete] // CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%int_12.1e1) [concrete] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete] @@ -114,9 +115,10 @@ var d: i32 = b.(0x7FFF_FFFF); // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [concrete = constants.%int_12.6a3] // CHECK:STDOUT: %.loc11_21.1: %tuple.type.985 = tuple_literal (%int_12) // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_12, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_12) [concrete = constants.%int_12.1e1] +// CHECK:STDOUT: %bound_method.loc11_21.1: = bound_method %int_12, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_21.2: = bound_method %int_12, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc11_21.2(%int_12) [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %.loc11_21.2: init %i32 = converted %int_12, %int.convert_checked [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %.loc11_21.3: init %tuple.type.a1c = tuple_init (%.loc11_21.2) to file.%a.var [concrete = constants.%tuple] // CHECK:STDOUT: %.loc11_1: init %tuple.type.a1c = converted %.loc11_21.1, %.loc11_21.3 [concrete = constants.%tuple] diff --git a/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon b/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon index 0ee467bbc5bc..2451c8a951f2 100644 --- a/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon +++ b/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon @@ -34,10 +34,11 @@ var b: i32 = a.(-10); // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.221: = bound_method %int_12.6a3, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.9a9: = specific_function %Convert.bound.221, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.dae: = bound_method %int_12.6a3, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [concrete] // CHECK:STDOUT: %Convert.bound.ce9: = bound_method %int_6.462, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.631: = specific_function %Convert.bound.ce9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.efa: = bound_method %int_6.462, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_6.e56: %i32 = int_value 6 [concrete] // CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%int_12.1e1, %int_6.e56) [concrete] // CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [concrete] @@ -101,15 +102,17 @@ var b: i32 = a.(-10); // CHECK:STDOUT: %.loc11_27.1: %tuple.type.f94 = tuple_literal (%int_12, %int_6) // CHECK:STDOUT: %impl.elem0.loc11_27.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc11_27.1: = bound_method %int_12, %impl.elem0.loc11_27.1 [concrete = constants.%Convert.bound.221] -// CHECK:STDOUT: %specific_fn.loc11_27.1: = specific_function %bound_method.loc11_27.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.9a9] -// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %specific_fn.loc11_27.1(%int_12) [concrete = constants.%int_12.1e1] +// CHECK:STDOUT: %specific_fn.loc11_27.1: = specific_function %impl.elem0.loc11_27.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_27.2: = bound_method %int_12, %specific_fn.loc11_27.1 [concrete = constants.%bound_method.dae] +// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %bound_method.loc11_27.2(%int_12) [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_12, %int.convert_checked.loc11_27.1 [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 // CHECK:STDOUT: %.loc11_27.3: init %i32 = initialize_from %.loc11_27.2 to %tuple.elem0 [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %impl.elem0.loc11_27.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11_27.2: = bound_method %int_6, %impl.elem0.loc11_27.2 [concrete = constants.%Convert.bound.ce9] -// CHECK:STDOUT: %specific_fn.loc11_27.2: = specific_function %bound_method.loc11_27.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.631] -// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %specific_fn.loc11_27.2(%int_6) [concrete = constants.%int_6.e56] +// CHECK:STDOUT: %bound_method.loc11_27.3: = bound_method %int_6, %impl.elem0.loc11_27.2 [concrete = constants.%Convert.bound.ce9] +// CHECK:STDOUT: %specific_fn.loc11_27.2: = specific_function %impl.elem0.loc11_27.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_27.4: = bound_method %int_6, %specific_fn.loc11_27.2 [concrete = constants.%bound_method.efa] +// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %bound_method.loc11_27.4(%int_6) [concrete = constants.%int_6.e56] // CHECK:STDOUT: %.loc11_27.4: init %i32 = converted %int_6, %int.convert_checked.loc11_27.2 [concrete = constants.%int_6.e56] // CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access file.%a.var, element1 // CHECK:STDOUT: %.loc11_27.5: init %i32 = initialize_from %.loc11_27.4 to %tuple.elem1 [concrete = constants.%int_6.e56] diff --git a/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon b/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon index 35c8a88245ef..5353a499d2b0 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon @@ -34,15 +34,16 @@ var c: i32 = a.(b); // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %Convert.bound.b30: = bound_method %int_3.1ba, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.b42: = specific_function %Convert.bound.b30, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.047: = bound_method %int_3.1ba, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%int_2.ef8, %int_3.822) [concrete] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b6e: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -106,15 +107,17 @@ var c: i32 = a.(b); // CHECK:STDOUT: %.loc11_26.1: %tuple.type.f94 = tuple_literal (%int_2, %int_3) // CHECK:STDOUT: %impl.elem0.loc11_26.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc11_26.1: = bound_method %int_2, %impl.elem0.loc11_26.1 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc11_26.1: = specific_function %bound_method.loc11_26.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc11_26.1: init %i32 = call %specific_fn.loc11_26.1(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %specific_fn.loc11_26.1: = specific_function %impl.elem0.loc11_26.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_26.2: = bound_method %int_2, %specific_fn.loc11_26.1 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc11_26.1: init %i32 = call %bound_method.loc11_26.2(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc11_26.2: init %i32 = converted %int_2, %int.convert_checked.loc11_26.1 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 // CHECK:STDOUT: %.loc11_26.3: init %i32 = initialize_from %.loc11_26.2 to %tuple.elem0 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %impl.elem0.loc11_26.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11_26.2: = bound_method %int_3, %impl.elem0.loc11_26.2 [concrete = constants.%Convert.bound.b30] -// CHECK:STDOUT: %specific_fn.loc11_26.2: = specific_function %bound_method.loc11_26.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc11_26.2: init %i32 = call %specific_fn.loc11_26.2(%int_3) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %bound_method.loc11_26.3: = bound_method %int_3, %impl.elem0.loc11_26.2 [concrete = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc11_26.2: = specific_function %impl.elem0.loc11_26.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_26.4: = bound_method %int_3, %specific_fn.loc11_26.2 [concrete = constants.%bound_method.047] +// CHECK:STDOUT: %int.convert_checked.loc11_26.2: init %i32 = call %bound_method.loc11_26.4(%int_3) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc11_26.4: init %i32 = converted %int_3, %int.convert_checked.loc11_26.2 [concrete = constants.%int_3.822] // CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access file.%a.var, element1 // CHECK:STDOUT: %.loc11_26.5: init %i32 = initialize_from %.loc11_26.4 to %tuple.elem1 [concrete = constants.%int_3.822] @@ -123,9 +126,10 @@ var c: i32 = a.(b); // CHECK:STDOUT: assign file.%a.var, %.loc11_1 // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0.loc12: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc12: = bound_method %int_0, %impl.elem0.loc12 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn.loc12: = specific_function %bound_method.loc12, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %specific_fn.loc12(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc12_1.1: = bound_method %int_0, %impl.elem0.loc12 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc12: = specific_function %impl.elem0.loc12, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc12_1.2: = bound_method %int_0, %specific_fn.loc12 [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %bound_method.loc12_1.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc12: init %i32 = converted %int_0, %int.convert_checked.loc12 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: assign file.%b.var, %.loc12 // CHECK:STDOUT: %a.ref: ref %tuple.type.d07 = name_ref a, file.%a diff --git a/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon b/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon index 0d04fdbf570c..1ddbc91519c2 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon @@ -36,10 +36,11 @@ var b: i32 = a.(2.6); // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.221: = bound_method %int_12.6a3, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.9a9: = specific_function %Convert.bound.221, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.dae: = bound_method %int_12.6a3, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [concrete] // CHECK:STDOUT: %Convert.bound.ce9: = bound_method %int_6.462, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.631: = specific_function %Convert.bound.ce9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.efa: = bound_method %int_6.462, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_6.e56: %i32 = int_value 6 [concrete] // CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%int_12.1e1, %int_6.e56) [concrete] // CHECK:STDOUT: %float: f64 = float_literal 2.6000000000000001 [concrete] @@ -94,15 +95,17 @@ var b: i32 = a.(2.6); // CHECK:STDOUT: %.loc11_27.1: %tuple.type.f94 = tuple_literal (%int_12, %int_6) // CHECK:STDOUT: %impl.elem0.loc11_27.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc11_27.1: = bound_method %int_12, %impl.elem0.loc11_27.1 [concrete = constants.%Convert.bound.221] -// CHECK:STDOUT: %specific_fn.loc11_27.1: = specific_function %bound_method.loc11_27.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.9a9] -// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %specific_fn.loc11_27.1(%int_12) [concrete = constants.%int_12.1e1] +// CHECK:STDOUT: %specific_fn.loc11_27.1: = specific_function %impl.elem0.loc11_27.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_27.2: = bound_method %int_12, %specific_fn.loc11_27.1 [concrete = constants.%bound_method.dae] +// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %bound_method.loc11_27.2(%int_12) [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_12, %int.convert_checked.loc11_27.1 [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 // CHECK:STDOUT: %.loc11_27.3: init %i32 = initialize_from %.loc11_27.2 to %tuple.elem0 [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %impl.elem0.loc11_27.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11_27.2: = bound_method %int_6, %impl.elem0.loc11_27.2 [concrete = constants.%Convert.bound.ce9] -// CHECK:STDOUT: %specific_fn.loc11_27.2: = specific_function %bound_method.loc11_27.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.631] -// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %specific_fn.loc11_27.2(%int_6) [concrete = constants.%int_6.e56] +// CHECK:STDOUT: %bound_method.loc11_27.3: = bound_method %int_6, %impl.elem0.loc11_27.2 [concrete = constants.%Convert.bound.ce9] +// CHECK:STDOUT: %specific_fn.loc11_27.2: = specific_function %impl.elem0.loc11_27.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_27.4: = bound_method %int_6, %specific_fn.loc11_27.2 [concrete = constants.%bound_method.efa] +// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %bound_method.loc11_27.4(%int_6) [concrete = constants.%int_6.e56] // CHECK:STDOUT: %.loc11_27.4: init %i32 = converted %int_6, %int.convert_checked.loc11_27.2 [concrete = constants.%int_6.e56] // CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access file.%a.var, element1 // CHECK:STDOUT: %.loc11_27.5: init %i32 = initialize_from %.loc11_27.4 to %tuple.elem1 [concrete = constants.%int_6.e56] diff --git a/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon b/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon index ab007f875d53..eb2cffffad98 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon @@ -44,7 +44,8 @@ fn Main() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5.64b, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_5.64b, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_5.0f6: %i32 = int_value 5 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_5.0f6, %int_5.0f6) [concrete] // CHECK:STDOUT: } @@ -82,16 +83,18 @@ fn Main() { // CHECK:STDOUT: %.loc18_39.1: %tuple.type = tuple_literal (%int_5.loc18_35, %int_5.loc18_38) // CHECK:STDOUT: %impl.elem0.loc18_39.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc18_39.1: = bound_method %int_5.loc18_35, %impl.elem0.loc18_39.1 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc18_39.1: = specific_function %bound_method.loc18_39.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc18_39.1: init %i32 = call %specific_fn.loc18_39.1(%int_5.loc18_35) [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %specific_fn.loc18_39.1: = specific_function %impl.elem0.loc18_39.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc18_39.2: = bound_method %int_5.loc18_35, %specific_fn.loc18_39.1 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc18_39.1: init %i32 = call %bound_method.loc18_39.2(%int_5.loc18_35) [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc18_39.2: init %i32 = converted %int_5.loc18_35, %int.convert_checked.loc18_39.1 [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %int_0.loc18: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc18_39.3: ref %i32 = array_index %non_tuple.var, %int_0.loc18 // CHECK:STDOUT: %.loc18_39.4: init %i32 = initialize_from %.loc18_39.2 to %.loc18_39.3 [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %impl.elem0.loc18_39.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc18_39.2: = bound_method %int_5.loc18_38, %impl.elem0.loc18_39.2 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn.loc18_39.2: = specific_function %bound_method.loc18_39.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc18_39.2: init %i32 = call %specific_fn.loc18_39.2(%int_5.loc18_38) [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %bound_method.loc18_39.3: = bound_method %int_5.loc18_38, %impl.elem0.loc18_39.2 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn.loc18_39.2: = specific_function %impl.elem0.loc18_39.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc18_39.4: = bound_method %int_5.loc18_38, %specific_fn.loc18_39.2 [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked.loc18_39.2: init %i32 = call %bound_method.loc18_39.4(%int_5.loc18_38) [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc18_39.5: init %i32 = converted %int_5.loc18_38, %int.convert_checked.loc18_39.2 [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %int_1.loc18: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] // CHECK:STDOUT: %.loc18_39.6: ref %i32 = array_index %non_tuple.var, %int_1.loc18 diff --git a/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon b/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon index 76a45a7192a3..70b2ecb31b6d 100644 --- a/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon +++ b/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon @@ -33,10 +33,11 @@ var b: i32 = a.2; // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.221: = bound_method %int_12.6a3, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.9a9: = specific_function %Convert.bound.221, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.dae: = bound_method %int_12.6a3, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [concrete] // CHECK:STDOUT: %Convert.bound.ce9: = bound_method %int_6.462, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.631: = specific_function %Convert.bound.ce9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.efa: = bound_method %int_6.462, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_6.e56: %i32 = int_value 6 [concrete] // CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%int_12.1e1, %int_6.e56) [concrete] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete] @@ -91,15 +92,17 @@ var b: i32 = a.2; // CHECK:STDOUT: %.loc11_27.1: %tuple.type.f94 = tuple_literal (%int_12, %int_6) // CHECK:STDOUT: %impl.elem0.loc11_27.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc11_27.1: = bound_method %int_12, %impl.elem0.loc11_27.1 [concrete = constants.%Convert.bound.221] -// CHECK:STDOUT: %specific_fn.loc11_27.1: = specific_function %bound_method.loc11_27.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.9a9] -// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %specific_fn.loc11_27.1(%int_12) [concrete = constants.%int_12.1e1] +// CHECK:STDOUT: %specific_fn.loc11_27.1: = specific_function %impl.elem0.loc11_27.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_27.2: = bound_method %int_12, %specific_fn.loc11_27.1 [concrete = constants.%bound_method.dae] +// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %bound_method.loc11_27.2(%int_12) [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_12, %int.convert_checked.loc11_27.1 [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 // CHECK:STDOUT: %.loc11_27.3: init %i32 = initialize_from %.loc11_27.2 to %tuple.elem0 [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %impl.elem0.loc11_27.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11_27.2: = bound_method %int_6, %impl.elem0.loc11_27.2 [concrete = constants.%Convert.bound.ce9] -// CHECK:STDOUT: %specific_fn.loc11_27.2: = specific_function %bound_method.loc11_27.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.631] -// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %specific_fn.loc11_27.2(%int_6) [concrete = constants.%int_6.e56] +// CHECK:STDOUT: %bound_method.loc11_27.3: = bound_method %int_6, %impl.elem0.loc11_27.2 [concrete = constants.%Convert.bound.ce9] +// CHECK:STDOUT: %specific_fn.loc11_27.2: = specific_function %impl.elem0.loc11_27.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_27.4: = bound_method %int_6, %specific_fn.loc11_27.2 [concrete = constants.%bound_method.efa] +// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %bound_method.loc11_27.4(%int_6) [concrete = constants.%int_6.e56] // CHECK:STDOUT: %.loc11_27.4: init %i32 = converted %int_6, %int.convert_checked.loc11_27.2 [concrete = constants.%int_6.e56] // CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access file.%a.var, element1 // CHECK:STDOUT: %.loc11_27.5: init %i32 = initialize_from %.loc11_27.4 to %tuple.elem1 [concrete = constants.%int_6.e56] diff --git a/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon b/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon index ca5447ae762f..8028b388b687 100644 --- a/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon +++ b/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon @@ -33,10 +33,11 @@ var b: i32 = a.({.index = 2}.index); // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.221: = bound_method %int_12.6a3, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.9a9: = specific_function %Convert.bound.221, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.dae: = bound_method %int_12.6a3, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [concrete] // CHECK:STDOUT: %Convert.bound.82c: = bound_method %int_34.3f9, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.6d4: = specific_function %Convert.bound.82c, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.34d: = bound_method %int_34.3f9, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_34.980: %i32 = int_value 34 [concrete] // CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%int_12.1e1, %int_34.980) [concrete] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete] @@ -93,15 +94,17 @@ var b: i32 = a.({.index = 2}.index); // CHECK:STDOUT: %.loc11_28.1: %tuple.type.f94 = tuple_literal (%int_12, %int_34) // CHECK:STDOUT: %impl.elem0.loc11_28.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc11_28.1: = bound_method %int_12, %impl.elem0.loc11_28.1 [concrete = constants.%Convert.bound.221] -// CHECK:STDOUT: %specific_fn.loc11_28.1: = specific_function %bound_method.loc11_28.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.9a9] -// CHECK:STDOUT: %int.convert_checked.loc11_28.1: init %i32 = call %specific_fn.loc11_28.1(%int_12) [concrete = constants.%int_12.1e1] +// CHECK:STDOUT: %specific_fn.loc11_28.1: = specific_function %impl.elem0.loc11_28.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_28.2: = bound_method %int_12, %specific_fn.loc11_28.1 [concrete = constants.%bound_method.dae] +// CHECK:STDOUT: %int.convert_checked.loc11_28.1: init %i32 = call %bound_method.loc11_28.2(%int_12) [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %.loc11_28.2: init %i32 = converted %int_12, %int.convert_checked.loc11_28.1 [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 // CHECK:STDOUT: %.loc11_28.3: init %i32 = initialize_from %.loc11_28.2 to %tuple.elem0 [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %impl.elem0.loc11_28.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11_28.2: = bound_method %int_34, %impl.elem0.loc11_28.2 [concrete = constants.%Convert.bound.82c] -// CHECK:STDOUT: %specific_fn.loc11_28.2: = specific_function %bound_method.loc11_28.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.6d4] -// CHECK:STDOUT: %int.convert_checked.loc11_28.2: init %i32 = call %specific_fn.loc11_28.2(%int_34) [concrete = constants.%int_34.980] +// CHECK:STDOUT: %bound_method.loc11_28.3: = bound_method %int_34, %impl.elem0.loc11_28.2 [concrete = constants.%Convert.bound.82c] +// CHECK:STDOUT: %specific_fn.loc11_28.2: = specific_function %impl.elem0.loc11_28.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_28.4: = bound_method %int_34, %specific_fn.loc11_28.2 [concrete = constants.%bound_method.34d] +// CHECK:STDOUT: %int.convert_checked.loc11_28.2: init %i32 = call %bound_method.loc11_28.4(%int_34) [concrete = constants.%int_34.980] // CHECK:STDOUT: %.loc11_28.4: init %i32 = converted %int_34, %int.convert_checked.loc11_28.2 [concrete = constants.%int_34.980] // CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access file.%a.var, element1 // CHECK:STDOUT: %.loc11_28.5: init %i32 = initialize_from %.loc11_28.4 to %tuple.elem1 [concrete = constants.%int_34.980] diff --git a/toolchain/check/testdata/tuple/access/index_not_literal.carbon b/toolchain/check/testdata/tuple/access/index_not_literal.carbon index 3c83c49998f0..79555cb94a66 100644 --- a/toolchain/check/testdata/tuple/access/index_not_literal.carbon +++ b/toolchain/check/testdata/tuple/access/index_not_literal.carbon @@ -35,7 +35,8 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: %ImplicitAs.facet.f7f: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet.f7f [concrete] // CHECK:STDOUT: %Convert.bound.82c: = bound_method %int_34.3f9, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.6d4: = specific_function %Convert.bound.82c, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn.b6f: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.34d: = bound_method %int_34.3f9, %Convert.specific_fn.b6f [concrete] // CHECK:STDOUT: %int_34.980: %i32 = int_value 34 [concrete] // CHECK:STDOUT: %tuple: %tuple.type.261 = tuple_value (%true, %int_34.980) [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] @@ -50,7 +51,8 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: %As.facet: %As.type.fd4 = facet_value Core.IntLiteral, %impl_witness.882 [concrete] // CHECK:STDOUT: %.214: type = fn_type_with_self_type %Convert.type.99b, %As.facet [concrete] // CHECK:STDOUT: %Convert.bound.129: = bound_method %int_0.5c6, %Convert.197 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.dc5: = specific_function %Convert.bound.129, @Convert.5(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn.aad: = specific_function %Convert.197, @Convert.5(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.46b: = bound_method %int_0.5c6, %Convert.specific_fn.aad [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %impl_witness.023: = impl_witness (imports.%Core.import_ref.85c), @impl.971(%int_32) [concrete] // CHECK:STDOUT: %Convert.type.4ad: type = fn_type @Convert.3, @impl.971(%int_32) [concrete] @@ -58,14 +60,15 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: %ImplicitAs.facet.e25: %ImplicitAs.type.2fd = facet_value %i32, %impl_witness.023 [concrete] // CHECK:STDOUT: %.10e: type = fn_type_with_self_type %Convert.type.71e, %ImplicitAs.facet.e25 [concrete] // CHECK:STDOUT: %Convert.bound.0fd: = bound_method %int_0.6a9, %Convert.960 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.f3f: = specific_function %Convert.bound.0fd, @Convert.3(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn.8a8: = specific_function %Convert.960, @Convert.3(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.4b5: = bound_method %int_0.6a9, %Convert.specific_fn.8a8 [concrete] // CHECK:STDOUT: %Convert.bound.c1b: = bound_method %int_1.5b8, %Convert.197 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.f9a: = specific_function %Convert.bound.c1b, @Convert.5(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.082: = bound_method %int_1.5b8, %Convert.specific_fn.aad [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %struct_type.index.6ea: type = struct_type {.index: %i32} [concrete] // CHECK:STDOUT: %struct.63a: %struct_type.index.6ea = struct_value (%int_1.5d2) [concrete] // CHECK:STDOUT: %Convert.bound.faf: = bound_method %int_1.5d2, %Convert.960 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.a84: = specific_function %Convert.bound.faf, @Convert.3(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.711: = bound_method %int_1.5d2, %Convert.specific_fn.8a8 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -144,9 +147,10 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: %tuple.elem0.loc11: ref bool = tuple_access file.%a.var, element0 // CHECK:STDOUT: %.loc11_31.2: init bool = initialize_from %true to %tuple.elem0.loc11 [concrete = constants.%true] // CHECK:STDOUT: %impl.elem0.loc11: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11: = bound_method %int_34, %impl.elem0.loc11 [concrete = constants.%Convert.bound.82c] -// CHECK:STDOUT: %specific_fn.loc11: = specific_function %bound_method.loc11, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.6d4] -// CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %specific_fn.loc11(%int_34) [concrete = constants.%int_34.980] +// CHECK:STDOUT: %bound_method.loc11_31.1: = bound_method %int_34, %impl.elem0.loc11 [concrete = constants.%Convert.bound.82c] +// CHECK:STDOUT: %specific_fn.loc11: = specific_function %impl.elem0.loc11, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b6f] +// CHECK:STDOUT: %bound_method.loc11_31.2: = bound_method %int_34, %specific_fn.loc11 [concrete = constants.%bound_method.34d] +// CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %bound_method.loc11_31.2(%int_34) [concrete = constants.%int_34.980] // CHECK:STDOUT: %.loc11_31.3: init %i32 = converted %int_34, %int.convert_checked.loc11 [concrete = constants.%int_34.980] // CHECK:STDOUT: %tuple.elem1.loc11: ref %i32 = tuple_access file.%a.var, element1 // CHECK:STDOUT: %.loc11_31.4: init %i32 = initialize_from %.loc11_31.3 to %tuple.elem1.loc11 [concrete = constants.%int_34.980] @@ -168,14 +172,16 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0.loc13_20.1: %.214 = impl_witness_access constants.%impl_witness.882, element0 [concrete = constants.%Convert.197] // CHECK:STDOUT: %bound_method.loc13_20.1: = bound_method %int_0, %impl.elem0.loc13_20.1 [concrete = constants.%Convert.bound.129] -// CHECK:STDOUT: %specific_fn.loc13_20.1: = specific_function %bound_method.loc13_20.1, @Convert.5(constants.%int_32) [concrete = constants.%Convert.specific_fn.dc5] -// CHECK:STDOUT: %int.convert_checked.loc13_20.1: init %i32 = call %specific_fn.loc13_20.1(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %specific_fn.loc13_20.1: = specific_function %impl.elem0.loc13_20.1, @Convert.5(constants.%int_32) [concrete = constants.%Convert.specific_fn.aad] +// CHECK:STDOUT: %bound_method.loc13_20.2: = bound_method %int_0, %specific_fn.loc13_20.1 [concrete = constants.%bound_method.46b] +// CHECK:STDOUT: %int.convert_checked.loc13_20.1: init %i32 = call %bound_method.loc13_20.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc13_20.1: %i32 = value_of_initializer %int.convert_checked.loc13_20.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc13_20.2: %i32 = converted %int_0, %.loc13_20.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %impl.elem0.loc13_20.2: %.10e = impl_witness_access constants.%impl_witness.023, element0 [concrete = constants.%Convert.960] -// CHECK:STDOUT: %bound_method.loc13_20.2: = bound_method %.loc13_20.2, %impl.elem0.loc13_20.2 [concrete = constants.%Convert.bound.0fd] -// CHECK:STDOUT: %specific_fn.loc13_20.2: = specific_function %bound_method.loc13_20.2, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn.f3f] -// CHECK:STDOUT: %int.convert_checked.loc13_20.2: init Core.IntLiteral = call %specific_fn.loc13_20.2(%.loc13_20.2) [concrete = constants.%int_0.5c6] +// CHECK:STDOUT: %bound_method.loc13_20.3: = bound_method %.loc13_20.2, %impl.elem0.loc13_20.2 [concrete = constants.%Convert.bound.0fd] +// CHECK:STDOUT: %specific_fn.loc13_20.2: = specific_function %impl.elem0.loc13_20.2, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn.8a8] +// CHECK:STDOUT: %bound_method.loc13_20.4: = bound_method %.loc13_20.2, %specific_fn.loc13_20.2 [concrete = constants.%bound_method.4b5] +// CHECK:STDOUT: %int.convert_checked.loc13_20.2: init Core.IntLiteral = call %bound_method.loc13_20.4(%.loc13_20.2) [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %.loc13_20.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc13_20.2 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %.loc13_20.4: Core.IntLiteral = converted %.loc13_20.2, %.loc13_20.3 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %tuple.elem0.loc13: ref bool = tuple_access %a.ref.loc13, element0 @@ -186,9 +192,10 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0.loc14_29: %.214 = impl_witness_access constants.%impl_witness.882, element0 [concrete = constants.%Convert.197] -// CHECK:STDOUT: %bound_method.loc14_29: = bound_method %int_1.loc14, %impl.elem0.loc14_29 [concrete = constants.%Convert.bound.c1b] -// CHECK:STDOUT: %specific_fn.loc14_29: = specific_function %bound_method.loc14_29, @Convert.5(constants.%int_32) [concrete = constants.%Convert.specific_fn.f9a] -// CHECK:STDOUT: %int.convert_checked.loc14_29: init %i32 = call %specific_fn.loc14_29(%int_1.loc14) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc14_29.1: = bound_method %int_1.loc14, %impl.elem0.loc14_29 [concrete = constants.%Convert.bound.c1b] +// CHECK:STDOUT: %specific_fn.loc14_29: = specific_function %impl.elem0.loc14_29, @Convert.5(constants.%int_32) [concrete = constants.%Convert.specific_fn.aad] +// CHECK:STDOUT: %bound_method.loc14_29.2: = bound_method %int_1.loc14, %specific_fn.loc14_29 [concrete = constants.%bound_method.082] +// CHECK:STDOUT: %int.convert_checked.loc14_29: init %i32 = call %bound_method.loc14_29.2(%int_1.loc14) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_29.1: %i32 = value_of_initializer %int.convert_checked.loc14_29 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_29.2: %i32 = converted %int_1.loc14, %.loc14_29.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_35.1: %struct_type.index.6ea = struct_literal (%.loc14_29.2) @@ -196,9 +203,10 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: %.loc14_35.2: %struct_type.index.6ea = converted %.loc14_35.1, %struct.loc14 [concrete = constants.%struct.63a] // CHECK:STDOUT: %.loc14_36.1: %i32 = struct_access %.loc14_35.2, element0 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc14_36: %.10e = impl_witness_access constants.%impl_witness.023, element0 [concrete = constants.%Convert.960] -// CHECK:STDOUT: %bound_method.loc14_36: = bound_method %.loc14_36.1, %impl.elem0.loc14_36 [concrete = constants.%Convert.bound.faf] -// CHECK:STDOUT: %specific_fn.loc14_36: = specific_function %bound_method.loc14_36, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn.a84] -// CHECK:STDOUT: %int.convert_checked.loc14_36: init Core.IntLiteral = call %specific_fn.loc14_36(%.loc14_36.1) [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %bound_method.loc14_36.1: = bound_method %.loc14_36.1, %impl.elem0.loc14_36 [concrete = constants.%Convert.bound.faf] +// CHECK:STDOUT: %specific_fn.loc14_36: = specific_function %impl.elem0.loc14_36, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn.8a8] +// CHECK:STDOUT: %bound_method.loc14_36.2: = bound_method %.loc14_36.1, %specific_fn.loc14_36 [concrete = constants.%bound_method.711] +// CHECK:STDOUT: %int.convert_checked.loc14_36: init Core.IntLiteral = call %bound_method.loc14_36.2(%.loc14_36.1) [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc14_36.2: Core.IntLiteral = value_of_initializer %int.convert_checked.loc14_36 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc14_36.3: Core.IntLiteral = converted %.loc14_36.1, %.loc14_36.2 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %tuple.elem1.loc14: ref %i32 = tuple_access %a.ref.loc14, element1 diff --git a/toolchain/check/testdata/tuple/access/return_value_access.carbon b/toolchain/check/testdata/tuple/access/return_value_access.carbon index c555b8cf5ff9..c518a7edede5 100644 --- a/toolchain/check/testdata/tuple/access/return_value_access.carbon +++ b/toolchain/check/testdata/tuple/access/return_value_access.carbon @@ -33,7 +33,8 @@ fn Run() -> i32 { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%int_0.6a9) [concrete] // CHECK:STDOUT: %Run.type: type = fn_type @Run [concrete] @@ -85,9 +86,10 @@ fn Run() -> i32 { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %.loc11_30.1: %tuple.type.985 = tuple_literal (%int_0) // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc11_30.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_30.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc11_30.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc11_30.2: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc11_30.3: %i32 = converted %int_0, %.loc11_30.2 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%.loc11_30.3) [concrete = constants.%tuple] diff --git a/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon b/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon index a5c23e7dc9fe..9e17b6c680e6 100644 --- a/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon +++ b/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon @@ -35,7 +35,8 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -76,9 +77,10 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: %float: f64 = float_literal 65.890000000000001 [concrete = constants.%float] // CHECK:STDOUT: %.loc18_30.1: %tuple.type.2c1 = tuple_literal (%int_2, %float) // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_2, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc18_30.1: = bound_method %int_2, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc18_30.2: = bound_method %int_2, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc18_30.2(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc18_30.2: init %i32 = converted %int_2, %int.convert_checked [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%x.var, element0 // CHECK:STDOUT: %.loc18_30.3: init %i32 = initialize_from %.loc18_30.2 to %tuple.elem0 [concrete = constants.%int_2.ef8] diff --git a/toolchain/check/testdata/tuple/import.carbon b/toolchain/check/testdata/tuple/import.carbon index 3244e16660dd..43a3c8f227b1 100644 --- a/toolchain/check/testdata/tuple/import.carbon +++ b/toolchain/check/testdata/tuple/import.carbon @@ -71,7 +71,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.d62: = specific_function %Convert.bound.d04, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b6e: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %tuple.592: %tuple.type.a1c = tuple_value (%int_0.6a9) [concrete] // CHECK:STDOUT: %tuple.type.8c7: type = tuple_type (%tuple.type.85c, type) [concrete] @@ -87,14 +88,14 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete] // CHECK:STDOUT: %tuple.type.d47: type = tuple_type (%tuple.type.186, %tuple.type.f94) [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %tuple.236: %tuple.type.fe6 = tuple_value (%tuple.592, %int_1.5d2) [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %Convert.bound.b30: = bound_method %int_3.1ba, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.b42: = specific_function %Convert.bound.b30, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.047: = bound_method %int_3.1ba, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %tuple.11a: %tuple.type.d07 = tuple_value (%int_2.ef8, %int_3.822) [concrete] // CHECK:STDOUT: %tuple.ba9: %tuple.type.fc1 = tuple_value (%tuple.236, %tuple.11a) [concrete] @@ -188,14 +189,16 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %.loc9_18.1: %tuple.type.f94 = tuple_literal (%int_1, %int_2) // CHECK:STDOUT: %impl.elem0.loc9_18.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc9_18.1: = bound_method %int_1, %impl.elem0.loc9_18.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc9_18.1: = specific_function %bound_method.loc9_18.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc9_18.1: init %i32 = call %specific_fn.loc9_18.1(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc9_18.1: = specific_function %impl.elem0.loc9_18.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_18.2: = bound_method %int_1, %specific_fn.loc9_18.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc9_18.1: init %i32 = call %bound_method.loc9_18.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc9_18.2: %i32 = value_of_initializer %int.convert_checked.loc9_18.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc9_18.3: %i32 = converted %int_1, %.loc9_18.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc9_18.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc9_18.2: = bound_method %int_2, %impl.elem0.loc9_18.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc9_18.2: = specific_function %bound_method.loc9_18.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc9_18.2: init %i32 = call %specific_fn.loc9_18.2(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc9_18.3: = bound_method %int_2, %impl.elem0.loc9_18.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc9_18.2: = specific_function %impl.elem0.loc9_18.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_18.4: = bound_method %int_2, %specific_fn.loc9_18.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc9_18.2: init %i32 = call %bound_method.loc9_18.4(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc9_18.4: %i32 = value_of_initializer %int.convert_checked.loc9_18.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc9_18.5: %i32 = converted %int_2, %.loc9_18.4 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%.loc9_18.3, %.loc9_18.5) [concrete = constants.%tuple.21c] @@ -228,9 +231,10 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %int_0.loc4: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %.loc4_24.1: %tuple.type.985 = tuple_literal (%int_0.loc4) // CHECK:STDOUT: %impl.elem0.loc4: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc4: = bound_method %int_0.loc4, %impl.elem0.loc4 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn.loc4: = specific_function %bound_method.loc4, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc4: init %i32 = call %specific_fn.loc4(%int_0.loc4) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc4_24.1: = bound_method %int_0.loc4, %impl.elem0.loc4 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc4: = specific_function %impl.elem0.loc4, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc4_24.2: = bound_method %int_0.loc4, %specific_fn.loc4 [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked.loc4: init %i32 = call %bound_method.loc4_24.2(%int_0.loc4) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc4_24.2: init %i32 = converted %int_0.loc4, %int.convert_checked.loc4 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc4_24.3: init %tuple.type.a1c = tuple_init (%.loc4_24.2) to file.%a_ref.var [concrete = constants.%tuple.592] // CHECK:STDOUT: %.loc4_1: init %tuple.type.a1c = converted %.loc4_24.1, %.loc4_24.3 [concrete = constants.%tuple.592] @@ -244,9 +248,10 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %.loc5_59.1: %tuple.type.f94 = tuple_literal (%int_2, %int_3) // CHECK:STDOUT: %.loc5_60.1: %tuple.type.d47 = tuple_literal (%.loc5_51.1, %.loc5_59.1) // CHECK:STDOUT: %impl.elem0.loc5_47: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc5_47: = bound_method %int_0.loc5, %impl.elem0.loc5_47 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn.loc5_47: = specific_function %bound_method.loc5_47, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc5_47: init %i32 = call %specific_fn.loc5_47(%int_0.loc5) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %bound_method.loc5_47.1: = bound_method %int_0.loc5, %impl.elem0.loc5_47 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn.loc5_47: = specific_function %impl.elem0.loc5_47, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc5_47.2: = bound_method %int_0.loc5, %specific_fn.loc5_47 [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked.loc5_47: init %i32 = call %bound_method.loc5_47.2(%int_0.loc5) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc5_47.2: init %i32 = converted %int_0.loc5, %int.convert_checked.loc5_47 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %tuple.elem0.loc5_60: ref %tuple.type.fe6 = tuple_access file.%b_ref.var, element0 // CHECK:STDOUT: %tuple.elem0.loc5_51: ref %tuple.type.a1c = tuple_access %tuple.elem0.loc5_60, element0 @@ -254,9 +259,10 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %.loc5_51.2: init %tuple.type.a1c = converted %.loc5_47.1, %.loc5_47.3 [concrete = constants.%tuple.592] // CHECK:STDOUT: %.loc5_51.3: init %tuple.type.a1c = initialize_from %.loc5_51.2 to %tuple.elem0.loc5_51 [concrete = constants.%tuple.592] // CHECK:STDOUT: %impl.elem0.loc5_51: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc5_51: = bound_method %int_1, %impl.elem0.loc5_51 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc5_51: = specific_function %bound_method.loc5_51, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc5_51: init %i32 = call %specific_fn.loc5_51(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %bound_method.loc5_51.1: = bound_method %int_1, %impl.elem0.loc5_51 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc5_51: = specific_function %impl.elem0.loc5_51, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc5_51.2: = bound_method %int_1, %specific_fn.loc5_51 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc5_51: init %i32 = call %bound_method.loc5_51.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc5_51.4: init %i32 = converted %int_1, %int.convert_checked.loc5_51 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %tuple.elem1.loc5_51: ref %i32 = tuple_access %tuple.elem0.loc5_60, element1 // CHECK:STDOUT: %.loc5_51.5: init %i32 = initialize_from %.loc5_51.4 to %tuple.elem1.loc5_51 [concrete = constants.%int_1.5d2] @@ -264,16 +270,18 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %.loc5_60.2: init %tuple.type.fe6 = converted %.loc5_51.1, %.loc5_51.6 [concrete = constants.%tuple.236] // CHECK:STDOUT: %impl.elem0.loc5_59.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc5_59.1: = bound_method %int_2, %impl.elem0.loc5_59.1 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc5_59.1: = specific_function %bound_method.loc5_59.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc5_59.1: init %i32 = call %specific_fn.loc5_59.1(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %specific_fn.loc5_59.1: = specific_function %impl.elem0.loc5_59.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc5_59.2: = bound_method %int_2, %specific_fn.loc5_59.1 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc5_59.1: init %i32 = call %bound_method.loc5_59.2(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc5_59.2: init %i32 = converted %int_2, %int.convert_checked.loc5_59.1 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %tuple.elem1.loc5_60: ref %tuple.type.d07 = tuple_access file.%b_ref.var, element1 // CHECK:STDOUT: %tuple.elem0.loc5_59: ref %i32 = tuple_access %tuple.elem1.loc5_60, element0 // CHECK:STDOUT: %.loc5_59.3: init %i32 = initialize_from %.loc5_59.2 to %tuple.elem0.loc5_59 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %impl.elem0.loc5_59.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc5_59.2: = bound_method %int_3, %impl.elem0.loc5_59.2 [concrete = constants.%Convert.bound.b30] -// CHECK:STDOUT: %specific_fn.loc5_59.2: = specific_function %bound_method.loc5_59.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc5_59.2: init %i32 = call %specific_fn.loc5_59.2(%int_3) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %bound_method.loc5_59.3: = bound_method %int_3, %impl.elem0.loc5_59.2 [concrete = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc5_59.2: = specific_function %impl.elem0.loc5_59.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc5_59.4: = bound_method %int_3, %specific_fn.loc5_59.2 [concrete = constants.%bound_method.047] +// CHECK:STDOUT: %int.convert_checked.loc5_59.2: init %i32 = call %bound_method.loc5_59.4(%int_3) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc5_59.4: init %i32 = converted %int_3, %int.convert_checked.loc5_59.2 [concrete = constants.%int_3.822] // CHECK:STDOUT: %tuple.elem1.loc5_59: ref %i32 = tuple_access %tuple.elem1.loc5_60, element1 // CHECK:STDOUT: %.loc5_59.5: init %i32 = initialize_from %.loc5_59.4 to %tuple.elem1.loc5_59 [concrete = constants.%int_3.822] @@ -325,10 +333,11 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.b9e = facet_value Core.IntLiteral, %impl_witness.847 [concrete] // CHECK:STDOUT: %.088: type = fn_type_with_self_type %Convert.type.ea0, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.dc5: = bound_method %int_1.5b8, %Convert.4cb [concrete] -// CHECK:STDOUT: %Convert.specific_fn.51b: = specific_function %Convert.bound.dc5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.4cb, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.c37: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.47b: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.30f: = bound_method %int_2.ecc, %Convert.4cb [concrete] -// CHECK:STDOUT: %Convert.specific_fn.9b5: = specific_function %Convert.bound.30f, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.62b: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.d0d: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %tuple: %tuple.type.c2c = tuple_value (%int_1.47b, %int_2.d0d) [concrete] // CHECK:STDOUT: %C.cf0: type = class_type @C, @C(%tuple) [concrete] @@ -349,7 +358,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: } // CHECK:STDOUT: %Implicit.import_ref.48d: %tuple.type.c2c = import_ref Implicit//default, loc7_9, loaded [symbolic = @C.%X (constants.%X)] // CHECK:STDOUT: %Implicit.import_ref.8f2: = import_ref Implicit//default, loc7_26, loaded [concrete = constants.%complete_type.357] -// CHECK:STDOUT: %Implicit.import_ref.964 = import_ref Implicit//default, inst1185 [no loc], unloaded +// CHECK:STDOUT: %Implicit.import_ref.964 = import_ref Implicit//default, inst1191 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -414,14 +423,16 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %.loc6_15.1: %tuple.type.f94 = tuple_literal (%int_1, %int_2) // CHECK:STDOUT: %impl.elem0.loc6_15.1: %.088 = impl_witness_access constants.%impl_witness.847, element0 [concrete = constants.%Convert.4cb] // CHECK:STDOUT: %bound_method.loc6_15.1: = bound_method %int_1, %impl.elem0.loc6_15.1 [concrete = constants.%Convert.bound.dc5] -// CHECK:STDOUT: %specific_fn.loc6_15.1: = specific_function %bound_method.loc6_15.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.51b] -// CHECK:STDOUT: %int.convert_checked.loc6_15.1: init %i32 = call %specific_fn.loc6_15.1(%int_1) [concrete = constants.%int_1.47b] +// CHECK:STDOUT: %specific_fn.loc6_15.1: = specific_function %impl.elem0.loc6_15.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_15.2: = bound_method %int_1, %specific_fn.loc6_15.1 [concrete = constants.%bound_method.c37] +// CHECK:STDOUT: %int.convert_checked.loc6_15.1: init %i32 = call %bound_method.loc6_15.2(%int_1) [concrete = constants.%int_1.47b] // CHECK:STDOUT: %.loc6_15.2: %i32 = value_of_initializer %int.convert_checked.loc6_15.1 [concrete = constants.%int_1.47b] // CHECK:STDOUT: %.loc6_15.3: %i32 = converted %int_1, %.loc6_15.2 [concrete = constants.%int_1.47b] // CHECK:STDOUT: %impl.elem0.loc6_15.2: %.088 = impl_witness_access constants.%impl_witness.847, element0 [concrete = constants.%Convert.4cb] -// CHECK:STDOUT: %bound_method.loc6_15.2: = bound_method %int_2, %impl.elem0.loc6_15.2 [concrete = constants.%Convert.bound.30f] -// CHECK:STDOUT: %specific_fn.loc6_15.2: = specific_function %bound_method.loc6_15.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.9b5] -// CHECK:STDOUT: %int.convert_checked.loc6_15.2: init %i32 = call %specific_fn.loc6_15.2(%int_2) [concrete = constants.%int_2.d0d] +// CHECK:STDOUT: %bound_method.loc6_15.3: = bound_method %int_2, %impl.elem0.loc6_15.2 [concrete = constants.%Convert.bound.30f] +// CHECK:STDOUT: %specific_fn.loc6_15.2: = specific_function %impl.elem0.loc6_15.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_15.4: = bound_method %int_2, %specific_fn.loc6_15.2 [concrete = constants.%bound_method.62b] +// CHECK:STDOUT: %int.convert_checked.loc6_15.2: init %i32 = call %bound_method.loc6_15.4(%int_2) [concrete = constants.%int_2.d0d] // CHECK:STDOUT: %.loc6_15.4: %i32 = value_of_initializer %int.convert_checked.loc6_15.2 [concrete = constants.%int_2.d0d] // CHECK:STDOUT: %.loc6_15.5: %i32 = converted %int_2, %.loc6_15.4 [concrete = constants.%int_2.d0d] // CHECK:STDOUT: %tuple: %tuple.type.c2c = tuple_value (%.loc6_15.3, %.loc6_15.5) [concrete = constants.%tuple] @@ -540,7 +551,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: } // CHECK:STDOUT: %Implicit.import_ref.48d: %tuple.type.c2c = import_ref Implicit//default, loc7_9, loaded [symbolic = @C.%X (constants.%X)] // CHECK:STDOUT: %Implicit.import_ref.8f2: = import_ref Implicit//default, loc7_26, loaded [concrete = constants.%complete_type.357] -// CHECK:STDOUT: %Implicit.import_ref.964 = import_ref Implicit//default, inst1185 [no loc], unloaded +// CHECK:STDOUT: %Implicit.import_ref.964 = import_ref Implicit//default, inst1191 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -630,10 +641,11 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.b9e = facet_value Core.IntLiteral, %impl_witness.847 [concrete] // CHECK:STDOUT: %.088: type = fn_type_with_self_type %Convert.type.ea0, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.a00: = bound_method %int_3.1ba, %Convert.4cb [concrete] -// CHECK:STDOUT: %Convert.specific_fn.dec: = specific_function %Convert.bound.a00, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.4cb, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.fc5: = bound_method %int_3.1ba, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.d47: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %Convert.bound.694: = bound_method %int_4.0c1, %Convert.4cb [concrete] -// CHECK:STDOUT: %Convert.specific_fn.739: = specific_function %Convert.bound.694, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b6e: = bound_method %int_4.0c1, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_4.ea3: %i32 = int_value 4 [concrete] // CHECK:STDOUT: %tuple.5de: %tuple.type.c2c = tuple_value (%int_3.d47, %int_4.ea3) [concrete] // CHECK:STDOUT: %C.ed5: type = class_type @C, @C(%tuple.5de) [concrete] @@ -657,7 +669,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: } // CHECK:STDOUT: %Implicit.import_ref.48d: %tuple.type.c2c = import_ref Implicit//default, loc7_9, loaded [symbolic = @C.%X (constants.%X)] // CHECK:STDOUT: %Implicit.import_ref.8f2: = import_ref Implicit//default, loc7_26, loaded [concrete = constants.%complete_type.357] -// CHECK:STDOUT: %Implicit.import_ref.964 = import_ref Implicit//default, inst1185 [no loc], unloaded +// CHECK:STDOUT: %Implicit.import_ref.964 = import_ref Implicit//default, inst1191 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -684,14 +696,16 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %.loc11_19.1: %tuple.type.f94 = tuple_literal (%int_3, %int_4) // CHECK:STDOUT: %impl.elem0.loc11_19.1: %.088 = impl_witness_access constants.%impl_witness.847, element0 [concrete = constants.%Convert.4cb] // CHECK:STDOUT: %bound_method.loc11_19.1: = bound_method %int_3, %impl.elem0.loc11_19.1 [concrete = constants.%Convert.bound.a00] -// CHECK:STDOUT: %specific_fn.loc11_19.1: = specific_function %bound_method.loc11_19.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.dec] -// CHECK:STDOUT: %int.convert_checked.loc11_19.1: init %i32 = call %specific_fn.loc11_19.1(%int_3) [concrete = constants.%int_3.d47] +// CHECK:STDOUT: %specific_fn.loc11_19.1: = specific_function %impl.elem0.loc11_19.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_19.2: = bound_method %int_3, %specific_fn.loc11_19.1 [concrete = constants.%bound_method.fc5] +// CHECK:STDOUT: %int.convert_checked.loc11_19.1: init %i32 = call %bound_method.loc11_19.2(%int_3) [concrete = constants.%int_3.d47] // CHECK:STDOUT: %.loc11_19.2: %i32 = value_of_initializer %int.convert_checked.loc11_19.1 [concrete = constants.%int_3.d47] // CHECK:STDOUT: %.loc11_19.3: %i32 = converted %int_3, %.loc11_19.2 [concrete = constants.%int_3.d47] // CHECK:STDOUT: %impl.elem0.loc11_19.2: %.088 = impl_witness_access constants.%impl_witness.847, element0 [concrete = constants.%Convert.4cb] -// CHECK:STDOUT: %bound_method.loc11_19.2: = bound_method %int_4, %impl.elem0.loc11_19.2 [concrete = constants.%Convert.bound.694] -// CHECK:STDOUT: %specific_fn.loc11_19.2: = specific_function %bound_method.loc11_19.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.739] -// CHECK:STDOUT: %int.convert_checked.loc11_19.2: init %i32 = call %specific_fn.loc11_19.2(%int_4) [concrete = constants.%int_4.ea3] +// CHECK:STDOUT: %bound_method.loc11_19.3: = bound_method %int_4, %impl.elem0.loc11_19.2 [concrete = constants.%Convert.bound.694] +// CHECK:STDOUT: %specific_fn.loc11_19.2: = specific_function %impl.elem0.loc11_19.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_19.4: = bound_method %int_4, %specific_fn.loc11_19.2 [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked.loc11_19.2: init %i32 = call %bound_method.loc11_19.4(%int_4) [concrete = constants.%int_4.ea3] // CHECK:STDOUT: %.loc11_19.4: %i32 = value_of_initializer %int.convert_checked.loc11_19.2 [concrete = constants.%int_4.ea3] // CHECK:STDOUT: %.loc11_19.5: %i32 = converted %int_4, %.loc11_19.4 [concrete = constants.%int_4.ea3] // CHECK:STDOUT: %tuple: %tuple.type.c2c = tuple_value (%.loc11_19.3, %.loc11_19.5) [concrete = constants.%tuple.5de] diff --git a/toolchain/check/testdata/tuple/nested_tuple.carbon b/toolchain/check/testdata/tuple/nested_tuple.carbon index 45f55e8a1459..110b2ff05e5a 100644 --- a/toolchain/check/testdata/tuple/nested_tuple.carbon +++ b/toolchain/check/testdata/tuple/nested_tuple.carbon @@ -32,14 +32,15 @@ var x: ((i32, i32), i32) = ((12, 76), 6); // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.221: = bound_method %int_12.6a3, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.9a9: = specific_function %Convert.bound.221, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.dae: = bound_method %int_12.6a3, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [concrete] // CHECK:STDOUT: %Convert.bound.033: = bound_method %int_76.872, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.454: = specific_function %Convert.bound.033, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.ce4: = bound_method %int_76.872, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_76.8dd: %i32 = int_value 76 [concrete] // CHECK:STDOUT: %tuple.737: %tuple.type.d07 = tuple_value (%int_12.1e1, %int_76.8dd) [concrete] // CHECK:STDOUT: %Convert.bound.ce9: = bound_method %int_6.462, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.631: = specific_function %Convert.bound.ce9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.efa: = bound_method %int_6.462, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_6.e56: %i32 = int_value 6 [concrete] // CHECK:STDOUT: %tuple.51f: %tuple.type.f72 = tuple_value (%tuple.737, %int_6.e56) [concrete] // CHECK:STDOUT: } @@ -88,25 +89,28 @@ var x: ((i32, i32), i32) = ((12, 76), 6); // CHECK:STDOUT: %.loc11_40.1: %tuple.type.acf = tuple_literal (%.loc11_36.1, %int_6) // CHECK:STDOUT: %impl.elem0.loc11_36.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc11_36.1: = bound_method %int_12, %impl.elem0.loc11_36.1 [concrete = constants.%Convert.bound.221] -// CHECK:STDOUT: %specific_fn.loc11_36.1: = specific_function %bound_method.loc11_36.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.9a9] -// CHECK:STDOUT: %int.convert_checked.loc11_36.1: init %i32 = call %specific_fn.loc11_36.1(%int_12) [concrete = constants.%int_12.1e1] +// CHECK:STDOUT: %specific_fn.loc11_36.1: = specific_function %impl.elem0.loc11_36.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_36.2: = bound_method %int_12, %specific_fn.loc11_36.1 [concrete = constants.%bound_method.dae] +// CHECK:STDOUT: %int.convert_checked.loc11_36.1: init %i32 = call %bound_method.loc11_36.2(%int_12) [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %.loc11_36.2: init %i32 = converted %int_12, %int.convert_checked.loc11_36.1 [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %tuple.elem0.loc11_40: ref %tuple.type.d07 = tuple_access file.%x.var, element0 // CHECK:STDOUT: %tuple.elem0.loc11_36: ref %i32 = tuple_access %tuple.elem0.loc11_40, element0 // CHECK:STDOUT: %.loc11_36.3: init %i32 = initialize_from %.loc11_36.2 to %tuple.elem0.loc11_36 [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %impl.elem0.loc11_36.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11_36.2: = bound_method %int_76, %impl.elem0.loc11_36.2 [concrete = constants.%Convert.bound.033] -// CHECK:STDOUT: %specific_fn.loc11_36.2: = specific_function %bound_method.loc11_36.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.454] -// CHECK:STDOUT: %int.convert_checked.loc11_36.2: init %i32 = call %specific_fn.loc11_36.2(%int_76) [concrete = constants.%int_76.8dd] +// CHECK:STDOUT: %bound_method.loc11_36.3: = bound_method %int_76, %impl.elem0.loc11_36.2 [concrete = constants.%Convert.bound.033] +// CHECK:STDOUT: %specific_fn.loc11_36.2: = specific_function %impl.elem0.loc11_36.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_36.4: = bound_method %int_76, %specific_fn.loc11_36.2 [concrete = constants.%bound_method.ce4] +// CHECK:STDOUT: %int.convert_checked.loc11_36.2: init %i32 = call %bound_method.loc11_36.4(%int_76) [concrete = constants.%int_76.8dd] // CHECK:STDOUT: %.loc11_36.4: init %i32 = converted %int_76, %int.convert_checked.loc11_36.2 [concrete = constants.%int_76.8dd] // CHECK:STDOUT: %tuple.elem1.loc11_36: ref %i32 = tuple_access %tuple.elem0.loc11_40, element1 // CHECK:STDOUT: %.loc11_36.5: init %i32 = initialize_from %.loc11_36.4 to %tuple.elem1.loc11_36 [concrete = constants.%int_76.8dd] // CHECK:STDOUT: %.loc11_36.6: init %tuple.type.d07 = tuple_init (%.loc11_36.3, %.loc11_36.5) to %tuple.elem0.loc11_40 [concrete = constants.%tuple.737] // CHECK:STDOUT: %.loc11_40.2: init %tuple.type.d07 = converted %.loc11_36.1, %.loc11_36.6 [concrete = constants.%tuple.737] // CHECK:STDOUT: %impl.elem0.loc11_40: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11_40: = bound_method %int_6, %impl.elem0.loc11_40 [concrete = constants.%Convert.bound.ce9] -// CHECK:STDOUT: %specific_fn.loc11_40: = specific_function %bound_method.loc11_40, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.631] -// CHECK:STDOUT: %int.convert_checked.loc11_40: init %i32 = call %specific_fn.loc11_40(%int_6) [concrete = constants.%int_6.e56] +// CHECK:STDOUT: %bound_method.loc11_40.1: = bound_method %int_6, %impl.elem0.loc11_40 [concrete = constants.%Convert.bound.ce9] +// CHECK:STDOUT: %specific_fn.loc11_40: = specific_function %impl.elem0.loc11_40, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_40.2: = bound_method %int_6, %specific_fn.loc11_40 [concrete = constants.%bound_method.efa] +// CHECK:STDOUT: %int.convert_checked.loc11_40: init %i32 = call %bound_method.loc11_40.2(%int_6) [concrete = constants.%int_6.e56] // CHECK:STDOUT: %.loc11_40.3: init %i32 = converted %int_6, %int.convert_checked.loc11_40 [concrete = constants.%int_6.e56] // CHECK:STDOUT: %tuple.elem1.loc11_40: ref %i32 = tuple_access file.%x.var, element1 // CHECK:STDOUT: %.loc11_40.4: init %i32 = initialize_from %.loc11_40.3 to %tuple.elem1.loc11_40 [concrete = constants.%int_6.e56] diff --git a/toolchain/check/testdata/tuple/nested_tuple_in_place.carbon b/toolchain/check/testdata/tuple/nested_tuple_in_place.carbon index 42979eef5a7f..c1b3cf3f74b9 100644 --- a/toolchain/check/testdata/tuple/nested_tuple_in_place.carbon +++ b/toolchain/check/testdata/tuple/nested_tuple_in_place.carbon @@ -46,10 +46,11 @@ fn H() { // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.70c: = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.787: = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -147,15 +148,17 @@ fn H() { // CHECK:STDOUT: %.loc18_50.1: %tuple.type.667 = tuple_literal (%int_1, %F.call, %int_2) // CHECK:STDOUT: %impl.elem0.loc18_50.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc18_50.1: = bound_method %int_1, %impl.elem0.loc18_50.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc18_50.1: = specific_function %bound_method.loc18_50.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc18_50.1: init %i32 = call %specific_fn.loc18_50.1(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %specific_fn.loc18_50.1: = specific_function %impl.elem0.loc18_50.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc18_50.2: = bound_method %int_1, %specific_fn.loc18_50.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc18_50.1: init %i32 = call %bound_method.loc18_50.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc18_50.2: init %i32 = converted %int_1, %int.convert_checked.loc18_50.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %v.var, element0 // CHECK:STDOUT: %.loc18_50.3: init %i32 = initialize_from %.loc18_50.2 to %tuple.elem0 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc18_50.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc18_50.2: = bound_method %int_2, %impl.elem0.loc18_50.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc18_50.2: = specific_function %bound_method.loc18_50.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc18_50.2: init %i32 = call %specific_fn.loc18_50.2(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %bound_method.loc18_50.3: = bound_method %int_2, %impl.elem0.loc18_50.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc18_50.2: = specific_function %impl.elem0.loc18_50.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc18_50.4: = bound_method %int_2, %specific_fn.loc18_50.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc18_50.2: init %i32 = call %bound_method.loc18_50.4(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc18_50.4: init %i32 = converted %int_2, %int.convert_checked.loc18_50.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %tuple.elem2: ref %i32 = tuple_access %v.var, element2 // CHECK:STDOUT: %.loc18_50.5: init %i32 = initialize_from %.loc18_50.4 to %tuple.elem2 [concrete = constants.%int_2.ef8] diff --git a/toolchain/check/testdata/tuple/one_element.carbon b/toolchain/check/testdata/tuple/one_element.carbon index 80ba258a8793..985bd1b0b666 100644 --- a/toolchain/check/testdata/tuple/one_element.carbon +++ b/toolchain/check/testdata/tuple/one_element.carbon @@ -28,7 +28,8 @@ var y: (i32,) = x; // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound: = bound_method %int_4.0c1, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_4.0c1, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete] // CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%int_4.940) [concrete] // CHECK:STDOUT: } @@ -80,9 +81,10 @@ var y: (i32,) = x; // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1] // CHECK:STDOUT: %.loc11_20.1: %tuple.type.985 = tuple_literal (%int_4) // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method: = bound_method %int_4, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_4) [concrete = constants.%int_4.940] +// CHECK:STDOUT: %bound_method.loc11_20.1: = bound_method %int_4, %impl.elem0 [concrete = constants.%Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_20.2: = bound_method %int_4, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc11_20.2(%int_4) [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc11_20.2: init %i32 = converted %int_4, %int.convert_checked [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc11_20.3: init %tuple.type.a1c = tuple_init (%.loc11_20.2) to file.%x.var [concrete = constants.%tuple] // CHECK:STDOUT: %.loc11_1: init %tuple.type.a1c = converted %.loc11_20.1, %.loc11_20.3 [concrete = constants.%tuple] diff --git a/toolchain/check/testdata/tuple/two_elements.carbon b/toolchain/check/testdata/tuple/two_elements.carbon index 9e02fce48942..6afd57a869c7 100644 --- a/toolchain/check/testdata/tuple/two_elements.carbon +++ b/toolchain/check/testdata/tuple/two_elements.carbon @@ -32,10 +32,11 @@ var y: (i32, i32) = x; // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete] // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Convert.bound.ac3: = bound_method %int_4.0c1, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.450: = specific_function %Convert.bound.ac3, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.1da: = bound_method %int_4.0c1, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete] // CHECK:STDOUT: %Convert.bound.063: = bound_method %int_102.b54, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn.9b4: = specific_function %Convert.bound.063, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.c20: = bound_method %int_102.b54, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_102.b91: %i32 = int_value 102 [concrete] // CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%int_4.940, %int_102.b91) [concrete] // CHECK:STDOUT: } @@ -71,14 +72,16 @@ var y: (i32, i32) = x; // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0.loc11_28.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc11_28.1: = bound_method @__global_init.%int_4.loc11, %impl.elem0.loc11_28.1 [concrete = constants.%Convert.bound.ac3] -// CHECK:STDOUT: %specific_fn.loc11_28.1: = specific_function %bound_method.loc11_28.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.450] -// CHECK:STDOUT: %int.convert_checked.loc11_28.1: init %i32 = call %specific_fn.loc11_28.1(@__global_init.%int_4.loc11) [concrete = constants.%int_4.940] +// CHECK:STDOUT: %specific_fn.loc11_28.1: = specific_function %impl.elem0.loc11_28.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_28.2: = bound_method @__global_init.%int_4.loc11, %specific_fn.loc11_28.1 [concrete = constants.%bound_method.1da] +// CHECK:STDOUT: %int.convert_checked.loc11_28.1: init %i32 = call %bound_method.loc11_28.2(@__global_init.%int_4.loc11) [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc11_28.1: %i32 = value_of_initializer %int.convert_checked.loc11_28.1 [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc11_28.2: %i32 = converted @__global_init.%int_4.loc11, %.loc11_28.1 [concrete = constants.%int_4.940] // CHECK:STDOUT: %impl.elem0.loc11_28.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11_28.2: = bound_method @__global_init.%int_102.loc11, %impl.elem0.loc11_28.2 [concrete = constants.%Convert.bound.063] -// CHECK:STDOUT: %specific_fn.loc11_28.2: = specific_function %bound_method.loc11_28.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.9b4] -// CHECK:STDOUT: %int.convert_checked.loc11_28.2: init %i32 = call %specific_fn.loc11_28.2(@__global_init.%int_102.loc11) [concrete = constants.%int_102.b91] +// CHECK:STDOUT: %bound_method.loc11_28.3: = bound_method @__global_init.%int_102.loc11, %impl.elem0.loc11_28.2 [concrete = constants.%Convert.bound.063] +// CHECK:STDOUT: %specific_fn.loc11_28.2: = specific_function %impl.elem0.loc11_28.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_28.4: = bound_method @__global_init.%int_102.loc11, %specific_fn.loc11_28.2 [concrete = constants.%bound_method.c20] +// CHECK:STDOUT: %int.convert_checked.loc11_28.2: init %i32 = call %bound_method.loc11_28.4(@__global_init.%int_102.loc11) [concrete = constants.%int_102.b91] // CHECK:STDOUT: %.loc11_28.3: %i32 = value_of_initializer %int.convert_checked.loc11_28.2 [concrete = constants.%int_102.b91] // CHECK:STDOUT: %.loc11_28.4: %i32 = converted @__global_init.%int_102.loc11, %.loc11_28.3 [concrete = constants.%int_102.b91] // CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%.loc11_28.2, %.loc11_28.4) [concrete = constants.%tuple] @@ -137,15 +140,17 @@ var y: (i32, i32) = x; // CHECK:STDOUT: %.loc14_28.1: %tuple.type.f94 = tuple_literal (%int_4.loc14, %int_102.loc14) // CHECK:STDOUT: %impl.elem0.loc14_28.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] // CHECK:STDOUT: %bound_method.loc14_28.1: = bound_method %int_4.loc14, %impl.elem0.loc14_28.1 [concrete = constants.%Convert.bound.ac3] -// CHECK:STDOUT: %specific_fn.loc14_28.1: = specific_function %bound_method.loc14_28.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.450] -// CHECK:STDOUT: %int.convert_checked.loc14_28.1: init %i32 = call %specific_fn.loc14_28.1(%int_4.loc14) [concrete = constants.%int_4.940] +// CHECK:STDOUT: %specific_fn.loc14_28.1: = specific_function %impl.elem0.loc14_28.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_28.2: = bound_method %int_4.loc14, %specific_fn.loc14_28.1 [concrete = constants.%bound_method.1da] +// CHECK:STDOUT: %int.convert_checked.loc14_28.1: init %i32 = call %bound_method.loc14_28.2(%int_4.loc14) [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc14_28.2: init %i32 = converted %int_4.loc14, %int.convert_checked.loc14_28.1 [concrete = constants.%int_4.940] // CHECK:STDOUT: %tuple.elem0.loc14: ref %i32 = tuple_access file.%x.var, element0 // CHECK:STDOUT: %.loc14_28.3: init %i32 = initialize_from %.loc14_28.2 to %tuple.elem0.loc14 [concrete = constants.%int_4.940] // CHECK:STDOUT: %impl.elem0.loc14_28.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc14_28.2: = bound_method %int_102.loc14, %impl.elem0.loc14_28.2 [concrete = constants.%Convert.bound.063] -// CHECK:STDOUT: %specific_fn.loc14_28.2: = specific_function %bound_method.loc14_28.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.9b4] -// CHECK:STDOUT: %int.convert_checked.loc14_28.2: init %i32 = call %specific_fn.loc14_28.2(%int_102.loc14) [concrete = constants.%int_102.b91] +// CHECK:STDOUT: %bound_method.loc14_28.3: = bound_method %int_102.loc14, %impl.elem0.loc14_28.2 [concrete = constants.%Convert.bound.063] +// CHECK:STDOUT: %specific_fn.loc14_28.2: = specific_function %impl.elem0.loc14_28.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_28.4: = bound_method %int_102.loc14, %specific_fn.loc14_28.2 [concrete = constants.%bound_method.c20] +// CHECK:STDOUT: %int.convert_checked.loc14_28.2: init %i32 = call %bound_method.loc14_28.4(%int_102.loc14) [concrete = constants.%int_102.b91] // CHECK:STDOUT: %.loc14_28.4: init %i32 = converted %int_102.loc14, %int.convert_checked.loc14_28.2 [concrete = constants.%int_102.b91] // CHECK:STDOUT: %tuple.elem1.loc14: ref %i32 = tuple_access file.%x.var, element1 // CHECK:STDOUT: %.loc14_28.5: init %i32 = initialize_from %.loc14_28.4 to %tuple.elem1.loc14 [concrete = constants.%int_102.b91] diff --git a/toolchain/lower/testdata/function/generic/call_basic.carbon b/toolchain/lower/testdata/function/generic/call_basic.carbon index e655239692a0..a836ffe8d446 100644 --- a/toolchain/lower/testdata/function/generic/call_basic.carbon +++ b/toolchain/lower/testdata/function/generic/call_basic.carbon @@ -8,6 +8,11 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/function/generic/call_basic.carbon +class C { + fn Cfn[self: Self, T:! type](x: T) { + } +} + fn F[T:! type](x: T) { } @@ -22,9 +27,14 @@ fn G[T:! type](x: T) -> T { H(i32); H(G(x)); G(T); + var a: f64; G(a); H(a); + + var c: C; + c.Cfn(x); + return x; } @@ -57,16 +67,16 @@ fn M() { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 8, ptr %p.var), !dbg !7 // CHECK:STDOUT: store double 1.000000e+00, ptr %p.var, align 8, !dbg !8 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 8, ptr %q.var), !dbg !7 -// CHECK:STDOUT: %.loc37 = load i32, ptr %n.var, align 4, !dbg !9 -// CHECK:STDOUT: call void @_CF.Main.b88d1103f417c6d4(i32 %.loc37), !dbg !10 -// CHECK:STDOUT: %.loc38 = load i32, ptr %n.var, align 4, !dbg !11 -// CHECK:STDOUT: %G.call.loc38 = call i32 @_CG.Main.b88d1103f417c6d4(i32 %.loc38), !dbg !12 -// CHECK:STDOUT: store i32 %G.call.loc38, ptr %m.var, align 4, !dbg !13 -// CHECK:STDOUT: %.loc39 = load double, ptr %p.var, align 8, !dbg !14 -// CHECK:STDOUT: call void @_CF.Main.66be507887ceee78(double %.loc39), !dbg !15 -// CHECK:STDOUT: %.loc40 = load double, ptr %p.var, align 8, !dbg !16 -// CHECK:STDOUT: %G.call.loc40 = call double @_CG.Main.66be507887ceee78(double %.loc40), !dbg !17 -// CHECK:STDOUT: store double %G.call.loc40, ptr %q.var, align 8, !dbg !18 +// CHECK:STDOUT: %.loc47 = load i32, ptr %n.var, align 4, !dbg !9 +// CHECK:STDOUT: call void @_CF.Main.b88d1103f417c6d4(i32 %.loc47), !dbg !10 +// CHECK:STDOUT: %.loc48 = load i32, ptr %n.var, align 4, !dbg !11 +// CHECK:STDOUT: %G.call.loc48 = call i32 @_CG.Main.b88d1103f417c6d4(i32 %.loc48), !dbg !12 +// CHECK:STDOUT: store i32 %G.call.loc48, ptr %m.var, align 4, !dbg !13 +// CHECK:STDOUT: %.loc49 = load double, ptr %p.var, align 8, !dbg !14 +// CHECK:STDOUT: call void @_CF.Main.66be507887ceee78(double %.loc49), !dbg !15 +// CHECK:STDOUT: %.loc50 = load double, ptr %p.var, align 8, !dbg !16 +// CHECK:STDOUT: %G.call.loc50 = call double @_CG.Main.66be507887ceee78(double %.loc50), !dbg !17 +// CHECK:STDOUT: store double %G.call.loc50, ptr %q.var, align 8, !dbg !18 // CHECK:STDOUT: ret void, !dbg !19 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -81,76 +91,100 @@ fn M() { // CHECK:STDOUT: define i32 @_CG.Main.b88d1103f417c6d4(i32 %x) !dbg !22 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca double, align 8, !dbg !23 -// CHECK:STDOUT: %H.call.loc20 = call i32 @_CH.Main.b88d1103f417c6d4(i32 %x), !dbg !24 -// CHECK:STDOUT: %H.call.loc21 = call %type @_CH.Main.5754c7a55c7cbe4a(%type zeroinitializer), !dbg !25 -// CHECK:STDOUT: %H.call.loc22 = call %type @_CH.Main.5754c7a55c7cbe4a(%type zeroinitializer), !dbg !26 -// CHECK:STDOUT: %G.call.loc23 = call i32 @_CG.Main.b88d1103f417c6d4(i32 %x), !dbg !27 -// CHECK:STDOUT: %H.call.loc23 = call i32 @_CH.Main.b88d1103f417c6d4(i32 %G.call.loc23), !dbg !28 -// CHECK:STDOUT: %G.call.loc24 = call %type @_CG.Main.5754c7a55c7cbe4a(%type zeroinitializer), !dbg !29 +// CHECK:STDOUT: %c.var = alloca {}, align 8, !dbg !24 +// CHECK:STDOUT: %H.call.loc25 = call i32 @_CH.Main.b88d1103f417c6d4(i32 %x), !dbg !24 +// CHECK:STDOUT: %H.call.loc26 = call %type @_CH.Main.5754c7a55c7cbe4a(%type zeroinitializer), !dbg !25 +// CHECK:STDOUT: %H.call.loc27 = call %type @_CH.Main.5754c7a55c7cbe4a(%type zeroinitializer), !dbg !26 +// CHECK:STDOUT: %G.call.loc28 = call i32 @_CG.Main.b88d1103f417c6d4(i32 %x), !dbg !27 +// CHECK:STDOUT: %H.call.loc28 = call i32 @_CH.Main.b88d1103f417c6d4(i32 %G.call.loc28), !dbg !28 +// CHECK:STDOUT: %G.call.loc29 = call %type @_CG.Main.5754c7a55c7cbe4a(%type zeroinitializer), !dbg !29 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 8, ptr %a.var), !dbg !23 -// CHECK:STDOUT: %.loc26 = load double, ptr %a.var, align 8, !dbg !30 -// CHECK:STDOUT: %G.call.loc26 = call double @_CG.Main.66be507887ceee78(double %.loc26), !dbg !31 -// CHECK:STDOUT: %.loc27 = load double, ptr %a.var, align 8, !dbg !32 -// CHECK:STDOUT: %H.call.loc27 = call double @_CH.Main.66be507887ceee78(double %.loc27), !dbg !33 -// CHECK:STDOUT: ret i32 %x, !dbg !34 +// CHECK:STDOUT: %.loc32 = load double, ptr %a.var, align 8, !dbg !30 +// CHECK:STDOUT: %G.call.loc32 = call double @_CG.Main.66be507887ceee78(double %.loc32), !dbg !31 +// CHECK:STDOUT: %.loc33 = load double, ptr %a.var, align 8, !dbg !32 +// CHECK:STDOUT: %H.call.loc33 = call double @_CH.Main.66be507887ceee78(double %.loc33), !dbg !33 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 0, ptr %c.var), !dbg !24 +// CHECK:STDOUT: call void @_CCfn.C.Main.b88d1103f417c6d4(ptr %c.var, i32 %x), !dbg !34 +// CHECK:STDOUT: ret i32 %x, !dbg !35 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @_CF.Main.66be507887ceee78(double %x) !dbg !35 { +// CHECK:STDOUT: define void @_CF.Main.66be507887ceee78(double %x) !dbg !36 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !36 +// CHECK:STDOUT: ret void, !dbg !37 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define double @_CG.Main.66be507887ceee78(double %x) !dbg !37 { +// CHECK:STDOUT: define double @_CG.Main.66be507887ceee78(double %x) !dbg !38 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a.var = alloca double, align 8, !dbg !38 -// CHECK:STDOUT: %H.call.loc20 = call double @_CH.Main.66be507887ceee78(double %x), !dbg !39 -// CHECK:STDOUT: %H.call.loc21 = call %type @_CH.Main.5754c7a55c7cbe4a(%type zeroinitializer), !dbg !40 -// CHECK:STDOUT: %H.call.loc22 = call %type @_CH.Main.5754c7a55c7cbe4a(%type zeroinitializer), !dbg !41 -// CHECK:STDOUT: %G.call.loc23 = call double @_CG.Main.66be507887ceee78(double %x), !dbg !42 -// CHECK:STDOUT: %H.call.loc23 = call double @_CH.Main.66be507887ceee78(double %G.call.loc23), !dbg !43 -// CHECK:STDOUT: %G.call.loc24 = call %type @_CG.Main.5754c7a55c7cbe4a(%type zeroinitializer), !dbg !44 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 8, ptr %a.var), !dbg !38 -// CHECK:STDOUT: %.loc26 = load double, ptr %a.var, align 8, !dbg !45 -// CHECK:STDOUT: %G.call.loc26 = call double @_CG.Main.66be507887ceee78(double %.loc26), !dbg !46 -// CHECK:STDOUT: %.loc27 = load double, ptr %a.var, align 8, !dbg !47 -// CHECK:STDOUT: %H.call.loc27 = call double @_CH.Main.66be507887ceee78(double %.loc27), !dbg !48 -// CHECK:STDOUT: ret double %x, !dbg !49 +// CHECK:STDOUT: %a.var = alloca double, align 8, !dbg !39 +// CHECK:STDOUT: %c.var = alloca {}, align 8, !dbg !40 +// CHECK:STDOUT: %H.call.loc25 = call double @_CH.Main.66be507887ceee78(double %x), !dbg !40 +// CHECK:STDOUT: %H.call.loc26 = call %type @_CH.Main.5754c7a55c7cbe4a(%type zeroinitializer), !dbg !41 +// CHECK:STDOUT: %H.call.loc27 = call %type @_CH.Main.5754c7a55c7cbe4a(%type zeroinitializer), !dbg !42 +// CHECK:STDOUT: %G.call.loc28 = call double @_CG.Main.66be507887ceee78(double %x), !dbg !43 +// CHECK:STDOUT: %H.call.loc28 = call double @_CH.Main.66be507887ceee78(double %G.call.loc28), !dbg !44 +// CHECK:STDOUT: %G.call.loc29 = call %type @_CG.Main.5754c7a55c7cbe4a(%type zeroinitializer), !dbg !45 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 8, ptr %a.var), !dbg !39 +// CHECK:STDOUT: %.loc32 = load double, ptr %a.var, align 8, !dbg !46 +// CHECK:STDOUT: %G.call.loc32 = call double @_CG.Main.66be507887ceee78(double %.loc32), !dbg !47 +// CHECK:STDOUT: %.loc33 = load double, ptr %a.var, align 8, !dbg !48 +// CHECK:STDOUT: %H.call.loc33 = call double @_CH.Main.66be507887ceee78(double %.loc33), !dbg !49 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 0, ptr %c.var), !dbg !40 +// CHECK:STDOUT: call void @_CCfn.C.Main.66be507887ceee78(ptr %c.var, double %x), !dbg !50 +// CHECK:STDOUT: ret double %x, !dbg !51 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @_CH.Main.b88d1103f417c6d4(i32 %x) !dbg !50 { +// CHECK:STDOUT: define i32 @_CH.Main.b88d1103f417c6d4(i32 %x) !dbg !52 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret i32 %x, !dbg !51 +// CHECK:STDOUT: ret i32 %x, !dbg !53 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define %type @_CH.Main.5754c7a55c7cbe4a(%type %x) !dbg !52 { +// CHECK:STDOUT: define %type @_CH.Main.5754c7a55c7cbe4a(%type %x) !dbg !54 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret %type %x, !dbg !53 +// CHECK:STDOUT: ret %type %x, !dbg !55 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define %type @_CG.Main.5754c7a55c7cbe4a(%type %x) !dbg !54 { +// CHECK:STDOUT: define %type @_CG.Main.5754c7a55c7cbe4a(%type %x) !dbg !56 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a.var = alloca double, align 8, !dbg !55 -// CHECK:STDOUT: %H.call.loc20 = call %type @_CH.Main.5754c7a55c7cbe4a(%type %x), !dbg !56 -// CHECK:STDOUT: %H.call.loc21 = call %type @_CH.Main.5754c7a55c7cbe4a(%type zeroinitializer), !dbg !57 -// CHECK:STDOUT: %H.call.loc22 = call %type @_CH.Main.5754c7a55c7cbe4a(%type zeroinitializer), !dbg !58 -// CHECK:STDOUT: %G.call.loc23 = call %type @_CG.Main.5754c7a55c7cbe4a(%type %x), !dbg !59 -// CHECK:STDOUT: %H.call.loc23 = call %type @_CH.Main.5754c7a55c7cbe4a(%type %G.call.loc23), !dbg !60 -// CHECK:STDOUT: %G.call.loc24 = call %type @_CG.Main.5754c7a55c7cbe4a(%type zeroinitializer), !dbg !61 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 8, ptr %a.var), !dbg !55 -// CHECK:STDOUT: %.loc26 = load double, ptr %a.var, align 8, !dbg !62 -// CHECK:STDOUT: %G.call.loc26 = call double @_CG.Main.66be507887ceee78(double %.loc26), !dbg !63 -// CHECK:STDOUT: %.loc27 = load double, ptr %a.var, align 8, !dbg !64 -// CHECK:STDOUT: %H.call.loc27 = call double @_CH.Main.66be507887ceee78(double %.loc27), !dbg !65 -// CHECK:STDOUT: ret %type %x, !dbg !66 +// CHECK:STDOUT: %a.var = alloca double, align 8, !dbg !57 +// CHECK:STDOUT: %c.var = alloca {}, align 8, !dbg !58 +// CHECK:STDOUT: %H.call.loc25 = call %type @_CH.Main.5754c7a55c7cbe4a(%type %x), !dbg !58 +// CHECK:STDOUT: %H.call.loc26 = call %type @_CH.Main.5754c7a55c7cbe4a(%type zeroinitializer), !dbg !59 +// CHECK:STDOUT: %H.call.loc27 = call %type @_CH.Main.5754c7a55c7cbe4a(%type zeroinitializer), !dbg !60 +// CHECK:STDOUT: %G.call.loc28 = call %type @_CG.Main.5754c7a55c7cbe4a(%type %x), !dbg !61 +// CHECK:STDOUT: %H.call.loc28 = call %type @_CH.Main.5754c7a55c7cbe4a(%type %G.call.loc28), !dbg !62 +// CHECK:STDOUT: %G.call.loc29 = call %type @_CG.Main.5754c7a55c7cbe4a(%type zeroinitializer), !dbg !63 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 8, ptr %a.var), !dbg !57 +// CHECK:STDOUT: %.loc32 = load double, ptr %a.var, align 8, !dbg !64 +// CHECK:STDOUT: %G.call.loc32 = call double @_CG.Main.66be507887ceee78(double %.loc32), !dbg !65 +// CHECK:STDOUT: %.loc33 = load double, ptr %a.var, align 8, !dbg !66 +// CHECK:STDOUT: %H.call.loc33 = call double @_CH.Main.66be507887ceee78(double %.loc33), !dbg !67 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 0, ptr %c.var), !dbg !58 +// CHECK:STDOUT: call void @_CCfn.C.Main.5754c7a55c7cbe4a(ptr %c.var, %type %x), !dbg !68 +// CHECK:STDOUT: ret %type %x, !dbg !69 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define double @_CH.Main.66be507887ceee78(double %x) !dbg !67 { +// CHECK:STDOUT: define double @_CH.Main.66be507887ceee78(double %x) !dbg !70 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret double %x, !dbg !68 +// CHECK:STDOUT: ret double %x, !dbg !71 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: define void @_CCfn.C.Main.b88d1103f417c6d4(ptr %self, i32 %x) !dbg !72 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !73 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: define void @_CCfn.C.Main.66be507887ceee78(ptr %self, double %x) !dbg !74 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !75 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: define void @_CCfn.C.Main.5754c7a55c7cbe4a(ptr %self, %type %x) !dbg !76 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !77 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 0, 1, 2, 6, 5, 4, 3 } +// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 0, 1, 2, 3, 4, 5, 9, 8, 7, 6 } // CHECK:STDOUT: uselistorder ptr @_CG.Main.66be507887ceee78, { 0, 1, 2, 4, 3 } // CHECK:STDOUT: uselistorder ptr @_CH.Main.b88d1103f417c6d4, { 1, 0 } // CHECK:STDOUT: uselistorder ptr @_CH.Main.5754c7a55c7cbe4a, { 0, 1, 2, 3, 7, 6, 5, 4 } @@ -166,68 +200,77 @@ fn M() { // CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) // CHECK:STDOUT: !3 = !DIFile(filename: "call_basic.carbon", directory: "") -// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "M", linkageName: "_CM.Main", scope: null, file: !3, line: 31, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "M", linkageName: "_CM.Main", scope: null, file: !3, line: 41, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} -// CHECK:STDOUT: !7 = !DILocation(line: 32, column: 3, scope: !4) -// CHECK:STDOUT: !8 = !DILocation(line: 34, column: 3, scope: !4) -// CHECK:STDOUT: !9 = !DILocation(line: 37, column: 5, scope: !4) -// CHECK:STDOUT: !10 = !DILocation(line: 37, column: 3, scope: !4) -// CHECK:STDOUT: !11 = !DILocation(line: 38, column: 9, scope: !4) -// CHECK:STDOUT: !12 = !DILocation(line: 38, column: 7, scope: !4) -// CHECK:STDOUT: !13 = !DILocation(line: 38, column: 3, scope: !4) -// CHECK:STDOUT: !14 = !DILocation(line: 39, column: 5, scope: !4) -// CHECK:STDOUT: !15 = !DILocation(line: 39, column: 3, scope: !4) -// CHECK:STDOUT: !16 = !DILocation(line: 40, column: 9, scope: !4) -// CHECK:STDOUT: !17 = !DILocation(line: 40, column: 7, scope: !4) -// CHECK:STDOUT: !18 = !DILocation(line: 40, column: 3, scope: !4) -// CHECK:STDOUT: !19 = !DILocation(line: 31, column: 1, scope: !4) -// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.b88d1103f417c6d4", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !21 = !DILocation(line: 11, column: 1, scope: !20) -// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.b88d1103f417c6d4", scope: null, file: !3, line: 18, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !23 = !DILocation(line: 25, column: 3, scope: !22) -// CHECK:STDOUT: !24 = !DILocation(line: 20, column: 3, scope: !22) -// CHECK:STDOUT: !25 = !DILocation(line: 21, column: 3, scope: !22) -// CHECK:STDOUT: !26 = !DILocation(line: 22, column: 3, scope: !22) -// CHECK:STDOUT: !27 = !DILocation(line: 23, column: 5, scope: !22) -// CHECK:STDOUT: !28 = !DILocation(line: 23, column: 3, scope: !22) -// CHECK:STDOUT: !29 = !DILocation(line: 24, column: 3, scope: !22) -// CHECK:STDOUT: !30 = !DILocation(line: 26, column: 5, scope: !22) -// CHECK:STDOUT: !31 = !DILocation(line: 26, column: 3, scope: !22) -// CHECK:STDOUT: !32 = !DILocation(line: 27, column: 5, scope: !22) -// CHECK:STDOUT: !33 = !DILocation(line: 27, column: 3, scope: !22) -// CHECK:STDOUT: !34 = !DILocation(line: 28, column: 3, scope: !22) -// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.66be507887ceee78", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !36 = !DILocation(line: 11, column: 1, scope: !35) -// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.66be507887ceee78", scope: null, file: !3, line: 18, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !38 = !DILocation(line: 25, column: 3, scope: !37) -// CHECK:STDOUT: !39 = !DILocation(line: 20, column: 3, scope: !37) -// CHECK:STDOUT: !40 = !DILocation(line: 21, column: 3, scope: !37) -// CHECK:STDOUT: !41 = !DILocation(line: 22, column: 3, scope: !37) -// CHECK:STDOUT: !42 = !DILocation(line: 23, column: 5, scope: !37) -// CHECK:STDOUT: !43 = !DILocation(line: 23, column: 3, scope: !37) -// CHECK:STDOUT: !44 = !DILocation(line: 24, column: 3, scope: !37) -// CHECK:STDOUT: !45 = !DILocation(line: 26, column: 5, scope: !37) -// CHECK:STDOUT: !46 = !DILocation(line: 26, column: 3, scope: !37) -// CHECK:STDOUT: !47 = !DILocation(line: 27, column: 5, scope: !37) -// CHECK:STDOUT: !48 = !DILocation(line: 27, column: 3, scope: !37) -// CHECK:STDOUT: !49 = !DILocation(line: 28, column: 3, scope: !37) -// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main.b88d1103f417c6d4", scope: null, file: !3, line: 14, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !51 = !DILocation(line: 15, column: 3, scope: !50) -// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main.5754c7a55c7cbe4a", scope: null, file: !3, line: 14, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !53 = !DILocation(line: 15, column: 3, scope: !52) -// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.5754c7a55c7cbe4a", scope: null, file: !3, line: 18, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !55 = !DILocation(line: 25, column: 3, scope: !54) -// CHECK:STDOUT: !56 = !DILocation(line: 20, column: 3, scope: !54) -// CHECK:STDOUT: !57 = !DILocation(line: 21, column: 3, scope: !54) -// CHECK:STDOUT: !58 = !DILocation(line: 22, column: 3, scope: !54) -// CHECK:STDOUT: !59 = !DILocation(line: 23, column: 5, scope: !54) -// CHECK:STDOUT: !60 = !DILocation(line: 23, column: 3, scope: !54) -// CHECK:STDOUT: !61 = !DILocation(line: 24, column: 3, scope: !54) -// CHECK:STDOUT: !62 = !DILocation(line: 26, column: 5, scope: !54) -// CHECK:STDOUT: !63 = !DILocation(line: 26, column: 3, scope: !54) -// CHECK:STDOUT: !64 = !DILocation(line: 27, column: 5, scope: !54) -// CHECK:STDOUT: !65 = !DILocation(line: 27, column: 3, scope: !54) -// CHECK:STDOUT: !66 = !DILocation(line: 28, column: 3, scope: !54) -// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main.66be507887ceee78", scope: null, file: !3, line: 14, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !68 = !DILocation(line: 15, column: 3, scope: !67) +// CHECK:STDOUT: !7 = !DILocation(line: 42, column: 3, scope: !4) +// CHECK:STDOUT: !8 = !DILocation(line: 44, column: 3, scope: !4) +// CHECK:STDOUT: !9 = !DILocation(line: 47, column: 5, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 47, column: 3, scope: !4) +// CHECK:STDOUT: !11 = !DILocation(line: 48, column: 9, scope: !4) +// CHECK:STDOUT: !12 = !DILocation(line: 48, column: 7, scope: !4) +// CHECK:STDOUT: !13 = !DILocation(line: 48, column: 3, scope: !4) +// CHECK:STDOUT: !14 = !DILocation(line: 49, column: 5, scope: !4) +// CHECK:STDOUT: !15 = !DILocation(line: 49, column: 3, scope: !4) +// CHECK:STDOUT: !16 = !DILocation(line: 50, column: 9, scope: !4) +// CHECK:STDOUT: !17 = !DILocation(line: 50, column: 7, scope: !4) +// CHECK:STDOUT: !18 = !DILocation(line: 50, column: 3, scope: !4) +// CHECK:STDOUT: !19 = !DILocation(line: 41, column: 1, scope: !4) +// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.b88d1103f417c6d4", scope: null, file: !3, line: 16, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !21 = !DILocation(line: 16, column: 1, scope: !20) +// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.b88d1103f417c6d4", scope: null, file: !3, line: 23, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !23 = !DILocation(line: 31, column: 3, scope: !22) +// CHECK:STDOUT: !24 = !DILocation(line: 25, column: 3, scope: !22) +// CHECK:STDOUT: !25 = !DILocation(line: 26, column: 3, scope: !22) +// CHECK:STDOUT: !26 = !DILocation(line: 27, column: 3, scope: !22) +// CHECK:STDOUT: !27 = !DILocation(line: 28, column: 5, scope: !22) +// CHECK:STDOUT: !28 = !DILocation(line: 28, column: 3, scope: !22) +// CHECK:STDOUT: !29 = !DILocation(line: 29, column: 3, scope: !22) +// CHECK:STDOUT: !30 = !DILocation(line: 32, column: 5, scope: !22) +// CHECK:STDOUT: !31 = !DILocation(line: 32, column: 3, scope: !22) +// CHECK:STDOUT: !32 = !DILocation(line: 33, column: 5, scope: !22) +// CHECK:STDOUT: !33 = !DILocation(line: 33, column: 3, scope: !22) +// CHECK:STDOUT: !34 = !DILocation(line: 36, column: 3, scope: !22) +// CHECK:STDOUT: !35 = !DILocation(line: 38, column: 3, scope: !22) +// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.66be507887ceee78", scope: null, file: !3, line: 16, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !37 = !DILocation(line: 16, column: 1, scope: !36) +// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.66be507887ceee78", scope: null, file: !3, line: 23, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !39 = !DILocation(line: 31, column: 3, scope: !38) +// CHECK:STDOUT: !40 = !DILocation(line: 25, column: 3, scope: !38) +// CHECK:STDOUT: !41 = !DILocation(line: 26, column: 3, scope: !38) +// CHECK:STDOUT: !42 = !DILocation(line: 27, column: 3, scope: !38) +// CHECK:STDOUT: !43 = !DILocation(line: 28, column: 5, scope: !38) +// CHECK:STDOUT: !44 = !DILocation(line: 28, column: 3, scope: !38) +// CHECK:STDOUT: !45 = !DILocation(line: 29, column: 3, scope: !38) +// CHECK:STDOUT: !46 = !DILocation(line: 32, column: 5, scope: !38) +// CHECK:STDOUT: !47 = !DILocation(line: 32, column: 3, scope: !38) +// CHECK:STDOUT: !48 = !DILocation(line: 33, column: 5, scope: !38) +// CHECK:STDOUT: !49 = !DILocation(line: 33, column: 3, scope: !38) +// CHECK:STDOUT: !50 = !DILocation(line: 36, column: 3, scope: !38) +// CHECK:STDOUT: !51 = !DILocation(line: 38, column: 3, scope: !38) +// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main.b88d1103f417c6d4", scope: null, file: !3, line: 19, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !53 = !DILocation(line: 20, column: 3, scope: !52) +// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main.5754c7a55c7cbe4a", scope: null, file: !3, line: 19, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !55 = !DILocation(line: 20, column: 3, scope: !54) +// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.5754c7a55c7cbe4a", scope: null, file: !3, line: 23, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !57 = !DILocation(line: 31, column: 3, scope: !56) +// CHECK:STDOUT: !58 = !DILocation(line: 25, column: 3, scope: !56) +// CHECK:STDOUT: !59 = !DILocation(line: 26, column: 3, scope: !56) +// CHECK:STDOUT: !60 = !DILocation(line: 27, column: 3, scope: !56) +// CHECK:STDOUT: !61 = !DILocation(line: 28, column: 5, scope: !56) +// CHECK:STDOUT: !62 = !DILocation(line: 28, column: 3, scope: !56) +// CHECK:STDOUT: !63 = !DILocation(line: 29, column: 3, scope: !56) +// CHECK:STDOUT: !64 = !DILocation(line: 32, column: 5, scope: !56) +// CHECK:STDOUT: !65 = !DILocation(line: 32, column: 3, scope: !56) +// CHECK:STDOUT: !66 = !DILocation(line: 33, column: 5, scope: !56) +// CHECK:STDOUT: !67 = !DILocation(line: 33, column: 3, scope: !56) +// CHECK:STDOUT: !68 = !DILocation(line: 36, column: 3, scope: !56) +// CHECK:STDOUT: !69 = !DILocation(line: 38, column: 3, scope: !56) +// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main.66be507887ceee78", scope: null, file: !3, line: 19, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !71 = !DILocation(line: 20, column: 3, scope: !70) +// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "Cfn", linkageName: "_CCfn.C.Main.b88d1103f417c6d4", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !73 = !DILocation(line: 12, column: 3, scope: !72) +// CHECK:STDOUT: !74 = distinct !DISubprogram(name: "Cfn", linkageName: "_CCfn.C.Main.66be507887ceee78", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !75 = !DILocation(line: 12, column: 3, scope: !74) +// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "Cfn", linkageName: "_CCfn.C.Main.5754c7a55c7cbe4a", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !77 = !DILocation(line: 12, column: 3, scope: !76) diff --git a/toolchain/sem_ir/function.cpp b/toolchain/sem_ir/function.cpp index b99400f10ae7..3a68e483680c 100644 --- a/toolchain/sem_ir/function.cpp +++ b/toolchain/sem_ir/function.cpp @@ -18,6 +18,11 @@ auto GetCalleeFunction(const File& sem_ir, InstId callee_id, .self_type_id = InstId::None, .self_id = InstId::None, .is_error = false}; + if (auto bound_method = sem_ir.insts().TryGetAs(callee_id)) { + result.self_id = bound_method->object_id; + callee_id = bound_method->function_decl_id; + } + if (specific_id.has_value()) { callee_id = sem_ir.constant_values().GetInstIdIfValid( GetConstantValueInSpecific(sem_ir, specific_id, callee_id)); @@ -31,11 +36,6 @@ auto GetCalleeFunction(const File& sem_ir, InstId callee_id, callee_id = specific_function->callee_id; } - if (auto bound_method = sem_ir.insts().TryGetAs(callee_id)) { - result.self_id = bound_method->object_id; - callee_id = bound_method->function_decl_id; - } - // Identify the function we're calling by its type. auto val_id = sem_ir.constant_values().GetConstantInstId(callee_id); if (!val_id.has_value()) {