diff --git a/toolchain/check/handle_array.cpp b/toolchain/check/handle_array.cpp index 5bcec9590a102..c9a6a5470f642 100644 --- a/toolchain/check/handle_array.cpp +++ b/toolchain/check/handle_array.cpp @@ -6,6 +6,7 @@ #include "toolchain/check/convert.h" #include "toolchain/check/handle.h" #include "toolchain/parse/node_kind.h" +#include "toolchain/sem_ir/builtin_inst_kind.h" namespace Carbon::Check { @@ -33,24 +34,29 @@ auto HandleParseNode(Context& context, Parse::ArrayExprId node_id) -> bool { auto [element_type_node_id, element_type_inst_id] = context.node_stack().PopExprWithNodeId(); - // The array bound must be a constant. + auto element_type_id = + ExprAsType(context, element_type_node_id, element_type_inst_id).type_id; + + // The array bound must be a constant. Diagnose this prior to conversion + // because conversion to `IntLiteral` will produce a generic "non-constant + // call to compile-time-only function" error. // // TODO: Should we support runtime-phase bounds in cases such as: // comptime fn F(n: i32) -> type { return [i32; n]; } - auto bound_inst = context.constant_values().Get(bound_inst_id); - if (!bound_inst.is_constant()) { + if (!context.constant_values().Get(bound_inst_id).is_constant()) { CARBON_DIAGNOSTIC(InvalidArrayExpr, Error, "array bound is not a constant"); context.emitter().Emit(bound_inst_id, InvalidArrayExpr); context.node_stack().Push(node_id, SemIR::InstId::BuiltinError); return true; } + bound_inst_id = ConvertToValueOfType( + context, context.insts().GetLocId(bound_inst_id), bound_inst_id, + context.GetBuiltinType(SemIR::BuiltinInstKind::IntLiteralType)); context.AddInstAndPush( node_id, {.type_id = SemIR::TypeId::TypeType, .bound_id = bound_inst_id, - .element_type_id = ExprAsType(context, element_type_node_id, - element_type_inst_id) - .type_id}); + .element_type_id = element_type_id}); return true; } diff --git a/toolchain/check/handle_function.cpp b/toolchain/check/handle_function.cpp index a510565f8d6c6..9cb4c230be0f6 100644 --- a/toolchain/check/handle_function.cpp +++ b/toolchain/check/handle_function.cpp @@ -502,6 +502,9 @@ auto HandleParseNode(Context& context, auto& function = context.functions().Get(function_id); if (IsValidBuiltinDeclaration(context, function, builtin_kind)) { function.builtin_function_kind = builtin_kind; + // Build an empty generic definition if this is a generic builtin. + StartGenericDefinition(context); + FinishGenericDefinition(context, function.generic_id); } else { CARBON_DIAGNOSTIC(InvalidBuiltinSignature, Error, "invalid signature for builtin function \"{0}\"", diff --git a/toolchain/check/testdata/array/array_in_place.carbon b/toolchain/check/testdata/array/array_in_place.carbon index ce83535436382..e313a53484b42 100644 --- a/toolchain/check/testdata/array/array_in_place.carbon +++ b/toolchain/check/testdata/array/array_in_place.carbon @@ -27,21 +27,149 @@ fn G() { // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %.1: i32 = int_value 2 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, %tuple.type.2 [template] -// CHECK:STDOUT: %.3: type = ptr_type %tuple.type.2 [template] -// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.2: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.3: %.2 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.6: %.2 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.9: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.9)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.10: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.11: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.9)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.19: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.20: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.21: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.22: %.21 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.28: type = array_type %.27, %tuple.type.2 [template] +// CHECK:STDOUT: %.29: type = ptr_type %tuple.type.2 [template] +// CHECK:STDOUT: %.30: type = ptr_type %.28 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (%tuple.type.2, %tuple.type.2) [template] -// CHECK:STDOUT: %.5: i32 = int_value 0 [template] -// CHECK:STDOUT: %.6: i32 = int_value 1 [template] +// CHECK:STDOUT: %.31: i32 = int_value 0 [template] +// CHECK:STDOUT: %.32: i32 = int_value 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.2) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.6)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.25] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -72,6 +200,198 @@ fn G() { // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.2) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %.2: @As.%.1 (%.15) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.20)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.23)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> %tuple.type.2; @@ -82,7 +402,7 @@ fn G() { // CHECK:STDOUT: %int.make_type_32.loc14_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc14_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_25.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc14_12, %int.make_type_32.loc14_17, %int.make_type_32.loc14_22) -// CHECK:STDOUT: %.loc14_28: i32 = int_value 2 [template = constants.%.1] +// CHECK:STDOUT: %.loc14_28.1: i32 = int_value 2 [template = constants.%.1] // CHECK:STDOUT: %.loc14_25.2: type = value_of_initializer %int.make_type_32.loc14_12 [template = i32] // CHECK:STDOUT: %.loc14_25.3: type = converted %int.make_type_32.loc14_12, %.loc14_25.2 [template = i32] // CHECK:STDOUT: %.loc14_25.4: type = value_of_initializer %int.make_type_32.loc14_17 [template = i32] @@ -90,25 +410,398 @@ fn G() { // CHECK:STDOUT: %.loc14_25.6: type = value_of_initializer %int.make_type_32.loc14_22 [template = i32] // CHECK:STDOUT: %.loc14_25.7: type = converted %int.make_type_32.loc14_22, %.loc14_25.6 [template = i32] // CHECK:STDOUT: %.loc14_25.8: type = converted %.loc14_25.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %.loc14_29: type = array_type %.loc14_28, %tuple.type.2 [template = constants.%.2] -// CHECK:STDOUT: %v.var: ref %.2 = var v -// CHECK:STDOUT: %v: ref %.2 = bind_name v, %v.var +// CHECK:STDOUT: %.loc14_28.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc14_28.3: = bound_method %.loc14_28.1, %.loc14_28.2 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc14_28.3(%.loc14_28.1) [template = constants.%.27] +// CHECK:STDOUT: %.loc14_28.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.27] +// CHECK:STDOUT: %.loc14_28.5: Core.IntLiteral = converted %.loc14_28.1, %.loc14_28.4 [template = constants.%.27] +// CHECK:STDOUT: %.loc14_29: type = array_type %.loc14_28.5, %tuple.type.2 [template = constants.%.28] +// CHECK:STDOUT: %v.var: ref %.28 = var v +// CHECK:STDOUT: %v: ref %.28 = bind_name v, %v.var // CHECK:STDOUT: %F.ref.loc14_34: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %.loc14_42.3: ref %tuple.type.2 = splice_block %.loc14_42.2 { -// CHECK:STDOUT: %.loc14_42.1: i32 = int_value 0 [template = constants.%.5] +// CHECK:STDOUT: %.loc14_42.1: i32 = int_value 0 [template = constants.%.31] // CHECK:STDOUT: %.loc14_42.2: ref %tuple.type.2 = array_index %v.var, %.loc14_42.1 // CHECK:STDOUT: } // CHECK:STDOUT: %F.call.loc14_35: init %tuple.type.2 = call %F.ref.loc14_34() to %.loc14_42.3 // CHECK:STDOUT: %F.ref.loc14_39: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %.loc14_42.6: ref %tuple.type.2 = splice_block %.loc14_42.5 { -// CHECK:STDOUT: %.loc14_42.4: i32 = int_value 1 [template = constants.%.6] +// CHECK:STDOUT: %.loc14_42.4: i32 = int_value 1 [template = constants.%.32] // CHECK:STDOUT: %.loc14_42.5: ref %tuple.type.2 = array_index %v.var, %.loc14_42.4 // CHECK:STDOUT: } // CHECK:STDOUT: %F.call.loc14_40: init %tuple.type.2 = call %F.ref.loc14_39() to %.loc14_42.6 // CHECK:STDOUT: %.loc14_42.7: %tuple.type.3 = tuple_literal (%F.call.loc14_35, %F.call.loc14_40) -// CHECK:STDOUT: %.loc14_42.8: init %.2 = array_init (%F.call.loc14_35, %F.call.loc14_40) to %v.var -// CHECK:STDOUT: %.loc14_43: init %.2 = converted %.loc14_42.7, %.loc14_42.8 +// CHECK:STDOUT: %.loc14_42.8: init %.28 = array_init (%F.call.loc14_35, %F.call.loc14_40) to %v.var +// CHECK:STDOUT: %.loc14_43: init %.28 = converted %.loc14_42.7, %.loc14_42.8 // CHECK:STDOUT: assign %v.var, %.loc14_43 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.2 => constants.%.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %.2 => constants.%.18 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.21 +// CHECK:STDOUT: %.2 => constants.%.22 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/array_vs_tuple.carbon b/toolchain/check/testdata/array/array_vs_tuple.carbon index 3f1085372f67f..f1f7b8f65568a 100644 --- a/toolchain/check/testdata/array/array_vs_tuple.carbon +++ b/toolchain/check/testdata/array/array_vs_tuple.carbon @@ -23,25 +23,153 @@ fn G() { // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.1: i32 = int_value 3 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] -// CHECK:STDOUT: %.4: i32 = int_value 1 [template] -// CHECK:STDOUT: %.5: i32 = int_value 2 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.2: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.3: %.2 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.6: %.2 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.9: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.9)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.10: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.11: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.9)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.19: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.20: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.21: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.22: %.21 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.28: type = array_type %.27, i32 [template] +// CHECK:STDOUT: %.29: type = ptr_type %.28 [template] +// CHECK:STDOUT: %.30: i32 = int_value 1 [template] +// CHECK:STDOUT: %.31: i32 = int_value 2 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (i32, i32, i32) [template] -// CHECK:STDOUT: %.6: i32 = int_value 0 [template] -// CHECK:STDOUT: %array: %.2 = tuple_value (%.4, %.5, %.1) [template] +// CHECK:STDOUT: %.32: i32 = int_value 0 [template] +// CHECK:STDOUT: %array: %.28 = tuple_value (%.30, %.31, %.1) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (type, type, type) [template] -// CHECK:STDOUT: %.7: type = ptr_type %tuple.type.1 [template] -// CHECK:STDOUT: %tuple: %tuple.type.1 = tuple_value (%.4, %.5, %.1) [template] +// CHECK:STDOUT: %.33: type = ptr_type %tuple.type.1 [template] +// CHECK:STDOUT: %tuple: %tuple.type.1 = tuple_value (%.30, %.31, %.1) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.2) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.6)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.25] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -53,30 +181,227 @@ fn G() { // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.2) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %.2: @As.%.1 (%.15) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.20)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.23)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @G() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_16: i32 = int_value 3 [template = constants.%.1] +// CHECK:STDOUT: %.loc13_16.1: i32 = int_value 3 [template = constants.%.1] // CHECK:STDOUT: %.loc13_11.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] // CHECK:STDOUT: %.loc13_11.2: type = converted %int.make_type_32.loc13, %.loc13_11.1 [template = i32] -// CHECK:STDOUT: %.loc13_17: type = array_type %.loc13_16, i32 [template = constants.%.2] -// CHECK:STDOUT: %a.var: ref %.2 = var a -// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var -// CHECK:STDOUT: %.loc13_22: i32 = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc13_25: i32 = int_value 2 [template = constants.%.5] +// CHECK:STDOUT: %.loc13_16.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc13_16.3: = bound_method %.loc13_16.1, %.loc13_16.2 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc13_16.3(%.loc13_16.1) [template = constants.%.27] +// CHECK:STDOUT: %.loc13_16.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.27] +// CHECK:STDOUT: %.loc13_16.5: Core.IntLiteral = converted %.loc13_16.1, %.loc13_16.4 [template = constants.%.27] +// CHECK:STDOUT: %.loc13_17: type = array_type %.loc13_16.5, i32 [template = constants.%.28] +// CHECK:STDOUT: %a.var: ref %.28 = var a +// CHECK:STDOUT: %a: ref %.28 = bind_name a, %a.var +// CHECK:STDOUT: %.loc13_22: i32 = int_value 1 [template = constants.%.30] +// CHECK:STDOUT: %.loc13_25: i32 = int_value 2 [template = constants.%.31] // CHECK:STDOUT: %.loc13_28: i32 = int_value 3 [template = constants.%.1] // CHECK:STDOUT: %.loc13_29.1: %tuple.type.1 = tuple_literal (%.loc13_22, %.loc13_25, %.loc13_28) -// CHECK:STDOUT: %.loc13_29.2: i32 = int_value 0 [template = constants.%.6] +// CHECK:STDOUT: %.loc13_29.2: i32 = int_value 0 [template = constants.%.32] // CHECK:STDOUT: %.loc13_29.3: ref i32 = array_index %a.var, %.loc13_29.2 -// CHECK:STDOUT: %.loc13_29.4: init i32 = initialize_from %.loc13_22 to %.loc13_29.3 [template = constants.%.4] -// CHECK:STDOUT: %.loc13_29.5: i32 = int_value 1 [template = constants.%.4] +// CHECK:STDOUT: %.loc13_29.4: init i32 = initialize_from %.loc13_22 to %.loc13_29.3 [template = constants.%.30] +// CHECK:STDOUT: %.loc13_29.5: i32 = int_value 1 [template = constants.%.30] // CHECK:STDOUT: %.loc13_29.6: ref i32 = array_index %a.var, %.loc13_29.5 -// CHECK:STDOUT: %.loc13_29.7: init i32 = initialize_from %.loc13_25 to %.loc13_29.6 [template = constants.%.5] -// CHECK:STDOUT: %.loc13_29.8: i32 = int_value 2 [template = constants.%.5] +// CHECK:STDOUT: %.loc13_29.7: init i32 = initialize_from %.loc13_25 to %.loc13_29.6 [template = constants.%.31] +// CHECK:STDOUT: %.loc13_29.8: i32 = int_value 2 [template = constants.%.31] // CHECK:STDOUT: %.loc13_29.9: ref i32 = array_index %a.var, %.loc13_29.8 // CHECK:STDOUT: %.loc13_29.10: init i32 = initialize_from %.loc13_28 to %.loc13_29.9 [template = constants.%.1] -// CHECK:STDOUT: %.loc13_29.11: init %.2 = array_init (%.loc13_29.4, %.loc13_29.7, %.loc13_29.10) to %a.var [template = constants.%array] -// CHECK:STDOUT: %.loc13_30: init %.2 = converted %.loc13_29.1, %.loc13_29.11 [template = constants.%array] +// CHECK:STDOUT: %.loc13_29.11: init %.28 = array_init (%.loc13_29.4, %.loc13_29.7, %.loc13_29.10) to %a.var [template = constants.%array] +// CHECK:STDOUT: %.loc13_30: init %.28 = converted %.loc13_29.1, %.loc13_29.11 [template = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc13_30 // CHECK:STDOUT: %int.make_type_32.loc14_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc14_16: init type = call constants.%Int32() [template = i32] @@ -91,14 +416,14 @@ fn G() { // CHECK:STDOUT: %.loc14_24.8: type = converted %.loc14_24.1, constants.%tuple.type.1 [template = constants.%tuple.type.1] // CHECK:STDOUT: %b.var: ref %tuple.type.1 = var b // CHECK:STDOUT: %b: ref %tuple.type.1 = bind_name b, %b.var -// CHECK:STDOUT: %.loc14_29: i32 = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc14_32: i32 = int_value 2 [template = constants.%.5] +// CHECK:STDOUT: %.loc14_29: i32 = int_value 1 [template = constants.%.30] +// CHECK:STDOUT: %.loc14_32: i32 = int_value 2 [template = constants.%.31] // CHECK:STDOUT: %.loc14_35: i32 = int_value 3 [template = constants.%.1] // CHECK:STDOUT: %.loc14_36.1: %tuple.type.1 = tuple_literal (%.loc14_29, %.loc14_32, %.loc14_35) // CHECK:STDOUT: %.loc14_36.2: ref i32 = tuple_access %b.var, element0 -// CHECK:STDOUT: %.loc14_36.3: init i32 = initialize_from %.loc14_29 to %.loc14_36.2 [template = constants.%.4] +// CHECK:STDOUT: %.loc14_36.3: init i32 = initialize_from %.loc14_29 to %.loc14_36.2 [template = constants.%.30] // CHECK:STDOUT: %.loc14_36.4: ref i32 = tuple_access %b.var, element1 -// CHECK:STDOUT: %.loc14_36.5: init i32 = initialize_from %.loc14_32 to %.loc14_36.4 [template = constants.%.5] +// CHECK:STDOUT: %.loc14_36.5: init i32 = initialize_from %.loc14_32 to %.loc14_36.4 [template = constants.%.31] // CHECK:STDOUT: %.loc14_36.6: ref i32 = tuple_access %b.var, element2 // CHECK:STDOUT: %.loc14_36.7: init i32 = initialize_from %.loc14_35 to %.loc14_36.6 [template = constants.%.1] // CHECK:STDOUT: %.loc14_36.8: init %tuple.type.1 = tuple_init (%.loc14_36.3, %.loc14_36.5, %.loc14_36.7) to %b.var [template = constants.%tuple] @@ -109,3 +434,371 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.2 => constants.%.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %.2 => constants.%.18 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.21 +// CHECK:STDOUT: %.2 => constants.%.22 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/assign_return_value.carbon b/toolchain/check/testdata/array/assign_return_value.carbon index 7ffc6b86ae552..e559d210bff62 100644 --- a/toolchain/check/testdata/array/assign_return_value.carbon +++ b/toolchain/check/testdata/array/assign_return_value.carbon @@ -29,17 +29,145 @@ fn Run() { // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] // CHECK:STDOUT: %.2: i32 = int_value 1 [template] -// CHECK:STDOUT: %.3: type = array_type %.2, i32 [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.3: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.5: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.7: %.3 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.8: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.10: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.10)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.11: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.12: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.12)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.17: %.16 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.18: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.19: %.18 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.10)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.20: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.12)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.21: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.22: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.23: %.22 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.27: = bound_method %.2, %Convert.15 [template] +// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.29: type = array_type %.28, i32 [template] +// CHECK:STDOUT: %.30: type = ptr_type %.29 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.26] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.10)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.12)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.10)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.12)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -64,6 +192,198 @@ fn Run() { // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.3)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.3) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.16)] +// CHECK:STDOUT: %.2: @As.%.1 (%.16) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.17)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.20)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.25)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> %tuple.type.2 { @@ -78,12 +398,17 @@ fn Run() { // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_16: i32 = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc14_16.1: i32 = int_value 1 [template = constants.%.2] // CHECK:STDOUT: %.loc14_11.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc14_11.2: type = converted %int.make_type_32, %.loc14_11.1 [template = i32] -// CHECK:STDOUT: %.loc14_17: type = array_type %.loc14_16, i32 [template = constants.%.3] -// CHECK:STDOUT: %t.var: ref %.3 = var t -// CHECK:STDOUT: %t: ref %.3 = bind_name t, %t.var +// CHECK:STDOUT: %.loc14_16.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc14_16.3: = bound_method %.loc14_16.1, %.loc14_16.2 [template = constants.%.27] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc14_16.3(%.loc14_16.1) [template = constants.%.28] +// CHECK:STDOUT: %.loc14_16.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.28] +// CHECK:STDOUT: %.loc14_16.5: Core.IntLiteral = converted %.loc14_16.1, %.loc14_16.4 [template = constants.%.28] +// CHECK:STDOUT: %.loc14_17: type = array_type %.loc14_16.5, i32 [template = constants.%.29] +// CHECK:STDOUT: %t.var: ref %.29 = var t +// CHECK:STDOUT: %t: ref %.29 = bind_name t, %t.var // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %F.call: init %tuple.type.2 = call %F.ref() // CHECK:STDOUT: %.loc14_22.1: ref %tuple.type.2 = temporary_storage @@ -93,9 +418,377 @@ fn Run() { // CHECK:STDOUT: %.loc14_22.5: i32 = int_value 0 [template = constants.%.1] // CHECK:STDOUT: %.loc14_22.6: ref i32 = array_index %t.var, %.loc14_22.5 // CHECK:STDOUT: %.loc14_22.7: init i32 = initialize_from %.loc14_22.4 to %.loc14_22.6 -// CHECK:STDOUT: %.loc14_22.8: init %.3 = array_init (%.loc14_22.7) to %t.var -// CHECK:STDOUT: %.loc14_24: init %.3 = converted %F.call, %.loc14_22.8 +// CHECK:STDOUT: %.loc14_22.8: init %.29 = array_init (%.loc14_22.7) to %t.var +// CHECK:STDOUT: %.loc14_24: init %.29 = converted %F.call, %.loc14_22.8 // CHECK:STDOUT: assign %t.var, %.loc14_24 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.10) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.12) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.10) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.12) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %.2 => constants.%.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: %.2 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.10) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.12) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.18 +// CHECK:STDOUT: %.2 => constants.%.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.10) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.12) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.22 +// CHECK:STDOUT: %.2 => constants.%.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/assign_var.carbon b/toolchain/check/testdata/array/assign_var.carbon index 5d3194b87369a..278733a618093 100644 --- a/toolchain/check/testdata/array/assign_var.carbon +++ b/toolchain/check/testdata/array/assign_var.carbon @@ -24,18 +24,146 @@ var b: [i32; 3] = a; // CHECK:STDOUT: %.3: i32 = int_value 2 [template] // CHECK:STDOUT: %.4: i32 = int_value 3 [template] // CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.2, %.3, %.4) [template] -// CHECK:STDOUT: %.5: type = array_type %.4, i32 [template] -// CHECK:STDOUT: %.6: type = ptr_type %.5 [template] -// CHECK:STDOUT: %.7: i32 = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.5: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.9: %.5 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.10: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.12: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.12)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.14: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.14)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.17: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.18: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.19: %.18 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.20: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.21: %.20 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.12)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.14)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.24: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.25: %.24 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.28: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.29: = bound_method %.4, %Convert.15 [template] +// CHECK:STDOUT: %.30: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.31: type = array_type %.30, i32 [template] +// CHECK:STDOUT: %.32: type = ptr_type %.31 [template] +// CHECK:STDOUT: %.33: i32 = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.5) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.9)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.28] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.12)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.14)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.12)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.14)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -59,16 +187,303 @@ var b: [i32; 3] = a; // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_14: i32 = int_value 3 [template = constants.%.4] +// CHECK:STDOUT: %.loc12_14.1: i32 = int_value 3 [template = constants.%.4] // CHECK:STDOUT: %.loc12_9.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] // CHECK:STDOUT: %.loc12_9.2: type = converted %int.make_type_32.loc12, %.loc12_9.1 [template = i32] -// CHECK:STDOUT: %.loc12_15: type = array_type %.loc12_14, i32 [template = constants.%.5] -// CHECK:STDOUT: %b.var: ref %.5 = var b -// CHECK:STDOUT: %b: ref %.5 = bind_name b, %b.var +// CHECK:STDOUT: %.loc12_14.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc12_14.3: = bound_method %.loc12_14.1, %.loc12_14.2 [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc12_14.3(%.loc12_14.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc12_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.30] +// CHECK:STDOUT: %.loc12_14.5: Core.IntLiteral = converted %.loc12_14.1, %.loc12_14.4 [template = constants.%.30] +// CHECK:STDOUT: %.loc12_15: type = array_type %.loc12_14.5, i32 [template = constants.%.31] +// CHECK:STDOUT: %b.var: ref %.31 = var b +// CHECK:STDOUT: %b: ref %.31 = bind_name b, %b.var +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.5) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.18)] +// CHECK:STDOUT: %.2: @As.%.1 (%.18) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.17)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.23)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.26)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.27)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.12) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.14) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.14)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.12) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.14) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.14)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc11_27: i32 = int_value 1 [template = constants.%.2] @@ -87,7 +502,7 @@ var b: [i32; 3] = a; // CHECK:STDOUT: %a.ref: ref %tuple.type.2 = name_ref a, file.%a // CHECK:STDOUT: %.loc12_19.1: ref i32 = tuple_access %a.ref, element0 // CHECK:STDOUT: %.loc12_19.2: i32 = bind_value %.loc12_19.1 -// CHECK:STDOUT: %.loc12_19.3: i32 = int_value 0 [template = constants.%.7] +// CHECK:STDOUT: %.loc12_19.3: i32 = int_value 0 [template = constants.%.33] // CHECK:STDOUT: %.loc12_19.4: ref i32 = array_index file.%b.var, %.loc12_19.3 // CHECK:STDOUT: %.loc12_19.5: init i32 = initialize_from %.loc12_19.2 to %.loc12_19.4 // CHECK:STDOUT: %.loc12_19.6: ref i32 = tuple_access %a.ref, element1 @@ -100,9 +515,287 @@ var b: [i32; 3] = a; // CHECK:STDOUT: %.loc12_19.13: i32 = int_value 2 [template = constants.%.3] // CHECK:STDOUT: %.loc12_19.14: ref i32 = array_index file.%b.var, %.loc12_19.13 // CHECK:STDOUT: %.loc12_19.15: init i32 = initialize_from %.loc12_19.12 to %.loc12_19.14 -// CHECK:STDOUT: %.loc12_19.16: init %.5 = array_init (%.loc12_19.5, %.loc12_19.10, %.loc12_19.15) to file.%b.var -// CHECK:STDOUT: %.loc12_20: init %.5 = converted %a.ref, %.loc12_19.16 +// CHECK:STDOUT: %.loc12_19.16: init %.31 = array_init (%.loc12_19.5, %.loc12_19.10, %.loc12_19.15) to file.%b.var +// CHECK:STDOUT: %.loc12_20: init %.31 = converted %a.ref, %.loc12_19.16 // CHECK:STDOUT: assign file.%b.var, %.loc12_20 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %.2 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.12) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.14) { +// CHECK:STDOUT: %Dest => constants.%.14 +// CHECK:STDOUT: %Dest.patt => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.14 +// CHECK:STDOUT: %Dest.patt => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.20 +// CHECK:STDOUT: %.2 => constants.%.21 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.12) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.14) { +// CHECK:STDOUT: %Dest => constants.%.14 +// CHECK:STDOUT: %Dest.patt => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.14 +// CHECK:STDOUT: %Dest.patt => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.24 +// CHECK:STDOUT: %.2 => constants.%.25 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/base.carbon b/toolchain/check/testdata/array/base.carbon index eb566d24e60f0..f449f4eb22aad 100644 --- a/toolchain/check/testdata/array/base.carbon +++ b/toolchain/check/testdata/array/base.carbon @@ -19,40 +19,172 @@ var c: [(); 5] = ((), (), (), (), (),); // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.1: i32 = int_value 1 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.2: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.3: %.2 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.6: %.2 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.9: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.9)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.10: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.11: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.9)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.19: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.20: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.21: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.22: %.21 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.28: type = array_type %.27, i32 [template] +// CHECK:STDOUT: %.29: type = ptr_type %.28 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (i32) [template] -// CHECK:STDOUT: %.4: i32 = int_value 0 [template] -// CHECK:STDOUT: %array.1: %.2 = tuple_value (%.1) [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 64 [template] +// CHECK:STDOUT: %.30: i32 = int_value 0 [template] +// CHECK:STDOUT: %array.1: %.28 = tuple_value (%.1) [template] +// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 64 [template] // CHECK:STDOUT: %Float.type: type = fn_type @Float [template] // CHECK:STDOUT: %Float: %Float.type = struct_value () [template] -// CHECK:STDOUT: %.6: i32 = int_value 2 [template] -// CHECK:STDOUT: %.7: type = array_type %.6, f64 [template] -// CHECK:STDOUT: %.8: type = ptr_type %.7 [template] -// CHECK:STDOUT: %.9: f64 = float_literal 11.100000000000001 [template] -// CHECK:STDOUT: %.10: f64 = float_literal 2.2000000000000002 [template] +// CHECK:STDOUT: %.32: i32 = int_value 2 [template] +// CHECK:STDOUT: %.33: = bound_method %.32, %Convert.15 [template] +// CHECK:STDOUT: %.34: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.35: type = array_type %.34, f64 [template] +// CHECK:STDOUT: %.36: type = ptr_type %.35 [template] +// CHECK:STDOUT: %.37: f64 = float_literal 11.100000000000001 [template] +// CHECK:STDOUT: %.38: f64 = float_literal 2.2000000000000002 [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (f64, f64) [template] -// CHECK:STDOUT: %array.2: %.7 = tuple_value (%.9, %.10) [template] -// CHECK:STDOUT: %.11: i32 = int_value 5 [template] -// CHECK:STDOUT: %.12: type = array_type %.11, %empty_tuple.type [template] -// CHECK:STDOUT: %.13: type = ptr_type %.12 [template] +// CHECK:STDOUT: %array.2: %.35 = tuple_value (%.37, %.38) [template] +// CHECK:STDOUT: %.39: i32 = int_value 5 [template] +// CHECK:STDOUT: %.40: = bound_method %.39, %Convert.15 [template] +// CHECK:STDOUT: %.41: Core.IntLiteral = int_value 5 [template] +// CHECK:STDOUT: %.42: type = array_type %.41, %empty_tuple.type [template] +// CHECK:STDOUT: %.43: type = ptr_type %.42 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (%empty_tuple.type, %empty_tuple.type, %empty_tuple.type, %empty_tuple.type, %empty_tuple.type) [template] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [template] -// CHECK:STDOUT: %.14: i32 = int_value 3 [template] -// CHECK:STDOUT: %.15: i32 = int_value 4 [template] -// CHECK:STDOUT: %array.3: %.12 = tuple_value (%empty_tuple, %empty_tuple, %empty_tuple, %empty_tuple, %empty_tuple) [template] +// CHECK:STDOUT: %.44: i32 = int_value 3 [template] +// CHECK:STDOUT: %.45: i32 = int_value 4 [template] +// CHECK:STDOUT: %array.3: %.42 = tuple_value (%empty_tuple, %empty_tuple, %empty_tuple, %empty_tuple, %empty_tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.1 -// CHECK:STDOUT: .Float = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .Float = %import_ref.51 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+60, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.2) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.6)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.25] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded +// CHECK:STDOUT: %import_ref.51: %Float.type = import_ref Core//prelude/types, inst+60, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -64,53 +196,350 @@ var c: [(); 5] = ((), (), (), (), (),); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_14: i32 = int_value 1 [template = constants.%.1] +// CHECK:STDOUT: %.loc11_14.1: i32 = int_value 1 [template = constants.%.1] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32, %.loc11_9.1 [template = i32] -// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, i32 [template = constants.%.2] -// CHECK:STDOUT: %a.var: ref %.2 = var a -// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var -// CHECK:STDOUT: %.loc12_9.1: Core.IntLiteral = int_value 64 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_14.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc11_14.3: = bound_method %.loc11_14.1, %.loc11_14.2 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc11: init Core.IntLiteral = call %.loc11_14.3(%.loc11_14.1) [template = constants.%.27] +// CHECK:STDOUT: %.loc11_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc11 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_14.5: Core.IntLiteral = converted %.loc11_14.1, %.loc11_14.4 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14.5, i32 [template = constants.%.28] +// CHECK:STDOUT: %a.var: ref %.28 = var a +// CHECK:STDOUT: %a: ref %.28 = bind_name a, %a.var +// CHECK:STDOUT: %.loc12_9.1: Core.IntLiteral = int_value 64 [template = constants.%.31] // CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc12_9.1) [template = f64] -// CHECK:STDOUT: %.loc12_14: i32 = int_value 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc12_14.1: i32 = int_value 2 [template = constants.%.32] // CHECK:STDOUT: %.loc12_9.2: type = value_of_initializer %float.make_type [template = f64] // CHECK:STDOUT: %.loc12_9.3: type = converted %float.make_type, %.loc12_9.2 [template = f64] -// CHECK:STDOUT: %.loc12_15: type = array_type %.loc12_14, f64 [template = constants.%.7] -// CHECK:STDOUT: %b.var: ref %.7 = var b -// CHECK:STDOUT: %b: ref %.7 = bind_name b, %b.var +// CHECK:STDOUT: %.loc12_14.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc12_14.3: = bound_method %.loc12_14.1, %.loc12_14.2 [template = constants.%.33] +// CHECK:STDOUT: %int.convert_checked.loc12: init Core.IntLiteral = call %.loc12_14.3(%.loc12_14.1) [template = constants.%.34] +// CHECK:STDOUT: %.loc12_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc12 [template = constants.%.34] +// CHECK:STDOUT: %.loc12_14.5: Core.IntLiteral = converted %.loc12_14.1, %.loc12_14.4 [template = constants.%.34] +// CHECK:STDOUT: %.loc12_15: type = array_type %.loc12_14.5, f64 [template = constants.%.35] +// CHECK:STDOUT: %b.var: ref %.35 = var b +// CHECK:STDOUT: %b: ref %.35 = bind_name b, %b.var // CHECK:STDOUT: %.loc13_10.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc13_13: i32 = int_value 5 [template = constants.%.11] +// CHECK:STDOUT: %.loc13_13.1: i32 = int_value 5 [template = constants.%.39] // CHECK:STDOUT: %.loc13_10.2: type = converted %.loc13_10.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc13_14: type = array_type %.loc13_13, %empty_tuple.type [template = constants.%.12] -// CHECK:STDOUT: %c.var: ref %.12 = var c -// CHECK:STDOUT: %c: ref %.12 = bind_name c, %c.var +// CHECK:STDOUT: %.loc13_13.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc13_13.3: = bound_method %.loc13_13.1, %.loc13_13.2 [template = constants.%.40] +// CHECK:STDOUT: %int.convert_checked.loc13: init Core.IntLiteral = call %.loc13_13.3(%.loc13_13.1) [template = constants.%.41] +// CHECK:STDOUT: %.loc13_13.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc13 [template = constants.%.41] +// CHECK:STDOUT: %.loc13_13.5: Core.IntLiteral = converted %.loc13_13.1, %.loc13_13.4 [template = constants.%.41] +// CHECK:STDOUT: %.loc13_14: type = array_type %.loc13_13.5, %empty_tuple.type [template = constants.%.42] +// CHECK:STDOUT: %c.var: ref %.42 = var c +// CHECK:STDOUT: %c: ref %.42 = bind_name c, %c.var +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.2) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %.2: @As.%.1 (%.15) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.20)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.23)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Float(%size.param_patt: Core.IntLiteral) -> type = "float.make_type"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc11_20: i32 = int_value 1 [template = constants.%.1] // CHECK:STDOUT: %.loc11_22.1: %tuple.type.1 = tuple_literal (%.loc11_20) -// CHECK:STDOUT: %.loc11_22.2: i32 = int_value 0 [template = constants.%.4] +// CHECK:STDOUT: %.loc11_22.2: i32 = int_value 0 [template = constants.%.30] // CHECK:STDOUT: %.loc11_22.3: ref i32 = array_index file.%a.var, %.loc11_22.2 // CHECK:STDOUT: %.loc11_22.4: init i32 = initialize_from %.loc11_20 to %.loc11_22.3 [template = constants.%.1] -// CHECK:STDOUT: %.loc11_22.5: init %.2 = array_init (%.loc11_22.4) to file.%a.var [template = constants.%array.1] -// CHECK:STDOUT: %.loc11_23: init %.2 = converted %.loc11_22.1, %.loc11_22.5 [template = constants.%array.1] +// CHECK:STDOUT: %.loc11_22.5: init %.28 = array_init (%.loc11_22.4) to file.%a.var [template = constants.%array.1] +// CHECK:STDOUT: %.loc11_23: init %.28 = converted %.loc11_22.1, %.loc11_22.5 [template = constants.%array.1] // CHECK:STDOUT: assign file.%a.var, %.loc11_23 -// CHECK:STDOUT: %.loc12_20: f64 = float_literal 11.100000000000001 [template = constants.%.9] -// CHECK:STDOUT: %.loc12_26: f64 = float_literal 2.2000000000000002 [template = constants.%.10] +// CHECK:STDOUT: %.loc12_20: f64 = float_literal 11.100000000000001 [template = constants.%.37] +// CHECK:STDOUT: %.loc12_26: f64 = float_literal 2.2000000000000002 [template = constants.%.38] // CHECK:STDOUT: %.loc12_30.1: %tuple.type.2 = tuple_literal (%.loc12_20, %.loc12_26) -// CHECK:STDOUT: %.loc12_30.2: i32 = int_value 0 [template = constants.%.4] +// CHECK:STDOUT: %.loc12_30.2: i32 = int_value 0 [template = constants.%.30] // CHECK:STDOUT: %.loc12_30.3: ref f64 = array_index file.%b.var, %.loc12_30.2 -// CHECK:STDOUT: %.loc12_30.4: init f64 = initialize_from %.loc12_20 to %.loc12_30.3 [template = constants.%.9] +// CHECK:STDOUT: %.loc12_30.4: init f64 = initialize_from %.loc12_20 to %.loc12_30.3 [template = constants.%.37] // CHECK:STDOUT: %.loc12_30.5: i32 = int_value 1 [template = constants.%.1] // CHECK:STDOUT: %.loc12_30.6: ref f64 = array_index file.%b.var, %.loc12_30.5 -// CHECK:STDOUT: %.loc12_30.7: init f64 = initialize_from %.loc12_26 to %.loc12_30.6 [template = constants.%.10] -// CHECK:STDOUT: %.loc12_30.8: init %.7 = array_init (%.loc12_30.4, %.loc12_30.7) to file.%b.var [template = constants.%array.2] -// CHECK:STDOUT: %.loc12_31: init %.7 = converted %.loc12_30.1, %.loc12_30.8 [template = constants.%array.2] +// CHECK:STDOUT: %.loc12_30.7: init f64 = initialize_from %.loc12_26 to %.loc12_30.6 [template = constants.%.38] +// CHECK:STDOUT: %.loc12_30.8: init %.35 = array_init (%.loc12_30.4, %.loc12_30.7) to file.%b.var [template = constants.%array.2] +// CHECK:STDOUT: %.loc12_31: init %.35 = converted %.loc12_30.1, %.loc12_30.8 [template = constants.%array.2] // CHECK:STDOUT: assign file.%b.var, %.loc12_31 // CHECK:STDOUT: %.loc13_20.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc13_24.1: %empty_tuple.type = tuple_literal () @@ -118,7 +547,7 @@ var c: [(); 5] = ((), (), (), (), (),); // CHECK:STDOUT: %.loc13_32.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc13_36.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc13_38.1: %tuple.type.3 = tuple_literal (%.loc13_20.1, %.loc13_24.1, %.loc13_28.1, %.loc13_32.1, %.loc13_36.1) -// CHECK:STDOUT: %.loc13_38.2: i32 = int_value 0 [template = constants.%.4] +// CHECK:STDOUT: %.loc13_38.2: i32 = int_value 0 [template = constants.%.30] // CHECK:STDOUT: %.loc13_38.3: ref %empty_tuple.type = array_index file.%c.var, %.loc13_38.2 // CHECK:STDOUT: %.loc13_20.2: init %empty_tuple.type = tuple_init () to %.loc13_38.3 [template = constants.%empty_tuple] // CHECK:STDOUT: %.loc13_38.4: init %empty_tuple.type = converted %.loc13_20.1, %.loc13_20.2 [template = constants.%empty_tuple] @@ -126,21 +555,299 @@ var c: [(); 5] = ((), (), (), (), (),); // CHECK:STDOUT: %.loc13_38.6: ref %empty_tuple.type = array_index file.%c.var, %.loc13_38.5 // CHECK:STDOUT: %.loc13_24.2: init %empty_tuple.type = tuple_init () to %.loc13_38.6 [template = constants.%empty_tuple] // CHECK:STDOUT: %.loc13_38.7: init %empty_tuple.type = converted %.loc13_24.1, %.loc13_24.2 [template = constants.%empty_tuple] -// CHECK:STDOUT: %.loc13_38.8: i32 = int_value 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc13_38.8: i32 = int_value 2 [template = constants.%.32] // CHECK:STDOUT: %.loc13_38.9: ref %empty_tuple.type = array_index file.%c.var, %.loc13_38.8 // CHECK:STDOUT: %.loc13_28.2: init %empty_tuple.type = tuple_init () to %.loc13_38.9 [template = constants.%empty_tuple] // CHECK:STDOUT: %.loc13_38.10: init %empty_tuple.type = converted %.loc13_28.1, %.loc13_28.2 [template = constants.%empty_tuple] -// CHECK:STDOUT: %.loc13_38.11: i32 = int_value 3 [template = constants.%.14] +// CHECK:STDOUT: %.loc13_38.11: i32 = int_value 3 [template = constants.%.44] // CHECK:STDOUT: %.loc13_38.12: ref %empty_tuple.type = array_index file.%c.var, %.loc13_38.11 // CHECK:STDOUT: %.loc13_32.2: init %empty_tuple.type = tuple_init () to %.loc13_38.12 [template = constants.%empty_tuple] // CHECK:STDOUT: %.loc13_38.13: init %empty_tuple.type = converted %.loc13_32.1, %.loc13_32.2 [template = constants.%empty_tuple] -// CHECK:STDOUT: %.loc13_38.14: i32 = int_value 4 [template = constants.%.15] +// CHECK:STDOUT: %.loc13_38.14: i32 = int_value 4 [template = constants.%.45] // CHECK:STDOUT: %.loc13_38.15: ref %empty_tuple.type = array_index file.%c.var, %.loc13_38.14 // CHECK:STDOUT: %.loc13_36.2: init %empty_tuple.type = tuple_init () to %.loc13_38.15 [template = constants.%empty_tuple] // CHECK:STDOUT: %.loc13_38.16: init %empty_tuple.type = converted %.loc13_36.1, %.loc13_36.2 [template = constants.%empty_tuple] -// CHECK:STDOUT: %.loc13_38.17: init %.12 = array_init (%.loc13_38.4, %.loc13_38.7, %.loc13_38.10, %.loc13_38.13, %.loc13_38.16) to file.%c.var [template = constants.%array.3] -// CHECK:STDOUT: %.loc13_39: init %.12 = converted %.loc13_38.1, %.loc13_38.17 [template = constants.%array.3] +// CHECK:STDOUT: %.loc13_38.17: init %.42 = array_init (%.loc13_38.4, %.loc13_38.7, %.loc13_38.10, %.loc13_38.13, %.loc13_38.16) to file.%c.var [template = constants.%array.3] +// CHECK:STDOUT: %.loc13_39: init %.42 = converted %.loc13_38.1, %.loc13_38.17 [template = constants.%array.3] // CHECK:STDOUT: assign file.%c.var, %.loc13_39 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.2 => constants.%.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %.2 => constants.%.18 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.21 +// CHECK:STDOUT: %.2 => constants.%.22 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/canonicalize_index.carbon b/toolchain/check/testdata/array/canonicalize_index.carbon index bd35769104715..316def89d02bb 100644 --- a/toolchain/check/testdata/array/canonicalize_index.carbon +++ b/toolchain/check/testdata/array/canonicalize_index.carbon @@ -9,9 +9,11 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/array/canonicalize_index.carbon fn Add(a: i32, b: i32) -> i32 = "int.sadd"; +fn ConvertToU32(a: i32) -> u32 = "int.convert_checked"; var a: [i32; Add(1, 2)] = (1, 2, 3); let b: [i32; 3]* = &a; +let c: [i32; ConvertToU32(3)]* = &a; // CHECK:STDOUT: --- canonicalize_index.carbon // CHECK:STDOUT: @@ -21,31 +23,176 @@ let b: [i32; 3]* = &a; // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %Add.type: type = fn_type @Add [template] // CHECK:STDOUT: %Add: %Add.type = struct_value () [template] -// CHECK:STDOUT: %.1: i32 = int_value 1 [template] -// CHECK:STDOUT: %.2: i32 = int_value 2 [template] -// CHECK:STDOUT: %.3: i32 = int_value 3 [template] -// CHECK:STDOUT: %.4: type = array_type %.3, i32 [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] +// CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] +// CHECK:STDOUT: %.2: type = int_type unsigned, %.1 [template] +// CHECK:STDOUT: %ConvertToU32.type: type = fn_type @ConvertToU32 [template] +// CHECK:STDOUT: %ConvertToU32: %ConvertToU32.type = struct_value () [template] +// CHECK:STDOUT: %.3: i32 = int_value 1 [template] +// CHECK:STDOUT: %.4: i32 = int_value 2 [template] +// CHECK:STDOUT: %.5: i32 = int_value 3 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.8: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.7 [template] +// CHECK:STDOUT: %.10: %.6 = assoc_entity element0, imports.%import_ref.8 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.11: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.13: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.13)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.15: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.15)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.17: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.18: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.19: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.20: %.19 = assoc_entity element0, imports.%import_ref.34 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.21: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.22: %.21 = assoc_entity element0, imports.%import_ref.35 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.15)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.25: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.26: %.25 = assoc_entity element0, imports.%import_ref.45 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.28: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.29: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.30: = bound_method %.5, %Convert.15 [template] +// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.32: type = array_type %.31, i32 [template] +// CHECK:STDOUT: %.33: type = ptr_type %.32 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (i32, i32, i32) [template] -// CHECK:STDOUT: %.6: i32 = int_value 0 [template] -// CHECK:STDOUT: %array: %.4 = tuple_value (%.1, %.2, %.3) [template] +// CHECK:STDOUT: %.34: i32 = int_value 0 [template] +// CHECK:STDOUT: %array: %.32 = tuple_value (%.3, %.4, %.5) [template] +// CHECK:STDOUT: %.35: %.2 = int_value 3 [template] +// CHECK:STDOUT: %.36: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.5, @impl.6(%.1) [template] +// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] +// CHECK:STDOUT: %.37: = interface_witness (%Convert.16) [template] +// CHECK:STDOUT: %.38: = bound_method %.35, %Convert.16 [template] +// CHECK:STDOUT: %.39: = specific_function %.38, @Convert.5(%.1) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .UInt = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.3 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %UInt.type = import_ref Core//prelude/types, inst+45, loaded [template = constants.%UInt] +// CHECK:STDOUT: %import_ref.3: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.5: @ImplicitAs.%.1 (%.6) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.10)] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.10: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.14: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.15 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.17: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.18 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.20: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.21: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.29] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.23: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.24 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.15)] +// CHECK:STDOUT: %import_ref.26: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.27: = import_ref Core//prelude/operators/as, inst+385, loaded [symbolic = @impl.6.%.2 (constants.%.18)] +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.30 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.32: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.37: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.38 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.40: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.41 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.43: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.45 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.47: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.48 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.15)] +// CHECK:STDOUT: %import_ref.50: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.51 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .Add = %Add.decl +// CHECK:STDOUT: .ConvertToU32 = %ConvertToU32.decl // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = @__global_init.%b +// CHECK:STDOUT: .c = @__global_init.%c // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { @@ -72,49 +219,686 @@ let b: [i32; 3]* = &a; // CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, %Add.decl [template = constants.%Add] -// CHECK:STDOUT: %.loc13_18: i32 = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc13_21: i32 = int_value 2 [template = constants.%.2] -// CHECK:STDOUT: %int.sadd: init i32 = call %Add.ref(%.loc13_18, %.loc13_21) [template = constants.%.3] -// CHECK:STDOUT: %.loc13_9.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_9.2: type = converted %int.make_type_32.loc13, %.loc13_9.1 [template = i32] -// CHECK:STDOUT: %.loc13_23: type = array_type %int.sadd, i32 [template = constants.%.4] -// CHECK:STDOUT: %a.var: ref %.4 = var a -// CHECK:STDOUT: %a: ref %.4 = bind_name a, %a.var +// CHECK:STDOUT: %ConvertToU32.decl: %ConvertToU32.type = fn_decl @ConvertToU32 [template = constants.%ConvertToU32] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %.2 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.2 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc12_20.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc12_20.2: type = converted %int.make_type_32, %.loc12_20.1 [template = i32] +// CHECK:STDOUT: %.loc12_28.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%.loc12_28.1) [template = constants.%.2] +// CHECK:STDOUT: %.loc12_28.2: type = value_of_initializer %int.make_type_unsigned [template = constants.%.2] +// CHECK:STDOUT: %.loc12_28.3: type = converted %int.make_type_unsigned, %.loc12_28.2 [template = constants.%.2] +// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %.2 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %.2 = return_slot %return.param +// CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_14: i32 = int_value 3 [template = constants.%.3] +// CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, %Add.decl [template = constants.%Add] +// CHECK:STDOUT: %.loc14_18: i32 = int_value 1 [template = constants.%.3] +// CHECK:STDOUT: %.loc14_21: i32 = int_value 2 [template = constants.%.4] +// CHECK:STDOUT: %int.sadd: init i32 = call %Add.ref(%.loc14_18, %.loc14_21) [template = constants.%.5] // CHECK:STDOUT: %.loc14_9.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] // CHECK:STDOUT: %.loc14_9.2: type = converted %int.make_type_32.loc14, %.loc14_9.1 [template = i32] -// CHECK:STDOUT: %.loc14_15: type = array_type %.loc14_14, i32 [template = constants.%.4] -// CHECK:STDOUT: %.loc14_16: type = ptr_type %.4 [template = constants.%.5] +// CHECK:STDOUT: %.loc14_17.1: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc14_17.2: = bound_method %int.sadd, %.loc14_17.1 [template = constants.%.30] +// CHECK:STDOUT: %.loc14_17.3: i32 = value_of_initializer %int.sadd [template = constants.%.5] +// CHECK:STDOUT: %.loc14_17.4: i32 = converted %int.sadd, %.loc14_17.3 [template = constants.%.5] +// CHECK:STDOUT: %int.convert_checked.loc14: init Core.IntLiteral = call %.loc14_17.2(%.loc14_17.4) [template = constants.%.31] +// CHECK:STDOUT: %.loc14_17.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc14 [template = constants.%.31] +// CHECK:STDOUT: %.loc14_17.6: Core.IntLiteral = converted %int.sadd, %.loc14_17.5 [template = constants.%.31] +// CHECK:STDOUT: %.loc14_23: type = array_type %.loc14_17.6, i32 [template = constants.%.32] +// CHECK:STDOUT: %a.var: ref %.32 = var a +// CHECK:STDOUT: %a: ref %.32 = bind_name a, %a.var +// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc15_14.1: i32 = int_value 3 [template = constants.%.5] +// CHECK:STDOUT: %.loc15_9.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] +// CHECK:STDOUT: %.loc15_9.2: type = converted %int.make_type_32.loc15, %.loc15_9.1 [template = i32] +// CHECK:STDOUT: %.loc15_14.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc15_14.3: = bound_method %.loc15_14.1, %.loc15_14.2 [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc15: init Core.IntLiteral = call %.loc15_14.3(%.loc15_14.1) [template = constants.%.31] +// CHECK:STDOUT: %.loc15_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc15 [template = constants.%.31] +// CHECK:STDOUT: %.loc15_14.5: Core.IntLiteral = converted %.loc15_14.1, %.loc15_14.4 [template = constants.%.31] +// CHECK:STDOUT: %.loc15_15: type = array_type %.loc15_14.5, i32 [template = constants.%.32] +// CHECK:STDOUT: %.loc15_16: type = ptr_type %.32 [template = constants.%.33] +// CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %ConvertToU32.ref: %ConvertToU32.type = name_ref ConvertToU32, %ConvertToU32.decl [template = constants.%ConvertToU32] +// CHECK:STDOUT: %.loc16_27: i32 = int_value 3 [template = constants.%.5] +// CHECK:STDOUT: %int.convert_checked.loc16_26.1: init %.2 = call %ConvertToU32.ref(%.loc16_27) [template = constants.%.35] +// CHECK:STDOUT: %.loc16_9.1: type = value_of_initializer %int.make_type_32.loc16 [template = i32] +// CHECK:STDOUT: %.loc16_9.2: type = converted %int.make_type_32.loc16, %.loc16_9.1 [template = i32] +// CHECK:STDOUT: %.loc16_26.1: %Convert.type.2 = interface_witness_access constants.%.37, element0 [template = constants.%Convert.16] +// CHECK:STDOUT: %.loc16_26.2: = bound_method %int.convert_checked.loc16_26.1, %.loc16_26.1 [template = constants.%.38] +// CHECK:STDOUT: %.loc16_26.3: = specific_function %.loc16_26.2, @Convert.5(constants.%.1) [template = constants.%.39] +// CHECK:STDOUT: %.loc16_26.4: %.2 = value_of_initializer %int.convert_checked.loc16_26.1 [template = constants.%.35] +// CHECK:STDOUT: %.loc16_26.5: %.2 = converted %int.convert_checked.loc16_26.1, %.loc16_26.4 [template = constants.%.35] +// CHECK:STDOUT: %int.convert_checked.loc16_26.2: init Core.IntLiteral = call %.loc16_26.3(%.loc16_26.5) [template = constants.%.31] +// CHECK:STDOUT: %.loc16_26.6: Core.IntLiteral = value_of_initializer %int.convert_checked.loc16_26.2 [template = constants.%.31] +// CHECK:STDOUT: %.loc16_26.7: Core.IntLiteral = converted %int.convert_checked.loc16_26.1, %.loc16_26.6 [template = constants.%.31] +// CHECK:STDOUT: %.loc16_29: type = array_type %.loc16_26.7, i32 [template = constants.%.32] +// CHECK:STDOUT: %.loc16_30: type = ptr_type %.32 [template = constants.%.33] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.6)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.6) = assoc_entity element0, imports.%import_ref.7 [symbolic = %.2 (constants.%.7)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: .Convert = imports.%import_ref.5 +// CHECK:STDOUT: witness = (imports.%import_ref.6) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.19)] +// CHECK:STDOUT: %.2: @As.%.1 (%.19) = assoc_entity element0, imports.%import_ref.34 [symbolic = %.2 (constants.%.20)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.28 +// CHECK:STDOUT: .Convert = imports.%import_ref.29 +// CHECK:STDOUT: witness = (imports.%import_ref.30) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.9 as imports.%import_ref.10 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.13 as imports.%import_ref.14 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.16 as imports.%import_ref.17 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.18 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.19 as imports.%import_ref.20 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.21 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.17)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.22 as imports.%import_ref.23 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.24 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.18)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.25 as imports.%import_ref.26 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.27 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.31 as imports.%import_ref.32 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.33 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.23)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.36 as imports.%import_ref.37 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.38 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.39 as imports.%import_ref.40 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.41 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.42 as imports.%import_ref.43 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.44 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.27)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.46 as imports.%import_ref.47 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.48 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.28)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.49 as imports.%import_ref.50 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.51 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Add(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @UInt(%size.param_patt: Core.IntLiteral) -> type = "int.make_type_unsigned"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @ConvertToU32(%a.param_patt: i32) -> %.2 = "int.convert_checked"; +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.15) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.15)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.15) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.15)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc13_28: i32 = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc13_31: i32 = int_value 2 [template = constants.%.2] -// CHECK:STDOUT: %.loc13_34: i32 = int_value 3 [template = constants.%.3] -// CHECK:STDOUT: %.loc13_35.1: %tuple.type = tuple_literal (%.loc13_28, %.loc13_31, %.loc13_34) -// CHECK:STDOUT: %.loc13_35.2: i32 = int_value 0 [template = constants.%.6] -// CHECK:STDOUT: %.loc13_35.3: ref i32 = array_index file.%a.var, %.loc13_35.2 -// CHECK:STDOUT: %.loc13_35.4: init i32 = initialize_from %.loc13_28 to %.loc13_35.3 [template = constants.%.1] -// CHECK:STDOUT: %.loc13_35.5: i32 = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc13_35.6: ref i32 = array_index file.%a.var, %.loc13_35.5 -// CHECK:STDOUT: %.loc13_35.7: init i32 = initialize_from %.loc13_31 to %.loc13_35.6 [template = constants.%.2] -// CHECK:STDOUT: %.loc13_35.8: i32 = int_value 2 [template = constants.%.2] -// CHECK:STDOUT: %.loc13_35.9: ref i32 = array_index file.%a.var, %.loc13_35.8 -// CHECK:STDOUT: %.loc13_35.10: init i32 = initialize_from %.loc13_34 to %.loc13_35.9 [template = constants.%.3] -// CHECK:STDOUT: %.loc13_35.11: init %.4 = array_init (%.loc13_35.4, %.loc13_35.7, %.loc13_35.10) to file.%a.var [template = constants.%array] -// CHECK:STDOUT: %.loc13_36: init %.4 = converted %.loc13_35.1, %.loc13_35.11 [template = constants.%array] -// CHECK:STDOUT: assign file.%a.var, %.loc13_36 -// CHECK:STDOUT: %a.ref: ref %.4 = name_ref a, file.%a -// CHECK:STDOUT: %.loc14: %.5 = addr_of %a.ref -// CHECK:STDOUT: %b: %.5 = bind_name b, %.loc14 +// CHECK:STDOUT: %.loc14_28: i32 = int_value 1 [template = constants.%.3] +// CHECK:STDOUT: %.loc14_31: i32 = int_value 2 [template = constants.%.4] +// CHECK:STDOUT: %.loc14_34: i32 = int_value 3 [template = constants.%.5] +// CHECK:STDOUT: %.loc14_35.1: %tuple.type = tuple_literal (%.loc14_28, %.loc14_31, %.loc14_34) +// CHECK:STDOUT: %.loc14_35.2: i32 = int_value 0 [template = constants.%.34] +// CHECK:STDOUT: %.loc14_35.3: ref i32 = array_index file.%a.var, %.loc14_35.2 +// CHECK:STDOUT: %.loc14_35.4: init i32 = initialize_from %.loc14_28 to %.loc14_35.3 [template = constants.%.3] +// CHECK:STDOUT: %.loc14_35.5: i32 = int_value 1 [template = constants.%.3] +// CHECK:STDOUT: %.loc14_35.6: ref i32 = array_index file.%a.var, %.loc14_35.5 +// CHECK:STDOUT: %.loc14_35.7: init i32 = initialize_from %.loc14_31 to %.loc14_35.6 [template = constants.%.4] +// CHECK:STDOUT: %.loc14_35.8: i32 = int_value 2 [template = constants.%.4] +// CHECK:STDOUT: %.loc14_35.9: ref i32 = array_index file.%a.var, %.loc14_35.8 +// CHECK:STDOUT: %.loc14_35.10: init i32 = initialize_from %.loc14_34 to %.loc14_35.9 [template = constants.%.5] +// CHECK:STDOUT: %.loc14_35.11: init %.32 = array_init (%.loc14_35.4, %.loc14_35.7, %.loc14_35.10) to file.%a.var [template = constants.%array] +// CHECK:STDOUT: %.loc14_36: init %.32 = converted %.loc14_35.1, %.loc14_35.11 [template = constants.%array] +// CHECK:STDOUT: assign file.%a.var, %.loc14_36 +// CHECK:STDOUT: %a.ref.loc15: ref %.32 = name_ref a, file.%a +// CHECK:STDOUT: %.loc15: %.33 = addr_of %a.ref.loc15 +// CHECK:STDOUT: %b: %.33 = bind_name b, %.loc15 +// CHECK:STDOUT: %a.ref.loc16: ref %.32 = name_ref a, file.%a +// CHECK:STDOUT: %.loc16: %.33 = addr_of %a.ref.loc16 +// CHECK:STDOUT: %c: %.33 = bind_name c, %.loc16 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: %.2 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %.2 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.15) { +// CHECK:STDOUT: %Dest => constants.%.15 +// CHECK:STDOUT: %Dest.patt => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.15 +// CHECK:STDOUT: %Dest.patt => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.21 +// CHECK:STDOUT: %.2 => constants.%.22 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.15) { +// CHECK:STDOUT: %Dest => constants.%.15 +// CHECK:STDOUT: %Dest.patt => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.15 +// CHECK:STDOUT: %Dest.patt => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.25 +// CHECK:STDOUT: %.2 => constants.%.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%.1) { +// CHECK:STDOUT: %N => constants.%.1 +// CHECK:STDOUT: %N.patt => constants.%.1 +// CHECK:STDOUT: %.1 => constants.%.36 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%.1) { +// CHECK:STDOUT: %N => constants.%.1 +// CHECK:STDOUT: %N.patt => constants.%.1 +// CHECK:STDOUT: %.1 => constants.%.2 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.16 +// CHECK:STDOUT: %Convert => constants.%Convert.16 +// CHECK:STDOUT: %.2 => constants.%.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%.1) { +// CHECK:STDOUT: %N => constants.%.1 +// CHECK:STDOUT: %.1 => constants.%.2 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/fail_bound_negative.carbon b/toolchain/check/testdata/array/fail_bound_negative.carbon index 11a7f4b58f6c4..d41e8a75202d4 100644 --- a/toolchain/check/testdata/array/fail_bound_negative.carbon +++ b/toolchain/check/testdata/array/fail_bound_negative.carbon @@ -25,15 +25,143 @@ var a: [i32; Negate(1)]; // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] // CHECK:STDOUT: %.1: i32 = int_value 1 [template] // CHECK:STDOUT: %.2: i32 = int_value -1 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.3: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.5: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.7: %.3 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.8: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.10: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.10)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.11: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.12: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.12)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.17: %.16 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.18: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.19: %.18 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.10)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.20: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.12)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.21: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.22: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.23: %.22 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.27: = bound_method %.2, %Convert.15 [template] +// CHECK:STDOUT: %.28: Core.IntLiteral = int_value -1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.26] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.10)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.12)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.10)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.12)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -66,12 +194,579 @@ var a: [i32; Negate(1)]; // CHECK:STDOUT: %int.snegate: init i32 = call %Negate.ref(%.loc16_21) [template = constants.%.2] // CHECK:STDOUT: %.loc16_9.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc16_9.2: type = converted %int.make_type_32, %.loc16_9.1 [template = i32] -// CHECK:STDOUT: %.loc16_23: type = array_type %int.snegate, i32 [template = ] +// CHECK:STDOUT: %.loc16_20.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc16_20.2: = bound_method %int.snegate, %.loc16_20.1 [template = constants.%.27] +// CHECK:STDOUT: %.loc16_20.3: i32 = value_of_initializer %int.snegate [template = constants.%.2] +// CHECK:STDOUT: %.loc16_20.4: i32 = converted %int.snegate, %.loc16_20.3 [template = constants.%.2] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc16_20.2(%.loc16_20.4) [template = constants.%.28] +// CHECK:STDOUT: %.loc16_20.5: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.28] +// CHECK:STDOUT: %.loc16_20.6: Core.IntLiteral = converted %int.snegate, %.loc16_20.5 [template = constants.%.28] +// CHECK:STDOUT: %.loc16_23: type = array_type %.loc16_20.6, i32 [template = ] // CHECK:STDOUT: %a.var: ref = var a // CHECK:STDOUT: %a: ref = bind_name a, %a.var // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.3)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.3) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.16)] +// CHECK:STDOUT: %.2: @As.%.1 (%.16) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.17)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.20)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.25)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Negate(%n.param_patt: i32) -> i32 = "int.snegate"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.10) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.12) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.10) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.12) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %.2 => constants.%.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: %.2 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.10) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.12) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.18 +// CHECK:STDOUT: %.2 => constants.%.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.10) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.12) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.22 +// CHECK:STDOUT: %.2 => constants.%.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/fail_bound_overflow.carbon b/toolchain/check/testdata/array/fail_bound_overflow.carbon index b9c6c6f0eb5d5..30f3e2c6782c6 100644 --- a/toolchain/check/testdata/array/fail_bound_overflow.carbon +++ b/toolchain/check/testdata/array/fail_bound_overflow.carbon @@ -402,6 +402,8 @@ var b: [1; 39999999999999999993]; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -409,6 +411,8 @@ var b: [1; 39999999999999999993]; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -416,6 +420,8 @@ var b: [1; 39999999999999999993]; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -423,6 +429,8 @@ var b: [1; 39999999999999999993]; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -438,6 +446,8 @@ var b: [1; 39999999999999999993]; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -445,6 +455,8 @@ var b: [1; 39999999999999999993]; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -452,6 +464,8 @@ var b: [1; 39999999999999999993]; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -459,6 +473,8 @@ var b: [1; 39999999999999999993]; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/fail_incomplete_element.carbon b/toolchain/check/testdata/array/fail_incomplete_element.carbon index 538628eeb5137..a88afed039e12 100644 --- a/toolchain/check/testdata/array/fail_incomplete_element.carbon +++ b/toolchain/check/testdata/array/fail_incomplete_element.carbon @@ -25,16 +25,145 @@ var p: Incomplete* = &a[0]; // CHECK:STDOUT: constants { // CHECK:STDOUT: %Incomplete: type = class_type @Incomplete [template] // CHECK:STDOUT: %.1: i32 = int_value 1 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, %Incomplete [template] -// CHECK:STDOUT: %.3: type = ptr_type %Incomplete [template] -// CHECK:STDOUT: %.4: i32 = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.2: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.3: %.2 = assoc_entity element0, imports.%import_ref.5 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.5 [template] +// CHECK:STDOUT: %.6: %.2 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.9: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.9)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.10: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.11: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.32 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.33 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.9)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.19: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.20: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.21: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.22: %.21 = assoc_entity element0, imports.%import_ref.43 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.28: type = array_type %.27, %Incomplete [template] +// CHECK:STDOUT: %.29: type = ptr_type %Incomplete [template] +// CHECK:STDOUT: %.30: i32 = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .ImplicitAs = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.2) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.6)] +// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.13 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.14: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.16 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.17: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.19: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.25] +// CHECK:STDOUT: %import_ref.20: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.22 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.23: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.25 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.29: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.31 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.36 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.37: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.39 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.40: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.42 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.44: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.46 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.47: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.49 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -47,24 +176,589 @@ var p: Incomplete* = &a[0]; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} {} // CHECK:STDOUT: %Incomplete.ref.loc19: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete] -// CHECK:STDOUT: %.loc19_21: i32 = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc19_22: type = array_type %.loc19_21, %Incomplete [template = constants.%.2] +// CHECK:STDOUT: %.loc19_21.1: i32 = int_value 1 [template = constants.%.1] +// CHECK:STDOUT: %.loc19_21.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc19_21.3: = bound_method %.loc19_21.1, %.loc19_21.2 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc19_21.3(%.loc19_21.1) [template = constants.%.27] +// CHECK:STDOUT: %.loc19_21.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.27] +// CHECK:STDOUT: %.loc19_21.5: Core.IntLiteral = converted %.loc19_21.1, %.loc19_21.4 [template = constants.%.27] +// CHECK:STDOUT: %.loc19_22: type = array_type %.loc19_21.5, %Incomplete [template = constants.%.28] // CHECK:STDOUT: %a.var: ref = var a // CHECK:STDOUT: %a: ref = bind_name a, %a.var // CHECK:STDOUT: %Incomplete.ref.loc21: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete] -// CHECK:STDOUT: %.loc21: type = ptr_type %Incomplete [template = constants.%.3] -// CHECK:STDOUT: %p.var: ref %.3 = var p -// CHECK:STDOUT: %p: ref %.3 = bind_name p, %p.var +// CHECK:STDOUT: %.loc21: type = ptr_type %Incomplete [template = constants.%.29] +// CHECK:STDOUT: %p.var: ref %.29 = var p +// CHECK:STDOUT: %p: ref %.29 = bind_name p, %p.var +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.2) = assoc_entity element0, imports.%import_ref.5 [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .Convert = imports.%import_ref.3 +// CHECK:STDOUT: witness = (imports.%import_ref.4) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %.2: @As.%.1 (%.15) = assoc_entity element0, imports.%import_ref.32 [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.26 +// CHECK:STDOUT: .Convert = imports.%import_ref.27 +// CHECK:STDOUT: witness = (imports.%import_ref.28) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.7 as imports.%import_ref.8 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.11 as imports.%import_ref.12 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.14 as imports.%import_ref.15 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.16 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.17 as imports.%import_ref.18 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.20 as imports.%import_ref.21 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.22 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.23 as imports.%import_ref.24 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.25 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.29 as imports.%import_ref.30 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.31 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.34 as imports.%import_ref.35 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.36 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.20)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.37 as imports.%import_ref.38 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.39 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.40 as imports.%import_ref.41 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.42 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.23)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.44 as imports.%import_ref.45 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.46 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.47 as imports.%import_ref.48 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.49 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Incomplete; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: ref = name_ref a, file.%a -// CHECK:STDOUT: %.loc21_25: i32 = int_value 0 [template = constants.%.4] +// CHECK:STDOUT: %.loc21_25: i32 = int_value 0 [template = constants.%.30] // CHECK:STDOUT: %.loc21_22: = addr_of [template = ] // CHECK:STDOUT: assign file.%p.var, // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.2 => constants.%.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %.2 => constants.%.18 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.21 +// CHECK:STDOUT: %.2 => constants.%.22 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/fail_invalid_type.carbon b/toolchain/check/testdata/array/fail_invalid_type.carbon index d5ee5a9d04171..4bcd455a1f23a 100644 --- a/toolchain/check/testdata/array/fail_invalid_type.carbon +++ b/toolchain/check/testdata/array/fail_invalid_type.carbon @@ -99,6 +99,11 @@ var a: [1; 1]; // CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.10, @impl.12(%N) [symbolic] // CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [symbolic] // CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [symbolic] +// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.16) [template] +// CHECK:STDOUT: %.28: = bound_method %.1, %Convert.16 [template] +// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -125,7 +130,7 @@ var a: [1; 1]; // CHECK:STDOUT: %import_ref.16 = import_ref Core//prelude/operators/as, inst+260, unloaded // CHECK:STDOUT: %import_ref.17: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] // CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.7] -// CHECK:STDOUT: %import_ref.19 = import_ref Core//prelude/operators/as, inst+296, unloaded +// CHECK:STDOUT: %import_ref.19: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.27] // CHECK:STDOUT: %import_ref.20 = import_ref Core//prelude/operators/as, inst+76, unloaded // CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.9)] // CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.7] @@ -166,9 +171,14 @@ var a: [1; 1]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %.loc17_9.1: i32 = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc17_12: i32 = int_value 1 [template = constants.%.1] +// CHECK:STDOUT: %.loc17_12.1: i32 = int_value 1 [template = constants.%.1] // CHECK:STDOUT: %.loc17_9.2: type = converted %.loc17_9.1, [template = ] -// CHECK:STDOUT: %.loc17_13: type = array_type %.loc17_12, [template = ] +// CHECK:STDOUT: %.loc17_12.2: %Convert.type.6 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.16] +// CHECK:STDOUT: %.loc17_12.3: = bound_method %.loc17_12.1, %.loc17_12.2 [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc17_12.3(%.loc17_12.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc17_12.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.29] +// CHECK:STDOUT: %.loc17_12.5: Core.IntLiteral = converted %.loc17_12.1, %.loc17_12.4 [template = constants.%.29] +// CHECK:STDOUT: %.loc17_13: type = array_type %.loc17_12.5, [template = ] // CHECK:STDOUT: %a.var: ref = var a // CHECK:STDOUT: %a: ref = bind_name a, %a.var // CHECK:STDOUT: } @@ -377,6 +387,8 @@ var a: [1; 1]; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -384,6 +396,8 @@ var a: [1; 1]; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -391,6 +405,8 @@ var a: [1; 1]; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -398,6 +414,8 @@ var a: [1; 1]; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -413,6 +431,8 @@ var a: [1; 1]; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -420,6 +440,8 @@ var a: [1; 1]; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -427,6 +449,8 @@ var a: [1; 1]; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -434,9 +458,13 @@ var a: [1; 1]; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest // CHECK:STDOUT: %Dest.patt => constants.%Dest diff --git a/toolchain/check/testdata/array/fail_out_of_bound.carbon b/toolchain/check/testdata/array/fail_out_of_bound.carbon index af697887891cc..13ec67dc62ed7 100644 --- a/toolchain/check/testdata/array/fail_out_of_bound.carbon +++ b/toolchain/check/testdata/array/fail_out_of_bound.carbon @@ -20,20 +20,148 @@ var a: [i32; 1] = (1, 2, 3); // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.1: i32 = int_value 1 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] -// CHECK:STDOUT: %.4: i32 = int_value 2 [template] -// CHECK:STDOUT: %.5: i32 = int_value 3 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.2: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.3: %.2 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.6: %.2 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.9: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.9)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.10: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.11: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.9)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.19: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.20: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.21: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.22: %.21 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.28: type = array_type %.27, i32 [template] +// CHECK:STDOUT: %.29: type = ptr_type %.28 [template] +// CHECK:STDOUT: %.30: i32 = int_value 2 [template] +// CHECK:STDOUT: %.31: i32 = int_value 3 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (i32, i32, i32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.2) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.6)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.25] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -43,23 +171,588 @@ var a: [i32; 1] = (1, 2, 3); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_14: i32 = int_value 1 [template = constants.%.1] +// CHECK:STDOUT: %.loc14_14.1: i32 = int_value 1 [template = constants.%.1] // CHECK:STDOUT: %.loc14_9.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc14_9.2: type = converted %int.make_type_32, %.loc14_9.1 [template = i32] -// CHECK:STDOUT: %.loc14_15: type = array_type %.loc14_14, i32 [template = constants.%.2] -// CHECK:STDOUT: %a.var: ref %.2 = var a -// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var +// CHECK:STDOUT: %.loc14_14.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc14_14.3: = bound_method %.loc14_14.1, %.loc14_14.2 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc14_14.3(%.loc14_14.1) [template = constants.%.27] +// CHECK:STDOUT: %.loc14_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.27] +// CHECK:STDOUT: %.loc14_14.5: Core.IntLiteral = converted %.loc14_14.1, %.loc14_14.4 [template = constants.%.27] +// CHECK:STDOUT: %.loc14_15: type = array_type %.loc14_14.5, i32 [template = constants.%.28] +// CHECK:STDOUT: %a.var: ref %.28 = var a +// CHECK:STDOUT: %a: ref %.28 = bind_name a, %a.var +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.2) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %.2: @As.%.1 (%.15) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.20)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.23)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc14_20: i32 = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc14_23: i32 = int_value 2 [template = constants.%.4] -// CHECK:STDOUT: %.loc14_26: i32 = int_value 3 [template = constants.%.5] +// CHECK:STDOUT: %.loc14_23: i32 = int_value 2 [template = constants.%.30] +// CHECK:STDOUT: %.loc14_26: i32 = int_value 3 [template = constants.%.31] // CHECK:STDOUT: %.loc14_27: %tuple.type = tuple_literal (%.loc14_20, %.loc14_23, %.loc14_26) // CHECK:STDOUT: assign file.%a.var, // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.2 => constants.%.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %.2 => constants.%.18 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.21 +// CHECK:STDOUT: %.2 => constants.%.22 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: 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 5a8ef99180cf5..b1eee7a601961 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 @@ -21,24 +21,152 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.1: i32 = int_value 3 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] -// CHECK:STDOUT: %.4: i32 = int_value 1 [template] -// CHECK:STDOUT: %.5: i32 = int_value 2 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.2: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.3: %.2 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.6: %.2 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.9: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.9)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.10: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.11: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.9)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.19: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.20: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.21: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.22: %.21 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.28: type = array_type %.27, i32 [template] +// CHECK:STDOUT: %.29: type = ptr_type %.28 [template] +// CHECK:STDOUT: %.30: i32 = int_value 1 [template] +// CHECK:STDOUT: %.31: i32 = int_value 2 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (i32, i32, i32) [template] -// CHECK:STDOUT: %.6: i32 = int_value 0 [template] -// CHECK:STDOUT: %array: %.2 = tuple_value (%.4, %.5, %.1) [template] -// CHECK:STDOUT: %.7: type = struct_type {.index: i32} [template] -// CHECK:STDOUT: %struct: %.7 = struct_value (%.1) [template] +// CHECK:STDOUT: %.32: i32 = int_value 0 [template] +// CHECK:STDOUT: %array: %.28 = tuple_value (%.30, %.31, %.1) [template] +// CHECK:STDOUT: %.33: type = struct_type {.index: i32} [template] +// CHECK:STDOUT: %struct: %.33 = struct_value (%.1) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.2) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.6)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.25] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -49,12 +177,17 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_14: i32 = int_value 3 [template = constants.%.1] +// CHECK:STDOUT: %.loc11_14.1: i32 = int_value 3 [template = constants.%.1] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] // CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32.loc11, %.loc11_9.1 [template = i32] -// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, i32 [template = constants.%.2] -// CHECK:STDOUT: %a.var: ref %.2 = var a -// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var +// CHECK:STDOUT: %.loc11_14.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc11_14.3: = bound_method %.loc11_14.1, %.loc11_14.2 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc11_14.3(%.loc11_14.1) [template = constants.%.27] +// CHECK:STDOUT: %.loc11_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.27] +// CHECK:STDOUT: %.loc11_14.5: Core.IntLiteral = converted %.loc11_14.1, %.loc11_14.4 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14.5, i32 [template = constants.%.28] +// CHECK:STDOUT: %a.var: ref %.28 = var a +// CHECK:STDOUT: %a: ref %.28 = bind_name a, %a.var // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] @@ -62,31 +195,313 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.2) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %.2: @As.%.1 (%.15) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.20)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.23)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_20: i32 = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc11_23: i32 = int_value 2 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_20: i32 = int_value 1 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_23: i32 = int_value 2 [template = constants.%.31] // CHECK:STDOUT: %.loc11_26: i32 = int_value 3 [template = constants.%.1] // CHECK:STDOUT: %.loc11_27.1: %tuple.type = tuple_literal (%.loc11_20, %.loc11_23, %.loc11_26) -// CHECK:STDOUT: %.loc11_27.2: i32 = int_value 0 [template = constants.%.6] +// CHECK:STDOUT: %.loc11_27.2: i32 = int_value 0 [template = constants.%.32] // CHECK:STDOUT: %.loc11_27.3: ref i32 = array_index file.%a.var, %.loc11_27.2 -// CHECK:STDOUT: %.loc11_27.4: init i32 = initialize_from %.loc11_20 to %.loc11_27.3 [template = constants.%.4] -// CHECK:STDOUT: %.loc11_27.5: i32 = int_value 1 [template = constants.%.4] +// CHECK:STDOUT: %.loc11_27.4: init i32 = initialize_from %.loc11_20 to %.loc11_27.3 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_27.5: i32 = int_value 1 [template = constants.%.30] // CHECK:STDOUT: %.loc11_27.6: ref i32 = array_index file.%a.var, %.loc11_27.5 -// CHECK:STDOUT: %.loc11_27.7: init i32 = initialize_from %.loc11_23 to %.loc11_27.6 [template = constants.%.5] -// CHECK:STDOUT: %.loc11_27.8: i32 = int_value 2 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_27.7: init i32 = initialize_from %.loc11_23 to %.loc11_27.6 [template = constants.%.31] +// CHECK:STDOUT: %.loc11_27.8: i32 = int_value 2 [template = constants.%.31] // CHECK:STDOUT: %.loc11_27.9: ref i32 = array_index file.%a.var, %.loc11_27.8 // CHECK:STDOUT: %.loc11_27.10: init i32 = initialize_from %.loc11_26 to %.loc11_27.9 [template = constants.%.1] -// CHECK:STDOUT: %.loc11_27.11: init %.2 = array_init (%.loc11_27.4, %.loc11_27.7, %.loc11_27.10) to file.%a.var [template = constants.%array] -// CHECK:STDOUT: %.loc11_28: init %.2 = converted %.loc11_27.1, %.loc11_27.11 [template = constants.%array] +// CHECK:STDOUT: %.loc11_27.11: init %.28 = array_init (%.loc11_27.4, %.loc11_27.7, %.loc11_27.10) to file.%a.var [template = constants.%array] +// CHECK:STDOUT: %.loc11_28: init %.28 = converted %.loc11_27.1, %.loc11_27.11 [template = constants.%array] // CHECK:STDOUT: assign file.%a.var, %.loc11_28 -// CHECK:STDOUT: %a.ref: ref %.2 = name_ref a, file.%a +// CHECK:STDOUT: %a.ref: ref %.28 = name_ref a, file.%a // CHECK:STDOUT: %.loc15_26: i32 = int_value 3 [template = constants.%.1] -// CHECK:STDOUT: %.loc15_27.1: %.7 = struct_literal (%.loc15_26) -// CHECK:STDOUT: %struct: %.7 = struct_value (%.loc15_26) [template = constants.%struct] -// CHECK:STDOUT: %.loc15_27.2: %.7 = converted %.loc15_27.1, %struct [template = constants.%struct] +// CHECK:STDOUT: %.loc15_27.1: %.33 = struct_literal (%.loc15_26) +// CHECK:STDOUT: %struct: %.33 = struct_value (%.loc15_26) [template = constants.%struct] +// CHECK:STDOUT: %.loc15_27.2: %.33 = converted %.loc15_27.1, %struct [template = constants.%struct] // CHECK:STDOUT: %.loc15_28: i32 = struct_access %.loc15_27.2, element0 [template = constants.%.1] // CHECK:STDOUT: %.loc15_34.1: ref i32 = array_index %a.ref, %.loc15_28 [template = ] // CHECK:STDOUT: %.loc15_34.2: i32 = bind_value %.loc15_34.1 @@ -94,3 +509,281 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.2 => constants.%.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %.2 => constants.%.18 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.21 +// CHECK:STDOUT: %.2 => constants.%.22 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/fail_type_mismatch.carbon b/toolchain/check/testdata/array/fail_type_mismatch.carbon index 9840615a30b22..2c46034bbce62 100644 --- a/toolchain/check/testdata/array/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/array/fail_type_mismatch.carbon @@ -46,14 +46,6 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.1: i32 = int_value 3 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] -// CHECK:STDOUT: %.4: i32 = int_value 1 [template] -// CHECK:STDOUT: %.5: type = ptr_type String [template] -// CHECK:STDOUT: %.6: String = string_literal "Hello" [template] -// CHECK:STDOUT: %.7: String = string_literal "World" [template] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (i32, String, String) [template] -// CHECK:STDOUT: %.8: i32 = int_value 0 [template] // CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] // CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] @@ -63,37 +55,37 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] -// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.6 [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %.2: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.3: %.2 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %.11: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] -// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, imports.%import_ref.6 [template] -// CHECK:STDOUT: %.13: %.9 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.6: %.2 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.11 [template] // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %.14: type = int_type signed, %N [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(%.14)> [symbolic] +// CHECK:STDOUT: %.9: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.9)> [symbolic] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] -// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.2, @impl.2(%N) [symbolic] -// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [symbolic] -// CHECK:STDOUT: %.15: = interface_witness (%Convert.3) [symbolic] -// CHECK:STDOUT: %.16: type = int_type unsigned, %N [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.16)> [symbolic] -// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] // CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] -// CHECK:STDOUT: %.17: = interface_witness (%Convert.4) [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [template] -// CHECK:STDOUT: %.18: type = assoc_entity_type %ImplicitAs.type.6, %Convert.type.5 [template] -// CHECK:STDOUT: %.19: %.18 = assoc_entity element0, imports.%import_ref.20 [template] +// CHECK:STDOUT: %.10: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.11: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.5) [symbolic] // CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] // CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] -// CHECK:STDOUT: %.20: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.6) [symbolic] // CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] // CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] -// CHECK:STDOUT: %.21: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.7) [symbolic] // CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] // CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] // CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] @@ -102,38 +94,51 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] // CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] -// CHECK:STDOUT: %.22: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] -// CHECK:STDOUT: %.23: %.22 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %.15: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.33 [symbolic] // CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] // CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] -// CHECK:STDOUT: %.24: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] -// CHECK:STDOUT: %.25: %.24 = assoc_entity element0, imports.%import_ref.34 [template] -// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.14)> [symbolic] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.9)> [symbolic] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.10) [symbolic] -// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.16)> [symbolic] +// CHECK:STDOUT: %.19: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.11)> [symbolic] // CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] // CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] -// CHECK:STDOUT: %.27: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %.20: = interface_witness (%Convert.11) [symbolic] // CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] // CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] -// CHECK:STDOUT: %.28: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] -// CHECK:STDOUT: %.29: %.28 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %.21: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.22: %.21 = assoc_entity element0, imports.%import_ref.44 [template] // CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] // CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] -// CHECK:STDOUT: %.30: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.13) [symbolic] // CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] // CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] -// CHECK:STDOUT: %.31: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.28: type = array_type %.27, i32 [template] +// CHECK:STDOUT: %.29: type = ptr_type %.28 [template] +// CHECK:STDOUT: %.30: i32 = int_value 1 [template] +// CHECK:STDOUT: %.31: type = ptr_type String [template] +// CHECK:STDOUT: %.32: String = string_literal "Hello" [template] +// CHECK:STDOUT: %.33: String = string_literal "World" [template] +// CHECK:STDOUT: %tuple.type.1: type = tuple_type (i32, String, String) [template] +// CHECK:STDOUT: %.34: i32 = int_value 0 [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (type, type, type) [template] -// CHECK:STDOUT: %tuple.type.3: type = tuple_type (i32, %.5, %.5) [template] -// CHECK:STDOUT: %.32: type = ptr_type %tuple.type.3 [template] -// CHECK:STDOUT: %.33: i32 = int_value 2 [template] +// CHECK:STDOUT: %tuple.type.3: type = tuple_type (i32, %.31, %.31) [template] +// CHECK:STDOUT: %.35: type = ptr_type %tuple.type.3 [template] +// CHECK:STDOUT: %.36: i32 = int_value 2 [template] // CHECK:STDOUT: %tuple.type.4: type = tuple_type (i32, i32) [template] // CHECK:STDOUT: %tuple.type.5: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %.34: type = ptr_type %tuple.type.4 [template] +// CHECK:STDOUT: %.37: type = ptr_type %tuple.type.4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -146,28 +151,28 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] // CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] // CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.9) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.13)] +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.2) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.6)] // CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded // CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded // CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] // CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.4)] -// CHECK:STDOUT: %import_ref.13 = import_ref Core//prelude/operators/as, inst+196, unloaded -// CHECK:STDOUT: %import_ref.14: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.5)] -// CHECK:STDOUT: %import_ref.16 = import_ref Core//prelude/operators/as, inst+260, unloaded -// CHECK:STDOUT: %import_ref.17: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] -// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.19 = import_ref Core//prelude/operators/as, inst+296, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Core//prelude/operators/as, inst+76, unloaded -// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.14)] -// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.6] +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.25] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] // CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded -// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.16)] -// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.6] +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] // CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded // CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded // CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded @@ -187,10 +192,10 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] // CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded // CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded -// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.14)] +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.9)] // CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] // CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded -// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.16)] +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.11)] // CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] // CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } @@ -207,12 +212,17 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc18: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_14: i32 = int_value 3 [template = constants.%.1] +// CHECK:STDOUT: %.loc18_14.1: i32 = int_value 3 [template = constants.%.1] // CHECK:STDOUT: %.loc18_9.1: type = value_of_initializer %int.make_type_32.loc18 [template = i32] // CHECK:STDOUT: %.loc18_9.2: type = converted %int.make_type_32.loc18, %.loc18_9.1 [template = i32] -// CHECK:STDOUT: %.loc18_15: type = array_type %.loc18_14, i32 [template = constants.%.2] -// CHECK:STDOUT: %a.var: ref %.2 = var a -// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var +// CHECK:STDOUT: %.loc18_14.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc18_14.3: = bound_method %.loc18_14.1, %.loc18_14.2 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc18: init Core.IntLiteral = call %.loc18_14.3(%.loc18_14.1) [template = constants.%.27] +// CHECK:STDOUT: %.loc18_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc18 [template = constants.%.27] +// CHECK:STDOUT: %.loc18_14.5: Core.IntLiteral = converted %.loc18_14.1, %.loc18_14.4 [template = constants.%.27] +// CHECK:STDOUT: %.loc18_15: type = array_type %.loc18_14.5, i32 [template = constants.%.28] +// CHECK:STDOUT: %a.var: ref %.28 = var a +// CHECK:STDOUT: %a: ref %.28 = bind_name a, %a.var // CHECK:STDOUT: %int.make_type_32.loc20: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc20_29.1: %tuple.type.2 = tuple_literal (%int.make_type_32.loc20, String, String) // CHECK:STDOUT: %.loc20_29.2: type = value_of_initializer %int.make_type_32.loc20 [template = i32] @@ -221,19 +231,29 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %t1.var: ref %tuple.type.1 = var t1 // CHECK:STDOUT: %t1: ref %tuple.type.1 = bind_name t1, %t1.var // CHECK:STDOUT: %int.make_type_32.loc28: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc28_14: i32 = int_value 3 [template = constants.%.1] +// CHECK:STDOUT: %.loc28_14.1: i32 = int_value 3 [template = constants.%.1] // CHECK:STDOUT: %.loc28_9.1: type = value_of_initializer %int.make_type_32.loc28 [template = i32] // CHECK:STDOUT: %.loc28_9.2: type = converted %int.make_type_32.loc28, %.loc28_9.1 [template = i32] -// CHECK:STDOUT: %.loc28_15: type = array_type %.loc28_14, i32 [template = constants.%.2] -// CHECK:STDOUT: %b.var: ref %.2 = var b -// CHECK:STDOUT: %b: ref %.2 = bind_name b, %b.var +// CHECK:STDOUT: %.loc28_14.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc28_14.3: = bound_method %.loc28_14.1, %.loc28_14.2 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc28: init Core.IntLiteral = call %.loc28_14.3(%.loc28_14.1) [template = constants.%.27] +// CHECK:STDOUT: %.loc28_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc28 [template = constants.%.27] +// CHECK:STDOUT: %.loc28_14.5: Core.IntLiteral = converted %.loc28_14.1, %.loc28_14.4 [template = constants.%.27] +// CHECK:STDOUT: %.loc28_15: type = array_type %.loc28_14.5, i32 [template = constants.%.28] +// CHECK:STDOUT: %b.var: ref %.28 = var b +// CHECK:STDOUT: %b: ref %.28 = bind_name b, %b.var // CHECK:STDOUT: %int.make_type_32.loc34: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc34_14: i32 = int_value 3 [template = constants.%.1] +// CHECK:STDOUT: %.loc34_14.1: i32 = int_value 3 [template = constants.%.1] // CHECK:STDOUT: %.loc34_9.1: type = value_of_initializer %int.make_type_32.loc34 [template = i32] // CHECK:STDOUT: %.loc34_9.2: type = converted %int.make_type_32.loc34, %.loc34_9.1 [template = i32] -// CHECK:STDOUT: %.loc34_15: type = array_type %.loc34_14, i32 [template = constants.%.2] -// CHECK:STDOUT: %c.var: ref %.2 = var c -// CHECK:STDOUT: %c: ref %.2 = bind_name c, %c.var +// CHECK:STDOUT: %.loc34_14.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc34_14.3: = bound_method %.loc34_14.1, %.loc34_14.2 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc34: init Core.IntLiteral = call %.loc34_14.3(%.loc34_14.1) [template = constants.%.27] +// CHECK:STDOUT: %.loc34_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc34 [template = constants.%.27] +// CHECK:STDOUT: %.loc34_14.5: Core.IntLiteral = converted %.loc34_14.1, %.loc34_14.4 [template = constants.%.27] +// CHECK:STDOUT: %.loc34_15: type = array_type %.loc34_14.5, i32 [template = constants.%.28] +// CHECK:STDOUT: %c.var: ref %.28 = var c +// CHECK:STDOUT: %c: ref %.28 = bind_name c, %c.var // CHECK:STDOUT: %int.make_type_32.loc36_10: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc36_15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc36_18.1: %tuple.type.5 = tuple_literal (%int.make_type_32.loc36_10, %int.make_type_32.loc36_15) @@ -245,12 +265,17 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %t2.var: ref %tuple.type.4 = var t2 // CHECK:STDOUT: %t2: ref %tuple.type.4 = bind_name t2, %t2.var // CHECK:STDOUT: %int.make_type_32.loc40: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc40_14: i32 = int_value 3 [template = constants.%.1] +// CHECK:STDOUT: %.loc40_14.1: i32 = int_value 3 [template = constants.%.1] // CHECK:STDOUT: %.loc40_9.1: type = value_of_initializer %int.make_type_32.loc40 [template = i32] // CHECK:STDOUT: %.loc40_9.2: type = converted %int.make_type_32.loc40, %.loc40_9.1 [template = i32] -// CHECK:STDOUT: %.loc40_15: type = array_type %.loc40_14, i32 [template = constants.%.2] -// CHECK:STDOUT: %d.var: ref %.2 = var d -// CHECK:STDOUT: %d: ref %.2 = bind_name d, %d.var +// CHECK:STDOUT: %.loc40_14.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc40_14.3: = bound_method %.loc40_14.1, %.loc40_14.2 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc40: init Core.IntLiteral = call %.loc40_14.3(%.loc40_14.1) [template = constants.%.27] +// CHECK:STDOUT: %.loc40_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc40 [template = constants.%.27] +// CHECK:STDOUT: %.loc40_14.5: Core.IntLiteral = converted %.loc40_14.1, %.loc40_14.4 [template = constants.%.27] +// CHECK:STDOUT: %.loc40_15: type = array_type %.loc40_14.5, i32 [template = constants.%.28] +// CHECK:STDOUT: %d.var: ref %.28 = var d +// CHECK:STDOUT: %d: ref %.28 = bind_name d, %d.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { @@ -262,8 +287,8 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] -// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.9)] -// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.9) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.10)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.2) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.3)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: @@ -282,8 +307,8 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] // CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] -// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.22)] -// CHECK:STDOUT: %.2: @As.%.1 (%.22) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.23)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %.2: @As.%.1 (%.15) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.16)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: @@ -301,51 +326,51 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.14)] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.4)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.3)] -// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.3) = struct_value () [symbolic = %Convert (constants.%Convert.3)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.15)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.10)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.11 as imports.%import_ref.12 { +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.13 +// CHECK:STDOUT: witness = imports.%import_ref.14 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.16)] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] -// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.17)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.14 as imports.%import_ref.15 { +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.16 +// CHECK:STDOUT: witness = imports.%import_ref.17 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.4: imports.%import_ref.17 as imports.%import_ref.18 { +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.19 +// CHECK:STDOUT: witness = imports.%import_ref.20 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] // CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.20)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] // CHECK:STDOUT: // CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { // CHECK:STDOUT: !members: @@ -356,12 +381,12 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.16)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] // CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] // CHECK:STDOUT: // CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { // CHECK:STDOUT: !members: @@ -377,13 +402,13 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] // CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.26)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.19)] // CHECK:STDOUT: // CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { // CHECK:STDOUT: !members: @@ -394,13 +419,13 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.16)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] // CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.27)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.20)] // CHECK:STDOUT: // CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { // CHECK:STDOUT: !members: @@ -416,12 +441,12 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] // CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.30)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.23)] // CHECK:STDOUT: // CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { // CHECK:STDOUT: !members: @@ -432,12 +457,12 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.16)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] // CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.31)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.24)] // CHECK:STDOUT: // CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { // CHECK:STDOUT: !members: @@ -457,30 +482,38 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.14) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.16)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.16) = "int.convert_checked"; +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.14)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.16)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.16)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { @@ -493,54 +526,64 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.14) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.16)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.16) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.14)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.16)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.16)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc18_20: i32 = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc18_23: String = string_literal "Hello" [template = constants.%.6] -// CHECK:STDOUT: %.loc18_32: String = string_literal "World" [template = constants.%.7] +// CHECK:STDOUT: %.loc18_20: i32 = int_value 1 [template = constants.%.30] +// CHECK:STDOUT: %.loc18_23: String = string_literal "Hello" [template = constants.%.32] +// CHECK:STDOUT: %.loc18_32: String = string_literal "World" [template = constants.%.33] // CHECK:STDOUT: %.loc18_39.1: %tuple.type.1 = tuple_literal (%.loc18_20, %.loc18_23, %.loc18_32) -// CHECK:STDOUT: %.loc18_39.2: i32 = int_value 0 [template = constants.%.8] +// CHECK:STDOUT: %.loc18_39.2: i32 = int_value 0 [template = constants.%.34] // CHECK:STDOUT: %.loc18_39.3: ref i32 = array_index file.%a.var, %.loc18_39.2 -// CHECK:STDOUT: %.loc18_39.4: init i32 = initialize_from %.loc18_20 to %.loc18_39.3 [template = constants.%.4] +// CHECK:STDOUT: %.loc18_39.4: init i32 = initialize_from %.loc18_20 to %.loc18_39.3 [template = constants.%.30] // CHECK:STDOUT: %.loc18_39.5: i32 = converted %.loc18_23, [template = ] // CHECK:STDOUT: assign file.%a.var, // CHECK:STDOUT: %t1.ref: ref %tuple.type.1 = name_ref t1, file.%t1 // CHECK:STDOUT: %.loc28_19.1: ref i32 = tuple_access %t1.ref, element0 // CHECK:STDOUT: %.loc28_19.2: i32 = bind_value %.loc28_19.1 -// CHECK:STDOUT: %.loc28_19.3: i32 = int_value 0 [template = constants.%.8] +// CHECK:STDOUT: %.loc28_19.3: i32 = int_value 0 [template = constants.%.34] // CHECK:STDOUT: %.loc28_19.4: ref i32 = array_index file.%b.var, %.loc28_19.3 // CHECK:STDOUT: %.loc28_19.5: init i32 = initialize_from %.loc28_19.2 to %.loc28_19.4 // CHECK:STDOUT: %.loc28_19.6: ref String = tuple_access %t1.ref, element1 // CHECK:STDOUT: %.loc28_19.7: i32 = converted %.loc28_19.6, [template = ] // CHECK:STDOUT: assign file.%b.var, -// CHECK:STDOUT: %.loc34_20: i32 = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc34_23: i32 = int_value 2 [template = constants.%.33] +// CHECK:STDOUT: %.loc34_20: i32 = int_value 1 [template = constants.%.30] +// CHECK:STDOUT: %.loc34_23: i32 = int_value 2 [template = constants.%.36] // CHECK:STDOUT: %.loc34_24: %tuple.type.4 = tuple_literal (%.loc34_20, %.loc34_23) // CHECK:STDOUT: assign file.%c.var, // CHECK:STDOUT: %t2.ref: ref %tuple.type.4 = name_ref t2, file.%t2 @@ -569,122 +612,122 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(i32) { -// CHECK:STDOUT: %Dest => i32 -// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 // CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.1 => constants.%.11 -// CHECK:STDOUT: %.2 => constants.%.12 +// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.2 => constants.%.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%.14) { -// CHECK:STDOUT: %Dest => constants.%.14 -// CHECK:STDOUT: %Dest.patt => constants.%.14 +// CHECK:STDOUT: specific @ImplicitAs(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { -// CHECK:STDOUT: %Dest => constants.%.14 -// CHECK:STDOUT: %Dest.patt => constants.%.14 +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.14 -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(@impl.2.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.14 -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.2(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %.1 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%.16) { -// CHECK:STDOUT: %Dest => constants.%.16 -// CHECK:STDOUT: %Dest.patt => constants.%.16 +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { -// CHECK:STDOUT: %Dest => constants.%.16 -// CHECK:STDOUT: %Dest.patt => constants.%.16 +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.3(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.16 -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.3(@impl.3.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.16 -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.3(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.16 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { -// CHECK:STDOUT: %Dest => Core.IntLiteral -// CHECK:STDOUT: %Dest.patt => Core.IntLiteral -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 -// CHECK:STDOUT: %Self => constants.%Self.2 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.5 -// CHECK:STDOUT: %Convert => constants.%Convert.5 -// CHECK:STDOUT: %.1 => constants.%.18 -// CHECK:STDOUT: %.2 => constants.%.19 +// CHECK:STDOUT: %.1 => constants.%.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.5(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %.1 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.5(@impl.5.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %.1 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.4(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %.1 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.6(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.16 +// CHECK:STDOUT: %.1 => constants.%.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.6(@impl.6.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.16 +// CHECK:STDOUT: %.1 => constants.%.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.5(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.16 +// CHECK:STDOUT: %.1 => constants.%.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(constants.%Dest) { @@ -701,8 +744,8 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %Self => constants.%Self.4 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 // CHECK:STDOUT: %Convert => constants.%Convert.9 -// CHECK:STDOUT: %.1 => constants.%.24 -// CHECK:STDOUT: %.2 => constants.%.25 +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %.2 => constants.%.18 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(@As.%Dest) { @@ -721,62 +764,62 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %Self => constants.%Self.3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(constants.%.14) { -// CHECK:STDOUT: %Dest => constants.%.14 -// CHECK:STDOUT: %Dest.patt => constants.%.14 +// CHECK:STDOUT: specific @As(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(@impl.8.%.1) { -// CHECK:STDOUT: %Dest => constants.%.14 -// CHECK:STDOUT: %Dest.patt => constants.%.14 +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.8(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %.1 => constants.%.9 // CHECK:STDOUT: %As.type => constants.%As.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.8(@impl.8.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %.1 => constants.%.9 // CHECK:STDOUT: %As.type => constants.%As.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.7(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %.1 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(constants.%.16) { -// CHECK:STDOUT: %Dest => constants.%.16 -// CHECK:STDOUT: %Dest.patt => constants.%.16 +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(@impl.9.%.1) { -// CHECK:STDOUT: %Dest => constants.%.16 -// CHECK:STDOUT: %Dest.patt => constants.%.16 +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.9(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.16 +// CHECK:STDOUT: %.1 => constants.%.11 // CHECK:STDOUT: %As.type => constants.%As.type.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.9(@impl.9.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.16 +// CHECK:STDOUT: %.1 => constants.%.11 // CHECK:STDOUT: %As.type => constants.%As.type.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.8(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.16 +// CHECK:STDOUT: %.1 => constants.%.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(Core.IntLiteral) { @@ -788,41 +831,41 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %Self => constants.%Self.4 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 // CHECK:STDOUT: %Convert => constants.%Convert.12 -// CHECK:STDOUT: %.1 => constants.%.28 -// CHECK:STDOUT: %.2 => constants.%.29 +// CHECK:STDOUT: %.1 => constants.%.21 +// CHECK:STDOUT: %.2 => constants.%.22 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.11(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %.1 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.11(@impl.11.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %.1 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.9(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %.1 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.12(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.16 +// CHECK:STDOUT: %.1 => constants.%.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.12(@impl.12.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.16 +// CHECK:STDOUT: %.1 => constants.%.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.10(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.16 +// CHECK:STDOUT: %.1 => constants.%.11 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/function_param.carbon b/toolchain/check/testdata/array/function_param.carbon index 9091f09890245..bbd8fcd2ac874 100644 --- a/toolchain/check/testdata/array/function_param.carbon +++ b/toolchain/check/testdata/array/function_param.carbon @@ -23,26 +23,154 @@ fn G() -> i32 { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.1: i32 = int_value 3 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.2: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.3: %.2 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.6: %.2 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.9: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.9)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.10: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.11: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.9)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.19: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.20: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.21: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.22: %.21 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.28: type = array_type %.27, i32 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.29: type = ptr_type %.28 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.4: i32 = int_value 1 [template] -// CHECK:STDOUT: %.5: i32 = int_value 2 [template] +// CHECK:STDOUT: %.30: i32 = int_value 1 [template] +// CHECK:STDOUT: %.31: i32 = int_value 2 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (i32, i32, i32) [template] -// CHECK:STDOUT: %.6: i32 = int_value 0 [template] -// CHECK:STDOUT: %array: %.2 = tuple_value (%.4, %.5, %.1) [template] +// CHECK:STDOUT: %.32: i32 = int_value 0 [template] +// CHECK:STDOUT: %array: %.28 = tuple_value (%.30, %.31, %.1) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.2) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.6)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.25] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -53,26 +181,31 @@ fn G() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %arr.patt: %.2 = binding_pattern arr -// CHECK:STDOUT: %arr.param_patt: %.2 = value_param_pattern %arr.patt, runtime_param0 +// CHECK:STDOUT: %arr.patt: %.28 = binding_pattern arr +// CHECK:STDOUT: %arr.param_patt: %.28 = value_param_pattern %arr.patt, runtime_param0 // CHECK:STDOUT: %i.patt: i32 = binding_pattern i // CHECK:STDOUT: %i.param_patt: i32 = value_param_pattern %i.patt, runtime_param1 // CHECK:STDOUT: %return.patt: i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc11_12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_17: i32 = int_value 3 [template = constants.%.1] +// CHECK:STDOUT: %.loc11_17.1: i32 = int_value 3 [template = constants.%.1] // CHECK:STDOUT: %.loc11_12.1: type = value_of_initializer %int.make_type_32.loc11_12 [template = i32] // CHECK:STDOUT: %.loc11_12.2: type = converted %int.make_type_32.loc11_12, %.loc11_12.1 [template = i32] -// CHECK:STDOUT: %.loc11_18: type = array_type %.loc11_17, i32 [template = constants.%.2] +// CHECK:STDOUT: %.loc11_17.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc11_17.3: = bound_method %.loc11_17.1, %.loc11_17.2 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc11_17.3(%.loc11_17.1) [template = constants.%.27] +// CHECK:STDOUT: %.loc11_17.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.27] +// CHECK:STDOUT: %.loc11_17.5: Core.IntLiteral = converted %.loc11_17.1, %.loc11_17.4 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_18: type = array_type %.loc11_17.5, i32 [template = constants.%.28] // CHECK:STDOUT: %int.make_type_32.loc11_24: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_24.1: type = value_of_initializer %int.make_type_32.loc11_24 [template = i32] // CHECK:STDOUT: %.loc11_24.2: type = converted %int.make_type_32.loc11_24, %.loc11_24.1 [template = i32] // CHECK:STDOUT: %int.make_type_32.loc11_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_32.1: type = value_of_initializer %int.make_type_32.loc11_32 [template = i32] // CHECK:STDOUT: %.loc11_32.2: type = converted %int.make_type_32.loc11_32, %.loc11_32.1 [template = i32] -// CHECK:STDOUT: %arr.param: %.2 = value_param runtime_param0 -// CHECK:STDOUT: %arr: %.2 = bind_name arr, %arr.param +// CHECK:STDOUT: %arr.param: %.28 = value_param runtime_param0 +// CHECK:STDOUT: %arr: %.28 = bind_name arr, %arr.param // CHECK:STDOUT: %i.param: i32 = value_param runtime_param1 // CHECK:STDOUT: %i: i32 = bind_name i, %i.param // CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 @@ -90,13 +223,295 @@ fn G() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.2) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %.2: @As.%.1 (%.15) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.20)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.23)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%arr.param_patt: %.2, %i.param_patt: i32) -> i32 { +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @F(%arr.param_patt: %.28, %i.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: %.2 = name_ref arr, %arr +// CHECK:STDOUT: %arr.ref: %.28 = name_ref arr, %arr // CHECK:STDOUT: %i.ref: i32 = name_ref i, %i -// CHECK:STDOUT: %.loc12_15.1: ref %.2 = value_as_ref %arr.ref +// CHECK:STDOUT: %.loc12_15.1: ref %.28 = value_as_ref %arr.ref // CHECK:STDOUT: %.loc12_15.2: ref i32 = array_index %.loc12_15.1, %i.ref // CHECK:STDOUT: %.loc12_15.3: i32 = bind_value %.loc12_15.2 // CHECK:STDOUT: return %.loc12_15.3 @@ -105,28 +520,306 @@ fn G() -> i32 { // CHECK:STDOUT: fn @G() -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] -// CHECK:STDOUT: %.loc16_13: i32 = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc16_16: i32 = int_value 2 [template = constants.%.5] +// CHECK:STDOUT: %.loc16_13: i32 = int_value 1 [template = constants.%.30] +// CHECK:STDOUT: %.loc16_16: i32 = int_value 2 [template = constants.%.31] // CHECK:STDOUT: %.loc16_19: i32 = int_value 3 [template = constants.%.1] // CHECK:STDOUT: %.loc16_20.1: %tuple.type = tuple_literal (%.loc16_13, %.loc16_16, %.loc16_19) -// CHECK:STDOUT: %.loc16_23: i32 = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc16_20.2: ref %.2 = temporary_storage -// CHECK:STDOUT: %.loc16_20.3: i32 = int_value 0 [template = constants.%.6] +// CHECK:STDOUT: %.loc16_23: i32 = int_value 1 [template = constants.%.30] +// CHECK:STDOUT: %.loc16_20.2: ref %.28 = temporary_storage +// CHECK:STDOUT: %.loc16_20.3: i32 = int_value 0 [template = constants.%.32] // CHECK:STDOUT: %.loc16_20.4: ref i32 = array_index %.loc16_20.2, %.loc16_20.3 -// CHECK:STDOUT: %.loc16_20.5: init i32 = initialize_from %.loc16_13 to %.loc16_20.4 [template = constants.%.4] -// CHECK:STDOUT: %.loc16_20.6: i32 = int_value 1 [template = constants.%.4] +// CHECK:STDOUT: %.loc16_20.5: init i32 = initialize_from %.loc16_13 to %.loc16_20.4 [template = constants.%.30] +// CHECK:STDOUT: %.loc16_20.6: i32 = int_value 1 [template = constants.%.30] // CHECK:STDOUT: %.loc16_20.7: ref i32 = array_index %.loc16_20.2, %.loc16_20.6 -// CHECK:STDOUT: %.loc16_20.8: init i32 = initialize_from %.loc16_16 to %.loc16_20.7 [template = constants.%.5] -// CHECK:STDOUT: %.loc16_20.9: i32 = int_value 2 [template = constants.%.5] +// CHECK:STDOUT: %.loc16_20.8: init i32 = initialize_from %.loc16_16 to %.loc16_20.7 [template = constants.%.31] +// CHECK:STDOUT: %.loc16_20.9: i32 = int_value 2 [template = constants.%.31] // CHECK:STDOUT: %.loc16_20.10: ref i32 = array_index %.loc16_20.2, %.loc16_20.9 // CHECK:STDOUT: %.loc16_20.11: init i32 = initialize_from %.loc16_19 to %.loc16_20.10 [template = constants.%.1] -// CHECK:STDOUT: %.loc16_20.12: init %.2 = array_init (%.loc16_20.5, %.loc16_20.8, %.loc16_20.11) to %.loc16_20.2 [template = constants.%array] -// CHECK:STDOUT: %.loc16_20.13: init %.2 = converted %.loc16_20.1, %.loc16_20.12 [template = constants.%array] -// CHECK:STDOUT: %.loc16_20.14: ref %.2 = temporary %.loc16_20.2, %.loc16_20.13 -// CHECK:STDOUT: %.loc16_20.15: %.2 = bind_value %.loc16_20.14 +// CHECK:STDOUT: %.loc16_20.12: init %.28 = array_init (%.loc16_20.5, %.loc16_20.8, %.loc16_20.11) to %.loc16_20.2 [template = constants.%array] +// CHECK:STDOUT: %.loc16_20.13: init %.28 = converted %.loc16_20.1, %.loc16_20.12 [template = constants.%array] +// CHECK:STDOUT: %.loc16_20.14: ref %.28 = temporary %.loc16_20.2, %.loc16_20.13 +// CHECK:STDOUT: %.loc16_20.15: %.28 = bind_value %.loc16_20.14 // CHECK:STDOUT: %F.call: init i32 = call %F.ref(%.loc16_20.15, %.loc16_23) // CHECK:STDOUT: %.loc16_25.1: i32 = value_of_initializer %F.call // CHECK:STDOUT: %.loc16_25.2: i32 = converted %F.call, %.loc16_25.1 // CHECK:STDOUT: return %.loc16_25.2 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.2 => constants.%.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %.2 => constants.%.18 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.21 +// CHECK:STDOUT: %.2 => constants.%.22 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/generic_empty.carbon b/toolchain/check/testdata/array/generic_empty.carbon index ef3d0f2023626..3e7ae52cb59db 100644 --- a/toolchain/check/testdata/array/generic_empty.carbon +++ b/toolchain/check/testdata/array/generic_empty.carbon @@ -22,16 +22,144 @@ fn G(T:! type) { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %.1: i32 = int_value 0 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, %T [symbolic] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [symbolic] -// CHECK:STDOUT: %array: %.2 = tuple_value () [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.2: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.3: %.2 = assoc_entity element0, imports.%import_ref.5 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.5 [template] +// CHECK:STDOUT: %.6: %.2 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.9: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.9)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.10: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.11: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.32 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.33 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.9)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.19: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.20: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.21: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.22: %.21 = assoc_entity element0, imports.%import_ref.43 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.28: type = array_type %.27, %T [symbolic] +// CHECK:STDOUT: %.29: type = ptr_type %.28 [symbolic] +// CHECK:STDOUT: %array: %.28 = tuple_value () [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .ImplicitAs = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.2) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.6)] +// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.13 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.14: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.16 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.17: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.19: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.25] +// CHECK:STDOUT: %import_ref.20: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.22 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.23: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.25 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.29: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.31 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.36 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.37: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.39 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.40: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.42 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.44: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.46 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.47: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.49 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -49,31 +177,596 @@ fn G(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.2) = assoc_entity element0, imports.%import_ref.5 [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .Convert = imports.%import_ref.3 +// CHECK:STDOUT: witness = (imports.%import_ref.4) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %.2: @As.%.1 (%.15) = assoc_entity element0, imports.%import_ref.32 [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.26 +// CHECK:STDOUT: .Convert = imports.%import_ref.27 +// CHECK:STDOUT: witness = (imports.%import_ref.28) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.7 as imports.%import_ref.8 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.11 as imports.%import_ref.12 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.14 as imports.%import_ref.15 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.16 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.17 as imports.%import_ref.18 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.20 as imports.%import_ref.21 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.22 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.23 as imports.%import_ref.24 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.25 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.29 as imports.%import_ref.30 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.31 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.34 as imports.%import_ref.35 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.36 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.20)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.37 as imports.%import_ref.38 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.39 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.40 as imports.%import_ref.41 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.42 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.23)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.44 as imports.%import_ref.45 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.46 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.47 as imports.%import_ref.48 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.49 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: generic fn @G(%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: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.loc13_17.2: type = array_type constants.%.1, @G.%T.loc11_6.2 (%T) [symbolic = %.loc13_17.2 (constants.%.2)] -// CHECK:STDOUT: %array: @G.%.loc13_17.2 (%.2) = tuple_value () [symbolic = %array (constants.%array)] +// CHECK:STDOUT: %.loc13_17.2: type = array_type constants.%.27, @G.%T.loc11_6.2 (%T) [symbolic = %.loc13_17.2 (constants.%.28)] +// CHECK:STDOUT: %array: @G.%.loc13_17.2 (%.28) = tuple_value () [symbolic = %array (constants.%array)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc11_6.1 [symbolic = %T.loc11_6.2 (constants.%T)] -// CHECK:STDOUT: %.loc13_16: i32 = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %.loc13_17.1: type = array_type %.loc13_16, %T [symbolic = %.loc13_17.2 (constants.%.2)] -// CHECK:STDOUT: %arr.var: ref @G.%.loc13_17.2 (%.2) = var arr -// CHECK:STDOUT: %arr: ref @G.%.loc13_17.2 (%.2) = bind_name arr, %arr.var +// CHECK:STDOUT: %.loc13_16.1: i32 = int_value 0 [template = constants.%.1] +// CHECK:STDOUT: %.loc13_16.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc13_16.3: = bound_method %.loc13_16.1, %.loc13_16.2 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc13_16.3(%.loc13_16.1) [template = constants.%.27] +// CHECK:STDOUT: %.loc13_16.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.27] +// CHECK:STDOUT: %.loc13_16.5: Core.IntLiteral = converted %.loc13_16.1, %.loc13_16.4 [template = constants.%.27] +// CHECK:STDOUT: %.loc13_17.1: type = array_type %.loc13_16.5, %T [symbolic = %.loc13_17.2 (constants.%.28)] +// CHECK:STDOUT: %arr.var: ref @G.%.loc13_17.2 (%.28) = var arr +// CHECK:STDOUT: %arr: ref @G.%.loc13_17.2 (%.28) = bind_name arr, %arr.var // CHECK:STDOUT: %.loc13_22.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc13_22.2: init @G.%.loc13_17.2 (%.2) = array_init () to %arr.var [symbolic = %array (constants.%array)] -// CHECK:STDOUT: %.loc13_23: init @G.%.loc13_17.2 (%.2) = converted %.loc13_22.1, %.loc13_22.2 [symbolic = %array (constants.%array)] +// CHECK:STDOUT: %.loc13_22.2: init @G.%.loc13_17.2 (%.28) = array_init () to %arr.var [symbolic = %array (constants.%array)] +// CHECK:STDOUT: %.loc13_23: init @G.%.loc13_17.2 (%.28) = converted %.loc13_22.1, %.loc13_22.2 [symbolic = %array (constants.%array)] // CHECK:STDOUT: assign %arr.var, %.loc13_23 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%T) { // CHECK:STDOUT: %T.loc11_6.2 => constants.%T // CHECK:STDOUT: %T.patt.loc11_6.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.2 => constants.%.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %.2 => constants.%.18 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.21 +// CHECK:STDOUT: %.2 => constants.%.22 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/index_not_literal.carbon b/toolchain/check/testdata/array/index_not_literal.carbon index 7e26aafd1829e..bae4012191fac 100644 --- a/toolchain/check/testdata/array/index_not_literal.carbon +++ b/toolchain/check/testdata/array/index_not_literal.carbon @@ -18,24 +18,152 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.1: i32 = int_value 3 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] -// CHECK:STDOUT: %.4: i32 = int_value 1 [template] -// CHECK:STDOUT: %.5: i32 = int_value 2 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.2: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.3: %.2 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.6: %.2 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.9: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.9)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.10: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.11: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.9)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.19: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.20: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.21: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.22: %.21 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.28: type = array_type %.27, i32 [template] +// CHECK:STDOUT: %.29: type = ptr_type %.28 [template] +// CHECK:STDOUT: %.30: i32 = int_value 1 [template] +// CHECK:STDOUT: %.31: i32 = int_value 2 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (i32, i32, i32) [template] -// CHECK:STDOUT: %.6: i32 = int_value 0 [template] -// CHECK:STDOUT: %array: %.2 = tuple_value (%.4, %.5, %.1) [template] -// CHECK:STDOUT: %.7: type = struct_type {.index: i32} [template] -// CHECK:STDOUT: %struct: %.7 = struct_value (%.5) [template] +// CHECK:STDOUT: %.32: i32 = int_value 0 [template] +// CHECK:STDOUT: %array: %.28 = tuple_value (%.30, %.31, %.1) [template] +// CHECK:STDOUT: %.33: type = struct_type {.index: i32} [template] +// CHECK:STDOUT: %struct: %.33 = struct_value (%.31) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.2) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.6)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.25] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -46,12 +174,17 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_14: i32 = int_value 3 [template = constants.%.1] +// CHECK:STDOUT: %.loc11_14.1: i32 = int_value 3 [template = constants.%.1] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] // CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32.loc11, %.loc11_9.1 [template = i32] -// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, i32 [template = constants.%.2] -// CHECK:STDOUT: %a.var: ref %.2 = var a -// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var +// CHECK:STDOUT: %.loc11_14.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc11_14.3: = bound_method %.loc11_14.1, %.loc11_14.2 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc11_14.3(%.loc11_14.1) [template = constants.%.27] +// CHECK:STDOUT: %.loc11_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.27] +// CHECK:STDOUT: %.loc11_14.5: Core.IntLiteral = converted %.loc11_14.1, %.loc11_14.4 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14.5, i32 [template = constants.%.28] +// CHECK:STDOUT: %a.var: ref %.28 = var a +// CHECK:STDOUT: %a: ref %.28 = bind_name a, %a.var // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] // CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_32.loc12, %.loc12_8.1 [template = i32] @@ -59,35 +192,595 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.2) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %.2: @As.%.1 (%.15) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.20)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.23)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_20: i32 = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc11_23: i32 = int_value 2 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_20: i32 = int_value 1 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_23: i32 = int_value 2 [template = constants.%.31] // CHECK:STDOUT: %.loc11_26: i32 = int_value 3 [template = constants.%.1] // CHECK:STDOUT: %.loc11_27.1: %tuple.type = tuple_literal (%.loc11_20, %.loc11_23, %.loc11_26) -// CHECK:STDOUT: %.loc11_27.2: i32 = int_value 0 [template = constants.%.6] +// CHECK:STDOUT: %.loc11_27.2: i32 = int_value 0 [template = constants.%.32] // CHECK:STDOUT: %.loc11_27.3: ref i32 = array_index file.%a.var, %.loc11_27.2 -// CHECK:STDOUT: %.loc11_27.4: init i32 = initialize_from %.loc11_20 to %.loc11_27.3 [template = constants.%.4] -// CHECK:STDOUT: %.loc11_27.5: i32 = int_value 1 [template = constants.%.4] +// CHECK:STDOUT: %.loc11_27.4: init i32 = initialize_from %.loc11_20 to %.loc11_27.3 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_27.5: i32 = int_value 1 [template = constants.%.30] // CHECK:STDOUT: %.loc11_27.6: ref i32 = array_index file.%a.var, %.loc11_27.5 -// CHECK:STDOUT: %.loc11_27.7: init i32 = initialize_from %.loc11_23 to %.loc11_27.6 [template = constants.%.5] -// CHECK:STDOUT: %.loc11_27.8: i32 = int_value 2 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_27.7: init i32 = initialize_from %.loc11_23 to %.loc11_27.6 [template = constants.%.31] +// CHECK:STDOUT: %.loc11_27.8: i32 = int_value 2 [template = constants.%.31] // CHECK:STDOUT: %.loc11_27.9: ref i32 = array_index file.%a.var, %.loc11_27.8 // CHECK:STDOUT: %.loc11_27.10: init i32 = initialize_from %.loc11_26 to %.loc11_27.9 [template = constants.%.1] -// CHECK:STDOUT: %.loc11_27.11: init %.2 = array_init (%.loc11_27.4, %.loc11_27.7, %.loc11_27.10) to file.%a.var [template = constants.%array] -// CHECK:STDOUT: %.loc11_28: init %.2 = converted %.loc11_27.1, %.loc11_27.11 [template = constants.%array] +// CHECK:STDOUT: %.loc11_27.11: init %.28 = array_init (%.loc11_27.4, %.loc11_27.7, %.loc11_27.10) to file.%a.var [template = constants.%array] +// CHECK:STDOUT: %.loc11_28: init %.28 = converted %.loc11_27.1, %.loc11_27.11 [template = constants.%array] // CHECK:STDOUT: assign file.%a.var, %.loc11_28 -// CHECK:STDOUT: %a.ref: ref %.2 = name_ref a, file.%a -// CHECK:STDOUT: %.loc12_26: i32 = int_value 2 [template = constants.%.5] -// CHECK:STDOUT: %.loc12_27.1: %.7 = struct_literal (%.loc12_26) -// CHECK:STDOUT: %struct: %.7 = struct_value (%.loc12_26) [template = constants.%struct] -// CHECK:STDOUT: %.loc12_27.2: %.7 = converted %.loc12_27.1, %struct [template = constants.%struct] -// CHECK:STDOUT: %.loc12_28: i32 = struct_access %.loc12_27.2, element0 [template = constants.%.5] +// CHECK:STDOUT: %a.ref: ref %.28 = name_ref a, file.%a +// CHECK:STDOUT: %.loc12_26: i32 = int_value 2 [template = constants.%.31] +// CHECK:STDOUT: %.loc12_27.1: %.33 = struct_literal (%.loc12_26) +// CHECK:STDOUT: %struct: %.33 = struct_value (%.loc12_26) [template = constants.%struct] +// CHECK:STDOUT: %.loc12_27.2: %.33 = converted %.loc12_27.1, %struct [template = constants.%struct] +// CHECK:STDOUT: %.loc12_28: i32 = struct_access %.loc12_27.2, element0 [template = constants.%.31] // CHECK:STDOUT: %.loc12_34.1: ref i32 = array_index %a.ref, %.loc12_28 // CHECK:STDOUT: %.loc12_34.2: i32 = bind_value %.loc12_34.1 // CHECK:STDOUT: assign file.%b.var, %.loc12_34.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.2 => constants.%.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %.2 => constants.%.18 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.21 +// CHECK:STDOUT: %.2 => constants.%.22 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/nine_elements.carbon b/toolchain/check/testdata/array/nine_elements.carbon index b9799ac1c2ccd..43f2a085d9766 100644 --- a/toolchain/check/testdata/array/nine_elements.carbon +++ b/toolchain/check/testdata/array/nine_elements.carbon @@ -17,28 +17,156 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.1: i32 = int_value 9 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] -// CHECK:STDOUT: %.4: i32 = int_value 1 [template] -// CHECK:STDOUT: %.5: i32 = int_value 2 [template] -// CHECK:STDOUT: %.6: i32 = int_value 3 [template] -// CHECK:STDOUT: %.7: i32 = int_value 4 [template] -// CHECK:STDOUT: %.8: i32 = int_value 5 [template] -// CHECK:STDOUT: %.9: i32 = int_value 6 [template] -// CHECK:STDOUT: %.10: i32 = int_value 7 [template] -// CHECK:STDOUT: %.11: i32 = int_value 8 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.2: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.3: %.2 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.6: %.2 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.9: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.9)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.10: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.11: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.9)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.19: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.20: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.21: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.22: %.21 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 9 [template] +// CHECK:STDOUT: %.28: type = array_type %.27, i32 [template] +// CHECK:STDOUT: %.29: type = ptr_type %.28 [template] +// CHECK:STDOUT: %.30: i32 = int_value 1 [template] +// CHECK:STDOUT: %.31: i32 = int_value 2 [template] +// CHECK:STDOUT: %.32: i32 = int_value 3 [template] +// CHECK:STDOUT: %.33: i32 = int_value 4 [template] +// CHECK:STDOUT: %.34: i32 = int_value 5 [template] +// CHECK:STDOUT: %.35: i32 = int_value 6 [template] +// CHECK:STDOUT: %.36: i32 = int_value 7 [template] +// CHECK:STDOUT: %.37: i32 = int_value 8 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (i32, i32, i32, i32, i32, i32, i32, i32, i32) [template] -// CHECK:STDOUT: %.12: i32 = int_value 0 [template] -// CHECK:STDOUT: %array: %.2 = tuple_value (%.4, %.5, %.6, %.7, %.8, %.9, %.10, %.11, %.1) [template] +// CHECK:STDOUT: %.38: i32 = int_value 0 [template] +// CHECK:STDOUT: %array: %.28 = tuple_value (%.30, %.31, %.32, %.33, %.34, %.35, %.36, %.37, %.1) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.2) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.6)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.25] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -48,58 +176,623 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_14: i32 = int_value 9 [template = constants.%.1] +// CHECK:STDOUT: %.loc11_14.1: i32 = int_value 9 [template = constants.%.1] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32, %.loc11_9.1 [template = i32] -// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, i32 [template = constants.%.2] -// CHECK:STDOUT: %a.var: ref %.2 = var a -// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var +// CHECK:STDOUT: %.loc11_14.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc11_14.3: = bound_method %.loc11_14.1, %.loc11_14.2 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc11_14.3(%.loc11_14.1) [template = constants.%.27] +// CHECK:STDOUT: %.loc11_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.27] +// CHECK:STDOUT: %.loc11_14.5: Core.IntLiteral = converted %.loc11_14.1, %.loc11_14.4 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14.5, i32 [template = constants.%.28] +// CHECK:STDOUT: %a.var: ref %.28 = var a +// CHECK:STDOUT: %a: ref %.28 = bind_name a, %a.var +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.2) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %.2: @As.%.1 (%.15) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.20)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.23)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_20: i32 = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc11_23: i32 = int_value 2 [template = constants.%.5] -// CHECK:STDOUT: %.loc11_26: i32 = int_value 3 [template = constants.%.6] -// CHECK:STDOUT: %.loc11_29: i32 = int_value 4 [template = constants.%.7] -// CHECK:STDOUT: %.loc11_32: i32 = int_value 5 [template = constants.%.8] -// CHECK:STDOUT: %.loc11_35: i32 = int_value 6 [template = constants.%.9] -// CHECK:STDOUT: %.loc11_38: i32 = int_value 7 [template = constants.%.10] -// CHECK:STDOUT: %.loc11_41: i32 = int_value 8 [template = constants.%.11] +// CHECK:STDOUT: %.loc11_20: i32 = int_value 1 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_23: i32 = int_value 2 [template = constants.%.31] +// CHECK:STDOUT: %.loc11_26: i32 = int_value 3 [template = constants.%.32] +// CHECK:STDOUT: %.loc11_29: i32 = int_value 4 [template = constants.%.33] +// CHECK:STDOUT: %.loc11_32: i32 = int_value 5 [template = constants.%.34] +// CHECK:STDOUT: %.loc11_35: i32 = int_value 6 [template = constants.%.35] +// CHECK:STDOUT: %.loc11_38: i32 = int_value 7 [template = constants.%.36] +// CHECK:STDOUT: %.loc11_41: i32 = int_value 8 [template = constants.%.37] // CHECK:STDOUT: %.loc11_44: i32 = int_value 9 [template = constants.%.1] // CHECK:STDOUT: %.loc11_45.1: %tuple.type = tuple_literal (%.loc11_20, %.loc11_23, %.loc11_26, %.loc11_29, %.loc11_32, %.loc11_35, %.loc11_38, %.loc11_41, %.loc11_44) -// CHECK:STDOUT: %.loc11_45.2: i32 = int_value 0 [template = constants.%.12] +// CHECK:STDOUT: %.loc11_45.2: i32 = int_value 0 [template = constants.%.38] // CHECK:STDOUT: %.loc11_45.3: ref i32 = array_index file.%a.var, %.loc11_45.2 -// CHECK:STDOUT: %.loc11_45.4: init i32 = initialize_from %.loc11_20 to %.loc11_45.3 [template = constants.%.4] -// CHECK:STDOUT: %.loc11_45.5: i32 = int_value 1 [template = constants.%.4] +// CHECK:STDOUT: %.loc11_45.4: init i32 = initialize_from %.loc11_20 to %.loc11_45.3 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_45.5: i32 = int_value 1 [template = constants.%.30] // CHECK:STDOUT: %.loc11_45.6: ref i32 = array_index file.%a.var, %.loc11_45.5 -// CHECK:STDOUT: %.loc11_45.7: init i32 = initialize_from %.loc11_23 to %.loc11_45.6 [template = constants.%.5] -// CHECK:STDOUT: %.loc11_45.8: i32 = int_value 2 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_45.7: init i32 = initialize_from %.loc11_23 to %.loc11_45.6 [template = constants.%.31] +// CHECK:STDOUT: %.loc11_45.8: i32 = int_value 2 [template = constants.%.31] // CHECK:STDOUT: %.loc11_45.9: ref i32 = array_index file.%a.var, %.loc11_45.8 -// CHECK:STDOUT: %.loc11_45.10: init i32 = initialize_from %.loc11_26 to %.loc11_45.9 [template = constants.%.6] -// CHECK:STDOUT: %.loc11_45.11: i32 = int_value 3 [template = constants.%.6] +// CHECK:STDOUT: %.loc11_45.10: init i32 = initialize_from %.loc11_26 to %.loc11_45.9 [template = constants.%.32] +// CHECK:STDOUT: %.loc11_45.11: i32 = int_value 3 [template = constants.%.32] // CHECK:STDOUT: %.loc11_45.12: ref i32 = array_index file.%a.var, %.loc11_45.11 -// CHECK:STDOUT: %.loc11_45.13: init i32 = initialize_from %.loc11_29 to %.loc11_45.12 [template = constants.%.7] -// CHECK:STDOUT: %.loc11_45.14: i32 = int_value 4 [template = constants.%.7] +// CHECK:STDOUT: %.loc11_45.13: init i32 = initialize_from %.loc11_29 to %.loc11_45.12 [template = constants.%.33] +// CHECK:STDOUT: %.loc11_45.14: i32 = int_value 4 [template = constants.%.33] // CHECK:STDOUT: %.loc11_45.15: ref i32 = array_index file.%a.var, %.loc11_45.14 -// CHECK:STDOUT: %.loc11_45.16: init i32 = initialize_from %.loc11_32 to %.loc11_45.15 [template = constants.%.8] -// CHECK:STDOUT: %.loc11_45.17: i32 = int_value 5 [template = constants.%.8] +// CHECK:STDOUT: %.loc11_45.16: init i32 = initialize_from %.loc11_32 to %.loc11_45.15 [template = constants.%.34] +// CHECK:STDOUT: %.loc11_45.17: i32 = int_value 5 [template = constants.%.34] // CHECK:STDOUT: %.loc11_45.18: ref i32 = array_index file.%a.var, %.loc11_45.17 -// CHECK:STDOUT: %.loc11_45.19: init i32 = initialize_from %.loc11_35 to %.loc11_45.18 [template = constants.%.9] -// CHECK:STDOUT: %.loc11_45.20: i32 = int_value 6 [template = constants.%.9] +// CHECK:STDOUT: %.loc11_45.19: init i32 = initialize_from %.loc11_35 to %.loc11_45.18 [template = constants.%.35] +// CHECK:STDOUT: %.loc11_45.20: i32 = int_value 6 [template = constants.%.35] // CHECK:STDOUT: %.loc11_45.21: ref i32 = array_index file.%a.var, %.loc11_45.20 -// CHECK:STDOUT: %.loc11_45.22: init i32 = initialize_from %.loc11_38 to %.loc11_45.21 [template = constants.%.10] -// CHECK:STDOUT: %.loc11_45.23: i32 = int_value 7 [template = constants.%.10] +// CHECK:STDOUT: %.loc11_45.22: init i32 = initialize_from %.loc11_38 to %.loc11_45.21 [template = constants.%.36] +// CHECK:STDOUT: %.loc11_45.23: i32 = int_value 7 [template = constants.%.36] // CHECK:STDOUT: %.loc11_45.24: ref i32 = array_index file.%a.var, %.loc11_45.23 -// CHECK:STDOUT: %.loc11_45.25: init i32 = initialize_from %.loc11_41 to %.loc11_45.24 [template = constants.%.11] -// CHECK:STDOUT: %.loc11_45.26: i32 = int_value 8 [template = constants.%.11] +// CHECK:STDOUT: %.loc11_45.25: init i32 = initialize_from %.loc11_41 to %.loc11_45.24 [template = constants.%.37] +// CHECK:STDOUT: %.loc11_45.26: i32 = int_value 8 [template = constants.%.37] // CHECK:STDOUT: %.loc11_45.27: ref i32 = array_index file.%a.var, %.loc11_45.26 // CHECK:STDOUT: %.loc11_45.28: init i32 = initialize_from %.loc11_44 to %.loc11_45.27 [template = constants.%.1] -// CHECK:STDOUT: %.loc11_45.29: init %.2 = array_init (%.loc11_45.4, %.loc11_45.7, %.loc11_45.10, %.loc11_45.13, %.loc11_45.16, %.loc11_45.19, %.loc11_45.22, %.loc11_45.25, %.loc11_45.28) to file.%a.var [template = constants.%array] -// CHECK:STDOUT: %.loc11_46: init %.2 = converted %.loc11_45.1, %.loc11_45.29 [template = constants.%array] +// CHECK:STDOUT: %.loc11_45.29: init %.28 = array_init (%.loc11_45.4, %.loc11_45.7, %.loc11_45.10, %.loc11_45.13, %.loc11_45.16, %.loc11_45.19, %.loc11_45.22, %.loc11_45.25, %.loc11_45.28) to file.%a.var [template = constants.%array] +// CHECK:STDOUT: %.loc11_46: init %.28 = converted %.loc11_45.1, %.loc11_45.29 [template = constants.%array] // CHECK:STDOUT: assign file.%a.var, %.loc11_46 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.2 => constants.%.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %.2 => constants.%.18 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.21 +// CHECK:STDOUT: %.2 => constants.%.22 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/as/adapter_conversion.carbon b/toolchain/check/testdata/as/adapter_conversion.carbon index 5789d779d20bd..a79527e7275c3 100644 --- a/toolchain/check/testdata/as/adapter_conversion.carbon +++ b/toolchain/check/testdata/as/adapter_conversion.carbon @@ -914,6 +914,8 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.16)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.16) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -921,6 +923,8 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.18)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.4.%.1 (%.18) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -928,6 +932,8 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.16)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.16)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -935,6 +941,8 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.18)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%.1 (%.18)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -942,6 +950,8 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.16)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.16) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -949,6 +959,8 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.18)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.18) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -956,6 +968,8 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.16)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.16)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -963,6 +977,8 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.18)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.18)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/as/fail_no_conversion.carbon b/toolchain/check/testdata/as/fail_no_conversion.carbon index 6556f1e3bcee1..0c3b897176b21 100644 --- a/toolchain/check/testdata/as/fail_no_conversion.carbon +++ b/toolchain/check/testdata/as/fail_no_conversion.carbon @@ -396,6 +396,8 @@ let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.12) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -403,6 +405,8 @@ let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.4.%.1 (%.14) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -410,6 +414,8 @@ let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -417,6 +423,8 @@ let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%.1 (%.14)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -424,6 +432,8 @@ let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.12) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -431,6 +441,8 @@ let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.14) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -438,6 +450,8 @@ let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -445,6 +459,8 @@ let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.14)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/as/fail_not_type.carbon b/toolchain/check/testdata/as/fail_not_type.carbon index 014267fbd5f2e..18205e0713e93 100644 --- a/toolchain/check/testdata/as/fail_not_type.carbon +++ b/toolchain/check/testdata/as/fail_not_type.carbon @@ -381,6 +381,8 @@ let n: i32 = 1 as 2; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.10) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -388,6 +390,8 @@ let n: i32 = 1 as 2; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.12) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -395,6 +399,8 @@ let n: i32 = 1 as 2; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -402,6 +408,8 @@ let n: i32 = 1 as 2; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -417,6 +425,8 @@ let n: i32 = 1 as 2; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.10) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -424,6 +434,8 @@ let n: i32 = 1 as 2; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.12) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -431,6 +443,8 @@ let n: i32 = 1 as 2; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -438,6 +452,8 @@ let n: i32 = 1 as 2; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/as/overloaded.carbon b/toolchain/check/testdata/as/overloaded.carbon index 02ddfecbb01d0..4b45d22e907dc 100644 --- a/toolchain/check/testdata/as/overloaded.carbon +++ b/toolchain/check/testdata/as/overloaded.carbon @@ -503,6 +503,8 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.19)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.5.%.1 (%.19) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -510,6 +512,8 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.21)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.6.%.1 (%.21) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -517,6 +521,8 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.19)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.7.%.1 (%.19)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -524,6 +530,8 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.21)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.8.%.1 (%.21)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -531,6 +539,8 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.19)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.9.%.1 (%.19) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -538,6 +548,8 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.21)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.10.%.1 (%.21) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -545,6 +557,8 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.19)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.11.%.1 (%.19)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -552,6 +566,8 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.21)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.12.%.1 (%.21)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/fail_non_type_as_type.carbon b/toolchain/check/testdata/basics/fail_non_type_as_type.carbon index 9a79f6d0c0645..2093ad7f1ff61 100644 --- a/toolchain/check/testdata/basics/fail_non_type_as_type.carbon +++ b/toolchain/check/testdata/basics/fail_non_type_as_type.carbon @@ -373,6 +373,8 @@ var x: type = 42; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -380,6 +382,8 @@ var x: type = 42; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -387,6 +391,8 @@ var x: type = 42; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -394,6 +400,8 @@ var x: type = 42; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -409,6 +417,8 @@ var x: type = 42; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -416,6 +426,8 @@ var x: type = 42; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -423,6 +435,8 @@ var x: type = 42; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -430,6 +444,8 @@ var x: type = 42; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/numeric_literals.carbon b/toolchain/check/testdata/basics/numeric_literals.carbon index 7dcaae83e58c9..e34e6de7e3374 100644 --- a/toolchain/check/testdata/basics/numeric_literals.carbon +++ b/toolchain/check/testdata/basics/numeric_literals.carbon @@ -38,43 +38,171 @@ fn F() { // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.1: i32 = int_value 6 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] -// CHECK:STDOUT: %.4: i32 = int_value 8 [template] -// CHECK:STDOUT: %.5: i32 = int_value 9 [template] -// CHECK:STDOUT: %.6: i32 = int_value 2147483647 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.2: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.3: %.2 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.6: %.2 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.9: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.9)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.10: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.11: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.9)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.19: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.20: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.21: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.22: %.21 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 6 [template] +// CHECK:STDOUT: %.28: type = array_type %.27, i32 [template] +// CHECK:STDOUT: %.29: type = ptr_type %.28 [template] +// CHECK:STDOUT: %.30: i32 = int_value 8 [template] +// CHECK:STDOUT: %.31: i32 = int_value 9 [template] +// CHECK:STDOUT: %.32: i32 = int_value 2147483647 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (i32, i32, i32, i32, i32, i32) [template] -// CHECK:STDOUT: %.7: i32 = int_value 0 [template] -// CHECK:STDOUT: %.8: i32 = int_value 1 [template] -// CHECK:STDOUT: %.9: i32 = int_value 2 [template] -// CHECK:STDOUT: %.10: i32 = int_value 3 [template] -// CHECK:STDOUT: %.11: i32 = int_value 4 [template] -// CHECK:STDOUT: %.12: i32 = int_value 5 [template] -// CHECK:STDOUT: %array.1: %.2 = tuple_value (%.4, %.5, %.4, %.4, %.6, %.6) [template] -// CHECK:STDOUT: %.13: Core.IntLiteral = int_value 64 [template] +// CHECK:STDOUT: %.33: i32 = int_value 0 [template] +// CHECK:STDOUT: %.34: i32 = int_value 1 [template] +// CHECK:STDOUT: %.35: i32 = int_value 2 [template] +// CHECK:STDOUT: %.36: i32 = int_value 3 [template] +// CHECK:STDOUT: %.37: i32 = int_value 4 [template] +// CHECK:STDOUT: %.38: i32 = int_value 5 [template] +// CHECK:STDOUT: %array.1: %.28 = tuple_value (%.30, %.31, %.30, %.30, %.32, %.32) [template] +// CHECK:STDOUT: %.39: Core.IntLiteral = int_value 64 [template] // CHECK:STDOUT: %Float.type: type = fn_type @Float [template] // CHECK:STDOUT: %Float: %Float.type = struct_value () [template] -// CHECK:STDOUT: %.14: type = array_type %.1, f64 [template] -// CHECK:STDOUT: %.15: type = ptr_type %.14 [template] -// CHECK:STDOUT: %.16: f64 = float_literal 0.90000000000000002 [template] -// CHECK:STDOUT: %.17: f64 = float_literal 8 [template] -// CHECK:STDOUT: %.18: f64 = float_literal 80 [template] -// CHECK:STDOUT: %.19: f64 = float_literal 1.0E+7 [template] -// CHECK:STDOUT: %.20: f64 = float_literal 1.0E+8 [template] -// CHECK:STDOUT: %.21: f64 = float_literal 1.0E-8 [template] +// CHECK:STDOUT: %.40: type = array_type %.27, f64 [template] +// CHECK:STDOUT: %.41: type = ptr_type %.40 [template] +// CHECK:STDOUT: %.42: f64 = float_literal 0.90000000000000002 [template] +// CHECK:STDOUT: %.43: f64 = float_literal 8 [template] +// CHECK:STDOUT: %.44: f64 = float_literal 80 [template] +// CHECK:STDOUT: %.45: f64 = float_literal 1.0E+7 [template] +// CHECK:STDOUT: %.46: f64 = float_literal 1.0E+8 [template] +// CHECK:STDOUT: %.47: f64 = float_literal 1.0E-8 [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (f64, f64, f64, f64, f64, f64) [template] -// CHECK:STDOUT: %array.2: %.14 = tuple_value (%.16, %.17, %.18, %.19, %.20, %.21) [template] +// CHECK:STDOUT: %array.2: %.40 = tuple_value (%.42, %.43, %.44, %.45, %.46, %.47) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.1 -// CHECK:STDOUT: .Float = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .Float = %import_ref.51 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+60, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.2) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.6)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.25] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded +// CHECK:STDOUT: %import_ref.51: %Float.type = import_ref Core//prelude/types, inst+60, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -86,83 +214,653 @@ fn F() { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.2) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %.2: @As.%.1 (%.15) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.20)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.23)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_19: i32 = int_value 6 [template = constants.%.1] +// CHECK:STDOUT: %.loc14_19.1: i32 = int_value 6 [template = constants.%.1] // CHECK:STDOUT: %.loc14_14.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc14_14.2: type = converted %int.make_type_32, %.loc14_14.1 [template = i32] -// CHECK:STDOUT: %.loc14_20: type = array_type %.loc14_19, i32 [template = constants.%.2] -// CHECK:STDOUT: %ints.var: ref %.2 = var ints -// CHECK:STDOUT: %ints: ref %.2 = bind_name ints, %ints.var -// CHECK:STDOUT: %.loc15: i32 = int_value 8 [template = constants.%.4] -// CHECK:STDOUT: %.loc16: i32 = int_value 9 [template = constants.%.5] -// CHECK:STDOUT: %.loc17: i32 = int_value 8 [template = constants.%.4] -// CHECK:STDOUT: %.loc18: i32 = int_value 8 [template = constants.%.4] -// CHECK:STDOUT: %.loc19: i32 = int_value 2147483647 [template = constants.%.6] -// CHECK:STDOUT: %.loc20: i32 = int_value 2147483647 [template = constants.%.6] +// CHECK:STDOUT: %.loc14_19.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc14_19.3: = bound_method %.loc14_19.1, %.loc14_19.2 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc14: init Core.IntLiteral = call %.loc14_19.3(%.loc14_19.1) [template = constants.%.27] +// CHECK:STDOUT: %.loc14_19.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc14 [template = constants.%.27] +// CHECK:STDOUT: %.loc14_19.5: Core.IntLiteral = converted %.loc14_19.1, %.loc14_19.4 [template = constants.%.27] +// CHECK:STDOUT: %.loc14_20: type = array_type %.loc14_19.5, i32 [template = constants.%.28] +// CHECK:STDOUT: %ints.var: ref %.28 = var ints +// CHECK:STDOUT: %ints: ref %.28 = bind_name ints, %ints.var +// CHECK:STDOUT: %.loc15: i32 = int_value 8 [template = constants.%.30] +// CHECK:STDOUT: %.loc16: i32 = int_value 9 [template = constants.%.31] +// CHECK:STDOUT: %.loc17: i32 = int_value 8 [template = constants.%.30] +// CHECK:STDOUT: %.loc18: i32 = int_value 8 [template = constants.%.30] +// CHECK:STDOUT: %.loc19: i32 = int_value 2147483647 [template = constants.%.32] +// CHECK:STDOUT: %.loc20: i32 = int_value 2147483647 [template = constants.%.32] // CHECK:STDOUT: %.loc21_3.1: %tuple.type.1 = tuple_literal (%.loc15, %.loc16, %.loc17, %.loc18, %.loc19, %.loc20) -// CHECK:STDOUT: %.loc21_3.2: i32 = int_value 0 [template = constants.%.7] +// CHECK:STDOUT: %.loc21_3.2: i32 = int_value 0 [template = constants.%.33] // CHECK:STDOUT: %.loc21_3.3: ref i32 = array_index %ints.var, %.loc21_3.2 -// CHECK:STDOUT: %.loc21_3.4: init i32 = initialize_from %.loc15 to %.loc21_3.3 [template = constants.%.4] -// CHECK:STDOUT: %.loc21_3.5: i32 = int_value 1 [template = constants.%.8] +// CHECK:STDOUT: %.loc21_3.4: init i32 = initialize_from %.loc15 to %.loc21_3.3 [template = constants.%.30] +// CHECK:STDOUT: %.loc21_3.5: i32 = int_value 1 [template = constants.%.34] // CHECK:STDOUT: %.loc21_3.6: ref i32 = array_index %ints.var, %.loc21_3.5 -// CHECK:STDOUT: %.loc21_3.7: init i32 = initialize_from %.loc16 to %.loc21_3.6 [template = constants.%.5] -// CHECK:STDOUT: %.loc21_3.8: i32 = int_value 2 [template = constants.%.9] +// CHECK:STDOUT: %.loc21_3.7: init i32 = initialize_from %.loc16 to %.loc21_3.6 [template = constants.%.31] +// CHECK:STDOUT: %.loc21_3.8: i32 = int_value 2 [template = constants.%.35] // CHECK:STDOUT: %.loc21_3.9: ref i32 = array_index %ints.var, %.loc21_3.8 -// CHECK:STDOUT: %.loc21_3.10: init i32 = initialize_from %.loc17 to %.loc21_3.9 [template = constants.%.4] -// CHECK:STDOUT: %.loc21_3.11: i32 = int_value 3 [template = constants.%.10] +// CHECK:STDOUT: %.loc21_3.10: init i32 = initialize_from %.loc17 to %.loc21_3.9 [template = constants.%.30] +// CHECK:STDOUT: %.loc21_3.11: i32 = int_value 3 [template = constants.%.36] // CHECK:STDOUT: %.loc21_3.12: ref i32 = array_index %ints.var, %.loc21_3.11 -// CHECK:STDOUT: %.loc21_3.13: init i32 = initialize_from %.loc18 to %.loc21_3.12 [template = constants.%.4] -// CHECK:STDOUT: %.loc21_3.14: i32 = int_value 4 [template = constants.%.11] +// CHECK:STDOUT: %.loc21_3.13: init i32 = initialize_from %.loc18 to %.loc21_3.12 [template = constants.%.30] +// CHECK:STDOUT: %.loc21_3.14: i32 = int_value 4 [template = constants.%.37] // CHECK:STDOUT: %.loc21_3.15: ref i32 = array_index %ints.var, %.loc21_3.14 -// CHECK:STDOUT: %.loc21_3.16: init i32 = initialize_from %.loc19 to %.loc21_3.15 [template = constants.%.6] -// CHECK:STDOUT: %.loc21_3.17: i32 = int_value 5 [template = constants.%.12] +// CHECK:STDOUT: %.loc21_3.16: init i32 = initialize_from %.loc19 to %.loc21_3.15 [template = constants.%.32] +// CHECK:STDOUT: %.loc21_3.17: i32 = int_value 5 [template = constants.%.38] // CHECK:STDOUT: %.loc21_3.18: ref i32 = array_index %ints.var, %.loc21_3.17 -// CHECK:STDOUT: %.loc21_3.19: init i32 = initialize_from %.loc20 to %.loc21_3.18 [template = constants.%.6] -// CHECK:STDOUT: %.loc21_3.20: init %.2 = array_init (%.loc21_3.4, %.loc21_3.7, %.loc21_3.10, %.loc21_3.13, %.loc21_3.16, %.loc21_3.19) to %ints.var [template = constants.%array.1] -// CHECK:STDOUT: %.loc21_4: init %.2 = converted %.loc21_3.1, %.loc21_3.20 [template = constants.%array.1] +// CHECK:STDOUT: %.loc21_3.19: init i32 = initialize_from %.loc20 to %.loc21_3.18 [template = constants.%.32] +// CHECK:STDOUT: %.loc21_3.20: init %.28 = array_init (%.loc21_3.4, %.loc21_3.7, %.loc21_3.10, %.loc21_3.13, %.loc21_3.16, %.loc21_3.19) to %ints.var [template = constants.%array.1] +// CHECK:STDOUT: %.loc21_4: init %.28 = converted %.loc21_3.1, %.loc21_3.20 [template = constants.%array.1] // CHECK:STDOUT: assign %ints.var, %.loc21_4 -// CHECK:STDOUT: %.loc22_16.1: Core.IntLiteral = int_value 64 [template = constants.%.13] +// CHECK:STDOUT: %.loc22_16.1: Core.IntLiteral = int_value 64 [template = constants.%.39] // CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc22_16.1) [template = f64] -// CHECK:STDOUT: %.loc22_21: i32 = int_value 6 [template = constants.%.1] +// CHECK:STDOUT: %.loc22_21.1: i32 = int_value 6 [template = constants.%.1] // CHECK:STDOUT: %.loc22_16.2: type = value_of_initializer %float.make_type [template = f64] // CHECK:STDOUT: %.loc22_16.3: type = converted %float.make_type, %.loc22_16.2 [template = f64] -// CHECK:STDOUT: %.loc22_22: type = array_type %.loc22_21, f64 [template = constants.%.14] -// CHECK:STDOUT: %floats.var: ref %.14 = var floats -// CHECK:STDOUT: %floats: ref %.14 = bind_name floats, %floats.var -// CHECK:STDOUT: %.loc23: f64 = float_literal 0.90000000000000002 [template = constants.%.16] -// CHECK:STDOUT: %.loc24: f64 = float_literal 8 [template = constants.%.17] -// CHECK:STDOUT: %.loc25: f64 = float_literal 80 [template = constants.%.18] -// CHECK:STDOUT: %.loc26: f64 = float_literal 1.0E+7 [template = constants.%.19] -// CHECK:STDOUT: %.loc27: f64 = float_literal 1.0E+8 [template = constants.%.20] -// CHECK:STDOUT: %.loc28: f64 = float_literal 1.0E-8 [template = constants.%.21] +// CHECK:STDOUT: %.loc22_21.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc22_21.3: = bound_method %.loc22_21.1, %.loc22_21.2 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc22: init Core.IntLiteral = call %.loc22_21.3(%.loc22_21.1) [template = constants.%.27] +// CHECK:STDOUT: %.loc22_21.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc22 [template = constants.%.27] +// CHECK:STDOUT: %.loc22_21.5: Core.IntLiteral = converted %.loc22_21.1, %.loc22_21.4 [template = constants.%.27] +// CHECK:STDOUT: %.loc22_22: type = array_type %.loc22_21.5, f64 [template = constants.%.40] +// CHECK:STDOUT: %floats.var: ref %.40 = var floats +// CHECK:STDOUT: %floats: ref %.40 = bind_name floats, %floats.var +// CHECK:STDOUT: %.loc23: f64 = float_literal 0.90000000000000002 [template = constants.%.42] +// CHECK:STDOUT: %.loc24: f64 = float_literal 8 [template = constants.%.43] +// CHECK:STDOUT: %.loc25: f64 = float_literal 80 [template = constants.%.44] +// CHECK:STDOUT: %.loc26: f64 = float_literal 1.0E+7 [template = constants.%.45] +// CHECK:STDOUT: %.loc27: f64 = float_literal 1.0E+8 [template = constants.%.46] +// CHECK:STDOUT: %.loc28: f64 = float_literal 1.0E-8 [template = constants.%.47] // CHECK:STDOUT: %.loc29_3.1: %tuple.type.2 = tuple_literal (%.loc23, %.loc24, %.loc25, %.loc26, %.loc27, %.loc28) -// CHECK:STDOUT: %.loc29_3.2: i32 = int_value 0 [template = constants.%.7] +// CHECK:STDOUT: %.loc29_3.2: i32 = int_value 0 [template = constants.%.33] // CHECK:STDOUT: %.loc29_3.3: ref f64 = array_index %floats.var, %.loc29_3.2 -// CHECK:STDOUT: %.loc29_3.4: init f64 = initialize_from %.loc23 to %.loc29_3.3 [template = constants.%.16] -// CHECK:STDOUT: %.loc29_3.5: i32 = int_value 1 [template = constants.%.8] +// CHECK:STDOUT: %.loc29_3.4: init f64 = initialize_from %.loc23 to %.loc29_3.3 [template = constants.%.42] +// CHECK:STDOUT: %.loc29_3.5: i32 = int_value 1 [template = constants.%.34] // CHECK:STDOUT: %.loc29_3.6: ref f64 = array_index %floats.var, %.loc29_3.5 -// CHECK:STDOUT: %.loc29_3.7: init f64 = initialize_from %.loc24 to %.loc29_3.6 [template = constants.%.17] -// CHECK:STDOUT: %.loc29_3.8: i32 = int_value 2 [template = constants.%.9] +// CHECK:STDOUT: %.loc29_3.7: init f64 = initialize_from %.loc24 to %.loc29_3.6 [template = constants.%.43] +// CHECK:STDOUT: %.loc29_3.8: i32 = int_value 2 [template = constants.%.35] // CHECK:STDOUT: %.loc29_3.9: ref f64 = array_index %floats.var, %.loc29_3.8 -// CHECK:STDOUT: %.loc29_3.10: init f64 = initialize_from %.loc25 to %.loc29_3.9 [template = constants.%.18] -// CHECK:STDOUT: %.loc29_3.11: i32 = int_value 3 [template = constants.%.10] +// CHECK:STDOUT: %.loc29_3.10: init f64 = initialize_from %.loc25 to %.loc29_3.9 [template = constants.%.44] +// CHECK:STDOUT: %.loc29_3.11: i32 = int_value 3 [template = constants.%.36] // CHECK:STDOUT: %.loc29_3.12: ref f64 = array_index %floats.var, %.loc29_3.11 -// CHECK:STDOUT: %.loc29_3.13: init f64 = initialize_from %.loc26 to %.loc29_3.12 [template = constants.%.19] -// CHECK:STDOUT: %.loc29_3.14: i32 = int_value 4 [template = constants.%.11] +// CHECK:STDOUT: %.loc29_3.13: init f64 = initialize_from %.loc26 to %.loc29_3.12 [template = constants.%.45] +// CHECK:STDOUT: %.loc29_3.14: i32 = int_value 4 [template = constants.%.37] // CHECK:STDOUT: %.loc29_3.15: ref f64 = array_index %floats.var, %.loc29_3.14 -// CHECK:STDOUT: %.loc29_3.16: init f64 = initialize_from %.loc27 to %.loc29_3.15 [template = constants.%.20] -// CHECK:STDOUT: %.loc29_3.17: i32 = int_value 5 [template = constants.%.12] +// CHECK:STDOUT: %.loc29_3.16: init f64 = initialize_from %.loc27 to %.loc29_3.15 [template = constants.%.46] +// CHECK:STDOUT: %.loc29_3.17: i32 = int_value 5 [template = constants.%.38] // CHECK:STDOUT: %.loc29_3.18: ref f64 = array_index %floats.var, %.loc29_3.17 -// CHECK:STDOUT: %.loc29_3.19: init f64 = initialize_from %.loc28 to %.loc29_3.18 [template = constants.%.21] -// CHECK:STDOUT: %.loc29_3.20: init %.14 = array_init (%.loc29_3.4, %.loc29_3.7, %.loc29_3.10, %.loc29_3.13, %.loc29_3.16, %.loc29_3.19) to %floats.var [template = constants.%array.2] -// CHECK:STDOUT: %.loc29_4: init %.14 = converted %.loc29_3.1, %.loc29_3.20 [template = constants.%array.2] +// CHECK:STDOUT: %.loc29_3.19: init f64 = initialize_from %.loc28 to %.loc29_3.18 [template = constants.%.47] +// CHECK:STDOUT: %.loc29_3.20: init %.40 = array_init (%.loc29_3.4, %.loc29_3.7, %.loc29_3.10, %.loc29_3.13, %.loc29_3.16, %.loc29_3.19) to %floats.var [template = constants.%array.2] +// CHECK:STDOUT: %.loc29_4: init %.40 = converted %.loc29_3.1, %.loc29_3.20 [template = constants.%array.2] // CHECK:STDOUT: assign %floats.var, %.loc29_4 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Float(%size.param_patt: Core.IntLiteral) -> type = "float.make_type"; // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.2 => constants.%.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %.2 => constants.%.18 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.21 +// CHECK:STDOUT: %.2 => constants.%.22 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/and.carbon b/toolchain/check/testdata/builtins/int/and.carbon index 2edb2ffb422d6..3a2385a3f2ce7 100644 --- a/toolchain/check/testdata/builtins/int/and.carbon +++ b/toolchain/check/testdata/builtins/int/and.carbon @@ -30,19 +30,147 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %.1: i32 = int_value 12 [template] // CHECK:STDOUT: %.2: i32 = int_value 10 [template] // CHECK:STDOUT: %.3: i32 = int_value 8 [template] -// CHECK:STDOUT: %.4: type = array_type %.3, i32 [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.8: %.4 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.11: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.13: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.19: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.20: %.19 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.21: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.23: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.24: %.23 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.28: = bound_method %.3, %Convert.15 [template] +// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 8 [template] +// CHECK:STDOUT: %.30: type = array_type %.29, i32 [template] +// CHECK:STDOUT: %.31: type = ptr_type %.30 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.27] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -85,15 +213,27 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %int.and: init i32 = call %And.ref(%.loc4_20, %.loc4_24) [template = constants.%.3] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_27: type = array_type %int.and, i32 [template = constants.%.4] -// CHECK:STDOUT: %arr.var: ref %.4 = var arr -// CHECK:STDOUT: %arr: ref %.4 = bind_name arr, %arr.var +// CHECK:STDOUT: %.loc4_19.1: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.and, %.loc4_19.1 [template = constants.%.28] +// CHECK:STDOUT: %.loc4_19.3: i32 = value_of_initializer %int.and [template = constants.%.3] +// CHECK:STDOUT: %.loc4_19.4: i32 = converted %int.and, %.loc4_19.3 [template = constants.%.3] +// CHECK:STDOUT: %int.convert_checked.loc4: init Core.IntLiteral = call %.loc4_19.2(%.loc4_19.4) [template = constants.%.29] +// CHECK:STDOUT: %.loc4_19.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = converted %int.and, %.loc4_19.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_27: type = array_type %.loc4_19.6, i32 [template = constants.%.30] +// CHECK:STDOUT: %arr.var: ref %.30 = var arr +// CHECK:STDOUT: %arr: ref %.30 = bind_name arr, %arr.var // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_18: i32 = int_value 8 [template = constants.%.3] +// CHECK:STDOUT: %.loc5_18.1: i32 = int_value 8 [template = constants.%.3] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.4] -// CHECK:STDOUT: %.loc5_20: type = ptr_type %.4 [template = constants.%.5] +// CHECK:STDOUT: %.loc5_18.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc5_18.3: = bound_method %.loc5_18.1, %.loc5_18.2 [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc5: init Core.IntLiteral = call %.loc5_18.3(%.loc5_18.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc5_18.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc5 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_18.5: Core.IntLiteral = converted %.loc5_18.1, %.loc5_18.4 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18.5, i32 [template = constants.%.30] +// CHECK:STDOUT: %.loc5_20: type = ptr_type %.30 [template = constants.%.31] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 @@ -120,10 +260,292 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.4) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: %.2: @As.%.1 (%.17) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.18)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.25)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.26)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: fn @And(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.and"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %And.ref: %And.type = name_ref And, file.%And.decl [template = constants.%And] @@ -137,9 +559,287 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %.4 = name_ref arr, file.%arr -// CHECK:STDOUT: %.loc5: %.5 = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %.5 = bind_name arr_p, %.loc5 +// CHECK:STDOUT: %arr.ref: ref %.30 = name_ref arr, file.%arr +// CHECK:STDOUT: %.loc5: %.31 = addr_of %arr.ref +// CHECK:STDOUT: %arr_p: %.31 = bind_name arr_p, %.loc5 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.2 => constants.%.7 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %.2 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: %.2 => constants.%.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.23 +// CHECK:STDOUT: %.2 => constants.%.24 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/complement.carbon b/toolchain/check/testdata/builtins/int/complement.carbon index e7704b72c3861..3a6dfd8592245 100644 --- a/toolchain/check/testdata/builtins/int/complement.carbon +++ b/toolchain/check/testdata/builtins/int/complement.carbon @@ -34,19 +34,147 @@ fn RuntimeCall(a: i32) -> i32 { // CHECK:STDOUT: %.2: i32 = int_value -1193047 [template] // CHECK:STDOUT: %.3: i32 = int_value 16777215 [template] // CHECK:STDOUT: %.4: i32 = int_value 15584169 [template] -// CHECK:STDOUT: %.5: type = array_type %.4, i32 [template] -// CHECK:STDOUT: %.6: type = ptr_type %.5 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.5: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.9: %.5 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.10: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.12: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.12)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.14: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.14)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.17: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.18: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.19: %.18 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.20: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.21: %.20 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.12)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.14)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.24: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.25: %.24 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.28: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.29: = bound_method %.4, %Convert.15 [template] +// CHECK:STDOUT: %.30: Core.IntLiteral = int_value 15584169 [template] +// CHECK:STDOUT: %.31: type = array_type %.30, i32 [template] +// CHECK:STDOUT: %.32: type = ptr_type %.31 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.5) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.9)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.28] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.12)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.14)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.12)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.14)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -111,15 +239,27 @@ fn RuntimeCall(a: i32) -> i32 { // CHECK:STDOUT: %int.and: init i32 = call %And.ref(%.loc5_30.2, %.loc5_42) [template = constants.%.4] // CHECK:STDOUT: %.loc5_11.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_11.2: type = converted %int.make_type_32.loc5, %.loc5_11.1 [template = i32] -// CHECK:STDOUT: %.loc5_51: type = array_type %int.and, i32 [template = constants.%.5] -// CHECK:STDOUT: %arr.var: ref %.5 = var arr -// CHECK:STDOUT: %arr: ref %.5 = bind_name arr, %arr.var +// CHECK:STDOUT: %.loc5_19.1: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc5_19.2: = bound_method %int.and, %.loc5_19.1 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_19.3: i32 = value_of_initializer %int.and [template = constants.%.4] +// CHECK:STDOUT: %.loc5_19.4: i32 = converted %int.and, %.loc5_19.3 [template = constants.%.4] +// CHECK:STDOUT: %int.convert_checked.loc5: init Core.IntLiteral = call %.loc5_19.2(%.loc5_19.4) [template = constants.%.30] +// CHECK:STDOUT: %.loc5_19.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc5 [template = constants.%.30] +// CHECK:STDOUT: %.loc5_19.6: Core.IntLiteral = converted %int.and, %.loc5_19.5 [template = constants.%.30] +// CHECK:STDOUT: %.loc5_51: type = array_type %.loc5_19.6, i32 [template = constants.%.31] +// CHECK:STDOUT: %arr.var: ref %.31 = var arr +// CHECK:STDOUT: %arr: ref %.31 = bind_name arr, %arr.var // CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_18: i32 = int_value 15584169 [template = constants.%.4] +// CHECK:STDOUT: %.loc6_18.1: i32 = int_value 15584169 [template = constants.%.4] // CHECK:STDOUT: %.loc6_13.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] // CHECK:STDOUT: %.loc6_13.2: type = converted %int.make_type_32.loc6, %.loc6_13.1 [template = i32] -// CHECK:STDOUT: %.loc6_26: type = array_type %.loc6_18, i32 [template = constants.%.5] -// CHECK:STDOUT: %.loc6_27: type = ptr_type %.5 [template = constants.%.6] +// CHECK:STDOUT: %.loc6_18.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc6_18.3: = bound_method %.loc6_18.1, %.loc6_18.2 [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc6: init Core.IntLiteral = call %.loc6_18.3(%.loc6_18.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc6_18.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc6 [template = constants.%.30] +// CHECK:STDOUT: %.loc6_18.5: Core.IntLiteral = converted %.loc6_18.1, %.loc6_18.4 [template = constants.%.30] +// CHECK:STDOUT: %.loc6_26: type = array_type %.loc6_18.5, i32 [template = constants.%.31] +// CHECK:STDOUT: %.loc6_27: type = ptr_type %.31 [template = constants.%.32] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 @@ -139,12 +279,294 @@ fn RuntimeCall(a: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.5) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.18)] +// CHECK:STDOUT: %.2: @As.%.1 (%.18) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.17)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.23)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.26)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.27)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Complement(%a.param_patt: i32) -> i32 = "int.complement"; // CHECK:STDOUT: // CHECK:STDOUT: fn @And(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.and"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.12) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.14) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.14)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.12) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.14) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.14)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Complement.ref: %Complement.type = name_ref Complement, file.%Complement.decl [template = constants.%Complement] @@ -157,9 +579,287 @@ fn RuntimeCall(a: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %.5 = name_ref arr, file.%arr -// CHECK:STDOUT: %.loc6: %.6 = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %.6 = bind_name arr_p, %.loc6 +// CHECK:STDOUT: %arr.ref: ref %.31 = name_ref arr, file.%arr +// CHECK:STDOUT: %.loc6: %.32 = addr_of %arr.ref +// CHECK:STDOUT: %arr_p: %.32 = bind_name arr_p, %.loc6 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %.2 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.12) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.14) { +// CHECK:STDOUT: %Dest => constants.%.14 +// CHECK:STDOUT: %Dest.patt => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.14 +// CHECK:STDOUT: %Dest.patt => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.20 +// CHECK:STDOUT: %.2 => constants.%.21 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.12) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.14) { +// CHECK:STDOUT: %Dest => constants.%.14 +// CHECK:STDOUT: %Dest.patt => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.14 +// CHECK:STDOUT: %Dest.patt => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.24 +// CHECK:STDOUT: %.2 => constants.%.25 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/left_shift.carbon b/toolchain/check/testdata/builtins/int/left_shift.carbon index c23669b4976d1..f71886f6dddb8 100644 --- a/toolchain/check/testdata/builtins/int/left_shift.carbon +++ b/toolchain/check/testdata/builtins/int/left_shift.carbon @@ -74,19 +74,147 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %.1: i32 = int_value 5 [template] // CHECK:STDOUT: %.2: i32 = int_value 2 [template] // CHECK:STDOUT: %.3: i32 = int_value 20 [template] -// CHECK:STDOUT: %.4: type = array_type %.3, i32 [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.8: %.4 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.11: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.13: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.19: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.20: %.19 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.21: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.23: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.24: %.23 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.28: = bound_method %.3, %Convert.15 [template] +// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 20 [template] +// CHECK:STDOUT: %.30: type = array_type %.29, i32 [template] +// CHECK:STDOUT: %.31: type = ptr_type %.30 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.27] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -129,15 +257,27 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %int.left_shift: init i32 = call %LeftShift.ref(%.loc4_26, %.loc4_29) [template = constants.%.3] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_31: type = array_type %int.left_shift, i32 [template = constants.%.4] -// CHECK:STDOUT: %arr.var: ref %.4 = var arr -// CHECK:STDOUT: %arr: ref %.4 = bind_name arr, %arr.var +// CHECK:STDOUT: %.loc4_25.1: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_25.2: = bound_method %int.left_shift, %.loc4_25.1 [template = constants.%.28] +// CHECK:STDOUT: %.loc4_25.3: i32 = value_of_initializer %int.left_shift [template = constants.%.3] +// CHECK:STDOUT: %.loc4_25.4: i32 = converted %int.left_shift, %.loc4_25.3 [template = constants.%.3] +// CHECK:STDOUT: %int.convert_checked.loc4: init Core.IntLiteral = call %.loc4_25.2(%.loc4_25.4) [template = constants.%.29] +// CHECK:STDOUT: %.loc4_25.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_25.6: Core.IntLiteral = converted %int.left_shift, %.loc4_25.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_31: type = array_type %.loc4_25.6, i32 [template = constants.%.30] +// CHECK:STDOUT: %arr.var: ref %.30 = var arr +// CHECK:STDOUT: %arr: ref %.30 = bind_name arr, %arr.var // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_18: i32 = int_value 20 [template = constants.%.3] +// CHECK:STDOUT: %.loc5_18.1: i32 = int_value 20 [template = constants.%.3] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_20: type = array_type %.loc5_18, i32 [template = constants.%.4] -// CHECK:STDOUT: %.loc5_21: type = ptr_type %.4 [template = constants.%.5] +// CHECK:STDOUT: %.loc5_18.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc5_18.3: = bound_method %.loc5_18.1, %.loc5_18.2 [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc5: init Core.IntLiteral = call %.loc5_18.3(%.loc5_18.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc5_18.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc5 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_18.5: Core.IntLiteral = converted %.loc5_18.1, %.loc5_18.4 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_20: type = array_type %.loc5_18.5, i32 [template = constants.%.30] +// CHECK:STDOUT: %.loc5_21: type = ptr_type %.30 [template = constants.%.31] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 @@ -164,10 +304,292 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.4) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: %.2: @As.%.1 (%.17) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.18)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.25)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.26)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: fn @LeftShift(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.left_shift"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %LeftShift.ref: %LeftShift.type = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] @@ -181,12 +603,290 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %.4 = name_ref arr, file.%arr -// CHECK:STDOUT: %.loc5: %.5 = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %.5 = bind_name arr_p, %.loc5 +// CHECK:STDOUT: %arr.ref: ref %.30 = name_ref arr, file.%arr +// CHECK:STDOUT: %.loc5: %.31 = addr_of %arr.ref +// CHECK:STDOUT: %arr_p: %.31 = bind_name arr_p, %.loc5 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.2 => constants.%.7 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %.2 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: %.2 => constants.%.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.23 +// CHECK:STDOUT: %.2 => constants.%.24 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_bad_shift.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { diff --git a/toolchain/check/testdata/builtins/int/or.carbon b/toolchain/check/testdata/builtins/int/or.carbon index c3269efac132d..e4e4fdba57616 100644 --- a/toolchain/check/testdata/builtins/int/or.carbon +++ b/toolchain/check/testdata/builtins/int/or.carbon @@ -30,19 +30,147 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %.1: i32 = int_value 12 [template] // CHECK:STDOUT: %.2: i32 = int_value 10 [template] // CHECK:STDOUT: %.3: i32 = int_value 14 [template] -// CHECK:STDOUT: %.4: type = array_type %.3, i32 [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.8: %.4 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.11: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.13: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.19: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.20: %.19 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.21: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.23: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.24: %.23 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.28: = bound_method %.3, %Convert.15 [template] +// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 14 [template] +// CHECK:STDOUT: %.30: type = array_type %.29, i32 [template] +// CHECK:STDOUT: %.31: type = ptr_type %.30 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.27] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -85,15 +213,27 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %int.or: init i32 = call %Or.ref(%.loc4_19, %.loc4_23) [template = constants.%.3] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_26: type = array_type %int.or, i32 [template = constants.%.4] -// CHECK:STDOUT: %arr.var: ref %.4 = var arr -// CHECK:STDOUT: %arr: ref %.4 = bind_name arr, %arr.var +// CHECK:STDOUT: %.loc4_18.1: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_18.2: = bound_method %int.or, %.loc4_18.1 [template = constants.%.28] +// CHECK:STDOUT: %.loc4_18.3: i32 = value_of_initializer %int.or [template = constants.%.3] +// CHECK:STDOUT: %.loc4_18.4: i32 = converted %int.or, %.loc4_18.3 [template = constants.%.3] +// CHECK:STDOUT: %int.convert_checked.loc4: init Core.IntLiteral = call %.loc4_18.2(%.loc4_18.4) [template = constants.%.29] +// CHECK:STDOUT: %.loc4_18.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_18.6: Core.IntLiteral = converted %int.or, %.loc4_18.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_26: type = array_type %.loc4_18.6, i32 [template = constants.%.30] +// CHECK:STDOUT: %arr.var: ref %.30 = var arr +// CHECK:STDOUT: %arr: ref %.30 = bind_name arr, %arr.var // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_18: i32 = int_value 14 [template = constants.%.3] +// CHECK:STDOUT: %.loc5_18.1: i32 = int_value 14 [template = constants.%.3] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_20: type = array_type %.loc5_18, i32 [template = constants.%.4] -// CHECK:STDOUT: %.loc5_21: type = ptr_type %.4 [template = constants.%.5] +// CHECK:STDOUT: %.loc5_18.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc5_18.3: = bound_method %.loc5_18.1, %.loc5_18.2 [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc5: init Core.IntLiteral = call %.loc5_18.3(%.loc5_18.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc5_18.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc5 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_18.5: Core.IntLiteral = converted %.loc5_18.1, %.loc5_18.4 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_20: type = array_type %.loc5_18.5, i32 [template = constants.%.30] +// CHECK:STDOUT: %.loc5_21: type = ptr_type %.30 [template = constants.%.31] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 @@ -120,10 +260,292 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.4) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: %.2: @As.%.1 (%.17) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.18)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.25)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.26)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Or(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.or"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Or.ref: %Or.type = name_ref Or, file.%Or.decl [template = constants.%Or] @@ -137,9 +559,287 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %.4 = name_ref arr, file.%arr -// CHECK:STDOUT: %.loc5: %.5 = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %.5 = bind_name arr_p, %.loc5 +// CHECK:STDOUT: %arr.ref: ref %.30 = name_ref arr, file.%arr +// CHECK:STDOUT: %.loc5: %.31 = addr_of %arr.ref +// CHECK:STDOUT: %arr_p: %.31 = bind_name arr_p, %.loc5 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.2 => constants.%.7 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %.2 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: %.2 => constants.%.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.23 +// CHECK:STDOUT: %.2 => constants.%.24 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/right_shift.carbon b/toolchain/check/testdata/builtins/int/right_shift.carbon index 21d367a899112..0e6e612c3fb9e 100644 --- a/toolchain/check/testdata/builtins/int/right_shift.carbon +++ b/toolchain/check/testdata/builtins/int/right_shift.carbon @@ -75,19 +75,147 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %.1: i32 = int_value 22 [template] // CHECK:STDOUT: %.2: i32 = int_value 2 [template] // CHECK:STDOUT: %.3: i32 = int_value 5 [template] -// CHECK:STDOUT: %.4: type = array_type %.3, i32 [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.8: %.4 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.11: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.13: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.19: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.20: %.19 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.21: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.23: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.24: %.23 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.28: = bound_method %.3, %Convert.15 [template] +// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 5 [template] +// CHECK:STDOUT: %.30: type = array_type %.29, i32 [template] +// CHECK:STDOUT: %.31: type = ptr_type %.30 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.27] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -130,15 +258,27 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %int.right_shift: init i32 = call %RightShift.ref(%.loc4_27, %.loc4_31) [template = constants.%.3] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_33: type = array_type %int.right_shift, i32 [template = constants.%.4] -// CHECK:STDOUT: %arr.var: ref %.4 = var arr -// CHECK:STDOUT: %arr: ref %.4 = bind_name arr, %arr.var +// CHECK:STDOUT: %.loc4_26.1: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_26.2: = bound_method %int.right_shift, %.loc4_26.1 [template = constants.%.28] +// CHECK:STDOUT: %.loc4_26.3: i32 = value_of_initializer %int.right_shift [template = constants.%.3] +// CHECK:STDOUT: %.loc4_26.4: i32 = converted %int.right_shift, %.loc4_26.3 [template = constants.%.3] +// CHECK:STDOUT: %int.convert_checked.loc4: init Core.IntLiteral = call %.loc4_26.2(%.loc4_26.4) [template = constants.%.29] +// CHECK:STDOUT: %.loc4_26.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_26.6: Core.IntLiteral = converted %int.right_shift, %.loc4_26.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_33: type = array_type %.loc4_26.6, i32 [template = constants.%.30] +// CHECK:STDOUT: %arr.var: ref %.30 = var arr +// CHECK:STDOUT: %arr: ref %.30 = bind_name arr, %arr.var // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_18: i32 = int_value 5 [template = constants.%.3] +// CHECK:STDOUT: %.loc5_18.1: i32 = int_value 5 [template = constants.%.3] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.4] -// CHECK:STDOUT: %.loc5_20: type = ptr_type %.4 [template = constants.%.5] +// CHECK:STDOUT: %.loc5_18.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc5_18.3: = bound_method %.loc5_18.1, %.loc5_18.2 [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc5: init Core.IntLiteral = call %.loc5_18.3(%.loc5_18.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc5_18.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc5 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_18.5: Core.IntLiteral = converted %.loc5_18.1, %.loc5_18.4 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18.5, i32 [template = constants.%.30] +// CHECK:STDOUT: %.loc5_20: type = ptr_type %.30 [template = constants.%.31] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 @@ -165,10 +305,292 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.4) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: %.2: @As.%.1 (%.17) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.18)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.25)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.26)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: fn @RightShift(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.right_shift"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %RightShift.ref: %RightShift.type = name_ref RightShift, file.%RightShift.decl [template = constants.%RightShift] @@ -182,12 +604,290 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %.4 = name_ref arr, file.%arr -// CHECK:STDOUT: %.loc5: %.5 = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %.5 = bind_name arr_p, %.loc5 +// CHECK:STDOUT: %arr.ref: ref %.30 = name_ref arr, file.%arr +// CHECK:STDOUT: %.loc5: %.31 = addr_of %arr.ref +// CHECK:STDOUT: %arr_p: %.31 = bind_name arr_p, %.loc5 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.2 => constants.%.7 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %.2 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: %.2 => constants.%.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.23 +// CHECK:STDOUT: %.2 => constants.%.24 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- arith_shift.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -200,24 +900,154 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] // CHECK:STDOUT: %.1: i32 = int_value 1 [template] // CHECK:STDOUT: %.2: i32 = int_value -1 [template] -// CHECK:STDOUT: %.3: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: i32 = int_value 10 [template] -// CHECK:STDOUT: %.6: i32 = int_value -10 [template] -// CHECK:STDOUT: %.7: i32 = int_value 2 [template] -// CHECK:STDOUT: %.8: i32 = int_value -3 [template] -// CHECK:STDOUT: %.9: i32 = int_value 3 [template] -// CHECK:STDOUT: %.10: type = array_type %.9, i32 [template] -// CHECK:STDOUT: %.11: type = ptr_type %.10 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.3: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.5: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.7: %.3 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.8: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.10: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.10)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.11: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.12: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.12)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.17: %.16 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.18: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.19: %.18 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.10)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.20: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.12)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.21: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.22: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.23: %.22 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] +// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.29: type = array_type %.28, i32 [template] +// CHECK:STDOUT: %.30: type = ptr_type %.29 [template] +// CHECK:STDOUT: %.31: i32 = int_value 10 [template] +// CHECK:STDOUT: %.32: i32 = int_value -10 [template] +// CHECK:STDOUT: %.33: i32 = int_value 2 [template] +// CHECK:STDOUT: %.34: i32 = int_value -3 [template] +// CHECK:STDOUT: %.35: i32 = int_value 3 [template] +// CHECK:STDOUT: %.36: = bound_method %.35, %Convert.15 [template] +// CHECK:STDOUT: %.37: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.38: type = array_type %.37, i32 [template] +// CHECK:STDOUT: %.39: type = ptr_type %.38 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.26] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.10)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.12)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.10)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.12)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -287,39 +1117,255 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %int.snegate.loc10_23: init i32 = call %Negate.ref.loc10_17(%.loc10_34.2) [template = constants.%.1] // CHECK:STDOUT: %.loc10_12.1: type = value_of_initializer %int.make_type_32.loc10 [template = i32] // CHECK:STDOUT: %.loc10_12.2: type = converted %int.make_type_32.loc10, %.loc10_12.1 [template = i32] -// CHECK:STDOUT: %.loc10_49: type = array_type %int.snegate.loc10_23, i32 [template = constants.%.3] -// CHECK:STDOUT: %arr1.var: ref %.3 = var arr1 -// CHECK:STDOUT: %arr1: ref %.3 = bind_name arr1, %arr1.var +// CHECK:STDOUT: %.loc10_23.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc10_23.2: = bound_method %int.snegate.loc10_23, %.loc10_23.1 [template = constants.%.27] +// CHECK:STDOUT: %.loc10_23.3: i32 = value_of_initializer %int.snegate.loc10_23 [template = constants.%.1] +// CHECK:STDOUT: %.loc10_23.4: i32 = converted %int.snegate.loc10_23, %.loc10_23.3 [template = constants.%.1] +// CHECK:STDOUT: %int.convert_checked.loc10: init Core.IntLiteral = call %.loc10_23.2(%.loc10_23.4) [template = constants.%.28] +// CHECK:STDOUT: %.loc10_23.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc10 [template = constants.%.28] +// CHECK:STDOUT: %.loc10_23.6: Core.IntLiteral = converted %int.snegate.loc10_23, %.loc10_23.5 [template = constants.%.28] +// CHECK:STDOUT: %.loc10_49: type = array_type %.loc10_23.6, i32 [template = constants.%.29] +// CHECK:STDOUT: %arr1.var: ref %.29 = var arr1 +// CHECK:STDOUT: %arr1: ref %.29 = bind_name arr1, %arr1.var // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_19: i32 = int_value 1 [template = constants.%.1] +// CHECK:STDOUT: %.loc11_19.1: i32 = int_value 1 [template = constants.%.1] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] // CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_32.loc11, %.loc11_14.1 [template = i32] -// CHECK:STDOUT: %.loc11_20: type = array_type %.loc11_19, i32 [template = constants.%.3] -// CHECK:STDOUT: %.loc11_21: type = ptr_type %.3 [template = constants.%.4] +// CHECK:STDOUT: %.loc11_19.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc11_19.3: = bound_method %.loc11_19.1, %.loc11_19.2 [template = constants.%.27] +// CHECK:STDOUT: %int.convert_checked.loc11: init Core.IntLiteral = call %.loc11_19.3(%.loc11_19.1) [template = constants.%.28] +// CHECK:STDOUT: %.loc11_19.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc11 [template = constants.%.28] +// CHECK:STDOUT: %.loc11_19.5: Core.IntLiteral = converted %.loc11_19.1, %.loc11_19.4 [template = constants.%.28] +// CHECK:STDOUT: %.loc11_20: type = array_type %.loc11_19.5, i32 [template = constants.%.29] +// CHECK:STDOUT: %.loc11_21: type = ptr_type %.29 [template = constants.%.30] // CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Negate.ref.loc14_17: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %RightShift.ref.loc14: %RightShift.type = name_ref RightShift, %RightShift.decl [template = constants.%RightShift] // CHECK:STDOUT: %Negate.ref.loc14_35: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc14_42: i32 = int_value 10 [template = constants.%.5] -// CHECK:STDOUT: %int.snegate.loc14_41: init i32 = call %Negate.ref.loc14_35(%.loc14_42) [template = constants.%.6] -// CHECK:STDOUT: %.loc14_47: i32 = int_value 2 [template = constants.%.7] -// CHECK:STDOUT: %.loc14_41.1: i32 = value_of_initializer %int.snegate.loc14_41 [template = constants.%.6] -// CHECK:STDOUT: %.loc14_41.2: i32 = converted %int.snegate.loc14_41, %.loc14_41.1 [template = constants.%.6] -// CHECK:STDOUT: %int.right_shift.loc14: init i32 = call %RightShift.ref.loc14(%.loc14_41.2, %.loc14_47) [template = constants.%.8] -// CHECK:STDOUT: %.loc14_34.1: i32 = value_of_initializer %int.right_shift.loc14 [template = constants.%.8] -// CHECK:STDOUT: %.loc14_34.2: i32 = converted %int.right_shift.loc14, %.loc14_34.1 [template = constants.%.8] -// CHECK:STDOUT: %int.snegate.loc14_23: init i32 = call %Negate.ref.loc14_17(%.loc14_34.2) [template = constants.%.9] +// CHECK:STDOUT: %.loc14_42: i32 = int_value 10 [template = constants.%.31] +// CHECK:STDOUT: %int.snegate.loc14_41: init i32 = call %Negate.ref.loc14_35(%.loc14_42) [template = constants.%.32] +// CHECK:STDOUT: %.loc14_47: i32 = int_value 2 [template = constants.%.33] +// CHECK:STDOUT: %.loc14_41.1: i32 = value_of_initializer %int.snegate.loc14_41 [template = constants.%.32] +// CHECK:STDOUT: %.loc14_41.2: i32 = converted %int.snegate.loc14_41, %.loc14_41.1 [template = constants.%.32] +// CHECK:STDOUT: %int.right_shift.loc14: init i32 = call %RightShift.ref.loc14(%.loc14_41.2, %.loc14_47) [template = constants.%.34] +// CHECK:STDOUT: %.loc14_34.1: i32 = value_of_initializer %int.right_shift.loc14 [template = constants.%.34] +// CHECK:STDOUT: %.loc14_34.2: i32 = converted %int.right_shift.loc14, %.loc14_34.1 [template = constants.%.34] +// CHECK:STDOUT: %int.snegate.loc14_23: init i32 = call %Negate.ref.loc14_17(%.loc14_34.2) [template = constants.%.35] // CHECK:STDOUT: %.loc14_12.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] // CHECK:STDOUT: %.loc14_12.2: type = converted %int.make_type_32.loc14, %.loc14_12.1 [template = i32] -// CHECK:STDOUT: %.loc14_50: type = array_type %int.snegate.loc14_23, i32 [template = constants.%.10] -// CHECK:STDOUT: %arr2.var: ref %.10 = var arr2 -// CHECK:STDOUT: %arr2: ref %.10 = bind_name arr2, %arr2.var +// CHECK:STDOUT: %.loc14_23.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc14_23.2: = bound_method %int.snegate.loc14_23, %.loc14_23.1 [template = constants.%.36] +// CHECK:STDOUT: %.loc14_23.3: i32 = value_of_initializer %int.snegate.loc14_23 [template = constants.%.35] +// CHECK:STDOUT: %.loc14_23.4: i32 = converted %int.snegate.loc14_23, %.loc14_23.3 [template = constants.%.35] +// CHECK:STDOUT: %int.convert_checked.loc14: init Core.IntLiteral = call %.loc14_23.2(%.loc14_23.4) [template = constants.%.37] +// CHECK:STDOUT: %.loc14_23.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc14 [template = constants.%.37] +// CHECK:STDOUT: %.loc14_23.6: Core.IntLiteral = converted %int.snegate.loc14_23, %.loc14_23.5 [template = constants.%.37] +// CHECK:STDOUT: %.loc14_50: type = array_type %.loc14_23.6, i32 [template = constants.%.38] +// CHECK:STDOUT: %arr2.var: ref %.38 = var arr2 +// CHECK:STDOUT: %arr2: ref %.38 = bind_name arr2, %arr2.var // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_19: i32 = int_value 3 [template = constants.%.9] +// CHECK:STDOUT: %.loc15_19.1: i32 = int_value 3 [template = constants.%.35] // CHECK:STDOUT: %.loc15_14.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_14.2: type = converted %int.make_type_32.loc15, %.loc15_14.1 [template = i32] -// CHECK:STDOUT: %.loc15_20: type = array_type %.loc15_19, i32 [template = constants.%.10] -// CHECK:STDOUT: %.loc15_21: type = ptr_type %.10 [template = constants.%.11] +// CHECK:STDOUT: %.loc15_19.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc15_19.3: = bound_method %.loc15_19.1, %.loc15_19.2 [template = constants.%.36] +// CHECK:STDOUT: %int.convert_checked.loc15: init Core.IntLiteral = call %.loc15_19.3(%.loc15_19.1) [template = constants.%.37] +// CHECK:STDOUT: %.loc15_19.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc15 [template = constants.%.37] +// CHECK:STDOUT: %.loc15_19.5: Core.IntLiteral = converted %.loc15_19.1, %.loc15_19.4 [template = constants.%.37] +// CHECK:STDOUT: %.loc15_20: type = array_type %.loc15_19.5, i32 [template = constants.%.38] +// CHECK:STDOUT: %.loc15_21: type = ptr_type %.38 [template = constants.%.39] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.3)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.3) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.16)] +// CHECK:STDOUT: %.2: @As.%.1 (%.16) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.17)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.20)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.25)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; @@ -328,17 +1374,385 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: // CHECK:STDOUT: fn @Negate(%a.param_patt: i32) -> i32 = "int.snegate"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.10) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.12) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.10) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.12) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr1.ref: ref %.3 = name_ref arr1, file.%arr1 -// CHECK:STDOUT: %.loc11: %.4 = addr_of %arr1.ref -// CHECK:STDOUT: %arr1_p: %.4 = bind_name arr1_p, %.loc11 -// CHECK:STDOUT: %arr2.ref: ref %.10 = name_ref arr2, file.%arr2 -// CHECK:STDOUT: %.loc15: %.11 = addr_of %arr2.ref -// CHECK:STDOUT: %arr2_p: %.11 = bind_name arr2_p, %.loc15 +// CHECK:STDOUT: %arr1.ref: ref %.29 = name_ref arr1, file.%arr1 +// CHECK:STDOUT: %.loc11: %.30 = addr_of %arr1.ref +// CHECK:STDOUT: %arr1_p: %.30 = bind_name arr1_p, %.loc11 +// CHECK:STDOUT: %arr2.ref: ref %.38 = name_ref arr2, file.%arr2 +// CHECK:STDOUT: %.loc15: %.39 = addr_of %arr2.ref +// CHECK:STDOUT: %arr2_p: %.39 = bind_name arr2_p, %.loc15 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %.2 => constants.%.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: %.2 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.10) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.12) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.18 +// CHECK:STDOUT: %.2 => constants.%.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.10) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.12) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.22 +// CHECK:STDOUT: %.2 => constants.%.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_bad_shift.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { diff --git a/toolchain/check/testdata/builtins/int/sadd.carbon b/toolchain/check/testdata/builtins/int/sadd.carbon index 8801b4c44f1fc..ba3a6e74b1af4 100644 --- a/toolchain/check/testdata/builtins/int/sadd.carbon +++ b/toolchain/check/testdata/builtins/int/sadd.carbon @@ -100,19 +100,147 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.1: i32 = int_value 1 [template] // CHECK:STDOUT: %.2: i32 = int_value 2 [template] // CHECK:STDOUT: %.3: i32 = int_value 3 [template] -// CHECK:STDOUT: %.4: type = array_type %.3, i32 [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.8: %.4 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.11: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.13: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.19: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.20: %.19 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.21: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.23: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.24: %.23 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.28: = bound_method %.3, %Convert.15 [template] +// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.30: type = array_type %.29, i32 [template] +// CHECK:STDOUT: %.31: type = ptr_type %.30 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.27] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -155,15 +283,27 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %int.sadd: init i32 = call %Add.ref(%.loc4_20, %.loc4_23) [template = constants.%.3] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_25: type = array_type %int.sadd, i32 [template = constants.%.4] -// CHECK:STDOUT: %arr.var: ref %.4 = var arr -// CHECK:STDOUT: %arr: ref %.4 = bind_name arr, %arr.var +// CHECK:STDOUT: %.loc4_19.1: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.sadd, %.loc4_19.1 [template = constants.%.28] +// CHECK:STDOUT: %.loc4_19.3: i32 = value_of_initializer %int.sadd [template = constants.%.3] +// CHECK:STDOUT: %.loc4_19.4: i32 = converted %int.sadd, %.loc4_19.3 [template = constants.%.3] +// CHECK:STDOUT: %int.convert_checked.loc4: init Core.IntLiteral = call %.loc4_19.2(%.loc4_19.4) [template = constants.%.29] +// CHECK:STDOUT: %.loc4_19.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = converted %int.sadd, %.loc4_19.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_25: type = array_type %.loc4_19.6, i32 [template = constants.%.30] +// CHECK:STDOUT: %arr.var: ref %.30 = var arr +// CHECK:STDOUT: %arr: ref %.30 = bind_name arr, %arr.var // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_18: i32 = int_value 3 [template = constants.%.3] +// CHECK:STDOUT: %.loc5_18.1: i32 = int_value 3 [template = constants.%.3] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.4] -// CHECK:STDOUT: %.loc5_20: type = ptr_type %.4 [template = constants.%.5] +// CHECK:STDOUT: %.loc5_18.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc5_18.3: = bound_method %.loc5_18.1, %.loc5_18.2 [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc5: init Core.IntLiteral = call %.loc5_18.3(%.loc5_18.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc5_18.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc5 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_18.5: Core.IntLiteral = converted %.loc5_18.1, %.loc5_18.4 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18.5, i32 [template = constants.%.30] +// CHECK:STDOUT: %.loc5_20: type = ptr_type %.30 [template = constants.%.31] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 @@ -190,10 +330,292 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.4) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: %.2: @As.%.1 (%.17) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.18)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.25)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.26)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Add(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, file.%Add.decl [template = constants.%Add] @@ -207,12 +629,290 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %.4 = name_ref arr, file.%arr -// CHECK:STDOUT: %.loc5: %.5 = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %.5 = bind_name arr_p, %.loc5 +// CHECK:STDOUT: %arr.ref: ref %.30 = name_ref arr, file.%arr +// CHECK:STDOUT: %.loc5: %.31 = addr_of %arr.ref +// CHECK:STDOUT: %arr_p: %.31 = bind_name arr_p, %.loc5 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.2 => constants.%.7 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %.2 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: %.2 => constants.%.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.23 +// CHECK:STDOUT: %.2 => constants.%.24 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_bad_decl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -365,8 +1065,10 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, %TooFew.decl [template = constants.%TooFew] -// CHECK:STDOUT: %.loc25: i32 = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %TooFew.call: init i32 = call %TooFew.ref(%.loc25) +// CHECK:STDOUT: %.loc25_27: i32 = int_value 1 [template = constants.%.1] +// CHECK:STDOUT: %TooFew.call: init i32 = call %TooFew.ref(%.loc25_27) +// CHECK:STDOUT: %.loc25_15.1: type = value_of_initializer %int.make_type_32.loc25 [template = i32] +// CHECK:STDOUT: %.loc25_15.2: type = converted %int.make_type_32.loc25, %.loc25_15.1 [template = i32] // CHECK:STDOUT: %too_few.var: ref = var too_few // CHECK:STDOUT: %too_few: ref = bind_name too_few, %too_few.var // CHECK:STDOUT: %int.make_type_32.loc30: init type = call constants.%Int32() [template = i32] @@ -375,6 +1077,8 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.loc30_32: i32 = int_value 2 [template = constants.%.2] // CHECK:STDOUT: %.loc30_35: i32 = int_value 3 [template = constants.%.3] // CHECK:STDOUT: %TooMany.call: init i32 = call %TooMany.ref(%.loc30_29, %.loc30_32, %.loc30_35) +// CHECK:STDOUT: %.loc30_16.1: type = value_of_initializer %int.make_type_32.loc30 [template = i32] +// CHECK:STDOUT: %.loc30_16.2: type = converted %int.make_type_32.loc30, %.loc30_16.1 [template = i32] // CHECK:STDOUT: %too_many.var: ref = var too_many // CHECK:STDOUT: %too_many: ref = bind_name too_many, %too_many.var // CHECK:STDOUT: %int.make_type_32.loc35: init type = call constants.%Int32() [template = i32] @@ -382,6 +1086,8 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.loc35_42: i32 = int_value 1 [template = constants.%.1] // CHECK:STDOUT: %.loc35_45: i32 = int_value 2 [template = constants.%.2] // CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%.loc35_42, %.loc35_45) +// CHECK:STDOUT: %.loc35_23.1: type = value_of_initializer %int.make_type_32.loc35 [template = i32] +// CHECK:STDOUT: %.loc35_23.2: type = converted %int.make_type_32.loc35, %.loc35_23.1 [template = i32] // CHECK:STDOUT: %bad_return_type.var: ref = var bad_return_type // CHECK:STDOUT: %bad_return_type: ref = bind_name bad_return_type, %bad_return_type.var // CHECK:STDOUT: %int.make_type_32.loc44: init type = call constants.%Int32() [template = i32] diff --git a/toolchain/check/testdata/builtins/int/sdiv.carbon b/toolchain/check/testdata/builtins/int/sdiv.carbon index a9aa02012f668..2c869e9295da3 100644 --- a/toolchain/check/testdata/builtins/int/sdiv.carbon +++ b/toolchain/check/testdata/builtins/int/sdiv.carbon @@ -68,19 +68,147 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %.1: i32 = int_value 3 [template] // CHECK:STDOUT: %.2: i32 = int_value 2 [template] // CHECK:STDOUT: %.3: i32 = int_value 1 [template] -// CHECK:STDOUT: %.4: type = array_type %.3, i32 [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.8: %.4 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.11: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.13: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.19: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.20: %.19 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.21: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.23: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.24: %.23 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.28: = bound_method %.3, %Convert.15 [template] +// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.30: type = array_type %.29, i32 [template] +// CHECK:STDOUT: %.31: type = ptr_type %.30 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.27] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -123,15 +251,27 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %int.sdiv: init i32 = call %Div.ref(%.loc4_20, %.loc4_23) [template = constants.%.3] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_25: type = array_type %int.sdiv, i32 [template = constants.%.4] -// CHECK:STDOUT: %arr.var: ref %.4 = var arr -// CHECK:STDOUT: %arr: ref %.4 = bind_name arr, %arr.var +// CHECK:STDOUT: %.loc4_19.1: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.sdiv, %.loc4_19.1 [template = constants.%.28] +// CHECK:STDOUT: %.loc4_19.3: i32 = value_of_initializer %int.sdiv [template = constants.%.3] +// CHECK:STDOUT: %.loc4_19.4: i32 = converted %int.sdiv, %.loc4_19.3 [template = constants.%.3] +// CHECK:STDOUT: %int.convert_checked.loc4: init Core.IntLiteral = call %.loc4_19.2(%.loc4_19.4) [template = constants.%.29] +// CHECK:STDOUT: %.loc4_19.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = converted %int.sdiv, %.loc4_19.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_25: type = array_type %.loc4_19.6, i32 [template = constants.%.30] +// CHECK:STDOUT: %arr.var: ref %.30 = var arr +// CHECK:STDOUT: %arr: ref %.30 = bind_name arr, %arr.var // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_18: i32 = int_value 1 [template = constants.%.3] +// CHECK:STDOUT: %.loc5_18.1: i32 = int_value 1 [template = constants.%.3] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.4] -// CHECK:STDOUT: %.loc5_20: type = ptr_type %.4 [template = constants.%.5] +// CHECK:STDOUT: %.loc5_18.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc5_18.3: = bound_method %.loc5_18.1, %.loc5_18.2 [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc5: init Core.IntLiteral = call %.loc5_18.3(%.loc5_18.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc5_18.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc5 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_18.5: Core.IntLiteral = converted %.loc5_18.1, %.loc5_18.4 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18.5, i32 [template = constants.%.30] +// CHECK:STDOUT: %.loc5_20: type = ptr_type %.30 [template = constants.%.31] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 @@ -158,10 +298,292 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.4) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: %.2: @As.%.1 (%.17) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.18)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.25)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.26)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Div(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sdiv"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Div.ref: %Div.type = name_ref Div, file.%Div.decl [template = constants.%Div] @@ -175,12 +597,290 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %.4 = name_ref arr, file.%arr -// CHECK:STDOUT: %.loc5: %.5 = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %.5 = bind_name arr_p, %.loc5 +// CHECK:STDOUT: %arr.ref: ref %.30 = name_ref arr, file.%arr +// CHECK:STDOUT: %.loc5: %.31 = addr_of %arr.ref +// CHECK:STDOUT: %arr_p: %.31 = bind_name arr_p, %.loc5 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.2 => constants.%.7 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %.2 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: %.2 => constants.%.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.23 +// CHECK:STDOUT: %.2 => constants.%.24 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_overflow.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { diff --git a/toolchain/check/testdata/builtins/int/smod.carbon b/toolchain/check/testdata/builtins/int/smod.carbon index 29c533faef57e..942bd097ced7d 100644 --- a/toolchain/check/testdata/builtins/int/smod.carbon +++ b/toolchain/check/testdata/builtins/int/smod.carbon @@ -71,19 +71,147 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %.1: i32 = int_value 5 [template] // CHECK:STDOUT: %.2: i32 = int_value 3 [template] // CHECK:STDOUT: %.3: i32 = int_value 2 [template] -// CHECK:STDOUT: %.4: type = array_type %.3, i32 [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.8: %.4 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.11: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.13: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.19: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.20: %.19 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.21: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.23: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.24: %.23 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.28: = bound_method %.3, %Convert.15 [template] +// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.30: type = array_type %.29, i32 [template] +// CHECK:STDOUT: %.31: type = ptr_type %.30 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.27] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -126,15 +254,27 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %int.smod: init i32 = call %Mod.ref(%.loc4_20, %.loc4_23) [template = constants.%.3] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_25: type = array_type %int.smod, i32 [template = constants.%.4] -// CHECK:STDOUT: %arr.var: ref %.4 = var arr -// CHECK:STDOUT: %arr: ref %.4 = bind_name arr, %arr.var +// CHECK:STDOUT: %.loc4_19.1: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.smod, %.loc4_19.1 [template = constants.%.28] +// CHECK:STDOUT: %.loc4_19.3: i32 = value_of_initializer %int.smod [template = constants.%.3] +// CHECK:STDOUT: %.loc4_19.4: i32 = converted %int.smod, %.loc4_19.3 [template = constants.%.3] +// CHECK:STDOUT: %int.convert_checked.loc4: init Core.IntLiteral = call %.loc4_19.2(%.loc4_19.4) [template = constants.%.29] +// CHECK:STDOUT: %.loc4_19.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = converted %int.smod, %.loc4_19.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_25: type = array_type %.loc4_19.6, i32 [template = constants.%.30] +// CHECK:STDOUT: %arr.var: ref %.30 = var arr +// CHECK:STDOUT: %arr: ref %.30 = bind_name arr, %arr.var // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_18: i32 = int_value 2 [template = constants.%.3] +// CHECK:STDOUT: %.loc5_18.1: i32 = int_value 2 [template = constants.%.3] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.4] -// CHECK:STDOUT: %.loc5_20: type = ptr_type %.4 [template = constants.%.5] +// CHECK:STDOUT: %.loc5_18.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc5_18.3: = bound_method %.loc5_18.1, %.loc5_18.2 [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc5: init Core.IntLiteral = call %.loc5_18.3(%.loc5_18.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc5_18.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc5 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_18.5: Core.IntLiteral = converted %.loc5_18.1, %.loc5_18.4 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18.5, i32 [template = constants.%.30] +// CHECK:STDOUT: %.loc5_20: type = ptr_type %.30 [template = constants.%.31] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 @@ -161,10 +301,292 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.4) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: %.2: @As.%.1 (%.17) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.18)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.25)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.26)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Mod(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.smod"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Mod.ref: %Mod.type = name_ref Mod, file.%Mod.decl [template = constants.%Mod] @@ -178,12 +600,290 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %.4 = name_ref arr, file.%arr -// CHECK:STDOUT: %.loc5: %.5 = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %.5 = bind_name arr_p, %.loc5 +// CHECK:STDOUT: %arr.ref: ref %.30 = name_ref arr, file.%arr +// CHECK:STDOUT: %.loc5: %.31 = addr_of %arr.ref +// CHECK:STDOUT: %arr_p: %.31 = bind_name arr_p, %.loc5 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.2 => constants.%.7 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %.2 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: %.2 => constants.%.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.23 +// CHECK:STDOUT: %.2 => constants.%.24 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_overflow.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { diff --git a/toolchain/check/testdata/builtins/int/smul.carbon b/toolchain/check/testdata/builtins/int/smul.carbon index e4a7763efad8d..1d4d33f83bbab 100644 --- a/toolchain/check/testdata/builtins/int/smul.carbon +++ b/toolchain/check/testdata/builtins/int/smul.carbon @@ -42,19 +42,147 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %.1: i32 = int_value 3 [template] // CHECK:STDOUT: %.2: i32 = int_value 2 [template] // CHECK:STDOUT: %.3: i32 = int_value 6 [template] -// CHECK:STDOUT: %.4: type = array_type %.3, i32 [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.8: %.4 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.11: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.13: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.19: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.20: %.19 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.21: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.23: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.24: %.23 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.28: = bound_method %.3, %Convert.15 [template] +// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 6 [template] +// CHECK:STDOUT: %.30: type = array_type %.29, i32 [template] +// CHECK:STDOUT: %.31: type = ptr_type %.30 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.27] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -97,15 +225,27 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %int.smul: init i32 = call %Mul.ref(%.loc4_20, %.loc4_23) [template = constants.%.3] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_25: type = array_type %int.smul, i32 [template = constants.%.4] -// CHECK:STDOUT: %arr.var: ref %.4 = var arr -// CHECK:STDOUT: %arr: ref %.4 = bind_name arr, %arr.var +// CHECK:STDOUT: %.loc4_19.1: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.smul, %.loc4_19.1 [template = constants.%.28] +// CHECK:STDOUT: %.loc4_19.3: i32 = value_of_initializer %int.smul [template = constants.%.3] +// CHECK:STDOUT: %.loc4_19.4: i32 = converted %int.smul, %.loc4_19.3 [template = constants.%.3] +// CHECK:STDOUT: %int.convert_checked.loc4: init Core.IntLiteral = call %.loc4_19.2(%.loc4_19.4) [template = constants.%.29] +// CHECK:STDOUT: %.loc4_19.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = converted %int.smul, %.loc4_19.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_25: type = array_type %.loc4_19.6, i32 [template = constants.%.30] +// CHECK:STDOUT: %arr.var: ref %.30 = var arr +// CHECK:STDOUT: %arr: ref %.30 = bind_name arr, %arr.var // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_18: i32 = int_value 6 [template = constants.%.3] +// CHECK:STDOUT: %.loc5_18.1: i32 = int_value 6 [template = constants.%.3] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.4] -// CHECK:STDOUT: %.loc5_20: type = ptr_type %.4 [template = constants.%.5] +// CHECK:STDOUT: %.loc5_18.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc5_18.3: = bound_method %.loc5_18.1, %.loc5_18.2 [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc5: init Core.IntLiteral = call %.loc5_18.3(%.loc5_18.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc5_18.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc5 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_18.5: Core.IntLiteral = converted %.loc5_18.1, %.loc5_18.4 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18.5, i32 [template = constants.%.30] +// CHECK:STDOUT: %.loc5_20: type = ptr_type %.30 [template = constants.%.31] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 @@ -132,10 +272,292 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.4) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: %.2: @As.%.1 (%.17) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.18)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.25)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.26)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Mul(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.smul"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Mul.ref: %Mul.type = name_ref Mul, file.%Mul.decl [template = constants.%Mul] @@ -149,12 +571,290 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %.4 = name_ref arr, file.%arr -// CHECK:STDOUT: %.loc5: %.5 = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %.5 = bind_name arr_p, %.loc5 +// CHECK:STDOUT: %arr.ref: ref %.30 = name_ref arr, file.%arr +// CHECK:STDOUT: %.loc5: %.31 = addr_of %arr.ref +// CHECK:STDOUT: %arr_p: %.31 = bind_name arr_p, %.loc5 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.2 => constants.%.7 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %.2 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: %.2 => constants.%.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.23 +// CHECK:STDOUT: %.2 => constants.%.24 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_overflow.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { diff --git a/toolchain/check/testdata/builtins/int/snegate.carbon b/toolchain/check/testdata/builtins/int/snegate.carbon index a614af4076f48..c4320e206bc0a 100644 --- a/toolchain/check/testdata/builtins/int/snegate.carbon +++ b/toolchain/check/testdata/builtins/int/snegate.carbon @@ -126,21 +126,149 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] // CHECK:STDOUT: %.1: i32 = int_value 123 [template] // CHECK:STDOUT: %.2: i32 = int_value -123 [template] -// CHECK:STDOUT: %.3: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: i32 = int_value 1 [template] -// CHECK:STDOUT: %.6: i32 = int_value -1 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.3: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.5: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.7: %.3 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.8: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.10: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.10)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.11: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.12: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.12)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.17: %.16 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.18: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.19: %.18 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.10)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.20: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.12)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.21: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.22: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.23: %.22 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] +// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 123 [template] +// CHECK:STDOUT: %.29: type = array_type %.28, i32 [template] +// CHECK:STDOUT: %.30: type = ptr_type %.29 [template] +// CHECK:STDOUT: %.31: i32 = int_value 1 [template] +// CHECK:STDOUT: %.32: i32 = int_value -1 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.26] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.10)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.12)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.10)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.12)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -180,15 +308,27 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %int.snegate.loc4_22: init i32 = call %Negate.ref.loc4_16(%.loc4_29.2) [template = constants.%.1] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_35: type = array_type %int.snegate.loc4_22, i32 [template = constants.%.3] -// CHECK:STDOUT: %arr.var: ref %.3 = var arr -// CHECK:STDOUT: %arr: ref %.3 = bind_name arr, %arr.var +// CHECK:STDOUT: %.loc4_22.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_22.2: = bound_method %int.snegate.loc4_22, %.loc4_22.1 [template = constants.%.27] +// CHECK:STDOUT: %.loc4_22.3: i32 = value_of_initializer %int.snegate.loc4_22 [template = constants.%.1] +// CHECK:STDOUT: %.loc4_22.4: i32 = converted %int.snegate.loc4_22, %.loc4_22.3 [template = constants.%.1] +// CHECK:STDOUT: %int.convert_checked.loc4: init Core.IntLiteral = call %.loc4_22.2(%.loc4_22.4) [template = constants.%.28] +// CHECK:STDOUT: %.loc4_22.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4 [template = constants.%.28] +// CHECK:STDOUT: %.loc4_22.6: Core.IntLiteral = converted %int.snegate.loc4_22, %.loc4_22.5 [template = constants.%.28] +// CHECK:STDOUT: %.loc4_35: type = array_type %.loc4_22.6, i32 [template = constants.%.29] +// CHECK:STDOUT: %arr.var: ref %.29 = var arr +// CHECK:STDOUT: %arr: ref %.29 = bind_name arr, %arr.var // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_18: i32 = int_value 123 [template = constants.%.1] +// CHECK:STDOUT: %.loc5_18.1: i32 = int_value 123 [template = constants.%.1] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_21: type = array_type %.loc5_18, i32 [template = constants.%.3] -// CHECK:STDOUT: %.loc5_22: type = ptr_type %.3 [template = constants.%.4] +// CHECK:STDOUT: %.loc5_18.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc5_18.3: = bound_method %.loc5_18.1, %.loc5_18.2 [template = constants.%.27] +// CHECK:STDOUT: %int.convert_checked.loc5: init Core.IntLiteral = call %.loc5_18.3(%.loc5_18.1) [template = constants.%.28] +// CHECK:STDOUT: %.loc5_18.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc5 [template = constants.%.28] +// CHECK:STDOUT: %.loc5_18.5: Core.IntLiteral = converted %.loc5_18.1, %.loc5_18.4 [template = constants.%.28] +// CHECK:STDOUT: %.loc5_21: type = array_type %.loc5_18.5, i32 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_22: type = ptr_type %.29 [template = constants.%.30] // CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] // CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_32.loc7, %.loc7_8.1 [template = i32] @@ -218,10 +358,292 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.3)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.3) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.16)] +// CHECK:STDOUT: %.2: @As.%.1 (%.16) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.17)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.20)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.25)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Negate(%a.param_patt: i32) -> i32 = "int.snegate"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.10) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.12) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.10) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.12) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] @@ -234,18 +656,296 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %.3 = name_ref arr, file.%arr -// CHECK:STDOUT: %.loc5: %.4 = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %.4 = bind_name arr_p, %.loc5 +// CHECK:STDOUT: %arr.ref: ref %.29 = name_ref arr, file.%arr +// CHECK:STDOUT: %.loc5: %.30 = addr_of %arr.ref +// CHECK:STDOUT: %arr_p: %.30 = bind_name arr_p, %.loc5 // CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc7_21: i32 = int_value 1 [template = constants.%.5] -// CHECK:STDOUT: %int.snegate: init i32 = call %Negate.ref(%.loc7_21) [template = constants.%.6] -// CHECK:STDOUT: %.loc7_23.1: i32 = value_of_initializer %int.snegate [template = constants.%.6] -// CHECK:STDOUT: %.loc7_23.2: i32 = converted %int.snegate, %.loc7_23.1 [template = constants.%.6] +// CHECK:STDOUT: %.loc7_21: i32 = int_value 1 [template = constants.%.31] +// CHECK:STDOUT: %int.snegate: init i32 = call %Negate.ref(%.loc7_21) [template = constants.%.32] +// CHECK:STDOUT: %.loc7_23.1: i32 = value_of_initializer %int.snegate [template = constants.%.32] +// CHECK:STDOUT: %.loc7_23.2: i32 = converted %int.snegate, %.loc7_23.1 [template = constants.%.32] // CHECK:STDOUT: %n: i32 = bind_name n, %.loc7_23.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %.2 => constants.%.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: %.2 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.10) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.12) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.18 +// CHECK:STDOUT: %.2 => constants.%.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.10) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.12) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.22 +// CHECK:STDOUT: %.2 => constants.%.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_bad_decl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -370,6 +1070,8 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %int.make_type_32.loc25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, %TooFew.decl [template = constants.%TooFew] // CHECK:STDOUT: %TooFew.call: init i32 = call %TooFew.ref() +// CHECK:STDOUT: %.loc25_15.1: type = value_of_initializer %int.make_type_32.loc25 [template = i32] +// CHECK:STDOUT: %.loc25_15.2: type = converted %int.make_type_32.loc25, %.loc25_15.1 [template = i32] // CHECK:STDOUT: %too_few.var: ref = var too_few // CHECK:STDOUT: %too_few: ref = bind_name too_few, %too_few.var // CHECK:STDOUT: %int.make_type_32.loc30: init type = call constants.%Int32() [template = i32] @@ -377,12 +1079,16 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.loc30_29: i32 = int_value 1 [template = constants.%.1] // CHECK:STDOUT: %.loc30_32: i32 = int_value 2 [template = constants.%.2] // CHECK:STDOUT: %TooMany.call: init i32 = call %TooMany.ref(%.loc30_29, %.loc30_32) +// CHECK:STDOUT: %.loc30_16.1: type = value_of_initializer %int.make_type_32.loc30 [template = i32] +// CHECK:STDOUT: %.loc30_16.2: type = converted %int.make_type_32.loc30, %.loc30_16.1 [template = i32] // CHECK:STDOUT: %too_many.var: ref = var too_many // CHECK:STDOUT: %too_many: ref = bind_name too_many, %too_many.var // CHECK:STDOUT: %int.make_type_32.loc35: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, %BadReturnType.decl [template = constants.%BadReturnType] -// CHECK:STDOUT: %.loc35: i32 = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%.loc35) +// CHECK:STDOUT: %.loc35_42: i32 = int_value 1 [template = constants.%.1] +// CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%.loc35_42) +// CHECK:STDOUT: %.loc35_23.1: type = value_of_initializer %int.make_type_32.loc35 [template = i32] +// CHECK:STDOUT: %.loc35_23.2: type = converted %int.make_type_32.loc35, %.loc35_23.1 [template = i32] // CHECK:STDOUT: %bad_return_type.var: ref = var bad_return_type // CHECK:STDOUT: %bad_return_type: ref = bind_name bad_return_type, %bad_return_type.var // CHECK:STDOUT: %int.make_type_32.loc44: init type = call constants.%Int32() [template = i32] diff --git a/toolchain/check/testdata/builtins/int/ssub.carbon b/toolchain/check/testdata/builtins/int/ssub.carbon index 7125456b2395c..478834e297ab4 100644 --- a/toolchain/check/testdata/builtins/int/ssub.carbon +++ b/toolchain/check/testdata/builtins/int/ssub.carbon @@ -43,19 +43,147 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %.1: i32 = int_value 3 [template] // CHECK:STDOUT: %.2: i32 = int_value 2 [template] // CHECK:STDOUT: %.3: i32 = int_value 1 [template] -// CHECK:STDOUT: %.4: type = array_type %.3, i32 [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.8: %.4 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.11: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.13: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.19: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.20: %.19 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.21: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.23: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.24: %.23 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.28: = bound_method %.3, %Convert.15 [template] +// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.30: type = array_type %.29, i32 [template] +// CHECK:STDOUT: %.31: type = ptr_type %.30 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.27] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -98,15 +226,27 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %int.ssub: init i32 = call %Sub.ref(%.loc4_20, %.loc4_23) [template = constants.%.3] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_25: type = array_type %int.ssub, i32 [template = constants.%.4] -// CHECK:STDOUT: %arr.var: ref %.4 = var arr -// CHECK:STDOUT: %arr: ref %.4 = bind_name arr, %arr.var +// CHECK:STDOUT: %.loc4_19.1: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.ssub, %.loc4_19.1 [template = constants.%.28] +// CHECK:STDOUT: %.loc4_19.3: i32 = value_of_initializer %int.ssub [template = constants.%.3] +// CHECK:STDOUT: %.loc4_19.4: i32 = converted %int.ssub, %.loc4_19.3 [template = constants.%.3] +// CHECK:STDOUT: %int.convert_checked.loc4: init Core.IntLiteral = call %.loc4_19.2(%.loc4_19.4) [template = constants.%.29] +// CHECK:STDOUT: %.loc4_19.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = converted %int.ssub, %.loc4_19.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_25: type = array_type %.loc4_19.6, i32 [template = constants.%.30] +// CHECK:STDOUT: %arr.var: ref %.30 = var arr +// CHECK:STDOUT: %arr: ref %.30 = bind_name arr, %arr.var // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_18: i32 = int_value 1 [template = constants.%.3] +// CHECK:STDOUT: %.loc5_18.1: i32 = int_value 1 [template = constants.%.3] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.4] -// CHECK:STDOUT: %.loc5_20: type = ptr_type %.4 [template = constants.%.5] +// CHECK:STDOUT: %.loc5_18.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc5_18.3: = bound_method %.loc5_18.1, %.loc5_18.2 [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc5: init Core.IntLiteral = call %.loc5_18.3(%.loc5_18.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc5_18.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc5 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_18.5: Core.IntLiteral = converted %.loc5_18.1, %.loc5_18.4 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18.5, i32 [template = constants.%.30] +// CHECK:STDOUT: %.loc5_20: type = ptr_type %.30 [template = constants.%.31] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 @@ -133,10 +273,292 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.4) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: %.2: @As.%.1 (%.17) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.18)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.25)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.26)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Sub(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.ssub"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Sub.ref: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] @@ -150,12 +572,290 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %.4 = name_ref arr, file.%arr -// CHECK:STDOUT: %.loc5: %.5 = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %.5 = bind_name arr_p, %.loc5 +// CHECK:STDOUT: %arr.ref: ref %.30 = name_ref arr, file.%arr +// CHECK:STDOUT: %.loc5: %.31 = addr_of %arr.ref +// CHECK:STDOUT: %arr_p: %.31 = bind_name arr_p, %.loc5 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.2 => constants.%.7 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %.2 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: %.2 => constants.%.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.23 +// CHECK:STDOUT: %.2 => constants.%.24 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_overflow.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { diff --git a/toolchain/check/testdata/builtins/int/uadd.carbon b/toolchain/check/testdata/builtins/int/uadd.carbon index f38d9ee15cf7d..27692e0c7216c 100644 --- a/toolchain/check/testdata/builtins/int/uadd.carbon +++ b/toolchain/check/testdata/builtins/int/uadd.carbon @@ -97,19 +97,147 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.1: i32 = int_value 1 [template] // CHECK:STDOUT: %.2: i32 = int_value 2 [template] // CHECK:STDOUT: %.3: i32 = int_value 3 [template] -// CHECK:STDOUT: %.4: type = array_type %.3, i32 [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.8: %.4 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.11: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.13: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.19: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.20: %.19 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.21: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.23: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.24: %.23 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.28: = bound_method %.3, %Convert.15 [template] +// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.30: type = array_type %.29, i32 [template] +// CHECK:STDOUT: %.31: type = ptr_type %.30 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.27] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -152,15 +280,27 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %int.uadd: init i32 = call %Add.ref(%.loc4_20, %.loc4_23) [template = constants.%.3] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_25: type = array_type %int.uadd, i32 [template = constants.%.4] -// CHECK:STDOUT: %arr.var: ref %.4 = var arr -// CHECK:STDOUT: %arr: ref %.4 = bind_name arr, %arr.var +// CHECK:STDOUT: %.loc4_19.1: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.uadd, %.loc4_19.1 [template = constants.%.28] +// CHECK:STDOUT: %.loc4_19.3: i32 = value_of_initializer %int.uadd [template = constants.%.3] +// CHECK:STDOUT: %.loc4_19.4: i32 = converted %int.uadd, %.loc4_19.3 [template = constants.%.3] +// CHECK:STDOUT: %int.convert_checked.loc4: init Core.IntLiteral = call %.loc4_19.2(%.loc4_19.4) [template = constants.%.29] +// CHECK:STDOUT: %.loc4_19.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = converted %int.uadd, %.loc4_19.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_25: type = array_type %.loc4_19.6, i32 [template = constants.%.30] +// CHECK:STDOUT: %arr.var: ref %.30 = var arr +// CHECK:STDOUT: %arr: ref %.30 = bind_name arr, %arr.var // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_18: i32 = int_value 3 [template = constants.%.3] +// CHECK:STDOUT: %.loc5_18.1: i32 = int_value 3 [template = constants.%.3] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.4] -// CHECK:STDOUT: %.loc5_20: type = ptr_type %.4 [template = constants.%.5] +// CHECK:STDOUT: %.loc5_18.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc5_18.3: = bound_method %.loc5_18.1, %.loc5_18.2 [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc5: init Core.IntLiteral = call %.loc5_18.3(%.loc5_18.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc5_18.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc5 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_18.5: Core.IntLiteral = converted %.loc5_18.1, %.loc5_18.4 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18.5, i32 [template = constants.%.30] +// CHECK:STDOUT: %.loc5_20: type = ptr_type %.30 [template = constants.%.31] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 @@ -187,10 +327,292 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.4) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: %.2: @As.%.1 (%.17) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.18)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.25)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.26)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Add(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.uadd"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, file.%Add.decl [template = constants.%Add] @@ -204,12 +626,290 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %.4 = name_ref arr, file.%arr -// CHECK:STDOUT: %.loc5: %.5 = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %.5 = bind_name arr_p, %.loc5 +// CHECK:STDOUT: %arr.ref: ref %.30 = name_ref arr, file.%arr +// CHECK:STDOUT: %.loc5: %.31 = addr_of %arr.ref +// CHECK:STDOUT: %arr_p: %.31 = bind_name arr_p, %.loc5 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.2 => constants.%.7 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %.2 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: %.2 => constants.%.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.23 +// CHECK:STDOUT: %.2 => constants.%.24 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_bad_decl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -362,8 +1062,10 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, %TooFew.decl [template = constants.%TooFew] -// CHECK:STDOUT: %.loc25: i32 = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %TooFew.call: init i32 = call %TooFew.ref(%.loc25) +// CHECK:STDOUT: %.loc25_27: i32 = int_value 1 [template = constants.%.1] +// CHECK:STDOUT: %TooFew.call: init i32 = call %TooFew.ref(%.loc25_27) +// CHECK:STDOUT: %.loc25_15.1: type = value_of_initializer %int.make_type_32.loc25 [template = i32] +// CHECK:STDOUT: %.loc25_15.2: type = converted %int.make_type_32.loc25, %.loc25_15.1 [template = i32] // CHECK:STDOUT: %too_few.var: ref = var too_few // CHECK:STDOUT: %too_few: ref = bind_name too_few, %too_few.var // CHECK:STDOUT: %int.make_type_32.loc30: init type = call constants.%Int32() [template = i32] @@ -372,6 +1074,8 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.loc30_32: i32 = int_value 2 [template = constants.%.2] // CHECK:STDOUT: %.loc30_35: i32 = int_value 3 [template = constants.%.3] // CHECK:STDOUT: %TooMany.call: init i32 = call %TooMany.ref(%.loc30_29, %.loc30_32, %.loc30_35) +// CHECK:STDOUT: %.loc30_16.1: type = value_of_initializer %int.make_type_32.loc30 [template = i32] +// CHECK:STDOUT: %.loc30_16.2: type = converted %int.make_type_32.loc30, %.loc30_16.1 [template = i32] // CHECK:STDOUT: %too_many.var: ref = var too_many // CHECK:STDOUT: %too_many: ref = bind_name too_many, %too_many.var // CHECK:STDOUT: %int.make_type_32.loc35: init type = call constants.%Int32() [template = i32] @@ -379,6 +1083,8 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.loc35_42: i32 = int_value 1 [template = constants.%.1] // CHECK:STDOUT: %.loc35_45: i32 = int_value 2 [template = constants.%.2] // CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%.loc35_42, %.loc35_45) +// CHECK:STDOUT: %.loc35_23.1: type = value_of_initializer %int.make_type_32.loc35 [template = i32] +// CHECK:STDOUT: %.loc35_23.2: type = converted %int.make_type_32.loc35, %.loc35_23.1 [template = i32] // CHECK:STDOUT: %bad_return_type.var: ref = var bad_return_type // CHECK:STDOUT: %bad_return_type: ref = bind_name bad_return_type, %bad_return_type.var // CHECK:STDOUT: %int.make_type_32.loc43: init type = call constants.%Int32() [template = i32] diff --git a/toolchain/check/testdata/builtins/int/udiv.carbon b/toolchain/check/testdata/builtins/int/udiv.carbon index 724806875494b..194b965c47d63 100644 --- a/toolchain/check/testdata/builtins/int/udiv.carbon +++ b/toolchain/check/testdata/builtins/int/udiv.carbon @@ -64,19 +64,147 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %.1: i32 = int_value 3 [template] // CHECK:STDOUT: %.2: i32 = int_value 2 [template] // CHECK:STDOUT: %.3: i32 = int_value 1 [template] -// CHECK:STDOUT: %.4: type = array_type %.3, i32 [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.8: %.4 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.11: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.13: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.19: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.20: %.19 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.21: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.23: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.24: %.23 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.28: = bound_method %.3, %Convert.15 [template] +// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.30: type = array_type %.29, i32 [template] +// CHECK:STDOUT: %.31: type = ptr_type %.30 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.27] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -119,15 +247,27 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %int.udiv: init i32 = call %Div.ref(%.loc4_20, %.loc4_23) [template = constants.%.3] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_25: type = array_type %int.udiv, i32 [template = constants.%.4] -// CHECK:STDOUT: %arr.var: ref %.4 = var arr -// CHECK:STDOUT: %arr: ref %.4 = bind_name arr, %arr.var +// CHECK:STDOUT: %.loc4_19.1: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.udiv, %.loc4_19.1 [template = constants.%.28] +// CHECK:STDOUT: %.loc4_19.3: i32 = value_of_initializer %int.udiv [template = constants.%.3] +// CHECK:STDOUT: %.loc4_19.4: i32 = converted %int.udiv, %.loc4_19.3 [template = constants.%.3] +// CHECK:STDOUT: %int.convert_checked.loc4: init Core.IntLiteral = call %.loc4_19.2(%.loc4_19.4) [template = constants.%.29] +// CHECK:STDOUT: %.loc4_19.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = converted %int.udiv, %.loc4_19.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_25: type = array_type %.loc4_19.6, i32 [template = constants.%.30] +// CHECK:STDOUT: %arr.var: ref %.30 = var arr +// CHECK:STDOUT: %arr: ref %.30 = bind_name arr, %arr.var // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_18: i32 = int_value 1 [template = constants.%.3] +// CHECK:STDOUT: %.loc5_18.1: i32 = int_value 1 [template = constants.%.3] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.4] -// CHECK:STDOUT: %.loc5_20: type = ptr_type %.4 [template = constants.%.5] +// CHECK:STDOUT: %.loc5_18.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc5_18.3: = bound_method %.loc5_18.1, %.loc5_18.2 [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc5: init Core.IntLiteral = call %.loc5_18.3(%.loc5_18.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc5_18.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc5 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_18.5: Core.IntLiteral = converted %.loc5_18.1, %.loc5_18.4 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18.5, i32 [template = constants.%.30] +// CHECK:STDOUT: %.loc5_20: type = ptr_type %.30 [template = constants.%.31] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 @@ -154,10 +294,292 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.4) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: %.2: @As.%.1 (%.17) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.18)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.25)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.26)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Div(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.udiv"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Div.ref: %Div.type = name_ref Div, file.%Div.decl [template = constants.%Div] @@ -171,12 +593,290 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %.4 = name_ref arr, file.%arr -// CHECK:STDOUT: %.loc5: %.5 = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %.5 = bind_name arr_p, %.loc5 +// CHECK:STDOUT: %arr.ref: ref %.30 = name_ref arr, file.%arr +// CHECK:STDOUT: %.loc5: %.31 = addr_of %arr.ref +// CHECK:STDOUT: %arr_p: %.31 = bind_name arr_p, %.loc5 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.2 => constants.%.7 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %.2 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: %.2 => constants.%.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.23 +// CHECK:STDOUT: %.2 => constants.%.24 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- overflow.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { diff --git a/toolchain/check/testdata/builtins/int/umod.carbon b/toolchain/check/testdata/builtins/int/umod.carbon index 8182d124ea3e0..16f9724e0ffcf 100644 --- a/toolchain/check/testdata/builtins/int/umod.carbon +++ b/toolchain/check/testdata/builtins/int/umod.carbon @@ -66,19 +66,147 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %.1: i32 = int_value 5 [template] // CHECK:STDOUT: %.2: i32 = int_value 3 [template] // CHECK:STDOUT: %.3: i32 = int_value 2 [template] -// CHECK:STDOUT: %.4: type = array_type %.3, i32 [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.8: %.4 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.11: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.13: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.19: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.20: %.19 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.21: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.23: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.24: %.23 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.28: = bound_method %.3, %Convert.15 [template] +// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.30: type = array_type %.29, i32 [template] +// CHECK:STDOUT: %.31: type = ptr_type %.30 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.27] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -121,15 +249,27 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %int.umod: init i32 = call %Mod.ref(%.loc4_20, %.loc4_23) [template = constants.%.3] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_25: type = array_type %int.umod, i32 [template = constants.%.4] -// CHECK:STDOUT: %arr.var: ref %.4 = var arr -// CHECK:STDOUT: %arr: ref %.4 = bind_name arr, %arr.var +// CHECK:STDOUT: %.loc4_19.1: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.umod, %.loc4_19.1 [template = constants.%.28] +// CHECK:STDOUT: %.loc4_19.3: i32 = value_of_initializer %int.umod [template = constants.%.3] +// CHECK:STDOUT: %.loc4_19.4: i32 = converted %int.umod, %.loc4_19.3 [template = constants.%.3] +// CHECK:STDOUT: %int.convert_checked.loc4: init Core.IntLiteral = call %.loc4_19.2(%.loc4_19.4) [template = constants.%.29] +// CHECK:STDOUT: %.loc4_19.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = converted %int.umod, %.loc4_19.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_25: type = array_type %.loc4_19.6, i32 [template = constants.%.30] +// CHECK:STDOUT: %arr.var: ref %.30 = var arr +// CHECK:STDOUT: %arr: ref %.30 = bind_name arr, %arr.var // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_18: i32 = int_value 2 [template = constants.%.3] +// CHECK:STDOUT: %.loc5_18.1: i32 = int_value 2 [template = constants.%.3] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.4] -// CHECK:STDOUT: %.loc5_20: type = ptr_type %.4 [template = constants.%.5] +// CHECK:STDOUT: %.loc5_18.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc5_18.3: = bound_method %.loc5_18.1, %.loc5_18.2 [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc5: init Core.IntLiteral = call %.loc5_18.3(%.loc5_18.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc5_18.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc5 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_18.5: Core.IntLiteral = converted %.loc5_18.1, %.loc5_18.4 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18.5, i32 [template = constants.%.30] +// CHECK:STDOUT: %.loc5_20: type = ptr_type %.30 [template = constants.%.31] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 @@ -156,10 +296,292 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.4) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: %.2: @As.%.1 (%.17) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.18)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.25)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.26)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Mod(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.umod"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Mod.ref: %Mod.type = name_ref Mod, file.%Mod.decl [template = constants.%Mod] @@ -173,12 +595,290 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %.4 = name_ref arr, file.%arr -// CHECK:STDOUT: %.loc5: %.5 = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %.5 = bind_name arr_p, %.loc5 +// CHECK:STDOUT: %arr.ref: ref %.30 = name_ref arr, file.%arr +// CHECK:STDOUT: %.loc5: %.31 = addr_of %arr.ref +// CHECK:STDOUT: %arr_p: %.31 = bind_name arr_p, %.loc5 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.2 => constants.%.7 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %.2 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: %.2 => constants.%.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.23 +// CHECK:STDOUT: %.2 => constants.%.24 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- overflow.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { diff --git a/toolchain/check/testdata/builtins/int/umul.carbon b/toolchain/check/testdata/builtins/int/umul.carbon index 72b9447d283e2..de82ff9a5f017 100644 --- a/toolchain/check/testdata/builtins/int/umul.carbon +++ b/toolchain/check/testdata/builtins/int/umul.carbon @@ -39,19 +39,147 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %.1: i32 = int_value 3 [template] // CHECK:STDOUT: %.2: i32 = int_value 2 [template] // CHECK:STDOUT: %.3: i32 = int_value 6 [template] -// CHECK:STDOUT: %.4: type = array_type %.3, i32 [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.8: %.4 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.11: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.13: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.19: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.20: %.19 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.21: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.23: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.24: %.23 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.28: = bound_method %.3, %Convert.15 [template] +// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 6 [template] +// CHECK:STDOUT: %.30: type = array_type %.29, i32 [template] +// CHECK:STDOUT: %.31: type = ptr_type %.30 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.27] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -94,15 +222,27 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %int.umul: init i32 = call %Mul.ref(%.loc4_20, %.loc4_23) [template = constants.%.3] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_25: type = array_type %int.umul, i32 [template = constants.%.4] -// CHECK:STDOUT: %arr.var: ref %.4 = var arr -// CHECK:STDOUT: %arr: ref %.4 = bind_name arr, %arr.var +// CHECK:STDOUT: %.loc4_19.1: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.umul, %.loc4_19.1 [template = constants.%.28] +// CHECK:STDOUT: %.loc4_19.3: i32 = value_of_initializer %int.umul [template = constants.%.3] +// CHECK:STDOUT: %.loc4_19.4: i32 = converted %int.umul, %.loc4_19.3 [template = constants.%.3] +// CHECK:STDOUT: %int.convert_checked.loc4: init Core.IntLiteral = call %.loc4_19.2(%.loc4_19.4) [template = constants.%.29] +// CHECK:STDOUT: %.loc4_19.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = converted %int.umul, %.loc4_19.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_25: type = array_type %.loc4_19.6, i32 [template = constants.%.30] +// CHECK:STDOUT: %arr.var: ref %.30 = var arr +// CHECK:STDOUT: %arr: ref %.30 = bind_name arr, %arr.var // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_18: i32 = int_value 6 [template = constants.%.3] +// CHECK:STDOUT: %.loc5_18.1: i32 = int_value 6 [template = constants.%.3] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.4] -// CHECK:STDOUT: %.loc5_20: type = ptr_type %.4 [template = constants.%.5] +// CHECK:STDOUT: %.loc5_18.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc5_18.3: = bound_method %.loc5_18.1, %.loc5_18.2 [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc5: init Core.IntLiteral = call %.loc5_18.3(%.loc5_18.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc5_18.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc5 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_18.5: Core.IntLiteral = converted %.loc5_18.1, %.loc5_18.4 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18.5, i32 [template = constants.%.30] +// CHECK:STDOUT: %.loc5_20: type = ptr_type %.30 [template = constants.%.31] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 @@ -129,10 +269,292 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.4) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: %.2: @As.%.1 (%.17) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.18)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.25)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.26)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Mul(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.umul"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Mul.ref: %Mul.type = name_ref Mul, file.%Mul.decl [template = constants.%Mul] @@ -146,12 +568,290 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %.4 = name_ref arr, file.%arr -// CHECK:STDOUT: %.loc5: %.5 = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %.5 = bind_name arr_p, %.loc5 +// CHECK:STDOUT: %arr.ref: ref %.30 = name_ref arr, file.%arr +// CHECK:STDOUT: %.loc5: %.31 = addr_of %arr.ref +// CHECK:STDOUT: %arr_p: %.31 = bind_name arr_p, %.loc5 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.2 => constants.%.7 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %.2 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: %.2 => constants.%.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.23 +// CHECK:STDOUT: %.2 => constants.%.24 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- overflow.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { diff --git a/toolchain/check/testdata/builtins/int/unegate.carbon b/toolchain/check/testdata/builtins/int/unegate.carbon index 20849dcbaf67c..986bf1792ba62 100644 --- a/toolchain/check/testdata/builtins/int/unegate.carbon +++ b/toolchain/check/testdata/builtins/int/unegate.carbon @@ -122,21 +122,149 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] // CHECK:STDOUT: %.1: i32 = int_value 123 [template] // CHECK:STDOUT: %.2: i32 = int_value -123 [template] -// CHECK:STDOUT: %.3: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: i32 = int_value 1 [template] -// CHECK:STDOUT: %.6: i32 = int_value -1 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.3: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.5: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.7: %.3 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.8: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.10: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.10)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.11: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.12: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.12)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.17: %.16 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.18: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.19: %.18 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.10)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.20: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.12)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.21: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.22: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.23: %.22 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] +// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 123 [template] +// CHECK:STDOUT: %.29: type = array_type %.28, i32 [template] +// CHECK:STDOUT: %.30: type = ptr_type %.29 [template] +// CHECK:STDOUT: %.31: i32 = int_value 1 [template] +// CHECK:STDOUT: %.32: i32 = int_value -1 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.26] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.10)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.12)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.10)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.12)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -176,15 +304,27 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %int.unegate.loc4_22: init i32 = call %Negate.ref.loc4_16(%.loc4_29.2) [template = constants.%.1] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_35: type = array_type %int.unegate.loc4_22, i32 [template = constants.%.3] -// CHECK:STDOUT: %arr.var: ref %.3 = var arr -// CHECK:STDOUT: %arr: ref %.3 = bind_name arr, %arr.var +// CHECK:STDOUT: %.loc4_22.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_22.2: = bound_method %int.unegate.loc4_22, %.loc4_22.1 [template = constants.%.27] +// CHECK:STDOUT: %.loc4_22.3: i32 = value_of_initializer %int.unegate.loc4_22 [template = constants.%.1] +// CHECK:STDOUT: %.loc4_22.4: i32 = converted %int.unegate.loc4_22, %.loc4_22.3 [template = constants.%.1] +// CHECK:STDOUT: %int.convert_checked.loc4: init Core.IntLiteral = call %.loc4_22.2(%.loc4_22.4) [template = constants.%.28] +// CHECK:STDOUT: %.loc4_22.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4 [template = constants.%.28] +// CHECK:STDOUT: %.loc4_22.6: Core.IntLiteral = converted %int.unegate.loc4_22, %.loc4_22.5 [template = constants.%.28] +// CHECK:STDOUT: %.loc4_35: type = array_type %.loc4_22.6, i32 [template = constants.%.29] +// CHECK:STDOUT: %arr.var: ref %.29 = var arr +// CHECK:STDOUT: %arr: ref %.29 = bind_name arr, %arr.var // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_18: i32 = int_value 123 [template = constants.%.1] +// CHECK:STDOUT: %.loc5_18.1: i32 = int_value 123 [template = constants.%.1] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_21: type = array_type %.loc5_18, i32 [template = constants.%.3] -// CHECK:STDOUT: %.loc5_22: type = ptr_type %.3 [template = constants.%.4] +// CHECK:STDOUT: %.loc5_18.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc5_18.3: = bound_method %.loc5_18.1, %.loc5_18.2 [template = constants.%.27] +// CHECK:STDOUT: %int.convert_checked.loc5: init Core.IntLiteral = call %.loc5_18.3(%.loc5_18.1) [template = constants.%.28] +// CHECK:STDOUT: %.loc5_18.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc5 [template = constants.%.28] +// CHECK:STDOUT: %.loc5_18.5: Core.IntLiteral = converted %.loc5_18.1, %.loc5_18.4 [template = constants.%.28] +// CHECK:STDOUT: %.loc5_21: type = array_type %.loc5_18.5, i32 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_22: type = ptr_type %.29 [template = constants.%.30] // CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] // CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_32.loc7, %.loc7_8.1 [template = i32] @@ -214,10 +354,292 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.3)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.3) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.16)] +// CHECK:STDOUT: %.2: @As.%.1 (%.16) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.17)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.20)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.25)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Negate(%a.param_patt: i32) -> i32 = "int.unegate"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.10) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.12) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.10) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.12) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] @@ -230,18 +652,296 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %.3 = name_ref arr, file.%arr -// CHECK:STDOUT: %.loc5: %.4 = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %.4 = bind_name arr_p, %.loc5 +// CHECK:STDOUT: %arr.ref: ref %.29 = name_ref arr, file.%arr +// CHECK:STDOUT: %.loc5: %.30 = addr_of %arr.ref +// CHECK:STDOUT: %arr_p: %.30 = bind_name arr_p, %.loc5 // CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc7_21: i32 = int_value 1 [template = constants.%.5] -// CHECK:STDOUT: %int.unegate: init i32 = call %Negate.ref(%.loc7_21) [template = constants.%.6] -// CHECK:STDOUT: %.loc7_23.1: i32 = value_of_initializer %int.unegate [template = constants.%.6] -// CHECK:STDOUT: %.loc7_23.2: i32 = converted %int.unegate, %.loc7_23.1 [template = constants.%.6] +// CHECK:STDOUT: %.loc7_21: i32 = int_value 1 [template = constants.%.31] +// CHECK:STDOUT: %int.unegate: init i32 = call %Negate.ref(%.loc7_21) [template = constants.%.32] +// CHECK:STDOUT: %.loc7_23.1: i32 = value_of_initializer %int.unegate [template = constants.%.32] +// CHECK:STDOUT: %.loc7_23.2: i32 = converted %int.unegate, %.loc7_23.1 [template = constants.%.32] // CHECK:STDOUT: %n: i32 = bind_name n, %.loc7_23.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %.2 => constants.%.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: %.2 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.10) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.12) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.18 +// CHECK:STDOUT: %.2 => constants.%.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.10) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.12) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.22 +// CHECK:STDOUT: %.2 => constants.%.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_bad_decl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -366,6 +1066,8 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %int.make_type_32.loc25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, %TooFew.decl [template = constants.%TooFew] // CHECK:STDOUT: %TooFew.call: init i32 = call %TooFew.ref() +// CHECK:STDOUT: %.loc25_15.1: type = value_of_initializer %int.make_type_32.loc25 [template = i32] +// CHECK:STDOUT: %.loc25_15.2: type = converted %int.make_type_32.loc25, %.loc25_15.1 [template = i32] // CHECK:STDOUT: %too_few.var: ref = var too_few // CHECK:STDOUT: %too_few: ref = bind_name too_few, %too_few.var // CHECK:STDOUT: %int.make_type_32.loc30: init type = call constants.%Int32() [template = i32] @@ -373,12 +1075,16 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.loc30_29: i32 = int_value 1 [template = constants.%.1] // CHECK:STDOUT: %.loc30_32: i32 = int_value 2 [template = constants.%.2] // CHECK:STDOUT: %TooMany.call: init i32 = call %TooMany.ref(%.loc30_29, %.loc30_32) +// CHECK:STDOUT: %.loc30_16.1: type = value_of_initializer %int.make_type_32.loc30 [template = i32] +// CHECK:STDOUT: %.loc30_16.2: type = converted %int.make_type_32.loc30, %.loc30_16.1 [template = i32] // CHECK:STDOUT: %too_many.var: ref = var too_many // CHECK:STDOUT: %too_many: ref = bind_name too_many, %too_many.var // CHECK:STDOUT: %int.make_type_32.loc35: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, %BadReturnType.decl [template = constants.%BadReturnType] -// CHECK:STDOUT: %.loc35: i32 = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%.loc35) +// CHECK:STDOUT: %.loc35_42: i32 = int_value 1 [template = constants.%.1] +// CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%.loc35_42) +// CHECK:STDOUT: %.loc35_23.1: type = value_of_initializer %int.make_type_32.loc35 [template = i32] +// CHECK:STDOUT: %.loc35_23.2: type = converted %int.make_type_32.loc35, %.loc35_23.1 [template = i32] // CHECK:STDOUT: %bad_return_type.var: ref = var bad_return_type // CHECK:STDOUT: %bad_return_type: ref = bind_name bad_return_type, %bad_return_type.var // CHECK:STDOUT: %int.make_type_32.loc44: init type = call constants.%Int32() [template = i32] diff --git a/toolchain/check/testdata/builtins/int/usub.carbon b/toolchain/check/testdata/builtins/int/usub.carbon index de8ce3cd35a05..546e031894d1b 100644 --- a/toolchain/check/testdata/builtins/int/usub.carbon +++ b/toolchain/check/testdata/builtins/int/usub.carbon @@ -40,19 +40,147 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %.1: i32 = int_value 3 [template] // CHECK:STDOUT: %.2: i32 = int_value 2 [template] // CHECK:STDOUT: %.3: i32 = int_value 1 [template] -// CHECK:STDOUT: %.4: type = array_type %.3, i32 [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.8: %.4 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.11: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.13: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.19: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.20: %.19 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.21: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.23: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.24: %.23 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.28: = bound_method %.3, %Convert.15 [template] +// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.30: type = array_type %.29, i32 [template] +// CHECK:STDOUT: %.31: type = ptr_type %.30 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.27] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -95,15 +223,27 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %int.usub: init i32 = call %Sub.ref(%.loc4_20, %.loc4_23) [template = constants.%.3] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_25: type = array_type %int.usub, i32 [template = constants.%.4] -// CHECK:STDOUT: %arr.var: ref %.4 = var arr -// CHECK:STDOUT: %arr: ref %.4 = bind_name arr, %arr.var +// CHECK:STDOUT: %.loc4_19.1: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.usub, %.loc4_19.1 [template = constants.%.28] +// CHECK:STDOUT: %.loc4_19.3: i32 = value_of_initializer %int.usub [template = constants.%.3] +// CHECK:STDOUT: %.loc4_19.4: i32 = converted %int.usub, %.loc4_19.3 [template = constants.%.3] +// CHECK:STDOUT: %int.convert_checked.loc4: init Core.IntLiteral = call %.loc4_19.2(%.loc4_19.4) [template = constants.%.29] +// CHECK:STDOUT: %.loc4_19.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = converted %int.usub, %.loc4_19.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_25: type = array_type %.loc4_19.6, i32 [template = constants.%.30] +// CHECK:STDOUT: %arr.var: ref %.30 = var arr +// CHECK:STDOUT: %arr: ref %.30 = bind_name arr, %arr.var // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_18: i32 = int_value 1 [template = constants.%.3] +// CHECK:STDOUT: %.loc5_18.1: i32 = int_value 1 [template = constants.%.3] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.4] -// CHECK:STDOUT: %.loc5_20: type = ptr_type %.4 [template = constants.%.5] +// CHECK:STDOUT: %.loc5_18.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc5_18.3: = bound_method %.loc5_18.1, %.loc5_18.2 [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc5: init Core.IntLiteral = call %.loc5_18.3(%.loc5_18.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc5_18.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc5 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_18.5: Core.IntLiteral = converted %.loc5_18.1, %.loc5_18.4 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18.5, i32 [template = constants.%.30] +// CHECK:STDOUT: %.loc5_20: type = ptr_type %.30 [template = constants.%.31] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 @@ -130,10 +270,292 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.4) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: %.2: @As.%.1 (%.17) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.18)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.25)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.26)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Sub(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.usub"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Sub.ref: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] @@ -147,12 +569,290 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %.4 = name_ref arr, file.%arr -// CHECK:STDOUT: %.loc5: %.5 = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %.5 = bind_name arr_p, %.loc5 +// CHECK:STDOUT: %arr.ref: ref %.30 = name_ref arr, file.%arr +// CHECK:STDOUT: %.loc5: %.31 = addr_of %arr.ref +// CHECK:STDOUT: %arr_p: %.31 = bind_name arr_p, %.loc5 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.2 => constants.%.7 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %.2 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: %.2 => constants.%.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.23 +// CHECK:STDOUT: %.2 => constants.%.24 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- overflow.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { diff --git a/toolchain/check/testdata/builtins/int/xor.carbon b/toolchain/check/testdata/builtins/int/xor.carbon index 7a4523157c785..9a9be0ad01441 100644 --- a/toolchain/check/testdata/builtins/int/xor.carbon +++ b/toolchain/check/testdata/builtins/int/xor.carbon @@ -30,19 +30,147 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %.1: i32 = int_value 12 [template] // CHECK:STDOUT: %.2: i32 = int_value 10 [template] // CHECK:STDOUT: %.3: i32 = int_value 6 [template] -// CHECK:STDOUT: %.4: type = array_type %.3, i32 [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.8: %.4 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.11: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.13: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.19: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.20: %.19 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.21: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.23: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.24: %.23 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.28: = bound_method %.3, %Convert.15 [template] +// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 6 [template] +// CHECK:STDOUT: %.30: type = array_type %.29, i32 [template] +// CHECK:STDOUT: %.31: type = ptr_type %.30 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.27] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -85,15 +213,27 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %int.xor: init i32 = call %Xor.ref(%.loc4_20, %.loc4_24) [template = constants.%.3] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_27: type = array_type %int.xor, i32 [template = constants.%.4] -// CHECK:STDOUT: %arr.var: ref %.4 = var arr -// CHECK:STDOUT: %arr: ref %.4 = bind_name arr, %arr.var +// CHECK:STDOUT: %.loc4_19.1: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.xor, %.loc4_19.1 [template = constants.%.28] +// CHECK:STDOUT: %.loc4_19.3: i32 = value_of_initializer %int.xor [template = constants.%.3] +// CHECK:STDOUT: %.loc4_19.4: i32 = converted %int.xor, %.loc4_19.3 [template = constants.%.3] +// CHECK:STDOUT: %int.convert_checked.loc4: init Core.IntLiteral = call %.loc4_19.2(%.loc4_19.4) [template = constants.%.29] +// CHECK:STDOUT: %.loc4_19.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = converted %int.xor, %.loc4_19.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_27: type = array_type %.loc4_19.6, i32 [template = constants.%.30] +// CHECK:STDOUT: %arr.var: ref %.30 = var arr +// CHECK:STDOUT: %arr: ref %.30 = bind_name arr, %arr.var // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_18: i32 = int_value 6 [template = constants.%.3] +// CHECK:STDOUT: %.loc5_18.1: i32 = int_value 6 [template = constants.%.3] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.4] -// CHECK:STDOUT: %.loc5_20: type = ptr_type %.4 [template = constants.%.5] +// CHECK:STDOUT: %.loc5_18.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc5_18.3: = bound_method %.loc5_18.1, %.loc5_18.2 [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc5: init Core.IntLiteral = call %.loc5_18.3(%.loc5_18.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc5_18.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc5 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_18.5: Core.IntLiteral = converted %.loc5_18.1, %.loc5_18.4 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18.5, i32 [template = constants.%.30] +// CHECK:STDOUT: %.loc5_20: type = ptr_type %.30 [template = constants.%.31] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 @@ -120,10 +260,292 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.4) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: %.2: @As.%.1 (%.17) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.18)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.25)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.26)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Xor(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.xor"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Xor.ref: %Xor.type = name_ref Xor, file.%Xor.decl [template = constants.%Xor] @@ -137,9 +559,287 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %.4 = name_ref arr, file.%arr -// CHECK:STDOUT: %.loc5: %.5 = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %.5 = bind_name arr_p, %.loc5 +// CHECK:STDOUT: %arr.ref: ref %.30 = name_ref arr, file.%arr +// CHECK:STDOUT: %.loc5: %.31 = addr_of %arr.ref +// CHECK:STDOUT: %arr_p: %.31 = bind_name arr_p, %.loc5 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.2 => constants.%.7 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %.2 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: %.2 => constants.%.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.23 +// CHECK:STDOUT: %.2 => constants.%.24 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/extend_adapt.carbon b/toolchain/check/testdata/class/extend_adapt.carbon index ed000b3c010ed..010214330f0e9 100644 --- a/toolchain/check/testdata/class/extend_adapt.carbon +++ b/toolchain/check/testdata/class/extend_adapt.carbon @@ -633,6 +633,8 @@ class StructAdapter { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.12) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -640,6 +642,8 @@ class StructAdapter { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.14) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -647,6 +651,8 @@ class StructAdapter { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -654,6 +660,8 @@ class StructAdapter { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.14)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -669,6 +677,8 @@ class StructAdapter { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.12) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -676,6 +686,8 @@ class StructAdapter { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.14) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -683,6 +695,8 @@ class StructAdapter { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -690,6 +704,8 @@ class StructAdapter { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.14)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1408,6 +1424,8 @@ class StructAdapter { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.13) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1415,6 +1433,8 @@ class StructAdapter { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.15) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1422,6 +1442,8 @@ class StructAdapter { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1429,6 +1451,8 @@ class StructAdapter { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.15)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1444,6 +1468,8 @@ class StructAdapter { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.13) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1451,6 +1477,8 @@ class StructAdapter { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.15) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1458,6 +1486,8 @@ class StructAdapter { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1465,6 +1495,8 @@ class StructAdapter { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.15)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon b/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon index c252525d0b9ec..1bf9b2154e2ea 100644 --- a/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon +++ b/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon @@ -480,6 +480,8 @@ class C { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -487,6 +489,8 @@ class C { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -494,6 +498,8 @@ class C { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -501,6 +507,8 @@ class C { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -516,6 +524,8 @@ class C { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -523,6 +533,8 @@ class C { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -530,6 +542,8 @@ class C { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -537,6 +551,8 @@ class C { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1217,6 +1233,8 @@ class C { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1224,6 +1242,8 @@ class C { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1231,6 +1251,8 @@ class C { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1238,6 +1260,8 @@ class C { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1253,6 +1277,8 @@ class C { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1260,6 +1286,8 @@ class C { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1267,6 +1295,8 @@ class C { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1274,6 +1304,8 @@ class C { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_base_bad_type.carbon b/toolchain/check/testdata/class/fail_base_bad_type.carbon index fa11e46771d66..d133f5f2230d8 100644 --- a/toolchain/check/testdata/class/fail_base_bad_type.carbon +++ b/toolchain/check/testdata/class/fail_base_bad_type.carbon @@ -639,6 +639,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -646,6 +648,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -653,6 +657,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -660,6 +666,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -675,6 +683,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -682,6 +692,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -689,6 +701,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -696,6 +710,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1423,6 +1439,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.10) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1430,6 +1448,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.12) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1437,6 +1457,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1444,6 +1466,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1459,6 +1483,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.10) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1466,6 +1492,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.12) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1473,6 +1501,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1480,6 +1510,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2219,6 +2251,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.13) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2226,6 +2260,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.15) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2233,6 +2269,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2240,6 +2278,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.15)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2255,6 +2295,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.13) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2262,6 +2304,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.15) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2269,6 +2313,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2276,6 +2322,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.15)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3012,6 +3060,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3019,6 +3069,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.13) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3026,6 +3078,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3033,6 +3087,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3048,6 +3104,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3055,6 +3113,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.13) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3062,6 +3122,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3069,6 +3131,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3793,6 +3857,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.10) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3800,6 +3866,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.12) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3807,6 +3875,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3814,6 +3884,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3829,6 +3901,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.10) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3836,6 +3910,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.12) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3843,6 +3919,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3850,6 +3928,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon b/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon index 5c6c83325f63b..c768fd754bd7c 100644 --- a/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon +++ b/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon @@ -451,6 +451,8 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.16)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.16) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -458,6 +460,8 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.18)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.18) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -465,6 +469,8 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.16)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.16)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -472,6 +478,8 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.18)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.18)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -487,6 +495,8 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.16)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.16) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -494,6 +504,8 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.18)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.18) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -501,6 +513,8 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.16)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.16)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -508,6 +522,8 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.18)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.18)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_derived_to_base.carbon b/toolchain/check/testdata/class/fail_derived_to_base.carbon index 055e4f8501670..52efe1eeb27ac 100644 --- a/toolchain/check/testdata/class/fail_derived_to_base.carbon +++ b/toolchain/check/testdata/class/fail_derived_to_base.carbon @@ -517,6 +517,8 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.22)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.22) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -524,6 +526,8 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.24)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.24) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -531,6 +535,8 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.22)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.22)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -538,6 +544,8 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.24)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.24)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -553,6 +561,8 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.22)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.22) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -560,6 +570,8 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.24)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.24) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -567,6 +579,8 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.22)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.22)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -574,6 +588,8 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.24)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.24)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_self.carbon b/toolchain/check/testdata/class/fail_self.carbon index f69d01ec53442..397a1c01626b2 100644 --- a/toolchain/check/testdata/class/fail_self.carbon +++ b/toolchain/check/testdata/class/fail_self.carbon @@ -518,6 +518,8 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -525,6 +527,8 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.13) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -532,6 +536,8 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -539,6 +545,8 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -554,6 +562,8 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -561,6 +571,8 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.13) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -568,6 +580,8 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -575,6 +589,8 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/base_is_generic.carbon b/toolchain/check/testdata/class/generic/base_is_generic.carbon index 3d52de729ad4c..932dd43f6d1bc 100644 --- a/toolchain/check/testdata/class/generic/base_is_generic.carbon +++ b/toolchain/check/testdata/class/generic/base_is_generic.carbon @@ -1213,6 +1213,8 @@ fn H() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.19)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.19) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1220,6 +1222,8 @@ fn H() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.21)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.21) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1227,6 +1231,8 @@ fn H() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.19)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.19)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1234,6 +1240,8 @@ fn H() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.21)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.21)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1249,6 +1257,8 @@ fn H() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.19)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.19) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1256,6 +1266,8 @@ fn H() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.21)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.21) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1263,6 +1275,8 @@ fn H() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.19)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.19)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1270,6 +1284,8 @@ fn H() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.21)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.21)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/call.carbon b/toolchain/check/testdata/class/generic/call.carbon index a1253a4f053d3..e4fe7bf6cfdcf 100644 --- a/toolchain/check/testdata/class/generic/call.carbon +++ b/toolchain/check/testdata/class/generic/call.carbon @@ -779,6 +779,8 @@ class Outer(T:! type) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.12) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -786,6 +788,8 @@ class Outer(T:! type) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.14) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -793,6 +797,8 @@ class Outer(T:! type) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -800,6 +806,8 @@ class Outer(T:! type) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.14)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -815,6 +823,8 @@ class Outer(T:! type) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.12) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -822,6 +832,8 @@ class Outer(T:! type) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.14) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -829,6 +841,8 @@ class Outer(T:! type) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -836,6 +850,8 @@ class Outer(T:! type) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.14)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/import.carbon b/toolchain/check/testdata/class/generic/import.carbon index c7ed74fb29a78..bfb4fedc1cedc 100644 --- a/toolchain/check/testdata/class/generic/import.carbon +++ b/toolchain/check/testdata/class/generic/import.carbon @@ -1034,6 +1034,8 @@ class Class(U:! type) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.15)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.15) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1041,6 +1043,8 @@ class Class(U:! type) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.17)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.17) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1048,6 +1052,8 @@ class Class(U:! type) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.15)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.15)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1055,6 +1061,8 @@ class Class(U:! type) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.17)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.17)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1070,6 +1078,8 @@ class Class(U:! type) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.15)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.15) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1077,6 +1087,8 @@ class Class(U:! type) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.17)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.17) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1084,6 +1096,8 @@ class Class(U:! type) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.15)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.15)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1091,6 +1105,8 @@ class Class(U:! type) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.17)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.17)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/member_access.carbon b/toolchain/check/testdata/class/generic/member_access.carbon index eadf6c37cef8b..074265c09ed53 100644 --- a/toolchain/check/testdata/class/generic/member_access.carbon +++ b/toolchain/check/testdata/class/generic/member_access.carbon @@ -842,6 +842,8 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.12) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -849,6 +851,8 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.14) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -856,6 +860,8 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -863,6 +869,8 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.14)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -878,6 +886,8 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.12) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -885,6 +895,8 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.14) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -892,6 +904,8 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -899,6 +913,8 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.14)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/stringify.carbon b/toolchain/check/testdata/class/generic/stringify.carbon index adacba77a3717..bae17e27e4d7a 100644 --- a/toolchain/check/testdata/class/generic/stringify.carbon +++ b/toolchain/check/testdata/class/generic/stringify.carbon @@ -432,6 +432,8 @@ var w: Outer({}*).Inner({.a: i32}*) = v; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -439,6 +441,8 @@ var w: Outer({}*).Inner({.a: i32}*) = v; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.13) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -446,6 +450,8 @@ var w: Outer({}*).Inner({.a: i32}*) = v; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -453,6 +459,8 @@ var w: Outer({}*).Inner({.a: i32}*) = v; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -468,6 +476,8 @@ var w: Outer({}*).Inner({.a: i32}*) = v; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -475,6 +485,8 @@ var w: Outer({}*).Inner({.a: i32}*) = v; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.13) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -482,6 +494,8 @@ var w: Outer({}*).Inner({.a: i32}*) = v; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -489,6 +503,8 @@ var w: Outer({}*).Inner({.a: i32}*) = v; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1239,6 +1255,8 @@ var w: Outer({}*).Inner({.a: i32}*) = v; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.13) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1246,6 +1264,8 @@ var w: Outer({}*).Inner({.a: i32}*) = v; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.15) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1253,6 +1273,8 @@ var w: Outer({}*).Inner({.a: i32}*) = v; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1260,6 +1282,8 @@ var w: Outer({}*).Inner({.a: i32}*) = v; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.15)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1275,6 +1299,8 @@ var w: Outer({}*).Inner({.a: i32}*) = v; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.13) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1282,6 +1308,8 @@ var w: Outer({}*).Inner({.a: i32}*) = v; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.15) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1289,6 +1317,8 @@ var w: Outer({}*).Inner({.a: i32}*) = v; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1296,6 +1326,8 @@ var w: Outer({}*).Inner({.a: i32}*) = v; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.15)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/init_adapt.carbon b/toolchain/check/testdata/class/init_adapt.carbon index a821cad56234a..f9f239c874603 100644 --- a/toolchain/check/testdata/class/init_adapt.carbon +++ b/toolchain/check/testdata/class/init_adapt.carbon @@ -679,6 +679,8 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.15)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.15) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -686,6 +688,8 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.17)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.17) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -693,6 +697,8 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.15)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.15)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -700,6 +706,8 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.17)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.17)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -715,6 +723,8 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.15)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.15) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -722,6 +732,8 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.17)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.17) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -729,6 +741,8 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.15)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.15)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -736,6 +750,8 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.17)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.17)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/self.carbon b/toolchain/check/testdata/class/self.carbon index b28ff59b45bb1..e3a0ddfb6da35 100644 --- a/toolchain/check/testdata/class/self.carbon +++ b/toolchain/check/testdata/class/self.carbon @@ -558,6 +558,8 @@ class Class { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.8)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.8) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -565,6 +567,8 @@ class Class { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.10) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -572,6 +576,8 @@ class Class { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.8)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.8)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -579,6 +585,8 @@ class Class { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -594,6 +602,8 @@ class Class { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.8)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.8) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -601,6 +611,8 @@ class Class { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.10) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -608,6 +620,8 @@ class Class { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.8)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.8)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -615,6 +629,8 @@ class Class { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/const/fail_collapse.carbon b/toolchain/check/testdata/const/fail_collapse.carbon index 1e56a28727de3..ae6ac797a0d86 100644 --- a/toolchain/check/testdata/const/fail_collapse.carbon +++ b/toolchain/check/testdata/const/fail_collapse.carbon @@ -419,6 +419,8 @@ fn G(p: const (const i32)**) -> i32** { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.13) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -426,6 +428,8 @@ fn G(p: const (const i32)**) -> i32** { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.15) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -433,6 +437,8 @@ fn G(p: const (const i32)**) -> i32** { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -440,6 +446,8 @@ fn G(p: const (const i32)**) -> i32** { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.15)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -455,6 +463,8 @@ fn G(p: const (const i32)**) -> i32** { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.13) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -462,6 +472,8 @@ fn G(p: const (const i32)**) -> i32** { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.15) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -469,6 +481,8 @@ fn G(p: const (const i32)**) -> i32** { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -476,6 +490,8 @@ fn G(p: const (const i32)**) -> i32** { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.15)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/deduce/array.carbon b/toolchain/check/testdata/deduce/array.carbon index 1ed07bcbf5caa..ac71a1e788a56 100644 --- a/toolchain/check/testdata/deduce/array.carbon +++ b/toolchain/check/testdata/deduce/array.carbon @@ -106,30 +106,158 @@ fn G() -> C { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.3: i32 = int_value 3 [template] -// CHECK:STDOUT: %.4: type = array_type %.3, %T [symbolic] -// CHECK:STDOUT: %F.type: type = fn_type @F [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.5 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.5 [template] +// CHECK:STDOUT: %.8: %.4 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.11: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.13: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.32 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.19: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.20: %.19 = assoc_entity element0, imports.%import_ref.33 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.21: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.23: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.24: %.23 = assoc_entity element0, imports.%import_ref.43 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.28: = bound_method %.3, %Convert.15 [template] +// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.30: type = array_type %.29, %T [symbolic] +// CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [symbolic] -// CHECK:STDOUT: %.6: i32 = int_value 0 [template] +// CHECK:STDOUT: %.31: type = ptr_type %.30 [symbolic] +// CHECK:STDOUT: %.32: i32 = int_value 0 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.7: type = ptr_type %.1 [template] -// CHECK:STDOUT: %.8: type = array_type %.3, %C [template] -// CHECK:STDOUT: %.9: type = ptr_type %.8 [template] +// CHECK:STDOUT: %.33: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.34: type = array_type %.29, %C [template] +// CHECK:STDOUT: %.35: type = ptr_type %.34 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (%.1, %.1, %.1) [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] -// CHECK:STDOUT: %.10: i32 = int_value 1 [template] -// CHECK:STDOUT: %.11: i32 = int_value 2 [template] -// CHECK:STDOUT: %array: %.8 = tuple_value (%struct, %struct, %struct) [template] -// CHECK:STDOUT: %.12: = specific_function %F, @F(%C) [template] +// CHECK:STDOUT: %.36: i32 = int_value 1 [template] +// CHECK:STDOUT: %.37: i32 = int_value 2 [template] +// CHECK:STDOUT: %array: %.34 = tuple_value (%struct, %struct, %struct) [template] +// CHECK:STDOUT: %.38: = specific_function %F, @F(%C) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .ImplicitAs = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] +// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.13 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.14: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.16 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.17: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.19: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.27] +// CHECK:STDOUT: %import_ref.20: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.22 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.23: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.25 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.29: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.31 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.36 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.37: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.39 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.40: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.42 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.44: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.46 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.47: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.49 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -144,19 +272,24 @@ fn G() -> C { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %T.patt.loc6_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc6_6.1, runtime_param [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] -// CHECK:STDOUT: %a.patt: @F.%.loc6_24.2 (%.4) = binding_pattern a -// CHECK:STDOUT: %a.param_patt: @F.%.loc6_24.2 (%.4) = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %a.patt: @F.%.loc6_24.2 (%.30) = binding_pattern a +// CHECK:STDOUT: %a.param_patt: @F.%.loc6_24.2 (%.30) = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %return.patt: @F.%T.loc6_6.2 (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @F.%T.loc6_6.2 (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref.loc6_20: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] -// CHECK:STDOUT: %.loc6_23: i32 = int_value 3 [template = constants.%.3] -// CHECK:STDOUT: %.loc6_24.1: type = array_type %.loc6_23, %T [symbolic = %.loc6_24.2 (constants.%.4)] +// CHECK:STDOUT: %.loc6_23.1: i32 = int_value 3 [template = constants.%.3] +// CHECK:STDOUT: %.loc6_23.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc6_23.3: = bound_method %.loc6_23.1, %.loc6_23.2 [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc6_23.3(%.loc6_23.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc6_23.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.29] +// CHECK:STDOUT: %.loc6_23.5: Core.IntLiteral = converted %.loc6_23.1, %.loc6_23.4 [template = constants.%.29] +// CHECK:STDOUT: %.loc6_24.1: type = array_type %.loc6_23.5, %T [symbolic = %.loc6_24.2 (constants.%.30)] // CHECK:STDOUT: %T.ref.loc6_30: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc6_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc6_6.2 (constants.%T)] -// CHECK:STDOUT: %a.param: @F.%.loc6_24.2 (%.4) = value_param runtime_param0 -// CHECK:STDOUT: %a: @F.%.loc6_24.2 (%.4) = bind_name a, %a.param +// CHECK:STDOUT: %a.param: @F.%.loc6_24.2 (%.30) = value_param runtime_param0 +// CHECK:STDOUT: %a: @F.%.loc6_24.2 (%.30) = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref @F.%T.loc6_6.2 (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @F.%T.loc6_6.2 (%T) = return_slot %return.param // CHECK:STDOUT: } @@ -170,218 +303,2330 @@ fn G() -> C { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: class @C { -// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%C +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.4) = assoc_entity element0, imports.%import_ref.5 [symbolic = %.2 (constants.%.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .Convert = imports.%import_ref.3 +// CHECK:STDOUT: witness = (imports.%import_ref.4) +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(%T.loc6_6.1: type) { -// CHECK:STDOUT: %T.loc6_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_6.2 (constants.%T)] -// CHECK:STDOUT: %T.patt.loc6_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] -// CHECK:STDOUT: %.loc6_24.2: type = array_type constants.%.3, @F.%T.loc6_6.2 (%T) [symbolic = %.loc6_24.2 (constants.%.4)] +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: %.2: @As.%.1 (%.17) = assoc_entity element0, imports.%import_ref.32 [symbolic = %.2 (constants.%.18)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.param_patt: type](%a.param_patt: @F.%.loc6_24.2 (%.4)) -> @F.%T.loc6_6.2 (%T) { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref: @F.%.loc6_24.2 (%.4) = name_ref a, %a -// CHECK:STDOUT: %.loc6_43: i32 = int_value 0 [template = constants.%.6] -// CHECK:STDOUT: %.loc6_44.1: ref @F.%.loc6_24.2 (%.4) = value_as_ref %a.ref -// CHECK:STDOUT: %.loc6_44.2: ref @F.%T.loc6_6.2 (%T) = array_index %.loc6_44.1, %.loc6_43 -// CHECK:STDOUT: %.loc6_44.3: @F.%T.loc6_6.2 (%T) = bind_value %.loc6_44.2 -// CHECK:STDOUT: return %.loc6_44.3 +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.26 +// CHECK:STDOUT: .Convert = imports.%import_ref.27 +// CHECK:STDOUT: witness = (imports.%import_ref.28) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G() -> %return: %C { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %C.ref.loc9: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc9_14: i32 = int_value 3 [template = constants.%.3] -// CHECK:STDOUT: %.loc9_15: type = array_type %.loc9_14, %C [template = constants.%.8] -// CHECK:STDOUT: %a.var: ref %.8 = var a -// CHECK:STDOUT: %a: ref %.8 = bind_name a, %a.var -// CHECK:STDOUT: %.loc9_21.1: %.1 = struct_literal () -// CHECK:STDOUT: %.loc9_25.1: %.1 = struct_literal () -// CHECK:STDOUT: %.loc9_29.1: %.1 = struct_literal () -// CHECK:STDOUT: %.loc9_30.1: %tuple.type = tuple_literal (%.loc9_21.1, %.loc9_25.1, %.loc9_29.1) -// CHECK:STDOUT: %.loc9_30.2: i32 = int_value 0 [template = constants.%.6] -// CHECK:STDOUT: %.loc9_30.3: ref %C = array_index %a.var, %.loc9_30.2 -// CHECK:STDOUT: %.loc9_21.2: init %C = class_init (), %.loc9_30.3 [template = constants.%struct] -// CHECK:STDOUT: %.loc9_30.4: init %C = converted %.loc9_21.1, %.loc9_21.2 [template = constants.%struct] -// CHECK:STDOUT: %.loc9_30.5: i32 = int_value 1 [template = constants.%.10] -// CHECK:STDOUT: %.loc9_30.6: ref %C = array_index %a.var, %.loc9_30.5 -// CHECK:STDOUT: %.loc9_25.2: init %C = class_init (), %.loc9_30.6 [template = constants.%struct] -// CHECK:STDOUT: %.loc9_30.7: init %C = converted %.loc9_25.1, %.loc9_25.2 [template = constants.%struct] -// CHECK:STDOUT: %.loc9_30.8: i32 = int_value 2 [template = constants.%.11] -// CHECK:STDOUT: %.loc9_30.9: ref %C = array_index %a.var, %.loc9_30.8 -// CHECK:STDOUT: %.loc9_29.2: init %C = class_init (), %.loc9_30.9 [template = constants.%struct] -// CHECK:STDOUT: %.loc9_30.10: init %C = converted %.loc9_29.1, %.loc9_29.2 [template = constants.%struct] -// CHECK:STDOUT: %.loc9_30.11: init %.8 = array_init (%.loc9_30.4, %.loc9_30.7, %.loc9_30.10) to %a.var [template = constants.%array] -// CHECK:STDOUT: %.loc9_31: init %.8 = converted %.loc9_30.1, %.loc9_30.11 [template = constants.%array] -// CHECK:STDOUT: assign %a.var, %.loc9_31 -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] -// CHECK:STDOUT: %a.ref: ref %.8 = name_ref a, %a -// CHECK:STDOUT: %.loc10_10: = specific_function %F.ref, @F(constants.%C) [template = constants.%.12] -// CHECK:STDOUT: %.loc8_8.2: ref %C = splice_block %return {} -// CHECK:STDOUT: %.loc10_12: %.8 = bind_value %a.ref -// CHECK:STDOUT: %F.call: init %C = call %.loc10_10(%.loc10_12) to %.loc8_8.2 -// CHECK:STDOUT: return %F.call to %return +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.7 as imports.%import_ref.8 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.9 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(constants.%T) { -// CHECK:STDOUT: %T.loc6_6.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc6_6.2 => constants.%T -// CHECK:STDOUT: %.loc6_24.2 => constants.%.4 +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.11 as imports.%import_ref.12 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.13 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(constants.%C) { -// CHECK:STDOUT: %T.loc6_6.2 => constants.%C -// CHECK:STDOUT: %T.patt.loc6_6.2 => constants.%C -// CHECK:STDOUT: %.loc6_24.2 => constants.%.8 +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: } +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] // CHECK:STDOUT: -// CHECK:STDOUT: --- fail_todo_bound_only.carbon +// CHECK:STDOUT: impl: imports.%import_ref.14 as imports.%import_ref.15 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.16 +// CHECK:STDOUT: } +// CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %C: type = class_type @C [template] -// CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %N: i32 = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 [symbolic] -// CHECK:STDOUT: %F.type: type = fn_type @F [template] -// CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %G.type: type = fn_type @G [template] -// CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] -// CHECK:STDOUT: %.4: i32 = int_value 3 [template] -// CHECK:STDOUT: %.5: type = array_type %.4, %C [template] -// CHECK:STDOUT: %.6: type = ptr_type %.5 [template] -// CHECK:STDOUT: %tuple.type: type = tuple_type (%.1, %.1, %.1) [template] -// CHECK:STDOUT: %.7: i32 = int_value 0 [template] -// CHECK:STDOUT: %struct: %C = struct_value () [template] -// CHECK:STDOUT: %.8: i32 = int_value 1 [template] -// CHECK:STDOUT: %.9: i32 = int_value 2 [template] -// CHECK:STDOUT: %array: %.5 = tuple_value (%struct, %struct, %struct) [template] +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.17 as imports.%import_ref.18 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.19 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.20 as imports.%import_ref.21 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.22 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %N.patt.loc10_6.1: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc10_6.2 (constants.%N.patt)] -// CHECK:STDOUT: %N.param_patt: i32 = value_param_pattern %N.patt.loc10_6.1, runtime_param [symbolic = %N.patt.loc10_6.2 (constants.%N.patt)] -// CHECK:STDOUT: %a.patt: = binding_pattern a -// CHECK:STDOUT: %a.param_patt: = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc10_10: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc10_10.1: type = value_of_initializer %int.make_type_32.loc10_10 [template = i32] -// CHECK:STDOUT: %.loc10_10.2: type = converted %int.make_type_32.loc10_10, %.loc10_10.1 [template = i32] -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %N.ref.loc10_22: i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N)] -// CHECK:STDOUT: %.loc10_23: type = array_type %N.ref.loc10_22, %C [template = ] -// CHECK:STDOUT: %int.make_type_32.loc10_29: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc10_29.1: type = value_of_initializer %int.make_type_32.loc10_29 [template = i32] -// CHECK:STDOUT: %.loc10_29.2: type = converted %int.make_type_32.loc10_29, %.loc10_29.1 [template = i32] -// CHECK:STDOUT: %N.param: i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc10_6.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc10_6.2 (constants.%N)] -// CHECK:STDOUT: %a.param: = value_param runtime_param0 -// CHECK:STDOUT: %a: = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %return.patt: %C = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param0 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc12: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %return.param: ref %C = out_param runtime_param0 -// CHECK:STDOUT: %return: ref %C = return_slot %return.param +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.23 as imports.%import_ref.24 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.25 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: class @C { -// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] -// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.29 as imports.%import_ref.30 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%C +// CHECK:STDOUT: witness = imports.%import_ref.31 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(%N.loc10_6.1: i32) { -// CHECK:STDOUT: %N.loc10_6.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc10_6.2 (constants.%N)] -// CHECK:STDOUT: %N.patt.loc10_6.2: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc10_6.2 (constants.%N.patt)] +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%N.param_patt: i32](%a.param_patt: ) -> i32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %N.ref.loc10_42: i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N)] -// CHECK:STDOUT: return %N.ref.loc10_42 +// CHECK:STDOUT: impl: imports.%import_ref.34 as imports.%import_ref.35 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.36 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G() -> %return: %C { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %C.ref.loc13: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc13_14: i32 = int_value 3 [template = constants.%.4] -// CHECK:STDOUT: %.loc13_15: type = array_type %.loc13_14, %C [template = constants.%.5] -// CHECK:STDOUT: %a.var: ref %.5 = var a -// CHECK:STDOUT: %a: ref %.5 = bind_name a, %a.var -// CHECK:STDOUT: %.loc13_21.1: %.1 = struct_literal () -// CHECK:STDOUT: %.loc13_25.1: %.1 = struct_literal () -// CHECK:STDOUT: %.loc13_29.1: %.1 = struct_literal () -// CHECK:STDOUT: %.loc13_30.1: %tuple.type = tuple_literal (%.loc13_21.1, %.loc13_25.1, %.loc13_29.1) -// CHECK:STDOUT: %.loc13_30.2: i32 = int_value 0 [template = constants.%.7] -// CHECK:STDOUT: %.loc13_30.3: ref %C = array_index %a.var, %.loc13_30.2 -// CHECK:STDOUT: %.loc13_21.2: init %C = class_init (), %.loc13_30.3 [template = constants.%struct] -// CHECK:STDOUT: %.loc13_30.4: init %C = converted %.loc13_21.1, %.loc13_21.2 [template = constants.%struct] -// CHECK:STDOUT: %.loc13_30.5: i32 = int_value 1 [template = constants.%.8] -// CHECK:STDOUT: %.loc13_30.6: ref %C = array_index %a.var, %.loc13_30.5 -// CHECK:STDOUT: %.loc13_25.2: init %C = class_init (), %.loc13_30.6 [template = constants.%struct] -// CHECK:STDOUT: %.loc13_30.7: init %C = converted %.loc13_25.1, %.loc13_25.2 [template = constants.%struct] -// CHECK:STDOUT: %.loc13_30.8: i32 = int_value 2 [template = constants.%.9] -// CHECK:STDOUT: %.loc13_30.9: ref %C = array_index %a.var, %.loc13_30.8 -// CHECK:STDOUT: %.loc13_29.2: init %C = class_init (), %.loc13_30.9 [template = constants.%struct] -// CHECK:STDOUT: %.loc13_30.10: init %C = converted %.loc13_29.1, %.loc13_29.2 [template = constants.%struct] -// CHECK:STDOUT: %.loc13_30.11: init %.5 = array_init (%.loc13_30.4, %.loc13_30.7, %.loc13_30.10) to %a.var [template = constants.%array] -// CHECK:STDOUT: %.loc13_31: init %.5 = converted %.loc13_30.1, %.loc13_30.11 [template = constants.%array] -// CHECK:STDOUT: assign %a.var, %.loc13_31 -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] -// CHECK:STDOUT: %a.ref: ref %.5 = name_ref a, %a -// CHECK:STDOUT: return to %return +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.37 as imports.%import_ref.38 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.39 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(constants.%N) { -// CHECK:STDOUT: %N.loc10_6.2 => constants.%N -// CHECK:STDOUT: %N.patt.loc10_6.2 => constants.%N +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.40 as imports.%import_ref.41 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.42 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: --- fail_todo_type_and_bound.carbon +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.25)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.44 as imports.%import_ref.45 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.46 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.26)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.47 as imports.%import_ref.48 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.49 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%C +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @F(%T.loc6_6.1: type) { +// CHECK:STDOUT: %T.loc6_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc6_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %.loc6_24.2: type = array_type constants.%.29, @F.%T.loc6_6.2 (%T) [symbolic = %.loc6_24.2 (constants.%.30)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%T.param_patt: type](%a.param_patt: @F.%.loc6_24.2 (%.30)) -> @F.%T.loc6_6.2 (%T) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %a.ref: @F.%.loc6_24.2 (%.30) = name_ref a, %a +// CHECK:STDOUT: %.loc6_43: i32 = int_value 0 [template = constants.%.32] +// CHECK:STDOUT: %.loc6_44.1: ref @F.%.loc6_24.2 (%.30) = value_as_ref %a.ref +// CHECK:STDOUT: %.loc6_44.2: ref @F.%T.loc6_6.2 (%T) = array_index %.loc6_44.1, %.loc6_43 +// CHECK:STDOUT: %.loc6_44.3: @F.%T.loc6_6.2 (%T) = bind_value %.loc6_44.2 +// CHECK:STDOUT: return %.loc6_44.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @G() -> %return: %C { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %C.ref.loc9: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %.loc9_14.1: i32 = int_value 3 [template = constants.%.3] +// CHECK:STDOUT: %.loc9_14.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc9_14.3: = bound_method %.loc9_14.1, %.loc9_14.2 [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc9_14.3(%.loc9_14.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc9_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.29] +// CHECK:STDOUT: %.loc9_14.5: Core.IntLiteral = converted %.loc9_14.1, %.loc9_14.4 [template = constants.%.29] +// CHECK:STDOUT: %.loc9_15: type = array_type %.loc9_14.5, %C [template = constants.%.34] +// CHECK:STDOUT: %a.var: ref %.34 = var a +// CHECK:STDOUT: %a: ref %.34 = bind_name a, %a.var +// CHECK:STDOUT: %.loc9_21.1: %.1 = struct_literal () +// CHECK:STDOUT: %.loc9_25.1: %.1 = struct_literal () +// CHECK:STDOUT: %.loc9_29.1: %.1 = struct_literal () +// CHECK:STDOUT: %.loc9_30.1: %tuple.type = tuple_literal (%.loc9_21.1, %.loc9_25.1, %.loc9_29.1) +// CHECK:STDOUT: %.loc9_30.2: i32 = int_value 0 [template = constants.%.32] +// CHECK:STDOUT: %.loc9_30.3: ref %C = array_index %a.var, %.loc9_30.2 +// CHECK:STDOUT: %.loc9_21.2: init %C = class_init (), %.loc9_30.3 [template = constants.%struct] +// CHECK:STDOUT: %.loc9_30.4: init %C = converted %.loc9_21.1, %.loc9_21.2 [template = constants.%struct] +// CHECK:STDOUT: %.loc9_30.5: i32 = int_value 1 [template = constants.%.36] +// CHECK:STDOUT: %.loc9_30.6: ref %C = array_index %a.var, %.loc9_30.5 +// CHECK:STDOUT: %.loc9_25.2: init %C = class_init (), %.loc9_30.6 [template = constants.%struct] +// CHECK:STDOUT: %.loc9_30.7: init %C = converted %.loc9_25.1, %.loc9_25.2 [template = constants.%struct] +// CHECK:STDOUT: %.loc9_30.8: i32 = int_value 2 [template = constants.%.37] +// CHECK:STDOUT: %.loc9_30.9: ref %C = array_index %a.var, %.loc9_30.8 +// CHECK:STDOUT: %.loc9_29.2: init %C = class_init (), %.loc9_30.9 [template = constants.%struct] +// CHECK:STDOUT: %.loc9_30.10: init %C = converted %.loc9_29.1, %.loc9_29.2 [template = constants.%struct] +// CHECK:STDOUT: %.loc9_30.11: init %.34 = array_init (%.loc9_30.4, %.loc9_30.7, %.loc9_30.10) to %a.var [template = constants.%array] +// CHECK:STDOUT: %.loc9_31: init %.34 = converted %.loc9_30.1, %.loc9_30.11 [template = constants.%array] +// CHECK:STDOUT: assign %a.var, %.loc9_31 +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] +// CHECK:STDOUT: %a.ref: ref %.34 = name_ref a, %a +// CHECK:STDOUT: %.loc10_10: = specific_function %F.ref, @F(constants.%C) [template = constants.%.38] +// CHECK:STDOUT: %.loc8_8.2: ref %C = splice_block %return {} +// CHECK:STDOUT: %.loc10_12: %.34 = bind_value %a.ref +// CHECK:STDOUT: %F.call: init %C = call %.loc10_10(%.loc10_12) to %.loc8_8.2 +// CHECK:STDOUT: return %F.call to %return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.2 => constants.%.7 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %.2 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: %.2 => constants.%.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.23 +// CHECK:STDOUT: %.2 => constants.%.24 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F(constants.%T) { +// CHECK:STDOUT: %T.loc6_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc6_6.2 => constants.%T +// CHECK:STDOUT: %.loc6_24.2 => constants.%.30 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F(constants.%C) { +// CHECK:STDOUT: %T.loc6_6.2 => constants.%C +// CHECK:STDOUT: %T.patt.loc6_6.2 => constants.%C +// CHECK:STDOUT: %.loc6_24.2 => constants.%.34 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- fail_todo_bound_only.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %C: type = class_type @C [template] +// CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] +// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %N.1: i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt.1: i32 = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.3: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.5: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.7: %.3 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.8: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N.2: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.10: type = int_type signed, %N.2 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.10)> [symbolic] +// CHECK:STDOUT: %N.patt.2: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.11: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.12: type = int_type unsigned, %N.2 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.12)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.17: %.16 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.18: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.19: %.18 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.10)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.20: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.12)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.21: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.22: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.23: %.22 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.27: = bound_method %N.1, %Convert.15 [symbolic] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.27(%N.1) [symbolic] +// CHECK:STDOUT: %F.type: type = fn_type @F [template] +// CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %G.type: type = fn_type @G [template] +// CHECK:STDOUT: %G: %G.type = struct_value () [template] +// CHECK:STDOUT: %.28: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.29: i32 = int_value 3 [template] +// CHECK:STDOUT: %.30: = bound_method %.29, %Convert.15 [template] +// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.32: type = array_type %.31, %C [template] +// CHECK:STDOUT: %.33: type = ptr_type %.32 [template] +// CHECK:STDOUT: %tuple.type: type = tuple_type (%.1, %.1, %.1) [template] +// CHECK:STDOUT: %.34: i32 = int_value 0 [template] +// CHECK:STDOUT: %struct: %C = struct_value () [template] +// CHECK:STDOUT: %.35: i32 = int_value 1 [template] +// CHECK:STDOUT: %.36: i32 = int_value 2 [template] +// CHECK:STDOUT: %array: %.32 = tuple_value (%struct, %struct, %struct) [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.26] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.10)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.12)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.10)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.12)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %N.patt.loc10_6.1: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc10_6.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.param_patt: i32 = value_param_pattern %N.patt.loc10_6.1, runtime_param [symbolic = %N.patt.loc10_6.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %a.patt: = binding_pattern a +// CHECK:STDOUT: %a.param_patt: = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %int.make_type_32.loc10_10: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc10_10.1: type = value_of_initializer %int.make_type_32.loc10_10 [template = i32] +// CHECK:STDOUT: %.loc10_10.2: type = converted %int.make_type_32.loc10_10, %.loc10_10.1 [template = i32] +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %N.ref.loc10_22: i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N.1)] +// CHECK:STDOUT: %.loc10_22.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc10_22.2: = bound_method %N.ref.loc10_22, %.loc10_22.1 [symbolic = %.loc10_22.5 (constants.%.27)] +// CHECK:STDOUT: %int.convert_checked.loc10_22.1: init Core.IntLiteral = call %.loc10_22.2(%N.ref.loc10_22) [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc10_22.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc10_22.1 [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc10_22.4: Core.IntLiteral = converted %N.ref.loc10_22, %.loc10_22.3 [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc10_23: type = array_type %.loc10_22.4, %C [template = ] +// CHECK:STDOUT: %int.make_type_32.loc10_29: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc10_29.1: type = value_of_initializer %int.make_type_32.loc10_29 [template = i32] +// CHECK:STDOUT: %.loc10_29.2: type = converted %int.make_type_32.loc10_29, %.loc10_29.1 [template = i32] +// CHECK:STDOUT: %N.param: i32 = value_param runtime_param +// CHECK:STDOUT: %N.loc10_6.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc10_6.2 (constants.%N.1)] +// CHECK:STDOUT: %a.param: = value_param runtime_param0 +// CHECK:STDOUT: %a: = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { +// CHECK:STDOUT: %return.patt: %C = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %C.ref.loc12: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %return.param: ref %C = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %C = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.3)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.3) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.16)] +// CHECK:STDOUT: %.2: @As.%.1 (%.16) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.17)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.20)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.25)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%C +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.10) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.12) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.10) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.12) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @F(%N.loc10_6.1: i32) { +// CHECK:STDOUT: %N.loc10_6.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc10_6.2 (constants.%N.1)] +// CHECK:STDOUT: %N.patt.loc10_6.2: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc10_6.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %.loc10_22.5: = bound_method %N.loc10_6.2, constants.%Convert.15 [symbolic = %.loc10_22.5 (constants.%.27)] +// CHECK:STDOUT: %int.convert_checked.loc10_22.2: init Core.IntLiteral = call %.loc10_22.5(%N.loc10_6.2) [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%N.param_patt: i32](%a.param_patt: ) -> i32 { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %N.ref.loc10_42: i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N.1)] +// CHECK:STDOUT: return %N.ref.loc10_42 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @G() -> %return: %C { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %C.ref.loc13: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %.loc13_14.1: i32 = int_value 3 [template = constants.%.29] +// CHECK:STDOUT: %.loc13_14.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc13_14.3: = bound_method %.loc13_14.1, %.loc13_14.2 [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc13_14.3(%.loc13_14.1) [template = constants.%.31] +// CHECK:STDOUT: %.loc13_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.31] +// CHECK:STDOUT: %.loc13_14.5: Core.IntLiteral = converted %.loc13_14.1, %.loc13_14.4 [template = constants.%.31] +// CHECK:STDOUT: %.loc13_15: type = array_type %.loc13_14.5, %C [template = constants.%.32] +// CHECK:STDOUT: %a.var: ref %.32 = var a +// CHECK:STDOUT: %a: ref %.32 = bind_name a, %a.var +// CHECK:STDOUT: %.loc13_21.1: %.1 = struct_literal () +// CHECK:STDOUT: %.loc13_25.1: %.1 = struct_literal () +// CHECK:STDOUT: %.loc13_29.1: %.1 = struct_literal () +// CHECK:STDOUT: %.loc13_30.1: %tuple.type = tuple_literal (%.loc13_21.1, %.loc13_25.1, %.loc13_29.1) +// CHECK:STDOUT: %.loc13_30.2: i32 = int_value 0 [template = constants.%.34] +// CHECK:STDOUT: %.loc13_30.3: ref %C = array_index %a.var, %.loc13_30.2 +// CHECK:STDOUT: %.loc13_21.2: init %C = class_init (), %.loc13_30.3 [template = constants.%struct] +// CHECK:STDOUT: %.loc13_30.4: init %C = converted %.loc13_21.1, %.loc13_21.2 [template = constants.%struct] +// CHECK:STDOUT: %.loc13_30.5: i32 = int_value 1 [template = constants.%.35] +// CHECK:STDOUT: %.loc13_30.6: ref %C = array_index %a.var, %.loc13_30.5 +// CHECK:STDOUT: %.loc13_25.2: init %C = class_init (), %.loc13_30.6 [template = constants.%struct] +// CHECK:STDOUT: %.loc13_30.7: init %C = converted %.loc13_25.1, %.loc13_25.2 [template = constants.%struct] +// CHECK:STDOUT: %.loc13_30.8: i32 = int_value 2 [template = constants.%.36] +// CHECK:STDOUT: %.loc13_30.9: ref %C = array_index %a.var, %.loc13_30.8 +// CHECK:STDOUT: %.loc13_29.2: init %C = class_init (), %.loc13_30.9 [template = constants.%struct] +// CHECK:STDOUT: %.loc13_30.10: init %C = converted %.loc13_29.1, %.loc13_29.2 [template = constants.%struct] +// CHECK:STDOUT: %.loc13_30.11: init %.32 = array_init (%.loc13_30.4, %.loc13_30.7, %.loc13_30.10) to %a.var [template = constants.%array] +// CHECK:STDOUT: %.loc13_31: init %.32 = converted %.loc13_30.1, %.loc13_30.11 [template = constants.%array] +// CHECK:STDOUT: assign %a.var, %.loc13_31 +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] +// CHECK:STDOUT: %a.ref: ref %.32 = name_ref a, %a +// CHECK:STDOUT: return to %return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %.2 => constants.%.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: %.2 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.10) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.12) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.18 +// CHECK:STDOUT: %.2 => constants.%.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.10) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.12) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.22 +// CHECK:STDOUT: %.2 => constants.%.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F(constants.%N.1) { +// CHECK:STDOUT: %N.loc10_6.2 => constants.%N.1 +// CHECK:STDOUT: %N.patt.loc10_6.2 => constants.%N.1 +// CHECK:STDOUT: %.loc10_22.5 => constants.%.27 +// CHECK:STDOUT: %int.convert_checked.loc10_22.2 => constants.%int.convert_checked +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- fail_todo_type_and_bound.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %C: type = class_type @C [template] +// CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] +// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %N.1: i32 = bind_symbolic_name N, 1 [symbolic] +// CHECK:STDOUT: %N.patt.1: i32 = symbolic_binding_pattern N, 1 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.3: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.5: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.7: %.3 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.8: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N.2: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.10: type = int_type signed, %N.2 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.10)> [symbolic] +// CHECK:STDOUT: %N.patt.2: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.11: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.12: type = int_type unsigned, %N.2 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.12)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.17: %.16 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.18: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.19: %.18 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.10)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.20: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.12)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.21: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.22: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.23: %.22 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.27: = bound_method %N.1, %Convert.15 [symbolic] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.27(%N.1) [symbolic] +// CHECK:STDOUT: %F.type: type = fn_type @F [template] +// CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %G.type: type = fn_type @G [template] +// CHECK:STDOUT: %G: %G.type = struct_value () [template] +// CHECK:STDOUT: %.28: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.29: i32 = int_value 3 [template] +// CHECK:STDOUT: %.30: = bound_method %.29, %Convert.15 [template] +// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.32: type = array_type %.31, %C [template] +// CHECK:STDOUT: %.33: type = ptr_type %.32 [template] +// CHECK:STDOUT: %tuple.type: type = tuple_type (%.1, %.1, %.1) [template] +// CHECK:STDOUT: %.34: i32 = int_value 0 [template] +// CHECK:STDOUT: %struct: %C = struct_value () [template] +// CHECK:STDOUT: %.35: i32 = int_value 1 [template] +// CHECK:STDOUT: %.36: i32 = int_value 2 [template] +// CHECK:STDOUT: %array: %.32 = tuple_value (%struct, %struct, %struct) [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.26] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.10)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.12)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.10)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.12)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %T.patt.loc10_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc10_6.1, runtime_param [symbolic = %T.patt.loc10_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %N.patt.loc10_16.1: i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc10_16.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.param_patt: i32 = value_param_pattern %N.patt.loc10_16.1, runtime_param [symbolic = %N.patt.loc10_16.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %a.patt: = binding_pattern a +// CHECK:STDOUT: %a.param_patt: = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: @F.%T.loc10_6.2 (%T) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @F.%T.loc10_6.2 (%T) = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc10_20.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc10_20.2: type = converted %int.make_type_32, %.loc10_20.1 [template = i32] +// CHECK:STDOUT: %T.ref.loc10_29: type = name_ref T, %T.loc10_6.1 [symbolic = %T.loc10_6.2 (constants.%T)] +// CHECK:STDOUT: %N.ref: i32 = name_ref N, %N.loc10_16.1 [symbolic = %N.loc10_16.2 (constants.%N.1)] +// CHECK:STDOUT: %.loc10_32.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc10_32.2: = bound_method %N.ref, %.loc10_32.1 [symbolic = %.loc10_32.5 (constants.%.27)] +// CHECK:STDOUT: %int.convert_checked.loc10_32.1: init Core.IntLiteral = call %.loc10_32.2(%N.ref) [symbolic = %int.convert_checked.loc10_32.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc10_32.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc10_32.1 [symbolic = %int.convert_checked.loc10_32.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc10_32.4: Core.IntLiteral = converted %N.ref, %.loc10_32.3 [symbolic = %int.convert_checked.loc10_32.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc10_33: type = array_type %.loc10_32.4, %T [template = ] +// CHECK:STDOUT: %T.ref.loc10_39: type = name_ref T, %T.loc10_6.1 [symbolic = %T.loc10_6.2 (constants.%T)] +// CHECK:STDOUT: %T.param: type = value_param runtime_param +// CHECK:STDOUT: %T.loc10_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc10_6.2 (constants.%T)] +// CHECK:STDOUT: %N.param: i32 = value_param runtime_param +// CHECK:STDOUT: %N.loc10_16.1: i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc10_16.2 (constants.%N.1)] +// CHECK:STDOUT: %a.param: = value_param runtime_param0 +// CHECK:STDOUT: %a: = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref @F.%T.loc10_6.2 (%T) = out_param runtime_param1 +// CHECK:STDOUT: %return: ref @F.%T.loc10_6.2 (%T) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { +// CHECK:STDOUT: %return.patt: %C = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %C.ref.loc12: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %return.param: ref %C = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %C = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.3)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.3) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.16)] +// CHECK:STDOUT: %.2: @As.%.1 (%.16) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.17)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.20)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.25)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%C +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.10) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.12) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.10) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.12) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @F(%T.loc10_6.1: type, %N.loc10_16.1: i32) { +// CHECK:STDOUT: %T.loc10_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc10_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc10_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %N.loc10_16.2: i32 = bind_symbolic_name N, 1 [symbolic = %N.loc10_16.2 (constants.%N.1)] +// CHECK:STDOUT: %N.patt.loc10_16.2: i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc10_16.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %.loc10_32.5: = bound_method %N.loc10_16.2, constants.%Convert.15 [symbolic = %.loc10_32.5 (constants.%.27)] +// CHECK:STDOUT: %int.convert_checked.loc10_32.2: init Core.IntLiteral = call %.loc10_32.5(%N.loc10_16.2) [symbolic = %int.convert_checked.loc10_32.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%T.param_patt: type, %N.param_patt: i32](%a.param_patt: ) -> @F.%T.loc10_6.2 (%T); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @G() -> %return: %C { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %C.ref.loc13: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %.loc13_14.1: i32 = int_value 3 [template = constants.%.29] +// CHECK:STDOUT: %.loc13_14.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc13_14.3: = bound_method %.loc13_14.1, %.loc13_14.2 [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc13_14.3(%.loc13_14.1) [template = constants.%.31] +// CHECK:STDOUT: %.loc13_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.31] +// CHECK:STDOUT: %.loc13_14.5: Core.IntLiteral = converted %.loc13_14.1, %.loc13_14.4 [template = constants.%.31] +// CHECK:STDOUT: %.loc13_15: type = array_type %.loc13_14.5, %C [template = constants.%.32] +// CHECK:STDOUT: %a.var: ref %.32 = var a +// CHECK:STDOUT: %a: ref %.32 = bind_name a, %a.var +// CHECK:STDOUT: %.loc13_21.1: %.1 = struct_literal () +// CHECK:STDOUT: %.loc13_25.1: %.1 = struct_literal () +// CHECK:STDOUT: %.loc13_29.1: %.1 = struct_literal () +// CHECK:STDOUT: %.loc13_30.1: %tuple.type = tuple_literal (%.loc13_21.1, %.loc13_25.1, %.loc13_29.1) +// CHECK:STDOUT: %.loc13_30.2: i32 = int_value 0 [template = constants.%.34] +// CHECK:STDOUT: %.loc13_30.3: ref %C = array_index %a.var, %.loc13_30.2 +// CHECK:STDOUT: %.loc13_21.2: init %C = class_init (), %.loc13_30.3 [template = constants.%struct] +// CHECK:STDOUT: %.loc13_30.4: init %C = converted %.loc13_21.1, %.loc13_21.2 [template = constants.%struct] +// CHECK:STDOUT: %.loc13_30.5: i32 = int_value 1 [template = constants.%.35] +// CHECK:STDOUT: %.loc13_30.6: ref %C = array_index %a.var, %.loc13_30.5 +// CHECK:STDOUT: %.loc13_25.2: init %C = class_init (), %.loc13_30.6 [template = constants.%struct] +// CHECK:STDOUT: %.loc13_30.7: init %C = converted %.loc13_25.1, %.loc13_25.2 [template = constants.%struct] +// CHECK:STDOUT: %.loc13_30.8: i32 = int_value 2 [template = constants.%.36] +// CHECK:STDOUT: %.loc13_30.9: ref %C = array_index %a.var, %.loc13_30.8 +// CHECK:STDOUT: %.loc13_29.2: init %C = class_init (), %.loc13_30.9 [template = constants.%struct] +// CHECK:STDOUT: %.loc13_30.10: init %C = converted %.loc13_29.1, %.loc13_29.2 [template = constants.%struct] +// CHECK:STDOUT: %.loc13_30.11: init %.32 = array_init (%.loc13_30.4, %.loc13_30.7, %.loc13_30.10) to %a.var [template = constants.%array] +// CHECK:STDOUT: %.loc13_31: init %.32 = converted %.loc13_30.1, %.loc13_30.11 [template = constants.%array] +// CHECK:STDOUT: assign %a.var, %.loc13_31 +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] +// CHECK:STDOUT: %a.ref: ref %.32 = name_ref a, %a +// CHECK:STDOUT: return to %return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %.2 => constants.%.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: %.2 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.10) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.12) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.18 +// CHECK:STDOUT: %.2 => constants.%.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.10) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.12) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.22 +// CHECK:STDOUT: %.2 => constants.%.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F(constants.%T, constants.%N.1) { +// CHECK:STDOUT: %T.loc10_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc10_6.2 => constants.%T +// CHECK:STDOUT: %N.loc10_16.2 => constants.%N.1 +// CHECK:STDOUT: %N.patt.loc10_16.2 => constants.%N.1 +// CHECK:STDOUT: %.loc10_32.5 => constants.%.27 +// CHECK:STDOUT: %int.convert_checked.loc10_32.2 => constants.%int.convert_checked +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- fail_bound_mismatch.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] @@ -389,165 +2634,877 @@ fn G() -> C { // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] +// CHECK:STDOUT: %.3: i32 = int_value 2 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %N: i32 = bind_symbolic_name N, 1 [symbolic] -// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 1 [symbolic] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.5 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.5 [template] +// CHECK:STDOUT: %.8: %.4 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.11: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.13: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.32 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.19: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.20: %.19 = assoc_entity element0, imports.%import_ref.33 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.21: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.23: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.24: %.23 = assoc_entity element0, imports.%import_ref.43 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.28: = bound_method %.3, %Convert.15 [template] +// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.30: type = array_type %.29, %T [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %.31: type = ptr_type %.30 [symbolic] +// CHECK:STDOUT: %.32: i32 = int_value 0 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] -// CHECK:STDOUT: %.4: i32 = int_value 3 [template] -// CHECK:STDOUT: %.5: type = array_type %.4, %C [template] -// CHECK:STDOUT: %.6: type = ptr_type %.5 [template] +// CHECK:STDOUT: %.33: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.34: i32 = int_value 3 [template] +// CHECK:STDOUT: %.35: = bound_method %.34, %Convert.15 [template] +// CHECK:STDOUT: %.36: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.37: type = array_type %.36, %C [template] +// CHECK:STDOUT: %.38: type = ptr_type %.37 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (%.1, %.1, %.1) [template] -// CHECK:STDOUT: %.7: i32 = int_value 0 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] -// CHECK:STDOUT: %.8: i32 = int_value 1 [template] -// CHECK:STDOUT: %.9: i32 = int_value 2 [template] -// CHECK:STDOUT: %array: %.5 = tuple_value (%struct, %struct, %struct) [template] +// CHECK:STDOUT: %.39: i32 = int_value 1 [template] +// CHECK:STDOUT: %array: %.37 = tuple_value (%struct, %struct, %struct) [template] +// CHECK:STDOUT: %.40: type = array_type %.29, %C [template] +// CHECK:STDOUT: %.41: = specific_function %F, @F(%C) [template] +// CHECK:STDOUT: %.42: type = ptr_type %.40 [template] +// CHECK:STDOUT: %ImplicitAs.type.7: type = facet_type <@ImplicitAs, @ImplicitAs(%.40)> [template] +// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.1, @ImplicitAs(%.40) [template] +// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] +// CHECK:STDOUT: %.43: type = assoc_entity_type %ImplicitAs.type.7, %Convert.type.16 [template] +// CHECK:STDOUT: %.44: %.43 = assoc_entity element0, imports.%import_ref.5 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .ImplicitAs = %import_ref.1 +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] +// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.13 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.14: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.16 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.17: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.19: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.27] +// CHECK:STDOUT: %import_ref.20: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.22 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.23: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.25 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.29: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.31 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.36 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.37: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.39 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.40: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.42 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.44: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.46 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.47: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.49 = import_ref Core//prelude/operators/as, inst+648, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %T.patt.loc6_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc6_6.1, runtime_param [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %a.patt: @F.%.loc6_24.2 (%.30) = binding_pattern a +// CHECK:STDOUT: %a.param_patt: @F.%.loc6_24.2 (%.30) = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: @F.%T.loc6_6.2 (%T) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @F.%T.loc6_6.2 (%T) = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.ref.loc6_20: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] +// CHECK:STDOUT: %.loc6_23.1: i32 = int_value 2 [template = constants.%.3] +// CHECK:STDOUT: %.loc6_23.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc6_23.3: = bound_method %.loc6_23.1, %.loc6_23.2 [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc6_23.3(%.loc6_23.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc6_23.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.29] +// CHECK:STDOUT: %.loc6_23.5: Core.IntLiteral = converted %.loc6_23.1, %.loc6_23.4 [template = constants.%.29] +// CHECK:STDOUT: %.loc6_24.1: type = array_type %.loc6_23.5, %T [symbolic = %.loc6_24.2 (constants.%.30)] +// CHECK:STDOUT: %T.ref.loc6_30: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] +// CHECK:STDOUT: %T.param: type = value_param runtime_param +// CHECK:STDOUT: %T.loc6_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc6_6.2 (constants.%T)] +// CHECK:STDOUT: %a.param: @F.%.loc6_24.2 (%.30) = value_param runtime_param0 +// CHECK:STDOUT: %a: @F.%.loc6_24.2 (%.30) = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref @F.%T.loc6_6.2 (%T) = out_param runtime_param1 +// CHECK:STDOUT: %return: ref @F.%T.loc6_6.2 (%T) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { +// CHECK:STDOUT: %return.patt: %C = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %return.param: ref %C = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %C = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.4) = assoc_entity element0, imports.%import_ref.5 [symbolic = %.2 (constants.%.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .Convert = imports.%import_ref.3 +// CHECK:STDOUT: witness = (imports.%import_ref.4) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: %.2: @As.%.1 (%.17) = assoc_entity element0, imports.%import_ref.32 [symbolic = %.2 (constants.%.18)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.26 +// CHECK:STDOUT: .Convert = imports.%import_ref.27 +// CHECK:STDOUT: witness = (imports.%import_ref.28) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.7 as imports.%import_ref.8 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.11 as imports.%import_ref.12 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.14 as imports.%import_ref.15 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.16 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.17 as imports.%import_ref.18 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.20 as imports.%import_ref.21 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.22 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.23 as imports.%import_ref.24 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.25 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.29 as imports.%import_ref.30 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.31 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.34 as imports.%import_ref.35 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.36 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.37 as imports.%import_ref.38 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.39 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.40 as imports.%import_ref.41 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.42 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.25)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.44 as imports.%import_ref.45 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.46 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.26)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.47 as imports.%import_ref.48 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.49 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%C +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @F(%T.loc6_6.1: type) { +// CHECK:STDOUT: %T.loc6_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc6_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %.loc6_24.2: type = array_type constants.%.29, @F.%T.loc6_6.2 (%T) [symbolic = %.loc6_24.2 (constants.%.30)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%T.param_patt: type](%a.param_patt: @F.%.loc6_24.2 (%.30)) -> @F.%T.loc6_6.2 (%T) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %a.ref: @F.%.loc6_24.2 (%.30) = name_ref a, %a +// CHECK:STDOUT: %.loc6_43: i32 = int_value 0 [template = constants.%.32] +// CHECK:STDOUT: %.loc6_44.1: ref @F.%.loc6_24.2 (%.30) = value_as_ref %a.ref +// CHECK:STDOUT: %.loc6_44.2: ref @F.%T.loc6_6.2 (%T) = array_index %.loc6_44.1, %.loc6_43 +// CHECK:STDOUT: %.loc6_44.3: @F.%T.loc6_6.2 (%T) = bind_value %.loc6_44.2 +// CHECK:STDOUT: return %.loc6_44.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @G() -> %return: %C { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %C.ref.loc10: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %.loc10_14.1: i32 = int_value 3 [template = constants.%.34] +// CHECK:STDOUT: %.loc10_14.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc10_14.3: = bound_method %.loc10_14.1, %.loc10_14.2 [template = constants.%.35] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc10_14.3(%.loc10_14.1) [template = constants.%.36] +// CHECK:STDOUT: %.loc10_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.36] +// CHECK:STDOUT: %.loc10_14.5: Core.IntLiteral = converted %.loc10_14.1, %.loc10_14.4 [template = constants.%.36] +// CHECK:STDOUT: %.loc10_15: type = array_type %.loc10_14.5, %C [template = constants.%.37] +// CHECK:STDOUT: %a.var: ref %.37 = var a +// CHECK:STDOUT: %a: ref %.37 = bind_name a, %a.var +// CHECK:STDOUT: %.loc10_21.1: %.1 = struct_literal () +// CHECK:STDOUT: %.loc10_25.1: %.1 = struct_literal () +// CHECK:STDOUT: %.loc10_29.1: %.1 = struct_literal () +// CHECK:STDOUT: %.loc10_30.1: %tuple.type = tuple_literal (%.loc10_21.1, %.loc10_25.1, %.loc10_29.1) +// CHECK:STDOUT: %.loc10_30.2: i32 = int_value 0 [template = constants.%.32] +// CHECK:STDOUT: %.loc10_30.3: ref %C = array_index %a.var, %.loc10_30.2 +// CHECK:STDOUT: %.loc10_21.2: init %C = class_init (), %.loc10_30.3 [template = constants.%struct] +// CHECK:STDOUT: %.loc10_30.4: init %C = converted %.loc10_21.1, %.loc10_21.2 [template = constants.%struct] +// CHECK:STDOUT: %.loc10_30.5: i32 = int_value 1 [template = constants.%.39] +// CHECK:STDOUT: %.loc10_30.6: ref %C = array_index %a.var, %.loc10_30.5 +// CHECK:STDOUT: %.loc10_25.2: init %C = class_init (), %.loc10_30.6 [template = constants.%struct] +// CHECK:STDOUT: %.loc10_30.7: init %C = converted %.loc10_25.1, %.loc10_25.2 [template = constants.%struct] +// CHECK:STDOUT: %.loc10_30.8: i32 = int_value 2 [template = constants.%.3] +// CHECK:STDOUT: %.loc10_30.9: ref %C = array_index %a.var, %.loc10_30.8 +// CHECK:STDOUT: %.loc10_29.2: init %C = class_init (), %.loc10_30.9 [template = constants.%struct] +// CHECK:STDOUT: %.loc10_30.10: init %C = converted %.loc10_29.1, %.loc10_29.2 [template = constants.%struct] +// CHECK:STDOUT: %.loc10_30.11: init %.37 = array_init (%.loc10_30.4, %.loc10_30.7, %.loc10_30.10) to %a.var [template = constants.%array] +// CHECK:STDOUT: %.loc10_31: init %.37 = converted %.loc10_30.1, %.loc10_30.11 [template = constants.%array] +// CHECK:STDOUT: assign %a.var, %.loc10_31 +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] +// CHECK:STDOUT: %a.ref: ref %.37 = name_ref a, %a +// CHECK:STDOUT: %.loc21_10: = specific_function %F.ref, @F(constants.%C) [template = constants.%.41] +// CHECK:STDOUT: %.loc8_8.2: ref %C = splice_block %return {} +// CHECK:STDOUT: %.loc21_12: %.40 = converted %a.ref, [template = ] +// CHECK:STDOUT: %F.call: init %C = call %.loc21_10() to %.loc8_8.2 +// CHECK:STDOUT: return %F.call to %return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.2 => constants.%.7 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %.2 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: %.2 => constants.%.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.23 +// CHECK:STDOUT: %.2 => constants.%.24 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.patt.loc10_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_6.2 (constants.%T.patt)] -// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc10_6.1, runtime_param [symbolic = %T.patt.loc10_6.2 (constants.%T.patt)] -// CHECK:STDOUT: %N.patt.loc10_16.1: i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc10_16.2 (constants.%N.patt)] -// CHECK:STDOUT: %N.param_patt: i32 = value_param_pattern %N.patt.loc10_16.1, runtime_param [symbolic = %N.patt.loc10_16.2 (constants.%N.patt)] -// CHECK:STDOUT: %a.patt: = binding_pattern a -// CHECK:STDOUT: %a.param_patt: = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: @F.%T.loc10_6.2 (%T) = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: @F.%T.loc10_6.2 (%T) = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc10_20.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc10_20.2: type = converted %int.make_type_32, %.loc10_20.1 [template = i32] -// CHECK:STDOUT: %T.ref.loc10_29: type = name_ref T, %T.loc10_6.1 [symbolic = %T.loc10_6.2 (constants.%T)] -// CHECK:STDOUT: %N.ref: i32 = name_ref N, %N.loc10_16.1 [symbolic = %N.loc10_16.2 (constants.%N)] -// CHECK:STDOUT: %.loc10_33: type = array_type %N.ref, %T [template = ] -// CHECK:STDOUT: %T.ref.loc10_39: type = name_ref T, %T.loc10_6.1 [symbolic = %T.loc10_6.2 (constants.%T)] -// CHECK:STDOUT: %T.param: type = value_param runtime_param -// CHECK:STDOUT: %T.loc10_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc10_6.2 (constants.%T)] -// CHECK:STDOUT: %N.param: i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc10_16.1: i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc10_16.2 (constants.%N)] -// CHECK:STDOUT: %a.param: = value_param runtime_param0 -// CHECK:STDOUT: %a: = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref @F.%T.loc10_6.2 (%T) = out_param runtime_param1 -// CHECK:STDOUT: %return: ref @F.%T.loc10_6.2 (%T) = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %return.patt: %C = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param0 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc12: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %return.param: ref %C = out_param runtime_param0 -// CHECK:STDOUT: %return: ref %C = return_slot %return.param -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: class @C { -// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%C +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; +// CHECK:STDOUT: specific @F(constants.%T) { +// CHECK:STDOUT: %T.loc6_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc6_6.2 => constants.%T +// CHECK:STDOUT: %.loc6_24.2 => constants.%.30 +// CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(%T.loc10_6.1: type, %N.loc10_16.1: i32) { -// CHECK:STDOUT: %T.loc10_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc10_6.2 (constants.%T)] -// CHECK:STDOUT: %T.patt.loc10_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_6.2 (constants.%T.patt)] -// CHECK:STDOUT: %N.loc10_16.2: i32 = bind_symbolic_name N, 1 [symbolic = %N.loc10_16.2 (constants.%N)] -// CHECK:STDOUT: %N.patt.loc10_16.2: i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc10_16.2 (constants.%N.patt)] +// CHECK:STDOUT: specific @F(constants.%C) { +// CHECK:STDOUT: %T.loc6_6.2 => constants.%C +// CHECK:STDOUT: %T.patt.loc6_6.2 => constants.%C +// CHECK:STDOUT: %.loc6_24.2 => constants.%.40 // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.param_patt: type, %N.param_patt: i32](%a.param_patt: ) -> @F.%T.loc10_6.2 (%T); +// CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G() -> %return: %C { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %C.ref.loc13: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc13_14: i32 = int_value 3 [template = constants.%.4] -// CHECK:STDOUT: %.loc13_15: type = array_type %.loc13_14, %C [template = constants.%.5] -// CHECK:STDOUT: %a.var: ref %.5 = var a -// CHECK:STDOUT: %a: ref %.5 = bind_name a, %a.var -// CHECK:STDOUT: %.loc13_21.1: %.1 = struct_literal () -// CHECK:STDOUT: %.loc13_25.1: %.1 = struct_literal () -// CHECK:STDOUT: %.loc13_29.1: %.1 = struct_literal () -// CHECK:STDOUT: %.loc13_30.1: %tuple.type = tuple_literal (%.loc13_21.1, %.loc13_25.1, %.loc13_29.1) -// CHECK:STDOUT: %.loc13_30.2: i32 = int_value 0 [template = constants.%.7] -// CHECK:STDOUT: %.loc13_30.3: ref %C = array_index %a.var, %.loc13_30.2 -// CHECK:STDOUT: %.loc13_21.2: init %C = class_init (), %.loc13_30.3 [template = constants.%struct] -// CHECK:STDOUT: %.loc13_30.4: init %C = converted %.loc13_21.1, %.loc13_21.2 [template = constants.%struct] -// CHECK:STDOUT: %.loc13_30.5: i32 = int_value 1 [template = constants.%.8] -// CHECK:STDOUT: %.loc13_30.6: ref %C = array_index %a.var, %.loc13_30.5 -// CHECK:STDOUT: %.loc13_25.2: init %C = class_init (), %.loc13_30.6 [template = constants.%struct] -// CHECK:STDOUT: %.loc13_30.7: init %C = converted %.loc13_25.1, %.loc13_25.2 [template = constants.%struct] -// CHECK:STDOUT: %.loc13_30.8: i32 = int_value 2 [template = constants.%.9] -// CHECK:STDOUT: %.loc13_30.9: ref %C = array_index %a.var, %.loc13_30.8 -// CHECK:STDOUT: %.loc13_29.2: init %C = class_init (), %.loc13_30.9 [template = constants.%struct] -// CHECK:STDOUT: %.loc13_30.10: init %C = converted %.loc13_29.1, %.loc13_29.2 [template = constants.%struct] -// CHECK:STDOUT: %.loc13_30.11: init %.5 = array_init (%.loc13_30.4, %.loc13_30.7, %.loc13_30.10) to %a.var [template = constants.%array] -// CHECK:STDOUT: %.loc13_31: init %.5 = converted %.loc13_30.1, %.loc13_30.11 [template = constants.%array] -// CHECK:STDOUT: assign %a.var, %.loc13_31 -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] -// CHECK:STDOUT: %a.ref: ref %.5 = name_ref a, %a -// CHECK:STDOUT: return to %return -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @ImplicitAs(constants.%.40) { +// CHECK:STDOUT: %Dest => constants.%.40 +// CHECK:STDOUT: %Dest.patt => constants.%.40 // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(constants.%T, constants.%N) { -// CHECK:STDOUT: %T.loc10_6.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc10_6.2 => constants.%T -// CHECK:STDOUT: %N.loc10_16.2 => constants.%N -// CHECK:STDOUT: %N.patt.loc10_16.2 => constants.%N +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.7 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.16 +// CHECK:STDOUT: %Convert => constants.%Convert.16 +// CHECK:STDOUT: %.1 => constants.%.43 +// CHECK:STDOUT: %.2 => constants.%.44 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: --- fail_bound_mismatch.carbon +// CHECK:STDOUT: --- fail_type_mismatch.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] -// CHECK:STDOUT: %.3: i32 = int_value 2 [template] -// CHECK:STDOUT: %.4: type = array_type %.3, %T [symbolic] -// CHECK:STDOUT: %F.type: type = fn_type @F [template] +// CHECK:STDOUT: %D: type = class_type @D [template] +// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [symbolic] -// CHECK:STDOUT: %.6: i32 = int_value 0 [template] -// CHECK:STDOUT: %G.type: type = fn_type @G [template] -// CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.7: type = ptr_type %.1 [template] -// CHECK:STDOUT: %.8: i32 = int_value 3 [template] -// CHECK:STDOUT: %.9: type = array_type %.8, %C [template] -// CHECK:STDOUT: %.10: type = ptr_type %.9 [template] -// CHECK:STDOUT: %tuple.type: type = tuple_type (%.1, %.1, %.1) [template] -// CHECK:STDOUT: %struct: %C = struct_value () [template] -// CHECK:STDOUT: %.11: i32 = int_value 1 [template] -// CHECK:STDOUT: %array: %.9 = tuple_value (%struct, %struct, %struct) [template] -// CHECK:STDOUT: %.12: type = array_type %.3, %C [template] -// CHECK:STDOUT: %.13: = specific_function %F, @F(%C) [template] -// CHECK:STDOUT: %.14: type = ptr_type %.12 [template] +// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %N.1: i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt.1: i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] // CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] @@ -557,108 +3514,125 @@ fn G() -> C { // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.15: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] -// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.5 [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%.12)> [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%.12) [template] +// CHECK:STDOUT: %.3: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %.17: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] -// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.5 [template] -// CHECK:STDOUT: %.19: %.15 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %.5: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.7: %.3 = assoc_entity element0, imports.%import_ref.7 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] // CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] -// CHECK:STDOUT: %.20: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] -// CHECK:STDOUT: %.21: %.20 = assoc_entity element0, imports.%import_ref.10 [template] -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %.22: type = int_type signed, %N [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.22)> [symbolic] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] -// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %.8: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N.2: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.10: type = int_type signed, %N.2 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.10)> [symbolic] +// CHECK:STDOUT: %N.patt.2: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N.2) [symbolic] // CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] -// CHECK:STDOUT: %.23: = interface_witness (%Convert.4) [symbolic] -// CHECK:STDOUT: %.24: type = int_type unsigned, %N [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.24)> [symbolic] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %.11: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.12: type = int_type unsigned, %N.2 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.12)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N.2) [symbolic] // CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.5) [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.7: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [template] -// CHECK:STDOUT: %.26: type = assoc_entity_type %ImplicitAs.type.7, %Convert.type.6 [template] -// CHECK:STDOUT: %.27: %.26 = assoc_entity element0, imports.%import_ref.20 [template] -// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N.2) [symbolic] // CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] -// CHECK:STDOUT: %.28: = interface_witness (%Convert.7) [symbolic] -// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.5, @impl.6(%N) [symbolic] -// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] -// CHECK:STDOUT: %.29: = interface_witness (%Convert.8) [symbolic] +// CHECK:STDOUT: %.15: = interface_witness (%Convert.7) [symbolic] // CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] // CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] // CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] // CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] // CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(%Dest) [symbolic] -// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [symbolic] -// CHECK:STDOUT: %.30: type = assoc_entity_type %As.type.2, %Convert.type.9 [symbolic] -// CHECK:STDOUT: %.31: %.30 = assoc_entity element0, imports.%import_ref.33 [symbolic] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.6, @As(i32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %.32: type = assoc_entity_type %As.type.3, %Convert.type.10 [template] -// CHECK:STDOUT: %.33: %.32 = assoc_entity element0, imports.%import_ref.34 [template] -// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.22)> [symbolic] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.17: %.16 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.18: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.19: %.18 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.10)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.20: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.12)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N.2) [symbolic] // CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] -// CHECK:STDOUT: %.34: = interface_witness (%Convert.11) [symbolic] -// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.24)> [symbolic] -// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.8, @impl.9(%N) [symbolic] -// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [symbolic] -// CHECK:STDOUT: %.35: = interface_witness (%Convert.12) [symbolic] +// CHECK:STDOUT: %.21: = interface_witness (%Convert.11) [symbolic] // CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] -// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template] -// CHECK:STDOUT: %.36: type = assoc_entity_type %As.type.6, %Convert.type.13 [template] -// CHECK:STDOUT: %.37: %.36 = assoc_entity element0, imports.%import_ref.44 [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.22: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.23: %.22 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N.2) [symbolic] // CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] -// CHECK:STDOUT: %.38: = interface_witness (%Convert.14) [symbolic] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.10, @impl.12(%N) [symbolic] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [symbolic] -// CHECK:STDOUT: %.39: = interface_witness (%Convert.15) [symbolic] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.27: = bound_method %N.1, %Convert.15 [symbolic] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.27(%N.1) [symbolic] +// CHECK:STDOUT: %F.type: type = fn_type @F [template] +// CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %G.type: type = fn_type @G [template] +// CHECK:STDOUT: %G: %G.type = struct_value () [template] +// CHECK:STDOUT: %.28: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.29: i32 = int_value 3 [template] +// CHECK:STDOUT: %.30: = bound_method %.29, %Convert.15 [template] +// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.32: type = array_type %.31, %D [template] +// CHECK:STDOUT: %.33: type = ptr_type %.32 [template] +// CHECK:STDOUT: %tuple.type: type = tuple_type (%.1, %.1, %.1) [template] +// CHECK:STDOUT: %.34: i32 = int_value 0 [template] +// CHECK:STDOUT: %struct: %D = struct_value () [template] +// CHECK:STDOUT: %.35: i32 = int_value 1 [template] +// CHECK:STDOUT: %.36: i32 = int_value 2 [template] +// CHECK:STDOUT: %array: %.32 = tuple_value (%struct, %struct, %struct) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .ImplicitAs = %import_ref.1 +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+61, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.15) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.19)] -// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)] // CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded -// CHECK:STDOUT: %import_ref.7: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/as, inst+133, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+76, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] -// CHECK:STDOUT: %import_ref.13 = import_ref Core//prelude/operators/as, inst+196, unloaded -// CHECK:STDOUT: %import_ref.14: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] -// CHECK:STDOUT: %import_ref.16 = import_ref Core//prelude/operators/as, inst+260, unloaded -// CHECK:STDOUT: %import_ref.17: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] -// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.7] -// CHECK:STDOUT: %import_ref.19 = import_ref Core//prelude/operators/as, inst+296, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Core//prelude/operators/as, inst+76, unloaded -// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.22)] -// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.7] +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.26] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.10)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] // CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded -// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.24)] -// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.7] +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.12)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] // CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded // CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded // CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded @@ -678,10 +3652,10 @@ fn G() -> C { // CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] // CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded // CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded -// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.22)] +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.10)] // CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] // CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded -// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.24)] +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.12)] // CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] // CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } @@ -690,35 +3664,47 @@ fn G() -> C { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .D = %D.decl // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.patt.loc6_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] -// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc6_6.1, runtime_param [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] -// CHECK:STDOUT: %a.patt: @F.%.loc6_24.2 (%.4) = binding_pattern a -// CHECK:STDOUT: %a.param_patt: @F.%.loc6_24.2 (%.4) = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: @F.%T.loc6_6.2 (%T) = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: @F.%T.loc6_6.2 (%T) = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %N.patt.loc10_6.1: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc10_6.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.param_patt: i32 = value_param_pattern %N.patt.loc10_6.1, runtime_param [symbolic = %N.patt.loc10_6.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %a.patt: = binding_pattern a +// CHECK:STDOUT: %a.param_patt: = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc6_20: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] -// CHECK:STDOUT: %.loc6_23: i32 = int_value 2 [template = constants.%.3] -// CHECK:STDOUT: %.loc6_24.1: type = array_type %.loc6_23, %T [symbolic = %.loc6_24.2 (constants.%.4)] -// CHECK:STDOUT: %T.ref.loc6_30: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] -// CHECK:STDOUT: %T.param: type = value_param runtime_param -// CHECK:STDOUT: %T.loc6_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc6_6.2 (constants.%T)] -// CHECK:STDOUT: %a.param: @F.%.loc6_24.2 (%.4) = value_param runtime_param0 -// CHECK:STDOUT: %a: @F.%.loc6_24.2 (%.4) = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref @F.%T.loc6_6.2 (%T) = out_param runtime_param1 -// CHECK:STDOUT: %return: ref @F.%T.loc6_6.2 (%T) = return_slot %return.param +// CHECK:STDOUT: %int.make_type_32.loc10_10: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc10_10.1: type = value_of_initializer %int.make_type_32.loc10_10 [template = i32] +// CHECK:STDOUT: %.loc10_10.2: type = converted %int.make_type_32.loc10_10, %.loc10_10.1 [template = i32] +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %N.ref.loc10_22: i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N.1)] +// CHECK:STDOUT: %.loc10_22.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc10_22.2: = bound_method %N.ref.loc10_22, %.loc10_22.1 [symbolic = %.loc10_22.5 (constants.%.27)] +// CHECK:STDOUT: %int.convert_checked.loc10_22.1: init Core.IntLiteral = call %.loc10_22.2(%N.ref.loc10_22) [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc10_22.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc10_22.1 [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc10_22.4: Core.IntLiteral = converted %N.ref.loc10_22, %.loc10_22.3 [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc10_23: type = array_type %.loc10_22.4, %C [template = ] +// CHECK:STDOUT: %int.make_type_32.loc10_29: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc10_29.1: type = value_of_initializer %int.make_type_32.loc10_29 [template = i32] +// CHECK:STDOUT: %.loc10_29.2: type = converted %int.make_type_32.loc10_29, %.loc10_29.1 [template = i32] +// CHECK:STDOUT: %N.param: i32 = value_param runtime_param +// CHECK:STDOUT: %N.loc10_6.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc10_6.2 (constants.%N.1)] +// CHECK:STDOUT: %a.param: = value_param runtime_param0 +// CHECK:STDOUT: %a: = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param0 // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } @@ -733,14 +3719,14 @@ fn G() -> C { // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] -// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.15)] -// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.15) = assoc_entity element0, imports.%import_ref.5 [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.3)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.3) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .Convert = imports.%import_ref.3 -// CHECK:STDOUT: witness = (imports.%import_ref.4) +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -751,10 +3737,10 @@ fn G() -> C { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] // CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.9)] -// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.9) = struct_value () [symbolic = %Convert (constants.%Convert.9)] -// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.9) [symbolic = %.1 (constants.%.30)] -// CHECK:STDOUT: %.2: @As.%.1 (%.30) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.31)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.16)] +// CHECK:STDOUT: %.2: @As.%.1 (%.16) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.17)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: @@ -764,59 +3750,59 @@ fn G() -> C { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: imports.%import_ref.7 as imports.%import_ref.8 { +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.9 +// CHECK:STDOUT: witness = imports.%import_ref.10 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.22)] +// CHECK:STDOUT: generic impl @impl.2(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] // CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.23)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.11)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.11 as imports.%import_ref.12 { +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.13 +// CHECK:STDOUT: witness = imports.%import_ref.14 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.24)] +// CHECK:STDOUT: generic impl @impl.3(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] // CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.25)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.14 as imports.%import_ref.15 { +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.16 +// CHECK:STDOUT: witness = imports.%import_ref.17 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.4: imports.%import_ref.17 as imports.%import_ref.18 { +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.19 +// CHECK:STDOUT: witness = imports.%import_ref.20 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.22)] +// CHECK:STDOUT: generic impl @impl.5(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] -// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.28)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] // CHECK:STDOUT: // CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { // CHECK:STDOUT: !members: @@ -824,15 +3810,15 @@ fn G() -> C { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.24)] +// CHECK:STDOUT: generic impl @impl.6(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.8)] -// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.29)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.15)] // CHECK:STDOUT: // CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { // CHECK:STDOUT: !members: @@ -845,16 +3831,16 @@ fn G() -> C { // CHECK:STDOUT: witness = imports.%import_ref.32 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.22)] +// CHECK:STDOUT: generic impl @impl.8(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] -// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.34)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.20)] // CHECK:STDOUT: // CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { // CHECK:STDOUT: !members: @@ -862,16 +3848,16 @@ fn G() -> C { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.24)] +// CHECK:STDOUT: generic impl @impl.9(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.12)] -// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.12) = struct_value () [symbolic = %Convert (constants.%Convert.12)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.35)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] // CHECK:STDOUT: // CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { // CHECK:STDOUT: !members: @@ -884,15 +3870,15 @@ fn G() -> C { // CHECK:STDOUT: witness = imports.%import_ref.43 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.22)] +// CHECK:STDOUT: generic impl @impl.11(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] -// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.38)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.24)] // CHECK:STDOUT: // CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { // CHECK:STDOUT: !members: @@ -900,15 +3886,15 @@ fn G() -> C { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.24)] +// CHECK:STDOUT: generic impl @impl.12(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.15)] -// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.15) = struct_value () [symbolic = %Convert (constants.%Convert.15)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.39)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.25)] // CHECK:STDOUT: // CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { // CHECK:STDOUT: !members: @@ -923,58 +3909,14 @@ fn G() -> C { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(%T.loc6_6.1: type) { -// CHECK:STDOUT: %T.loc6_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_6.2 (constants.%T)] -// CHECK:STDOUT: %T.patt.loc6_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] -// CHECK:STDOUT: %.loc6_24.2: type = array_type constants.%.3, @F.%T.loc6_6.2 (%T) [symbolic = %.loc6_24.2 (constants.%.4)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: +// CHECK:STDOUT: class @D { +// CHECK:STDOUT: %.loc5: = complete_type_witness %.1 [template = constants.%.2] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.param_patt: type](%a.param_patt: @F.%.loc6_24.2 (%.4)) -> @F.%T.loc6_6.2 (%T) { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref: @F.%.loc6_24.2 (%.4) = name_ref a, %a -// CHECK:STDOUT: %.loc6_43: i32 = int_value 0 [template = constants.%.6] -// CHECK:STDOUT: %.loc6_44.1: ref @F.%.loc6_24.2 (%.4) = value_as_ref %a.ref -// CHECK:STDOUT: %.loc6_44.2: ref @F.%T.loc6_6.2 (%T) = array_index %.loc6_44.1, %.loc6_43 -// CHECK:STDOUT: %.loc6_44.3: @F.%T.loc6_6.2 (%T) = bind_value %.loc6_44.2 -// CHECK:STDOUT: return %.loc6_44.3 -// CHECK:STDOUT: } +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%D // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G() -> %return: %C { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %C.ref.loc10: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc10_14: i32 = int_value 3 [template = constants.%.8] -// CHECK:STDOUT: %.loc10_15: type = array_type %.loc10_14, %C [template = constants.%.9] -// CHECK:STDOUT: %a.var: ref %.9 = var a -// CHECK:STDOUT: %a: ref %.9 = bind_name a, %a.var -// CHECK:STDOUT: %.loc10_21.1: %.1 = struct_literal () -// CHECK:STDOUT: %.loc10_25.1: %.1 = struct_literal () -// CHECK:STDOUT: %.loc10_29.1: %.1 = struct_literal () -// CHECK:STDOUT: %.loc10_30.1: %tuple.type = tuple_literal (%.loc10_21.1, %.loc10_25.1, %.loc10_29.1) -// CHECK:STDOUT: %.loc10_30.2: i32 = int_value 0 [template = constants.%.6] -// CHECK:STDOUT: %.loc10_30.3: ref %C = array_index %a.var, %.loc10_30.2 -// CHECK:STDOUT: %.loc10_21.2: init %C = class_init (), %.loc10_30.3 [template = constants.%struct] -// CHECK:STDOUT: %.loc10_30.4: init %C = converted %.loc10_21.1, %.loc10_21.2 [template = constants.%struct] -// CHECK:STDOUT: %.loc10_30.5: i32 = int_value 1 [template = constants.%.11] -// CHECK:STDOUT: %.loc10_30.6: ref %C = array_index %a.var, %.loc10_30.5 -// CHECK:STDOUT: %.loc10_25.2: init %C = class_init (), %.loc10_30.6 [template = constants.%struct] -// CHECK:STDOUT: %.loc10_30.7: init %C = converted %.loc10_25.1, %.loc10_25.2 [template = constants.%struct] -// CHECK:STDOUT: %.loc10_30.8: i32 = int_value 2 [template = constants.%.3] -// CHECK:STDOUT: %.loc10_30.9: ref %C = array_index %a.var, %.loc10_30.8 -// CHECK:STDOUT: %.loc10_29.2: init %C = class_init (), %.loc10_30.9 [template = constants.%struct] -// CHECK:STDOUT: %.loc10_30.10: init %C = converted %.loc10_29.1, %.loc10_29.2 [template = constants.%struct] -// CHECK:STDOUT: %.loc10_30.11: init %.9 = array_init (%.loc10_30.4, %.loc10_30.7, %.loc10_30.10) to %a.var [template = constants.%array] -// CHECK:STDOUT: %.loc10_31: init %.9 = converted %.loc10_30.1, %.loc10_30.11 [template = constants.%array] -// CHECK:STDOUT: assign %a.var, %.loc10_31 -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] -// CHECK:STDOUT: %a.ref: ref %.9 = name_ref a, %a -// CHECK:STDOUT: %.loc21_10: = specific_function %F.ref, @F(constants.%C) [template = constants.%.13] -// CHECK:STDOUT: %.loc8_8.2: ref %C = splice_block %return {} -// CHECK:STDOUT: %.loc21_12: %.12 = converted %a.ref, [template = ] -// CHECK:STDOUT: %F.call: init %C = call %.loc21_10() to %.loc8_8.2 -// CHECK:STDOUT: return %F.call to %return -// CHECK:STDOUT: } +// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] @@ -984,32 +3926,40 @@ fn G() -> C { // CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.22)] +// CHECK:STDOUT: generic fn @Convert.2(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.22) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.10) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.24)] +// CHECK:STDOUT: generic fn @Convert.3(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.24) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.12) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.22)] +// CHECK:STDOUT: generic fn @Convert.4(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.22)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.24)] +// CHECK:STDOUT: generic fn @Convert.5(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.24)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { @@ -1020,46 +3970,93 @@ fn G() -> C { // CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.22)] +// CHECK:STDOUT: generic fn @Convert.7(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.22) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.10) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.24)] +// CHECK:STDOUT: generic fn @Convert.8(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.24) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.12) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.22)] +// CHECK:STDOUT: generic fn @Convert.9(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.22)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.24)] +// CHECK:STDOUT: generic fn @Convert.10(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.24)]() -> Core.IntLiteral = "int.convert_checked"; -// CHECK:STDOUT: } +// CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(constants.%T) { -// CHECK:STDOUT: %T.loc6_6.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc6_6.2 => constants.%T -// CHECK:STDOUT: %.loc6_24.2 => constants.%.4 +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(constants.%C) { -// CHECK:STDOUT: %T.loc6_6.2 => constants.%C -// CHECK:STDOUT: %T.patt.loc6_6.2 => constants.%C -// CHECK:STDOUT: %.loc6_24.2 => constants.%.12 +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @F(%N.loc10_6.1: i32) { +// CHECK:STDOUT: %N.loc10_6.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc10_6.2 (constants.%N.1)] +// CHECK:STDOUT: %N.patt.loc10_6.2: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc10_6.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %.loc10_22.5: = bound_method %N.loc10_6.2, constants.%Convert.15 [symbolic = %.loc10_22.5 (constants.%.27)] +// CHECK:STDOUT: %int.convert_checked.loc10_22.2: init Core.IntLiteral = call %.loc10_22.5(%N.loc10_6.2) [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%N.param_patt: i32](%a.param_patt: ) -> i32 { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %N.ref.loc10_42: i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N.1)] +// CHECK:STDOUT: return %N.ref.loc10_42 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @G() -> %return: %C { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] +// CHECK:STDOUT: %.loc13_14.1: i32 = int_value 3 [template = constants.%.29] +// CHECK:STDOUT: %.loc13_14.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc13_14.3: = bound_method %.loc13_14.1, %.loc13_14.2 [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc13_14.3(%.loc13_14.1) [template = constants.%.31] +// CHECK:STDOUT: %.loc13_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.31] +// CHECK:STDOUT: %.loc13_14.5: Core.IntLiteral = converted %.loc13_14.1, %.loc13_14.4 [template = constants.%.31] +// CHECK:STDOUT: %.loc13_15: type = array_type %.loc13_14.5, %D [template = constants.%.32] +// CHECK:STDOUT: %a.var: ref %.32 = var a +// CHECK:STDOUT: %a: ref %.32 = bind_name a, %a.var +// CHECK:STDOUT: %.loc13_21.1: %.1 = struct_literal () +// CHECK:STDOUT: %.loc13_25.1: %.1 = struct_literal () +// CHECK:STDOUT: %.loc13_29.1: %.1 = struct_literal () +// CHECK:STDOUT: %.loc13_30.1: %tuple.type = tuple_literal (%.loc13_21.1, %.loc13_25.1, %.loc13_29.1) +// CHECK:STDOUT: %.loc13_30.2: i32 = int_value 0 [template = constants.%.34] +// CHECK:STDOUT: %.loc13_30.3: ref %D = array_index %a.var, %.loc13_30.2 +// CHECK:STDOUT: %.loc13_21.2: init %D = class_init (), %.loc13_30.3 [template = constants.%struct] +// CHECK:STDOUT: %.loc13_30.4: init %D = converted %.loc13_21.1, %.loc13_21.2 [template = constants.%struct] +// CHECK:STDOUT: %.loc13_30.5: i32 = int_value 1 [template = constants.%.35] +// CHECK:STDOUT: %.loc13_30.6: ref %D = array_index %a.var, %.loc13_30.5 +// CHECK:STDOUT: %.loc13_25.2: init %D = class_init (), %.loc13_30.6 [template = constants.%struct] +// CHECK:STDOUT: %.loc13_30.7: init %D = converted %.loc13_25.1, %.loc13_25.2 [template = constants.%struct] +// CHECK:STDOUT: %.loc13_30.8: i32 = int_value 2 [template = constants.%.36] +// CHECK:STDOUT: %.loc13_30.9: ref %D = array_index %a.var, %.loc13_30.8 +// CHECK:STDOUT: %.loc13_29.2: init %D = class_init (), %.loc13_30.9 [template = constants.%struct] +// CHECK:STDOUT: %.loc13_30.10: init %D = converted %.loc13_29.1, %.loc13_29.2 [template = constants.%struct] +// CHECK:STDOUT: %.loc13_30.11: init %.32 = array_init (%.loc13_30.4, %.loc13_30.7, %.loc13_30.10) to %a.var [template = constants.%array] +// CHECK:STDOUT: %.loc13_31: init %.32 = converted %.loc13_30.1, %.loc13_30.11 [template = constants.%array] +// CHECK:STDOUT: assign %a.var, %.loc13_31 +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] +// CHECK:STDOUT: %a.ref: ref %.32 = name_ref a, %a +// CHECK:STDOUT: return to %return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { @@ -1083,17 +4080,17 @@ fn G() -> C { // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%.12) { -// CHECK:STDOUT: %Dest => constants.%.12 -// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 // CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.1 => constants.%.17 -// CHECK:STDOUT: %.2 => constants.%.18 +// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %.2 => constants.%.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(i32) { @@ -1105,113 +4102,100 @@ fn G() -> C { // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 // CHECK:STDOUT: %Convert => constants.%Convert.3 -// CHECK:STDOUT: %.1 => constants.%.20 -// CHECK:STDOUT: %.2 => constants.%.21 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: %.2 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%.22) { -// CHECK:STDOUT: %Dest => constants.%.22 -// CHECK:STDOUT: %Dest.patt => constants.%.22 +// CHECK:STDOUT: specific @ImplicitAs(constants.%.10) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { -// CHECK:STDOUT: %Dest => constants.%.22 -// CHECK:STDOUT: %Dest.patt => constants.%.22 +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.2(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.22 +// CHECK:STDOUT: specific @impl.2(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(@impl.2.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.22 +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.2(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.22 +// CHECK:STDOUT: specific @Convert.2(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%.24) { -// CHECK:STDOUT: %Dest => constants.%.24 -// CHECK:STDOUT: %Dest.patt => constants.%.24 +// CHECK:STDOUT: specific @ImplicitAs(constants.%.12) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { -// CHECK:STDOUT: %Dest => constants.%.24 -// CHECK:STDOUT: %Dest.patt => constants.%.24 +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.3(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.24 +// CHECK:STDOUT: specific @impl.3(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.3(@impl.3.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.24 +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.3(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.24 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { -// CHECK:STDOUT: %Dest => Core.IntLiteral -// CHECK:STDOUT: %Dest.patt => Core.IntLiteral -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.7 -// CHECK:STDOUT: %Self => constants.%Self.2 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.6 -// CHECK:STDOUT: %Convert => constants.%Convert.6 -// CHECK:STDOUT: %.1 => constants.%.26 -// CHECK:STDOUT: %.2 => constants.%.27 +// CHECK:STDOUT: specific @Convert.3(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.5(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.22 +// CHECK:STDOUT: specific @impl.5(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.5(@impl.5.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.22 +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.4(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.22 +// CHECK:STDOUT: specific @Convert.4(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.6(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.24 +// CHECK:STDOUT: specific @impl.6(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.6(@impl.6.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.24 +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.5(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.24 +// CHECK:STDOUT: specific @Convert.5(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(constants.%Dest) { @@ -1226,10 +4210,10 @@ fn G() -> C { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %As.type => constants.%As.type.3 // CHECK:STDOUT: %Self => constants.%Self.4 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.10 -// CHECK:STDOUT: %Convert => constants.%Convert.10 -// CHECK:STDOUT: %.1 => constants.%.32 -// CHECK:STDOUT: %.2 => constants.%.33 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.18 +// CHECK:STDOUT: %.2 => constants.%.19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(@As.%Dest) { @@ -1248,62 +4232,62 @@ fn G() -> C { // CHECK:STDOUT: %Self => constants.%Self.3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(constants.%.22) { -// CHECK:STDOUT: %Dest => constants.%.22 -// CHECK:STDOUT: %Dest.patt => constants.%.22 +// CHECK:STDOUT: specific @As(constants.%.10) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(@impl.8.%.1) { -// CHECK:STDOUT: %Dest => constants.%.22 -// CHECK:STDOUT: %Dest.patt => constants.%.22 +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.8(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.22 +// CHECK:STDOUT: specific @impl.8(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 // CHECK:STDOUT: %As.type => constants.%As.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.8(@impl.8.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.22 +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 // CHECK:STDOUT: %As.type => constants.%As.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.7(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.22 +// CHECK:STDOUT: specific @Convert.7(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(constants.%.24) { -// CHECK:STDOUT: %Dest => constants.%.24 -// CHECK:STDOUT: %Dest.patt => constants.%.24 +// CHECK:STDOUT: specific @As(constants.%.12) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(@impl.9.%.1) { -// CHECK:STDOUT: %Dest => constants.%.24 -// CHECK:STDOUT: %Dest.patt => constants.%.24 +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.9(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.24 +// CHECK:STDOUT: specific @impl.9(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 // CHECK:STDOUT: %As.type => constants.%As.type.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.9(@impl.9.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.24 +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 // CHECK:STDOUT: %As.type => constants.%As.type.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.8(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.24 +// CHECK:STDOUT: specific @Convert.8(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(Core.IntLiteral) { @@ -1313,190 +4297,50 @@ fn G() -> C { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %As.type => constants.%As.type.6 // CHECK:STDOUT: %Self => constants.%Self.4 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.13 -// CHECK:STDOUT: %Convert => constants.%Convert.13 -// CHECK:STDOUT: %.1 => constants.%.36 -// CHECK:STDOUT: %.2 => constants.%.37 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.22 +// CHECK:STDOUT: %.2 => constants.%.23 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.11(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.22 +// CHECK:STDOUT: specific @impl.11(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.11(@impl.11.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.22 +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.9(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.22 +// CHECK:STDOUT: specific @Convert.9(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.12(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.24 +// CHECK:STDOUT: specific @impl.12(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.12(@impl.12.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.24 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.10(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.24 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_type_mismatch.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %C: type = class_type @C [template] -// CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] -// CHECK:STDOUT: %D: type = class_type @D [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %N: i32 = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 [symbolic] -// CHECK:STDOUT: %F.type: type = fn_type @F [template] -// CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %G.type: type = fn_type @G [template] -// CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] -// CHECK:STDOUT: %.4: i32 = int_value 3 [template] -// CHECK:STDOUT: %.5: type = array_type %.4, %D [template] -// CHECK:STDOUT: %.6: type = ptr_type %.5 [template] -// CHECK:STDOUT: %tuple.type: type = tuple_type (%.1, %.1, %.1) [template] -// CHECK:STDOUT: %.7: i32 = int_value 0 [template] -// CHECK:STDOUT: %struct: %D = struct_value () [template] -// CHECK:STDOUT: %.8: i32 = int_value 1 [template] -// CHECK:STDOUT: %.9: i32 = int_value 2 [template] -// CHECK:STDOUT: %array: %.5 = tuple_value (%struct, %struct, %struct) [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .D = %D.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} -// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %N.patt.loc10_6.1: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc10_6.2 (constants.%N.patt)] -// CHECK:STDOUT: %N.param_patt: i32 = value_param_pattern %N.patt.loc10_6.1, runtime_param [symbolic = %N.patt.loc10_6.2 (constants.%N.patt)] -// CHECK:STDOUT: %a.patt: = binding_pattern a -// CHECK:STDOUT: %a.param_patt: = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc10_10: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc10_10.1: type = value_of_initializer %int.make_type_32.loc10_10 [template = i32] -// CHECK:STDOUT: %.loc10_10.2: type = converted %int.make_type_32.loc10_10, %.loc10_10.1 [template = i32] -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %N.ref.loc10_22: i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N)] -// CHECK:STDOUT: %.loc10_23: type = array_type %N.ref.loc10_22, %C [template = ] -// CHECK:STDOUT: %int.make_type_32.loc10_29: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc10_29.1: type = value_of_initializer %int.make_type_32.loc10_29 [template = i32] -// CHECK:STDOUT: %.loc10_29.2: type = converted %int.make_type_32.loc10_29, %.loc10_29.1 [template = i32] -// CHECK:STDOUT: %N.param: i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc10_6.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc10_6.2 (constants.%N)] -// CHECK:STDOUT: %a.param: = value_param runtime_param0 -// CHECK:STDOUT: %a: = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %return.patt: %C = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param0 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %return.param: ref %C = out_param runtime_param0 -// CHECK:STDOUT: %return: ref %C = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: class @C { -// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%C -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: class @D { -// CHECK:STDOUT: %.loc5: = complete_type_witness %.1 [template = constants.%.2] -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%D -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(%N.loc10_6.1: i32) { -// CHECK:STDOUT: %N.loc10_6.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc10_6.2 (constants.%N)] -// CHECK:STDOUT: %N.patt.loc10_6.2: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc10_6.2 (constants.%N.patt)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: -// CHECK:STDOUT: fn[%N.param_patt: i32](%a.param_patt: ) -> i32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %N.ref.loc10_42: i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N)] -// CHECK:STDOUT: return %N.ref.loc10_42 -// CHECK:STDOUT: } +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G() -> %return: %C { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %.loc13_14: i32 = int_value 3 [template = constants.%.4] -// CHECK:STDOUT: %.loc13_15: type = array_type %.loc13_14, %D [template = constants.%.5] -// CHECK:STDOUT: %a.var: ref %.5 = var a -// CHECK:STDOUT: %a: ref %.5 = bind_name a, %a.var -// CHECK:STDOUT: %.loc13_21.1: %.1 = struct_literal () -// CHECK:STDOUT: %.loc13_25.1: %.1 = struct_literal () -// CHECK:STDOUT: %.loc13_29.1: %.1 = struct_literal () -// CHECK:STDOUT: %.loc13_30.1: %tuple.type = tuple_literal (%.loc13_21.1, %.loc13_25.1, %.loc13_29.1) -// CHECK:STDOUT: %.loc13_30.2: i32 = int_value 0 [template = constants.%.7] -// CHECK:STDOUT: %.loc13_30.3: ref %D = array_index %a.var, %.loc13_30.2 -// CHECK:STDOUT: %.loc13_21.2: init %D = class_init (), %.loc13_30.3 [template = constants.%struct] -// CHECK:STDOUT: %.loc13_30.4: init %D = converted %.loc13_21.1, %.loc13_21.2 [template = constants.%struct] -// CHECK:STDOUT: %.loc13_30.5: i32 = int_value 1 [template = constants.%.8] -// CHECK:STDOUT: %.loc13_30.6: ref %D = array_index %a.var, %.loc13_30.5 -// CHECK:STDOUT: %.loc13_25.2: init %D = class_init (), %.loc13_30.6 [template = constants.%struct] -// CHECK:STDOUT: %.loc13_30.7: init %D = converted %.loc13_25.1, %.loc13_25.2 [template = constants.%struct] -// CHECK:STDOUT: %.loc13_30.8: i32 = int_value 2 [template = constants.%.9] -// CHECK:STDOUT: %.loc13_30.9: ref %D = array_index %a.var, %.loc13_30.8 -// CHECK:STDOUT: %.loc13_29.2: init %D = class_init (), %.loc13_30.9 [template = constants.%struct] -// CHECK:STDOUT: %.loc13_30.10: init %D = converted %.loc13_29.1, %.loc13_29.2 [template = constants.%struct] -// CHECK:STDOUT: %.loc13_30.11: init %.5 = array_init (%.loc13_30.4, %.loc13_30.7, %.loc13_30.10) to %a.var [template = constants.%array] -// CHECK:STDOUT: %.loc13_31: init %.5 = converted %.loc13_30.1, %.loc13_30.11 [template = constants.%array] -// CHECK:STDOUT: assign %a.var, %.loc13_31 -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] -// CHECK:STDOUT: %a.ref: ref %.5 = name_ref a, %a -// CHECK:STDOUT: return to %return +// CHECK:STDOUT: specific @Convert.10(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.12 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(constants.%N) { -// CHECK:STDOUT: %N.loc10_6.2 => constants.%N -// CHECK:STDOUT: %N.patt.loc10_6.2 => constants.%N +// CHECK:STDOUT: specific @F(constants.%N.1) { +// CHECK:STDOUT: %N.loc10_6.2 => constants.%N.1 +// CHECK:STDOUT: %N.patt.loc10_6.2 => constants.%N.1 +// CHECK:STDOUT: %.loc10_22.5 => constants.%.27 +// CHECK:STDOUT: %int.convert_checked.loc10_22.2 => constants.%int.convert_checked // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/eval/aggregate.carbon b/toolchain/check/testdata/eval/aggregate.carbon index ffa0ce3a91a7b..5305f4ec269c3 100644 --- a/toolchain/check/testdata/eval/aggregate.carbon +++ b/toolchain/check/testdata/eval/aggregate.carbon @@ -36,29 +36,157 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: %.9: type = ptr_type %.8 [template] // CHECK:STDOUT: %struct.1: %.8 = struct_value (%.3, %.2, %.6) [template] // CHECK:STDOUT: %struct.2: %.4 = struct_value (%.2, %.3, %.6) [template] -// CHECK:STDOUT: %.10: type = array_type %.2, i32 [template] -// CHECK:STDOUT: %.11: type = ptr_type %.10 [template] -// CHECK:STDOUT: %.12: i32 = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.10: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.12: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.14: %.10 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.15: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.17: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.17)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.18: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.19: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.19)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.20: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.21: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.23: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.24: %.23 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.25: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.26: %.25 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.17)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.19)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.28: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.29: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.30: %.29 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.31: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.32: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.33: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.34: = bound_method %.2, %Convert.15 [template] +// CHECK:STDOUT: %.35: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.36: type = array_type %.35, i32 [template] +// CHECK:STDOUT: %.37: type = ptr_type %.36 [template] +// CHECK:STDOUT: %.38: i32 = int_value 0 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (i32) [template] -// CHECK:STDOUT: %.13: i32 = int_value 5 [template] -// CHECK:STDOUT: %.14: i32 = int_value 7 [template] -// CHECK:STDOUT: %.15: i32 = int_value 9 [template] +// CHECK:STDOUT: %.39: i32 = int_value 5 [template] +// CHECK:STDOUT: %.40: i32 = int_value 7 [template] +// CHECK:STDOUT: %.41: i32 = int_value 9 [template] // CHECK:STDOUT: %tuple.type.4: type = tuple_type (i32, i32, i32, i32) [template] -// CHECK:STDOUT: %.16: type = ptr_type %tuple.type.4 [template] -// CHECK:STDOUT: %tuple.2: %tuple.type.4 = tuple_value (%.13, %.14, %.2, %.15) [template] -// CHECK:STDOUT: %array: %.10 = tuple_value (%.12) [template] -// CHECK:STDOUT: %.17: type = struct_type {.a: i32, .b: i32} [template] -// CHECK:STDOUT: %.18: type = ptr_type %.17 [template] -// CHECK:STDOUT: %struct.3: %.17 = struct_value (%.6, %.2) [template] +// CHECK:STDOUT: %.42: type = ptr_type %tuple.type.4 [template] +// CHECK:STDOUT: %tuple.2: %tuple.type.4 = tuple_value (%.39, %.40, %.2, %.41) [template] +// CHECK:STDOUT: %array: %.36 = tuple_value (%.38) [template] +// CHECK:STDOUT: %.43: type = struct_type {.a: i32, .b: i32} [template] +// CHECK:STDOUT: %.44: type = ptr_type %.43 [template] +// CHECK:STDOUT: %struct.3: %.43 = struct_value (%.6, %.2) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.10) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.14)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.33] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.17)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.19)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.17)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.19)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -93,23 +221,315 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: %struct_copy.var: ref %.4 = var struct_copy // CHECK:STDOUT: %struct_copy: ref %.4 = bind_name struct_copy, %struct_copy.var // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_24: i32 = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc15_24.1: i32 = int_value 1 [template = constants.%.2] // CHECK:STDOUT: %.loc15_19.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_19.2: type = converted %int.make_type_32.loc15, %.loc15_19.1 [template = i32] -// CHECK:STDOUT: %.loc15_25: type = array_type %.loc15_24, i32 [template = constants.%.10] -// CHECK:STDOUT: %tuple_index.var: ref %.10 = var tuple_index -// CHECK:STDOUT: %tuple_index: ref %.10 = bind_name tuple_index, %tuple_index.var +// CHECK:STDOUT: %.loc15_24.2: %Convert.type.2 = interface_witness_access constants.%.33, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc15_24.3: = bound_method %.loc15_24.1, %.loc15_24.2 [template = constants.%.34] +// CHECK:STDOUT: %int.convert_checked.loc15: init Core.IntLiteral = call %.loc15_24.3(%.loc15_24.1) [template = constants.%.35] +// CHECK:STDOUT: %.loc15_24.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc15 [template = constants.%.35] +// CHECK:STDOUT: %.loc15_24.5: Core.IntLiteral = converted %.loc15_24.1, %.loc15_24.4 [template = constants.%.35] +// CHECK:STDOUT: %.loc15_25: type = array_type %.loc15_24.5, i32 [template = constants.%.36] +// CHECK:STDOUT: %tuple_index.var: ref %.36 = var tuple_index +// CHECK:STDOUT: %tuple_index: ref %.36 = bind_name tuple_index, %tuple_index.var // CHECK:STDOUT: %int.make_type_32.loc17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc17_26: i32 = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc17_26.1: i32 = int_value 1 [template = constants.%.2] // CHECK:STDOUT: %.loc17_21.1: type = value_of_initializer %int.make_type_32.loc17 [template = i32] // CHECK:STDOUT: %.loc17_21.2: type = converted %int.make_type_32.loc17, %.loc17_21.1 [template = i32] -// CHECK:STDOUT: %.loc17_27: type = array_type %.loc17_26, i32 [template = constants.%.10] -// CHECK:STDOUT: %struct_access.var: ref %.10 = var struct_access -// CHECK:STDOUT: %struct_access: ref %.10 = bind_name struct_access, %struct_access.var +// CHECK:STDOUT: %.loc17_26.2: %Convert.type.2 = interface_witness_access constants.%.33, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc17_26.3: = bound_method %.loc17_26.1, %.loc17_26.2 [template = constants.%.34] +// CHECK:STDOUT: %int.convert_checked.loc17: init Core.IntLiteral = call %.loc17_26.3(%.loc17_26.1) [template = constants.%.35] +// CHECK:STDOUT: %.loc17_26.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc17 [template = constants.%.35] +// CHECK:STDOUT: %.loc17_26.5: Core.IntLiteral = converted %.loc17_26.1, %.loc17_26.4 [template = constants.%.35] +// CHECK:STDOUT: %.loc17_27: type = array_type %.loc17_26.5, i32 [template = constants.%.36] +// CHECK:STDOUT: %struct_access.var: ref %.36 = var struct_access +// CHECK:STDOUT: %struct_access: ref %.36 = bind_name struct_access, %struct_access.var +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.10) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.23)] +// CHECK:STDOUT: %.2: @As.%.1 (%.23) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.18)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.19)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.20)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.27)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.19)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.28)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.31)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.32)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.17) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.19) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.17)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.19)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.17) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.19) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.17)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.19)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc11_31: i32 = int_value 1 [template = constants.%.2] @@ -158,47 +578,335 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: %.loc13_73.11: init %.4 = struct_init (%.loc13_73.4, %.loc13_73.7, %.loc13_73.10) to file.%struct_copy.var [template = constants.%struct.2] // CHECK:STDOUT: %.loc13_103: init %.4 = converted %.loc13_73.1, %.loc13_73.11 [template = constants.%struct.2] // CHECK:STDOUT: assign file.%struct_copy.var, %.loc13_103 -// CHECK:STDOUT: %.loc15_30: i32 = int_value 0 [template = constants.%.12] +// CHECK:STDOUT: %.loc15_30: i32 = int_value 0 [template = constants.%.38] // CHECK:STDOUT: %.loc15_32.1: %tuple.type.3 = tuple_literal (%.loc15_30) // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_44: i32 = int_value 5 [template = constants.%.13] -// CHECK:STDOUT: %.loc15_47: i32 = int_value 7 [template = constants.%.14] +// CHECK:STDOUT: %.loc15_44: i32 = int_value 5 [template = constants.%.39] +// CHECK:STDOUT: %.loc15_47: i32 = int_value 7 [template = constants.%.40] // CHECK:STDOUT: %.loc15_50: i32 = int_value 1 [template = constants.%.2] -// CHECK:STDOUT: %.loc15_53: i32 = int_value 9 [template = constants.%.15] +// CHECK:STDOUT: %.loc15_53: i32 = int_value 9 [template = constants.%.41] // CHECK:STDOUT: %.loc15_54.1: %tuple.type.4 = tuple_literal (%.loc15_44, %.loc15_47, %.loc15_50, %.loc15_53) // CHECK:STDOUT: %.loc15_56: i32 = int_value 2 [template = constants.%.3] // CHECK:STDOUT: %tuple: %tuple.type.4 = tuple_value (%.loc15_44, %.loc15_47, %.loc15_50, %.loc15_53) [template = constants.%tuple.2] // CHECK:STDOUT: %.loc15_54.2: %tuple.type.4 = converted %.loc15_54.1, %tuple [template = constants.%tuple.2] -// CHECK:STDOUT: %.loc15_55: i32 = tuple_access %.loc15_54.2, element2 [template = constants.%.2] +// CHECK:STDOUT: %.loc15_55.1: i32 = tuple_access %.loc15_54.2, element2 [template = constants.%.2] // CHECK:STDOUT: %.loc15_38.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_38.2: type = converted %int.make_type_32.loc15, %.loc15_38.1 [template = i32] -// CHECK:STDOUT: %.loc15_57: type = array_type %.loc15_55, i32 [template = constants.%.10] -// CHECK:STDOUT: %.loc15_5: ref %.10 = splice_block file.%tuple_index.var {} -// CHECK:STDOUT: %.loc15_32.2: i32 = int_value 0 [template = constants.%.12] +// CHECK:STDOUT: %.loc15_55.2: %Convert.type.2 = interface_witness_access constants.%.33, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc15_55.3: = bound_method %.loc15_55.1, %.loc15_55.2 [template = constants.%.34] +// CHECK:STDOUT: %int.convert_checked.loc15: init Core.IntLiteral = call %.loc15_55.3(%.loc15_55.1) [template = constants.%.35] +// CHECK:STDOUT: %.loc15_55.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc15 [template = constants.%.35] +// CHECK:STDOUT: %.loc15_55.5: Core.IntLiteral = converted %.loc15_55.1, %.loc15_55.4 [template = constants.%.35] +// CHECK:STDOUT: %.loc15_57: type = array_type %.loc15_55.5, i32 [template = constants.%.36] +// CHECK:STDOUT: %.loc15_5: ref %.36 = splice_block file.%tuple_index.var {} +// CHECK:STDOUT: %.loc15_32.2: i32 = int_value 0 [template = constants.%.38] // CHECK:STDOUT: %.loc15_32.3: ref i32 = array_index %.loc15_5, %.loc15_32.2 -// CHECK:STDOUT: %.loc15_32.4: init i32 = initialize_from %.loc15_30 to %.loc15_32.3 [template = constants.%.12] -// CHECK:STDOUT: %.loc15_32.5: init %.10 = array_init (%.loc15_32.4) to %.loc15_5 [template = constants.%array] -// CHECK:STDOUT: %.loc15_34: init %.10 = converted %.loc15_32.1, %.loc15_32.5 [template = constants.%array] +// CHECK:STDOUT: %.loc15_32.4: init i32 = initialize_from %.loc15_30 to %.loc15_32.3 [template = constants.%.38] +// CHECK:STDOUT: %.loc15_32.5: init %.36 = array_init (%.loc15_32.4) to %.loc15_5 [template = constants.%array] +// CHECK:STDOUT: %.loc15_34: init %.36 = converted %.loc15_32.1, %.loc15_32.5 [template = constants.%array] // CHECK:STDOUT: assign file.%tuple_index.var, %.loc15_34 -// CHECK:STDOUT: %.loc17_32: i32 = int_value 0 [template = constants.%.12] +// CHECK:STDOUT: %.loc17_32: i32 = int_value 0 [template = constants.%.38] // CHECK:STDOUT: %.loc17_34.1: %tuple.type.3 = tuple_literal (%.loc17_32) // CHECK:STDOUT: %int.make_type_32.loc17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc17_51: i32 = int_value 3 [template = constants.%.6] // CHECK:STDOUT: %.loc17_59: i32 = int_value 1 [template = constants.%.2] -// CHECK:STDOUT: %.loc17_60.1: %.17 = struct_literal (%.loc17_51, %.loc17_59) -// CHECK:STDOUT: %struct.loc17: %.17 = struct_value (%.loc17_51, %.loc17_59) [template = constants.%struct.3] -// CHECK:STDOUT: %.loc17_60.2: %.17 = converted %.loc17_60.1, %struct.loc17 [template = constants.%struct.3] -// CHECK:STDOUT: %.loc17_61: i32 = struct_access %.loc17_60.2, element1 [template = constants.%.2] +// CHECK:STDOUT: %.loc17_60.1: %.43 = struct_literal (%.loc17_51, %.loc17_59) +// CHECK:STDOUT: %struct.loc17: %.43 = struct_value (%.loc17_51, %.loc17_59) [template = constants.%struct.3] +// CHECK:STDOUT: %.loc17_60.2: %.43 = converted %.loc17_60.1, %struct.loc17 [template = constants.%struct.3] +// CHECK:STDOUT: %.loc17_61.1: i32 = struct_access %.loc17_60.2, element1 [template = constants.%.2] // CHECK:STDOUT: %.loc17_40.1: type = value_of_initializer %int.make_type_32.loc17 [template = i32] // CHECK:STDOUT: %.loc17_40.2: type = converted %int.make_type_32.loc17, %.loc17_40.1 [template = i32] -// CHECK:STDOUT: %.loc17_63: type = array_type %.loc17_61, i32 [template = constants.%.10] -// CHECK:STDOUT: %.loc17_5: ref %.10 = splice_block file.%struct_access.var {} -// CHECK:STDOUT: %.loc17_34.2: i32 = int_value 0 [template = constants.%.12] +// CHECK:STDOUT: %.loc17_61.2: %Convert.type.2 = interface_witness_access constants.%.33, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc17_61.3: = bound_method %.loc17_61.1, %.loc17_61.2 [template = constants.%.34] +// CHECK:STDOUT: %int.convert_checked.loc17: init Core.IntLiteral = call %.loc17_61.3(%.loc17_61.1) [template = constants.%.35] +// CHECK:STDOUT: %.loc17_61.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc17 [template = constants.%.35] +// CHECK:STDOUT: %.loc17_61.5: Core.IntLiteral = converted %.loc17_61.1, %.loc17_61.4 [template = constants.%.35] +// CHECK:STDOUT: %.loc17_63: type = array_type %.loc17_61.5, i32 [template = constants.%.36] +// CHECK:STDOUT: %.loc17_5: ref %.36 = splice_block file.%struct_access.var {} +// CHECK:STDOUT: %.loc17_34.2: i32 = int_value 0 [template = constants.%.38] // CHECK:STDOUT: %.loc17_34.3: ref i32 = array_index %.loc17_5, %.loc17_34.2 -// CHECK:STDOUT: %.loc17_34.4: init i32 = initialize_from %.loc17_32 to %.loc17_34.3 [template = constants.%.12] -// CHECK:STDOUT: %.loc17_34.5: init %.10 = array_init (%.loc17_34.4) to %.loc17_5 [template = constants.%array] -// CHECK:STDOUT: %.loc17_36: init %.10 = converted %.loc17_34.1, %.loc17_34.5 [template = constants.%array] +// CHECK:STDOUT: %.loc17_34.4: init i32 = initialize_from %.loc17_32 to %.loc17_34.3 [template = constants.%.38] +// CHECK:STDOUT: %.loc17_34.5: init %.36 = array_init (%.loc17_34.4) to %.loc17_5 [template = constants.%array] +// CHECK:STDOUT: %.loc17_36: init %.36 = converted %.loc17_34.1, %.loc17_34.5 [template = constants.%array] // CHECK:STDOUT: assign file.%struct_access.var, %.loc17_36 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %.2 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: %.2 => constants.%.16 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.17) { +// CHECK:STDOUT: %Dest => constants.%.17 +// CHECK:STDOUT: %Dest.patt => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.17 +// CHECK:STDOUT: %Dest.patt => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.19) { +// CHECK:STDOUT: %Dest => constants.%.19 +// CHECK:STDOUT: %Dest.patt => constants.%.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.19 +// CHECK:STDOUT: %Dest.patt => constants.%.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.25 +// CHECK:STDOUT: %.2 => constants.%.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.17) { +// CHECK:STDOUT: %Dest => constants.%.17 +// CHECK:STDOUT: %Dest.patt => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.17 +// CHECK:STDOUT: %Dest.patt => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.19) { +// CHECK:STDOUT: %Dest => constants.%.19 +// CHECK:STDOUT: %Dest.patt => constants.%.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.19 +// CHECK:STDOUT: %Dest.patt => constants.%.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.29 +// CHECK:STDOUT: %.2 => constants.%.30 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/eval/fail_aggregate.carbon b/toolchain/check/testdata/eval/fail_aggregate.carbon index cd27e7ff7d908..b24d15b971b46 100644 --- a/toolchain/check/testdata/eval/fail_aggregate.carbon +++ b/toolchain/check/testdata/eval/fail_aggregate.carbon @@ -22,29 +22,159 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.1: i32 = int_value 1 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] -// CHECK:STDOUT: %.4: i32 = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.2: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.3: %.2 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.6: %.2 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.9: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.9)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.10: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.11: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.9)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.19: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.20: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.21: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.22: %.21 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.28: type = array_type %.27, i32 [template] +// CHECK:STDOUT: %.29: type = ptr_type %.28 [template] +// CHECK:STDOUT: %.30: i32 = int_value 0 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (i32) [template] -// CHECK:STDOUT: %.5: i32 = int_value 5 [template] -// CHECK:STDOUT: %.6: i32 = int_value 7 [template] -// CHECK:STDOUT: %.7: i32 = int_value 9 [template] +// CHECK:STDOUT: %.31: i32 = int_value 5 [template] +// CHECK:STDOUT: %.32: i32 = int_value 7 [template] +// CHECK:STDOUT: %.33: i32 = int_value 9 [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32, i32, i32) [template] -// CHECK:STDOUT: %.8: i32 = int_value 4 [template] -// CHECK:STDOUT: %.9: type = array_type %.8, i32 [template] -// CHECK:STDOUT: %.10: type = ptr_type %.9 [template] -// CHECK:STDOUT: %.11: i32 = int_value 2 [template] -// CHECK:STDOUT: %.12: i32 = int_value 3 [template] -// CHECK:STDOUT: %array: %.9 = tuple_value (%.5, %.6, %.1, %.7) [template] +// CHECK:STDOUT: %.34: i32 = int_value 4 [template] +// CHECK:STDOUT: %.35: = bound_method %.34, %Convert.15 [template] +// CHECK:STDOUT: %.36: Core.IntLiteral = int_value 4 [template] +// CHECK:STDOUT: %.37: type = array_type %.36, i32 [template] +// CHECK:STDOUT: %.38: type = ptr_type %.37 [template] +// CHECK:STDOUT: %.39: i32 = int_value 2 [template] +// CHECK:STDOUT: %.40: i32 = int_value 3 [template] +// CHECK:STDOUT: %array: %.37 = tuple_value (%.31, %.32, %.1, %.33) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.2) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.6)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.25] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -54,51 +184,623 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_24: i32 = int_value 1 [template = constants.%.1] +// CHECK:STDOUT: %.loc16_24.1: i32 = int_value 1 [template = constants.%.1] // CHECK:STDOUT: %.loc16_19.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc16_19.2: type = converted %int.make_type_32, %.loc16_19.1 [template = i32] -// CHECK:STDOUT: %.loc16_25: type = array_type %.loc16_24, i32 [template = constants.%.2] -// CHECK:STDOUT: %array_index.var: ref %.2 = var array_index -// CHECK:STDOUT: %array_index: ref %.2 = bind_name array_index, %array_index.var +// CHECK:STDOUT: %.loc16_24.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc16_24.3: = bound_method %.loc16_24.1, %.loc16_24.2 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc16_24.3(%.loc16_24.1) [template = constants.%.27] +// CHECK:STDOUT: %.loc16_24.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.27] +// CHECK:STDOUT: %.loc16_24.5: Core.IntLiteral = converted %.loc16_24.1, %.loc16_24.4 [template = constants.%.27] +// CHECK:STDOUT: %.loc16_25: type = array_type %.loc16_24.5, i32 [template = constants.%.28] +// CHECK:STDOUT: %array_index.var: ref %.28 = var array_index +// CHECK:STDOUT: %array_index: ref %.28 = bind_name array_index, %array_index.var +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.2) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %.2: @As.%.1 (%.15) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.20)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.23)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc16_30: i32 = int_value 0 [template = constants.%.4] +// CHECK:STDOUT: %.loc16_30: i32 = int_value 0 [template = constants.%.30] // CHECK:STDOUT: %.loc16_32: %tuple.type.1 = tuple_literal (%.loc16_30) // CHECK:STDOUT: %int.make_type_32.loc16_38: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_45: i32 = int_value 5 [template = constants.%.5] -// CHECK:STDOUT: %.loc16_48: i32 = int_value 7 [template = constants.%.6] +// CHECK:STDOUT: %.loc16_45: i32 = int_value 5 [template = constants.%.31] +// CHECK:STDOUT: %.loc16_48: i32 = int_value 7 [template = constants.%.32] // CHECK:STDOUT: %.loc16_51: i32 = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc16_54: i32 = int_value 9 [template = constants.%.7] +// CHECK:STDOUT: %.loc16_54: i32 = int_value 9 [template = constants.%.33] // CHECK:STDOUT: %.loc16_55.1: %tuple.type.2 = tuple_literal (%.loc16_45, %.loc16_48, %.loc16_51, %.loc16_54) // CHECK:STDOUT: %int.make_type_32.loc16_61: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_66: i32 = int_value 4 [template = constants.%.8] +// CHECK:STDOUT: %.loc16_66.1: i32 = int_value 4 [template = constants.%.34] // CHECK:STDOUT: %.loc16_61.1: type = value_of_initializer %int.make_type_32.loc16_61 [template = i32] // CHECK:STDOUT: %.loc16_61.2: type = converted %int.make_type_32.loc16_61, %.loc16_61.1 [template = i32] -// CHECK:STDOUT: %.loc16_67: type = array_type %.loc16_66, i32 [template = constants.%.9] -// CHECK:STDOUT: %.loc16_55.2: ref %.9 = temporary_storage -// CHECK:STDOUT: %.loc16_55.3: i32 = int_value 0 [template = constants.%.4] +// CHECK:STDOUT: %.loc16_66.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc16_66.3: = bound_method %.loc16_66.1, %.loc16_66.2 [template = constants.%.35] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc16_66.3(%.loc16_66.1) [template = constants.%.36] +// CHECK:STDOUT: %.loc16_66.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.36] +// CHECK:STDOUT: %.loc16_66.5: Core.IntLiteral = converted %.loc16_66.1, %.loc16_66.4 [template = constants.%.36] +// CHECK:STDOUT: %.loc16_67: type = array_type %.loc16_66.5, i32 [template = constants.%.37] +// CHECK:STDOUT: %.loc16_55.2: ref %.37 = temporary_storage +// CHECK:STDOUT: %.loc16_55.3: i32 = int_value 0 [template = constants.%.30] // CHECK:STDOUT: %.loc16_55.4: ref i32 = array_index %.loc16_55.2, %.loc16_55.3 -// CHECK:STDOUT: %.loc16_55.5: init i32 = initialize_from %.loc16_45 to %.loc16_55.4 [template = constants.%.5] +// CHECK:STDOUT: %.loc16_55.5: init i32 = initialize_from %.loc16_45 to %.loc16_55.4 [template = constants.%.31] // CHECK:STDOUT: %.loc16_55.6: i32 = int_value 1 [template = constants.%.1] // CHECK:STDOUT: %.loc16_55.7: ref i32 = array_index %.loc16_55.2, %.loc16_55.6 -// CHECK:STDOUT: %.loc16_55.8: init i32 = initialize_from %.loc16_48 to %.loc16_55.7 [template = constants.%.6] -// CHECK:STDOUT: %.loc16_55.9: i32 = int_value 2 [template = constants.%.11] +// CHECK:STDOUT: %.loc16_55.8: init i32 = initialize_from %.loc16_48 to %.loc16_55.7 [template = constants.%.32] +// CHECK:STDOUT: %.loc16_55.9: i32 = int_value 2 [template = constants.%.39] // CHECK:STDOUT: %.loc16_55.10: ref i32 = array_index %.loc16_55.2, %.loc16_55.9 // CHECK:STDOUT: %.loc16_55.11: init i32 = initialize_from %.loc16_51 to %.loc16_55.10 [template = constants.%.1] -// CHECK:STDOUT: %.loc16_55.12: i32 = int_value 3 [template = constants.%.12] +// CHECK:STDOUT: %.loc16_55.12: i32 = int_value 3 [template = constants.%.40] // CHECK:STDOUT: %.loc16_55.13: ref i32 = array_index %.loc16_55.2, %.loc16_55.12 -// CHECK:STDOUT: %.loc16_55.14: init i32 = initialize_from %.loc16_54 to %.loc16_55.13 [template = constants.%.7] -// CHECK:STDOUT: %.loc16_55.15: init %.9 = array_init (%.loc16_55.5, %.loc16_55.8, %.loc16_55.11, %.loc16_55.14) to %.loc16_55.2 [template = constants.%array] -// CHECK:STDOUT: %.loc16_57.1: init %.9 = converted %.loc16_55.1, %.loc16_55.15 [template = constants.%array] -// CHECK:STDOUT: %.loc16_70: i32 = int_value 2 [template = constants.%.11] -// CHECK:STDOUT: %.loc16_57.2: ref %.9 = temporary %.loc16_55.2, %.loc16_57.1 +// CHECK:STDOUT: %.loc16_55.14: init i32 = initialize_from %.loc16_54 to %.loc16_55.13 [template = constants.%.33] +// CHECK:STDOUT: %.loc16_55.15: init %.37 = array_init (%.loc16_55.5, %.loc16_55.8, %.loc16_55.11, %.loc16_55.14) to %.loc16_55.2 [template = constants.%array] +// CHECK:STDOUT: %.loc16_57.1: init %.37 = converted %.loc16_55.1, %.loc16_55.15 [template = constants.%array] +// CHECK:STDOUT: %.loc16_70: i32 = int_value 2 [template = constants.%.39] +// CHECK:STDOUT: %.loc16_57.2: ref %.37 = temporary %.loc16_55.2, %.loc16_57.1 // CHECK:STDOUT: %.loc16_71.1: ref i32 = array_index %.loc16_57.2, %.loc16_70 // CHECK:STDOUT: %.loc16_71.2: i32 = bind_value %.loc16_71.1 +// CHECK:STDOUT: %.loc16_38.1: type = value_of_initializer %int.make_type_32.loc16_38 [template = i32] +// CHECK:STDOUT: %.loc16_38.2: type = converted %int.make_type_32.loc16_38, %.loc16_38.1 [template = i32] // CHECK:STDOUT: assign file.%array_index.var, // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.2 => constants.%.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %.2 => constants.%.18 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.21 +// CHECK:STDOUT: %.2 => constants.%.22 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/eval/fail_symbolic.carbon b/toolchain/check/testdata/eval/fail_symbolic.carbon index 4a12df4ec7583..d20c3834ea8a4 100644 --- a/toolchain/check/testdata/eval/fail_symbolic.carbon +++ b/toolchain/check/testdata/eval/fail_symbolic.carbon @@ -22,19 +22,147 @@ fn G(N:! i32) { // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %N: i32 = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %N.1: i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt.1: i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.1: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.2: %.1 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.3: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.5: %.1 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N.2: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.8: type = int_type signed, %N.2 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.8)> [symbolic] +// CHECK:STDOUT: %N.patt.2: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.9: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.10: type = int_type unsigned, %N.2 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.10)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.11: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.15: %.14 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.16: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.17: %.16 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.8)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.18: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.10)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.19: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.20: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.21: %.20 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.25: = bound_method %N.1, %Convert.15 [symbolic] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.25(%N.1) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.1) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.5)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.24] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.8)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.10)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.8)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.10)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -44,40 +172,607 @@ fn G(N:! i32) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %N.patt.loc12_6.1: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc12_6.2 (constants.%N.patt)] -// CHECK:STDOUT: %N.param_patt: i32 = value_param_pattern %N.patt.loc12_6.1, runtime_param [symbolic = %N.patt.loc12_6.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.patt.loc12_6.1: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc12_6.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.param_patt: i32 = value_param_pattern %N.patt.loc12_6.1, runtime_param [symbolic = %N.patt.loc12_6.2 (constants.%N.patt.1)] // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] // CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32.loc12, %.loc12_10.1 [template = i32] // CHECK:STDOUT: %N.param: i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc12_6.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc12_6.2 (constants.%N)] +// CHECK:STDOUT: %N.loc12_6.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc12_6.2 (constants.%N.1)] +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.1)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.1) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: %.2: @As.%.1 (%.14) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.8)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.8)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.8)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.18)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.8)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.23)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: generic fn @G(%N.loc12_6.1: i32) { -// CHECK:STDOUT: %N.loc12_6.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc12_6.2 (constants.%N)] -// CHECK:STDOUT: %N.patt.loc12_6.2: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc12_6.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.loc12_6.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc12_6.2 (constants.%N.1)] +// CHECK:STDOUT: %N.patt.loc12_6.2: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc12_6.2 (constants.%N.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %.loc16_16.5: = bound_method %N.loc12_6.2, constants.%Convert.15 [symbolic = %.loc16_16.5 (constants.%.25)] +// CHECK:STDOUT: %int.convert_checked.loc16_16.2: init Core.IntLiteral = call %.loc16_16.5(%N.loc12_6.2) [symbolic = %int.convert_checked.loc16_16.2 (constants.%int.convert_checked)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%N.param_patt: i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %N.ref: i32 = name_ref N, %N.loc12_6.1 [symbolic = %N.loc12_6.2 (constants.%N)] +// CHECK:STDOUT: %N.ref: i32 = name_ref N, %N.loc12_6.1 [symbolic = %N.loc12_6.2 (constants.%N.1)] // CHECK:STDOUT: %.loc16_11.1: type = value_of_initializer %int.make_type_32.loc16 [template = i32] // CHECK:STDOUT: %.loc16_11.2: type = converted %int.make_type_32.loc16, %.loc16_11.1 [template = i32] -// CHECK:STDOUT: %.loc16_17: type = array_type %N.ref, i32 [template = ] +// CHECK:STDOUT: %.loc16_16.1: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc16_16.2: = bound_method %N.ref, %.loc16_16.1 [symbolic = %.loc16_16.5 (constants.%.25)] +// CHECK:STDOUT: %int.convert_checked.loc16_16.1: init Core.IntLiteral = call %.loc16_16.2(%N.ref) [symbolic = %int.convert_checked.loc16_16.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc16_16.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc16_16.1 [symbolic = %int.convert_checked.loc16_16.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc16_16.4: Core.IntLiteral = converted %N.ref, %.loc16_16.3 [symbolic = %int.convert_checked.loc16_16.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc16_17: type = array_type %.loc16_16.4, i32 [template = ] // CHECK:STDOUT: %k.var: ref = var k // CHECK:STDOUT: %k: ref = bind_name k, %k.var // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @G(constants.%N) { -// CHECK:STDOUT: %N.loc12_6.2 => constants.%N -// CHECK:STDOUT: %N.patt.loc12_6.2 => constants.%N +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.8)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.8) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.10) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.8)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.8)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.8)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.8) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.10) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.8)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.8)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: +// CHECK:STDOUT: specific @G(constants.%N.1) { +// CHECK:STDOUT: %N.loc12_6.2 => constants.%N.1 +// CHECK:STDOUT: %N.patt.loc12_6.2 => constants.%N.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.3 +// CHECK:STDOUT: %.2 => constants.%.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.2 => constants.%.7 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.8) { +// CHECK:STDOUT: %Dest => constants.%.8 +// CHECK:STDOUT: %Dest.patt => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.8 +// CHECK:STDOUT: %Dest.patt => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.10) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.16 +// CHECK:STDOUT: %.2 => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.8) { +// CHECK:STDOUT: %Dest => constants.%.8 +// CHECK:STDOUT: %Dest.patt => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.8 +// CHECK:STDOUT: %Dest.patt => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.10) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.20 +// CHECK:STDOUT: %.2 => constants.%.21 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/eval/symbolic.carbon b/toolchain/check/testdata/eval/symbolic.carbon index 776fff3dc5d5b..300151e8b494d 100644 --- a/toolchain/check/testdata/eval/symbolic.carbon +++ b/toolchain/check/testdata/eval/symbolic.carbon @@ -31,15 +31,143 @@ fn F(T:! type) { // CHECK:STDOUT: %.3: type = ptr_type %tuple.type.3 [symbolic] // CHECK:STDOUT: %.4: type = struct_type {.a: %T} [symbolic] // CHECK:STDOUT: %.5: i32 = int_value 5 [template] -// CHECK:STDOUT: %.6: type = array_type %.5, %T [symbolic] -// CHECK:STDOUT: %.7: type = ptr_type %.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.5 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.8: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.5 [template] +// CHECK:STDOUT: %.10: %.6 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.11: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.13: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.13)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.15: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.15)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.17: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.18: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.19: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.20: %.19 = assoc_entity element0, imports.%import_ref.32 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.21: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.22: %.21 = assoc_entity element0, imports.%import_ref.33 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.15)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.25: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.26: %.25 = assoc_entity element0, imports.%import_ref.43 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.28: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.29: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.30: = bound_method %.5, %Convert.15 [template] +// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 5 [template] +// CHECK:STDOUT: %.32: type = array_type %.31, %T [symbolic] +// CHECK:STDOUT: %.33: type = ptr_type %.32 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .ImplicitAs = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.6) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.10)] +// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.13 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.14: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.16 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.17: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.19: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.29] +// CHECK:STDOUT: %import_ref.20: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.22 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.23: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.15)] +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.25 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.29: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.31 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.36 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.37: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.39 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.40: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.42 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.44: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.46 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.47: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.15)] +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.49 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -57,6 +185,198 @@ fn F(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.6)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.6) = assoc_entity element0, imports.%import_ref.5 [symbolic = %.2 (constants.%.7)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .Convert = imports.%import_ref.3 +// CHECK:STDOUT: witness = (imports.%import_ref.4) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.19)] +// CHECK:STDOUT: %.2: @As.%.1 (%.19) = assoc_entity element0, imports.%import_ref.32 [symbolic = %.2 (constants.%.20)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.26 +// CHECK:STDOUT: .Convert = imports.%import_ref.27 +// CHECK:STDOUT: witness = (imports.%import_ref.28) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.7 as imports.%import_ref.8 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.11 as imports.%import_ref.12 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.14 as imports.%import_ref.15 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.16 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.17 as imports.%import_ref.18 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.17)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.20 as imports.%import_ref.21 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.22 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.18)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.23 as imports.%import_ref.24 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.25 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.29 as imports.%import_ref.30 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.31 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.23)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.34 as imports.%import_ref.35 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.36 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.37 as imports.%import_ref.38 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.39 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.40 as imports.%import_ref.41 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.42 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.27)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.44 as imports.%import_ref.45 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.46 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.28)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.47 as imports.%import_ref.48 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.49 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc12_6.1: type) { // CHECK:STDOUT: %T.loc12_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc12_6.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc12_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_6.2 (constants.%T.patt)] @@ -66,7 +386,7 @@ fn F(T:! type) { // CHECK:STDOUT: %.loc13_15.2: type = const_type @F.%T.loc12_6.2 (%T) [symbolic = %.loc13_15.2 (constants.%.2)] // CHECK:STDOUT: %tuple.type: type = tuple_type (@F.%.loc13_12.2 (%.1), @F.%.loc13_15.2 (%.2)) [symbolic = %tuple.type (constants.%tuple.type.2)] // CHECK:STDOUT: %.loc14_16.2: type = struct_type {.a: @F.%T.loc12_6.2 (%T)} [symbolic = %.loc14_16.2 (constants.%.4)] -// CHECK:STDOUT: %.loc15_15.2: type = array_type constants.%.5, @F.%T.loc12_6.2 (%T) [symbolic = %.loc15_15.2 (constants.%.6)] +// CHECK:STDOUT: %.loc15_15.2: type = array_type constants.%.31, @F.%T.loc12_6.2 (%T) [symbolic = %.loc15_15.2 (constants.%.32)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type) { // CHECK:STDOUT: !entry: @@ -83,16 +403,389 @@ fn F(T:! type) { // CHECK:STDOUT: %v.var: ref @F.%.loc14_16.2 (%.4) = var v // CHECK:STDOUT: %v: ref @F.%.loc14_16.2 (%.4) = bind_name v, %v.var // CHECK:STDOUT: %T.ref.loc15: type = name_ref T, %T.loc12_6.1 [symbolic = %T.loc12_6.2 (constants.%T)] -// CHECK:STDOUT: %.loc15_14: i32 = int_value 5 [template = constants.%.5] -// CHECK:STDOUT: %.loc15_15.1: type = array_type %.loc15_14, %T [symbolic = %.loc15_15.2 (constants.%.6)] -// CHECK:STDOUT: %w.var: ref @F.%.loc15_15.2 (%.6) = var w -// CHECK:STDOUT: %w: ref @F.%.loc15_15.2 (%.6) = bind_name w, %w.var +// CHECK:STDOUT: %.loc15_14.1: i32 = int_value 5 [template = constants.%.5] +// CHECK:STDOUT: %.loc15_14.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc15_14.3: = bound_method %.loc15_14.1, %.loc15_14.2 [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc15_14.3(%.loc15_14.1) [template = constants.%.31] +// CHECK:STDOUT: %.loc15_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.31] +// CHECK:STDOUT: %.loc15_14.5: Core.IntLiteral = converted %.loc15_14.1, %.loc15_14.4 [template = constants.%.31] +// CHECK:STDOUT: %.loc15_15.1: type = array_type %.loc15_14.5, %T [symbolic = %.loc15_15.2 (constants.%.32)] +// CHECK:STDOUT: %w.var: ref @F.%.loc15_15.2 (%.32) = var w +// CHECK:STDOUT: %w: ref @F.%.loc15_15.2 (%.32) = bind_name w, %w.var // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.15) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.15)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.15) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.15)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { // CHECK:STDOUT: %T.loc12_6.2 => constants.%T // CHECK:STDOUT: %T.patt.loc12_6.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: %.2 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %.2 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.15) { +// CHECK:STDOUT: %Dest => constants.%.15 +// CHECK:STDOUT: %Dest.patt => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.15 +// CHECK:STDOUT: %Dest.patt => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.21 +// CHECK:STDOUT: %.2 => constants.%.22 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.15) { +// CHECK:STDOUT: %Dest => constants.%.15 +// CHECK:STDOUT: %Dest.patt => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.15 +// CHECK:STDOUT: %Dest.patt => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.25 +// CHECK:STDOUT: %.2 => constants.%.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/builtin/call.carbon b/toolchain/check/testdata/function/builtin/call.carbon index b4c6e26649645..d57e5cb1c7999 100644 --- a/toolchain/check/testdata/function/builtin/call.carbon +++ b/toolchain/check/testdata/function/builtin/call.carbon @@ -23,17 +23,145 @@ var arr: [i32; Add(1, 2)]; // CHECK:STDOUT: %.1: i32 = int_value 1 [template] // CHECK:STDOUT: %.2: i32 = int_value 2 [template] // CHECK:STDOUT: %.3: i32 = int_value 3 [template] -// CHECK:STDOUT: %.4: type = array_type %.3, i32 [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.8: %.4 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.11: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.13: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.19: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.20: %.19 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.21: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.23: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.24: %.23 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.28: = bound_method %.3, %Convert.15 [template] +// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.30: type = array_type %.29, i32 [template] +// CHECK:STDOUT: %.31: type = ptr_type %.30 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.4) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.8)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.27] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -74,12 +202,579 @@ var arr: [i32; Add(1, 2)]; // CHECK:STDOUT: %int.sadd: init i32 = call %Add.ref(%.loc13_20, %.loc13_23) [template = constants.%.3] // CHECK:STDOUT: %.loc13_11.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc13_11.2: type = converted %int.make_type_32, %.loc13_11.1 [template = i32] -// CHECK:STDOUT: %.loc13_25: type = array_type %int.sadd, i32 [template = constants.%.4] -// CHECK:STDOUT: %arr.var: ref %.4 = var arr -// CHECK:STDOUT: %arr: ref %.4 = bind_name arr, %arr.var +// CHECK:STDOUT: %.loc13_19.1: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc13_19.2: = bound_method %int.sadd, %.loc13_19.1 [template = constants.%.28] +// CHECK:STDOUT: %.loc13_19.3: i32 = value_of_initializer %int.sadd [template = constants.%.3] +// CHECK:STDOUT: %.loc13_19.4: i32 = converted %int.sadd, %.loc13_19.3 [template = constants.%.3] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc13_19.2(%.loc13_19.4) [template = constants.%.29] +// CHECK:STDOUT: %.loc13_19.5: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.29] +// CHECK:STDOUT: %.loc13_19.6: Core.IntLiteral = converted %int.sadd, %.loc13_19.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc13_25: type = array_type %.loc13_19.6, i32 [template = constants.%.30] +// CHECK:STDOUT: %arr.var: ref %.30 = var arr +// CHECK:STDOUT: %arr: ref %.30 = bind_name arr, %arr.var +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.4) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: %.2: @As.%.1 (%.17) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.18)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.25)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.26)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Add(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.2 => constants.%.7 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %.2 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: %.2 => constants.%.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.23 +// CHECK:STDOUT: %.2 => constants.%.24 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/builtin/method.carbon b/toolchain/check/testdata/function/builtin/method.carbon index 0d878d0873149..5ba27414eabec 100644 --- a/toolchain/check/testdata/function/builtin/method.carbon +++ b/toolchain/check/testdata/function/builtin/method.carbon @@ -22,7 +22,7 @@ var arr: [i32; 1.(I.F)(2)]; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %I.type: type = facet_type <@I> [template] -// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %Self.1: %I.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template] @@ -37,17 +37,145 @@ var arr: [i32; 1.(I.F)(2)]; // CHECK:STDOUT: %.5: = bound_method %.4, %F.2 [template] // CHECK:STDOUT: %.6: i32 = int_value 2 [template] // CHECK:STDOUT: %.7: i32 = int_value 3 [template] -// CHECK:STDOUT: %.8: type = array_type %.7, i32 [template] -// CHECK:STDOUT: %.9: type = ptr_type %.8 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.2: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.3: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.8: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.10: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.12: %.8 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.13: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.15: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.15)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.17: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.17)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.4(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.18: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.19: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.7(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.20: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.4: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.5: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.21: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.22: %.21 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.23: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.24: %.23 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.15)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.17)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.10(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.27: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.28: %.27 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.29: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.13(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.30: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.31: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.32: = bound_method %.7, %Convert.15 [template] +// CHECK:STDOUT: %.33: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.34: type = array_type %.33, i32 [template] +// CHECK:STDOUT: %.35: type = ptr_type %.34 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.8) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.12)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.4.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.31] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.6.%.1 (constants.%.15)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.7.%.1 (constants.%.17)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.9.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.10.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.12.%.1 (constants.%.15)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.13.%.1 (constants.%.17)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -58,7 +186,7 @@ var arr: [i32; 1.(I.F)(2)]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {} -// CHECK:STDOUT: impl_decl @impl [template] {} { +// CHECK:STDOUT: impl_decl @impl.1 [template] {} { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_6.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc15_6.2: type = converted %int.make_type_32, %.loc15_6.1 [template = i32] @@ -74,36 +202,43 @@ var arr: [i32; 1.(I.F)(2)]; // CHECK:STDOUT: %int.sadd: init i32 = call %.loc19_17.2(%.loc19_16, %.loc19_24) [template = constants.%.7] // CHECK:STDOUT: %.loc19_11.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc19_11.2: type = converted %int.make_type_32, %.loc19_11.1 [template = i32] -// CHECK:STDOUT: %.loc19_26: type = array_type %int.sadd, i32 [template = constants.%.8] -// CHECK:STDOUT: %arr.var: ref %.8 = var arr -// CHECK:STDOUT: %arr: ref %.8 = bind_name arr, %arr.var +// CHECK:STDOUT: %.loc19_23.1: %Convert.type.2 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc19_23.2: = bound_method %int.sadd, %.loc19_23.1 [template = constants.%.32] +// CHECK:STDOUT: %.loc19_23.3: i32 = value_of_initializer %int.sadd [template = constants.%.7] +// CHECK:STDOUT: %.loc19_23.4: i32 = converted %int.sadd, %.loc19_23.3 [template = constants.%.7] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc19_23.2(%.loc19_23.4) [template = constants.%.33] +// CHECK:STDOUT: %.loc19_23.5: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.33] +// CHECK:STDOUT: %.loc19_23.6: Core.IntLiteral = converted %int.sadd, %.loc19_23.5 [template = constants.%.33] +// CHECK:STDOUT: %.loc19_26: type = array_type %.loc19_23.6, i32 [template = constants.%.34] +// CHECK:STDOUT: %arr.var: ref %.34 = var arr +// CHECK:STDOUT: %arr: ref %.34 = bind_name arr, %arr.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { -// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] +// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.1] // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] { -// CHECK:STDOUT: %self.patt: @F.1.%Self (%Self) = binding_pattern self -// CHECK:STDOUT: %self.param_patt: @F.1.%Self (%Self) = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %other.patt: @F.1.%Self (%Self) = binding_pattern other -// CHECK:STDOUT: %other.param_patt: @F.1.%Self (%Self) = value_param_pattern %other.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: @F.1.%Self (%Self) = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: @F.1.%Self (%Self) = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %self.patt: @F.1.%Self (%Self.1) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @F.1.%Self (%Self.1) = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %other.patt: @F.1.%Self (%Self.1) = binding_pattern other +// CHECK:STDOUT: %other.param_patt: @F.1.%Self (%Self.1) = value_param_pattern %other.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: @F.1.%Self (%Self.1) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @F.1.%Self (%Self.1) = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc12_14: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %.loc12_14.1: type = facet_type_access %Self.ref.loc12_14 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %.loc12_14.2: type = converted %Self.ref.loc12_14, %.loc12_14.1 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.ref.loc12_27: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %.loc12_27.1: type = facet_type_access %Self.ref.loc12_27 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %.loc12_27.2: type = converted %Self.ref.loc12_27, %.loc12_27.1 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.ref.loc12_36: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %.loc12_36.1: type = facet_type_access %Self.ref.loc12_36 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %.loc12_36.2: type = converted %Self.ref.loc12_36, %.loc12_36.1 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %self.param: @F.1.%Self (%Self) = value_param runtime_param0 -// CHECK:STDOUT: %self: @F.1.%Self (%Self) = bind_name self, %self.param -// CHECK:STDOUT: %other.param: @F.1.%Self (%Self) = value_param runtime_param1 -// CHECK:STDOUT: %other: @F.1.%Self (%Self) = bind_name other, %other.param -// CHECK:STDOUT: %return.param: ref @F.1.%Self (%Self) = out_param runtime_param2 -// CHECK:STDOUT: %return: ref @F.1.%Self (%Self) = return_slot %return.param +// CHECK:STDOUT: %Self.ref.loc12_14: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: %.loc12_14.1: type = facet_type_access %Self.ref.loc12_14 [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: %.loc12_14.2: type = converted %Self.ref.loc12_14, %.loc12_14.1 [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: %Self.ref.loc12_27: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: %.loc12_27.1: type = facet_type_access %Self.ref.loc12_27 [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: %.loc12_27.2: type = converted %Self.ref.loc12_27, %.loc12_27.1 [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: %Self.ref.loc12_36: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: %.loc12_36.1: type = facet_type_access %Self.ref.loc12_36 [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: %.loc12_36.2: type = converted %Self.ref.loc12_36, %.loc12_36.1 [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: %self.param: @F.1.%Self (%Self.1) = value_param runtime_param0 +// CHECK:STDOUT: %self: @F.1.%Self (%Self.1) = bind_name self, %self.param +// CHECK:STDOUT: %other.param: @F.1.%Self (%Self.1) = value_param runtime_param1 +// CHECK:STDOUT: %other: @F.1.%Self (%Self.1) = bind_name other, %other.param +// CHECK:STDOUT: %return.param: ref @F.1.%Self (%Self.1) = out_param runtime_param2 +// CHECK:STDOUT: %return: ref @F.1.%Self (%Self.1) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc12: %.1 = assoc_entity element0, %F.decl [template = constants.%.2] // CHECK:STDOUT: @@ -113,7 +248,47 @@ var arr: [i32; 1.(I.F)(2)]; // CHECK:STDOUT: witness = (%F.decl) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %.loc15_6.2 as %I.ref { +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.3)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.8)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.8) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.5)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.21)] +// CHECK:STDOUT: %.2: @As.%.1 (%.21) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.22)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: %.loc15_6.2 as %I.ref { // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { // CHECK:STDOUT: %self.patt: i32 = binding_pattern self // CHECK:STDOUT: %self.param_patt: i32 = value_param_pattern %self.patt, runtime_param0 @@ -145,21 +320,541 @@ var arr: [i32; 1.(I.F)(2)]; // CHECK:STDOUT: witness = %.loc15_15 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.2: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.4(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.4.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.18)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.5: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.7(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.7.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.20)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.8: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.25)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.10(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.10.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.26)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.11: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.29)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.13(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.13(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.13.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.30)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: generic fn @F.1(@I.%Self: %I.type) { -// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @F.1.%Self (%Self)](%other.param_patt: @F.1.%Self (%Self)) -> @F.1.%Self (%Self); +// CHECK:STDOUT: fn[%self.param_patt: @F.1.%Self (%Self.1)](%other.param_patt: @F.1.%Self (%Self.1)) -> @F.1.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: fn @F.2[%self.param_patt: i32](%other.param_patt: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: -// CHECK:STDOUT: specific @F.1(constants.%Self) { -// CHECK:STDOUT: %Self => constants.%Self +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.2: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.3)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.15) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.17) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.15)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.17)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.4: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.5)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.15) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.17) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.15)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.17)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F.1(constants.%Self.1) { +// CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(i32) { // CHECK:STDOUT: %Self => i32 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.2) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %.2 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %.2 => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.15) { +// CHECK:STDOUT: %Dest => constants.%.15 +// CHECK:STDOUT: %Dest.patt => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.15 +// CHECK:STDOUT: %Dest.patt => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.17) { +// CHECK:STDOUT: %Dest => constants.%.17 +// CHECK:STDOUT: %Dest.patt => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.4.%.1) { +// CHECK:STDOUT: %Dest => constants.%.17 +// CHECK:STDOUT: %Dest.patt => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.4(@impl.4.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.7(@impl.7.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.5 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.23 +// CHECK:STDOUT: %.2 => constants.%.24 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.4) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.15) { +// CHECK:STDOUT: %Dest => constants.%.15 +// CHECK:STDOUT: %Dest.patt => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.15 +// CHECK:STDOUT: %Dest.patt => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.17) { +// CHECK:STDOUT: %Dest => constants.%.17 +// CHECK:STDOUT: %Dest.patt => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.10.%.1) { +// CHECK:STDOUT: %Dest => constants.%.17 +// CHECK:STDOUT: %Dest.patt => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.10(@impl.10.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.5 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.27 +// CHECK:STDOUT: %.2 => constants.%.28 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.13(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.13(@impl.13.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon b/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon index 2d8c61d6f5a8b..5509e1f3c982b 100644 --- a/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon +++ b/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon @@ -13,21 +13,28 @@ package Core; fn Int32() -> type = "int.make_type_32"; +fn IntLiteral() -> type = "int_literal.make_type"; interface Add { fn Op[self: Self](other: Self) -> Self; } -// --- user.carbon - -import Core; +interface ImplicitAs(T:! type) { + fn Convert[self: Self]() -> T; +} -// TODO: This should be in `Core`, but currently impl lookup only looks in the -// current file. -impl i32 as Core.Add { +impl i32 as Add { fn Op[self: Self](other: Self) -> Self = "int.sadd"; } +impl i32 as ImplicitAs(IntLiteral()) { + fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked"; +} + +// --- user.carbon + +import Core; + var arr: [i32; 1 + 2] = (3, 4, 3 + 4); // CHECK:STDOUT: --- core.carbon @@ -36,18 +43,43 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4); // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template] +// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template] // CHECK:STDOUT: %Add.type: type = facet_type <@Add> [template] -// CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %Op.type: type = fn_type @Op [template] -// CHECK:STDOUT: %Op: %Op.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = assoc_entity_type %Add.type, %Op.type [template] +// CHECK:STDOUT: %Self.1: %Add.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] +// CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] +// CHECK:STDOUT: %.1: type = assoc_entity_type %Add.type, %Op.type.1 [template] // CHECK:STDOUT: %.2: %.1 = assoc_entity element0, @Add.%Op.decl [template] +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%T) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.3: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, @ImplicitAs.%Convert.decl [symbolic] +// CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] +// CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] +// CHECK:STDOUT: %.5: = interface_witness (%Op.2) [template] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.2 [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.3 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, @ImplicitAs.%Convert.decl [template] +// CHECK:STDOUT: %.8: = interface_witness (%Convert.2) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Int32 = %Int32.decl +// CHECK:STDOUT: .IntLiteral = %IntLiteral.decl // CHECK:STDOUT: .Add = %Add.decl +// CHECK:STDOUT: .ImplicitAs = %ImplicitAs.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Int32.decl: %Int32.type = fn_decl @Int32 [template = constants.%Int32] { // CHECK:STDOUT: %return.patt: type = return_slot_pattern @@ -56,53 +88,231 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4); // CHECK:STDOUT: %return.param: ref type = out_param runtime_param0 // CHECK:STDOUT: %return: ref type = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %IntLiteral.decl: %IntLiteral.type = fn_decl @IntLiteral [template = constants.%IntLiteral] { +// CHECK:STDOUT: %return.patt: type = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %return.param: ref type = out_param runtime_param0 +// CHECK:STDOUT: %return: ref type = return_slot %return.param +// CHECK:STDOUT: } // CHECK:STDOUT: %Add.decl: type = interface_decl @Add [template = constants.%Add.type] {} {} +// CHECK:STDOUT: %ImplicitAs.decl: %ImplicitAs.type.1 = interface_decl @ImplicitAs [template = constants.%ImplicitAs] { +// CHECK:STDOUT: %T.patt.loc11_22.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_22.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc11_22.1, runtime_param [symbolic = %T.patt.loc11_22.2 (constants.%T.patt)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = value_param runtime_param +// CHECK:STDOUT: %T.loc11_22.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc11_22.2 (constants.%T)] +// CHECK:STDOUT: } +// CHECK:STDOUT: impl_decl @impl.1 [template] {} { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc15_6.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc15_6.2: type = converted %int.make_type_32, %.loc15_6.1 [template = i32] +// CHECK:STDOUT: %Add.ref: type = name_ref Add, file.%Add.decl [template = constants.%Add.type] +// CHECK:STDOUT: } +// CHECK:STDOUT: impl_decl @impl.2 [template] {} { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc19_6.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc19_6.2: type = converted %int.make_type_32, %.loc19_6.1 [template = i32] +// CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.1 = name_ref ImplicitAs, file.%ImplicitAs.decl [template = constants.%ImplicitAs] +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc19_23.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc19_23.2: type = converted %int_literal.make_type, %.loc19_23.1 [template = Core.IntLiteral] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Add { -// CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] -// CHECK:STDOUT: %Op.decl: %Op.type = fn_decl @Op [template = constants.%Op] { -// CHECK:STDOUT: %self.patt: @Op.%Self (%Self) = binding_pattern self -// CHECK:STDOUT: %self.param_patt: @Op.%Self (%Self) = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %other.patt: @Op.%Self (%Self) = binding_pattern other -// CHECK:STDOUT: %other.param_patt: @Op.%Self (%Self) = value_param_pattern %other.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: @Op.%Self (%Self) = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: @Op.%Self (%Self) = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.1] +// CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { +// CHECK:STDOUT: %self.patt: @Op.1.%Self (%Self.1) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @Op.1.%Self (%Self.1) = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %other.patt: @Op.1.%Self (%Self.1) = binding_pattern other +// CHECK:STDOUT: %other.param_patt: @Op.1.%Self (%Self.1) = value_param_pattern %other.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: @Op.1.%Self (%Self.1) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @Op.1.%Self (%Self.1) = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc7_15: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %.loc7_15.1: type = facet_type_access %Self.ref.loc7_15 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %.loc7_15.2: type = converted %Self.ref.loc7_15, %.loc7_15.1 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.ref.loc7_28: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %.loc7_28.1: type = facet_type_access %Self.ref.loc7_28 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %.loc7_28.2: type = converted %Self.ref.loc7_28, %.loc7_28.1 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.ref.loc7_37: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %.loc7_37.1: type = facet_type_access %Self.ref.loc7_37 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %.loc7_37.2: type = converted %Self.ref.loc7_37, %.loc7_37.1 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %self.param: @Op.%Self (%Self) = value_param runtime_param0 -// CHECK:STDOUT: %self: @Op.%Self (%Self) = bind_name self, %self.param -// CHECK:STDOUT: %other.param: @Op.%Self (%Self) = value_param runtime_param1 -// CHECK:STDOUT: %other: @Op.%Self (%Self) = bind_name other, %other.param -// CHECK:STDOUT: %return.param: ref @Op.%Self (%Self) = out_param runtime_param2 -// CHECK:STDOUT: %return: ref @Op.%Self (%Self) = return_slot %return.param +// CHECK:STDOUT: %Self.ref.loc8_15: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: %.loc8_15.1: type = facet_type_access %Self.ref.loc8_15 [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: %.loc8_15.2: type = converted %Self.ref.loc8_15, %.loc8_15.1 [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: %Self.ref.loc8_28: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: %.loc8_28.1: type = facet_type_access %Self.ref.loc8_28 [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: %.loc8_28.2: type = converted %Self.ref.loc8_28, %.loc8_28.1 [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: %Self.ref.loc8_37: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: %.loc8_37.1: type = facet_type_access %Self.ref.loc8_37 [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: %.loc8_37.2: type = converted %Self.ref.loc8_37, %.loc8_37.1 [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: %self.param: @Op.1.%Self (%Self.1) = value_param runtime_param0 +// CHECK:STDOUT: %self: @Op.1.%Self (%Self.1) = bind_name self, %self.param +// CHECK:STDOUT: %other.param: @Op.1.%Self (%Self.1) = value_param runtime_param1 +// CHECK:STDOUT: %other: @Op.1.%Self (%Self.1) = bind_name other, %other.param +// CHECK:STDOUT: %return.param: ref @Op.1.%Self (%Self.1) = out_param runtime_param2 +// CHECK:STDOUT: %return: ref @Op.1.%Self (%Self.1) = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc7: %.1 = assoc_entity element0, %Op.decl [template = constants.%.2] +// CHECK:STDOUT: %.loc8: %.1 = assoc_entity element0, %Op.decl [template = constants.%.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: .Op = %.loc7 +// CHECK:STDOUT: .Op = %.loc8 // CHECK:STDOUT: witness = (%Op.decl) // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(%T.loc11_22.1: type) { +// CHECK:STDOUT: %T.loc11_22.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc11_22.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc11_22.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_22.2 (constants.%T.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%T.loc11_22.2)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%T.loc11_22.2) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.loc12_32.2: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.loc12_32.2 (constants.%.3)] +// CHECK:STDOUT: %.loc12_32.3: @ImplicitAs.%.loc12_32.2 (%.3) = assoc_entity element0, %Convert.decl [symbolic = %.loc12_32.3 (constants.%.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.2)] +// CHECK:STDOUT: %Convert.decl: @ImplicitAs.%Convert.type (%Convert.type.1) = fn_decl @Convert.1 [symbolic = @ImplicitAs.%Convert (constants.%Convert.1)] { +// CHECK:STDOUT: %self.patt: @Convert.1.%Self (%Self.2) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @Convert.1.%Self (%Self.2) = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: @Convert.1.%T (%T) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @Convert.1.%T (%T) = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %.loc12_20.1: @Convert.1.%ImplicitAs.type (%ImplicitAs.type.2) = specific_constant @ImplicitAs.%Self.1, @ImplicitAs(constants.%T) [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Self.ref: @Convert.1.%ImplicitAs.type (%ImplicitAs.type.2) = name_ref Self, %.loc12_20.1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.loc12_20.2: type = facet_type_access %Self.ref [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.loc12_20.3: type = converted %Self.ref, %.loc12_20.2 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %T.ref: type = name_ref T, @ImplicitAs.%T.loc11_22.1 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %self.param: @Convert.1.%Self (%Self.2) = value_param runtime_param0 +// CHECK:STDOUT: %self: @Convert.1.%Self (%Self.2) = bind_name self, %self.param +// CHECK:STDOUT: %return.param: ref @Convert.1.%T (%T) = out_param runtime_param1 +// CHECK:STDOUT: %return: ref @Convert.1.%T (%T) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %.loc12_32.1: @ImplicitAs.%.loc12_32.2 (%.3) = assoc_entity element0, %Convert.decl [symbolic = %.loc12_32.3 (constants.%.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self.1 +// CHECK:STDOUT: .Convert = %.loc12_32.1 +// CHECK:STDOUT: witness = (%Convert.decl) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: %.loc15_6.2 as %Add.ref { +// CHECK:STDOUT: %Op.decl: %Op.type.2 = fn_decl @Op.2 [template = constants.%Op.2] { +// CHECK:STDOUT: %self.patt: i32 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: i32 = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %other.patt: i32 = binding_pattern other +// CHECK:STDOUT: %other.param_patt: i32 = value_param_pattern %other.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Self.ref.loc16_15: type = name_ref Self, @impl.1.%.loc15_6.2 [template = i32] +// CHECK:STDOUT: %Self.ref.loc16_28: type = name_ref Self, @impl.1.%.loc15_6.2 [template = i32] +// CHECK:STDOUT: %Self.ref.loc16_37: type = name_ref Self, @impl.1.%.loc15_6.2 [template = i32] +// CHECK:STDOUT: %self.param: i32 = value_param runtime_param0 +// CHECK:STDOUT: %self: i32 = bind_name self, %self.param +// CHECK:STDOUT: %other.param: i32 = value_param runtime_param1 +// CHECK:STDOUT: %other: i32 = bind_name other, %other.param +// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %.loc15_17: = interface_witness (%Op.decl) [template = constants.%.5] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Op = %Op.decl +// CHECK:STDOUT: witness = %.loc15_17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.2: %.loc19_6.2 as %ImplicitAs.type { +// CHECK:STDOUT: %Convert.decl: %Convert.type.2 = fn_decl @Convert.2 [template = constants.%Convert.2] { +// CHECK:STDOUT: %self.patt: i32 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: i32 = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.2.%.loc19_6.2 [template = i32] +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc20_42.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc20_42.2: type = converted %int_literal.make_type, %.loc20_42.1 [template = Core.IntLiteral] +// CHECK:STDOUT: %self.param: i32 = value_param runtime_param0 +// CHECK:STDOUT: %self: i32 = bind_name self, %self.param +// CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1 +// CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %.loc19_38: = interface_witness (%Convert.decl) [template = constants.%.8] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Convert = %Convert.decl +// CHECK:STDOUT: witness = %.loc19_38 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op(@Add.%Self: %Add.type) { -// CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: fn @IntLiteral() -> type = "int_literal.make_type"; +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Op.1(@Add.%Self: %Add.type) { +// CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Op.1.%Self (%Self.1)](%other.param_patt: @Op.1.%Self (%Self.1)) -> @Op.1.%Self (%Self.1); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(@ImplicitAs.%T.loc11_22.1: type, @ImplicitAs.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%T (%T); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Op.2[%self.param_patt: i32](%other.param_patt: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Op.%Self (%Self)](%other.param_patt: @Op.%Self (%Self)) -> @Op.%Self (%Self); +// CHECK:STDOUT: fn @Convert.2[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Op.1(constants.%Self.1) { +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%T) { +// CHECK:STDOUT: %T.loc11_22.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_22.2 => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%T) { +// CHECK:STDOUT: %T.loc11_22.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_22.2 => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%T, constants.%Self.2) { +// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Op(constants.%Self) { -// CHECK:STDOUT: %Self => constants.%Self +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%T.loc11_22.2) { +// CHECK:STDOUT: %T.loc11_22.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_22.2 => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Op.1(i32) { +// CHECK:STDOUT: %Self => i32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %T.loc11_22.2 => Core.IntLiteral +// CHECK:STDOUT: %T.patt.loc11_22.2 => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self.2 => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.loc12_32.2 => constants.%.6 +// CHECK:STDOUT: %.loc12_32.3 => constants.%.7 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(Core.IntLiteral, i32) { +// CHECK:STDOUT: %T => Core.IntLiteral +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => i32 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- user.carbon @@ -111,41 +321,77 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4); // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: i32 = int_value 1 [template] +// CHECK:STDOUT: %.2: i32 = int_value 2 [template] // CHECK:STDOUT: %Add.type: type = facet_type <@Add> [template] -// CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %Self.1: %Add.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] // CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] +// CHECK:STDOUT: %.3: type = assoc_entity_type %Add.type, %Op.type.1 [template] +// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic] +// CHECK:STDOUT: %Self.2: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Self.3: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%T) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.5: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.16 [symbolic] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.17 [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] -// CHECK:STDOUT: %.1: = interface_witness (%Op.1) [template] -// CHECK:STDOUT: %.2: i32 = int_value 1 [template] -// CHECK:STDOUT: %.3: i32 = int_value 2 [template] -// CHECK:STDOUT: %.4: type = assoc_entity_type %Add.type, %Op.type.2 [template] -// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [template] -// CHECK:STDOUT: %.6: = bound_method %.2, %Op.1 [template] -// CHECK:STDOUT: %.7: i32 = int_value 3 [template] -// CHECK:STDOUT: %.8: type = array_type %.7, i32 [template] -// CHECK:STDOUT: %.9: type = ptr_type %.8 [template] -// CHECK:STDOUT: %.10: i32 = int_value 4 [template] -// CHECK:STDOUT: %.11: = bound_method %.7, %Op.1 [template] -// CHECK:STDOUT: %.12: i32 = int_value 7 [template] +// CHECK:STDOUT: %.9: = interface_witness (%Op.2) [template] +// CHECK:STDOUT: %.10: = bound_method %.1, %Op.2 [template] +// CHECK:STDOUT: %.11: i32 = int_value 3 [template] +// CHECK:STDOUT: %.12: %.5 = assoc_entity element0, imports.%import_ref.19 [symbolic] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.2 [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.3) [template] +// CHECK:STDOUT: %.14: = bound_method %.11, %Convert.3 [template] +// CHECK:STDOUT: %.15: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.16: type = array_type %.15, i32 [template] +// CHECK:STDOUT: %.17: type = ptr_type %.16 [template] +// CHECK:STDOUT: %.18: i32 = int_value 4 [template] +// CHECK:STDOUT: %.19: = bound_method %.11, %Op.2 [template] +// CHECK:STDOUT: %.20: i32 = int_value 7 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (i32, i32, i32) [template] -// CHECK:STDOUT: %.13: i32 = int_value 0 [template] -// CHECK:STDOUT: %array: %.8 = tuple_value (%.7, %.10, %.12) [template] +// CHECK:STDOUT: %.21: i32 = int_value 0 [template] +// CHECK:STDOUT: %array: %.16 = tuple_value (%.11, %.18, %.20) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.1 // CHECK:STDOUT: .Add = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.18 // CHECK:STDOUT: import Core//default // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//default, inst+5, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: type = import_ref Core//default, inst+9, loaded [template = constants.%Add.type] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//default, inst+11, unloaded -// CHECK:STDOUT: %import_ref.4: %.4 = import_ref Core//default, inst+39, loaded [template = constants.%.5] -// CHECK:STDOUT: %import_ref.5: %Op.type.2 = import_ref Core//default, inst+34, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//default, inst+34, unloaded +// CHECK:STDOUT: %import_ref.2: type = import_ref Core//default, inst+16, loaded [template = constants.%Add.type] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//default, inst+18, unloaded +// CHECK:STDOUT: %import_ref.4: %.3 = import_ref Core//default, inst+46, loaded [template = constants.%.4] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//default, inst+41, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//default, inst+41, unloaded +// CHECK:STDOUT: %import_ref.7: type = import_ref Core//default, inst+92, loaded [template = i32] +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//default, inst+93, loaded [template = constants.%Add.type] +// CHECK:STDOUT: %import_ref.9: = import_ref Core//default, inst+113, loaded [template = constants.%.9] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//default, inst+60, unloaded +// CHECK:STDOUT: %import_ref.11: @ImplicitAs.%.1 (%.5) = import_ref Core//default, inst+82, loaded [symbolic = @ImplicitAs.%.2 (constants.%.12)] +// CHECK:STDOUT: %import_ref.12 = import_ref Core//default, inst+75, unloaded +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//default, inst+117, loaded [template = i32] +// CHECK:STDOUT: %import_ref.14: type = import_ref Core//default, inst+123, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.15: = import_ref Core//default, inst+146, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.16 = import_ref Core//default, inst+75, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Core//default, inst+75, unloaded +// CHECK:STDOUT: %import_ref.18: %ImplicitAs.type.1 = import_ref Core//default, inst+54, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.19 = import_ref Core//default, inst+75, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -154,24 +400,24 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4); // CHECK:STDOUT: .arr = %arr // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: impl_decl @impl [template] {} { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_6.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc6_6.2: type = converted %int.make_type_32, %.loc6_6.1 [template = i32] -// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%import_ref.2 [template = constants.%Add.type] -// CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc10_16: i32 = int_value 1 [template = constants.%.2] -// CHECK:STDOUT: %.loc10_20: i32 = int_value 2 [template = constants.%.3] -// CHECK:STDOUT: %.loc10_18.1: %Op.type.2 = interface_witness_access constants.%.1, element0 [template = constants.%Op.1] -// CHECK:STDOUT: %.loc10_18.2: = bound_method %.loc10_16, %.loc10_18.1 [template = constants.%.6] -// CHECK:STDOUT: %int.sadd: init i32 = call %.loc10_18.2(%.loc10_16, %.loc10_20) [template = constants.%.7] -// CHECK:STDOUT: %.loc10_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc10_11.2: type = converted %int.make_type_32, %.loc10_11.1 [template = i32] -// CHECK:STDOUT: %.loc10_21: type = array_type %int.sadd, i32 [template = constants.%.8] -// CHECK:STDOUT: %arr.var: ref %.8 = var arr -// CHECK:STDOUT: %arr: ref %.8 = bind_name arr, %arr.var +// CHECK:STDOUT: %.loc4_16: i32 = int_value 1 [template = constants.%.1] +// CHECK:STDOUT: %.loc4_20: i32 = int_value 2 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_18.1: %Op.type.1 = interface_witness_access constants.%.9, element0 [template = constants.%Op.2] +// CHECK:STDOUT: %.loc4_18.2: = bound_method %.loc4_16, %.loc4_18.1 [template = constants.%.10] +// CHECK:STDOUT: %int.sadd: init i32 = call %.loc4_18.2(%.loc4_16, %.loc4_20) [template = constants.%.11] +// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32, %.loc4_11.1 [template = i32] +// CHECK:STDOUT: %.loc4_18.3: %Convert.type.2 = interface_witness_access constants.%.13, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %.loc4_18.4: = bound_method %int.sadd, %.loc4_18.3 [template = constants.%.14] +// CHECK:STDOUT: %.loc4_18.5: i32 = value_of_initializer %int.sadd [template = constants.%.11] +// CHECK:STDOUT: %.loc4_18.6: i32 = converted %int.sadd, %.loc4_18.5 [template = constants.%.11] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc4_18.4(%.loc4_18.6) [template = constants.%.15] +// CHECK:STDOUT: %.loc4_18.7: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.15] +// CHECK:STDOUT: %.loc4_18.8: Core.IntLiteral = converted %int.sadd, %.loc4_18.7 [template = constants.%.15] +// CHECK:STDOUT: %.loc4_21: type = array_type %.loc4_18.8, i32 [template = constants.%.16] +// CHECK:STDOUT: %arr.var: ref %.16 = var arr +// CHECK:STDOUT: %arr: ref %.16 = bind_name arr, %arr.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Add { @@ -181,72 +427,116 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4); // CHECK:STDOUT: witness = (imports.%import_ref.5) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %.loc6_6.2 as %Add.ref { -// CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { -// CHECK:STDOUT: %self.patt: i32 = binding_pattern self -// CHECK:STDOUT: %self.param_patt: i32 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %other.patt: i32 = binding_pattern other -// CHECK:STDOUT: %other.param_patt: i32 = value_param_pattern %other.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc7_15: type = name_ref Self, @impl.%.loc6_6.2 [template = i32] -// CHECK:STDOUT: %Self.ref.loc7_28: type = name_ref Self, @impl.%.loc6_6.2 [template = i32] -// CHECK:STDOUT: %Self.ref.loc7_37: type = name_ref Self, @impl.%.loc6_6.2 [template = i32] -// CHECK:STDOUT: %self.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %self: i32 = bind_name self, %self.param -// CHECK:STDOUT: %other.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %other: i32 = bind_name other, %other.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%T: type) { +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.3)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%T) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.5) = assoc_entity element0, imports.%import_ref.16 [symbolic = %.2 (constants.%.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.10 +// CHECK:STDOUT: .Convert = imports.%import_ref.11 +// CHECK:STDOUT: witness = (imports.%import_ref.12) // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc6_22: = interface_witness (%Op.decl) [template = constants.%.1] +// CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.7 as imports.%import_ref.8 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = %.loc6_22 +// CHECK:STDOUT: witness = imports.%import_ref.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.2: imports.%import_ref.13 as imports.%import_ref.14 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.15 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[%self.param_patt: i32](%other.param_patt: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: generic fn @Op.1(constants.%Self.1: %Add.type) { +// CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Op.1.%Self (%Self.1)](%other.param_patt: @Op.1.%Self (%Self.1)) -> @Op.1.%Self (%Self.1); +// CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.2(constants.%Self: %Add.type) { -// CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: generic fn @Convert.1(constants.%T: type, constants.%Self.2: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.3)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Op.2.%Self (%Self)](%other.param_patt: @Op.2.%Self (%Self)) -> @Op.2.%Self (%Self); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.3)]() -> @Convert.1.%T (%T); // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Op.2[%self.param_patt: i32](%other.param_patt: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.2[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc10_26: i32 = int_value 3 [template = constants.%.7] -// CHECK:STDOUT: %.loc10_29: i32 = int_value 4 [template = constants.%.10] -// CHECK:STDOUT: %.loc10_32: i32 = int_value 3 [template = constants.%.7] -// CHECK:STDOUT: %.loc10_36: i32 = int_value 4 [template = constants.%.10] -// CHECK:STDOUT: %.loc10_34.1: %Op.type.2 = interface_witness_access constants.%.1, element0 [template = constants.%Op.1] -// CHECK:STDOUT: %.loc10_34.2: = bound_method %.loc10_32, %.loc10_34.1 [template = constants.%.11] -// CHECK:STDOUT: %int.sadd: init i32 = call %.loc10_34.2(%.loc10_32, %.loc10_36) [template = constants.%.12] -// CHECK:STDOUT: %.loc10_37.1: %tuple.type = tuple_literal (%.loc10_26, %.loc10_29, %int.sadd) -// CHECK:STDOUT: %.loc10_37.2: i32 = int_value 0 [template = constants.%.13] -// CHECK:STDOUT: %.loc10_37.3: ref i32 = array_index file.%arr.var, %.loc10_37.2 -// CHECK:STDOUT: %.loc10_37.4: init i32 = initialize_from %.loc10_26 to %.loc10_37.3 [template = constants.%.7] -// CHECK:STDOUT: %.loc10_37.5: i32 = int_value 1 [template = constants.%.2] -// CHECK:STDOUT: %.loc10_37.6: ref i32 = array_index file.%arr.var, %.loc10_37.5 -// CHECK:STDOUT: %.loc10_37.7: init i32 = initialize_from %.loc10_29 to %.loc10_37.6 [template = constants.%.10] -// CHECK:STDOUT: %.loc10_37.8: i32 = int_value 2 [template = constants.%.3] -// CHECK:STDOUT: %.loc10_37.9: ref i32 = array_index file.%arr.var, %.loc10_37.8 -// CHECK:STDOUT: %.loc10_37.10: init i32 = initialize_from %int.sadd to %.loc10_37.9 [template = constants.%.12] -// CHECK:STDOUT: %.loc10_37.11: init %.8 = array_init (%.loc10_37.4, %.loc10_37.7, %.loc10_37.10) to file.%arr.var [template = constants.%array] -// CHECK:STDOUT: %.loc10_38: init %.8 = converted %.loc10_37.1, %.loc10_37.11 [template = constants.%array] -// CHECK:STDOUT: assign file.%arr.var, %.loc10_38 +// CHECK:STDOUT: %.loc4_26: i32 = int_value 3 [template = constants.%.11] +// CHECK:STDOUT: %.loc4_29: i32 = int_value 4 [template = constants.%.18] +// CHECK:STDOUT: %.loc4_32: i32 = int_value 3 [template = constants.%.11] +// CHECK:STDOUT: %.loc4_36: i32 = int_value 4 [template = constants.%.18] +// CHECK:STDOUT: %.loc4_34.1: %Op.type.1 = interface_witness_access constants.%.9, element0 [template = constants.%Op.2] +// CHECK:STDOUT: %.loc4_34.2: = bound_method %.loc4_32, %.loc4_34.1 [template = constants.%.19] +// CHECK:STDOUT: %int.sadd: init i32 = call %.loc4_34.2(%.loc4_32, %.loc4_36) [template = constants.%.20] +// CHECK:STDOUT: %.loc4_37.1: %tuple.type = tuple_literal (%.loc4_26, %.loc4_29, %int.sadd) +// CHECK:STDOUT: %.loc4_37.2: i32 = int_value 0 [template = constants.%.21] +// CHECK:STDOUT: %.loc4_37.3: ref i32 = array_index file.%arr.var, %.loc4_37.2 +// CHECK:STDOUT: %.loc4_37.4: init i32 = initialize_from %.loc4_26 to %.loc4_37.3 [template = constants.%.11] +// CHECK:STDOUT: %.loc4_37.5: i32 = int_value 1 [template = constants.%.1] +// CHECK:STDOUT: %.loc4_37.6: ref i32 = array_index file.%arr.var, %.loc4_37.5 +// CHECK:STDOUT: %.loc4_37.7: init i32 = initialize_from %.loc4_29 to %.loc4_37.6 [template = constants.%.18] +// CHECK:STDOUT: %.loc4_37.8: i32 = int_value 2 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_37.9: ref i32 = array_index file.%arr.var, %.loc4_37.8 +// CHECK:STDOUT: %.loc4_37.10: init i32 = initialize_from %int.sadd to %.loc4_37.9 [template = constants.%.20] +// CHECK:STDOUT: %.loc4_37.11: init %.16 = array_init (%.loc4_37.4, %.loc4_37.7, %.loc4_37.10) to file.%arr.var [template = constants.%array] +// CHECK:STDOUT: %.loc4_38: init %.16 = converted %.loc4_37.1, %.loc4_37.11 [template = constants.%array] +// CHECK:STDOUT: assign file.%arr.var, %.loc4_38 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Op.2(constants.%Self) { -// CHECK:STDOUT: %Self => constants.%Self +// CHECK:STDOUT: specific @Op.1(constants.%Self.1) { +// CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Op.2(i32) { -// CHECK:STDOUT: %Self => i32 +// CHECK:STDOUT: specific @ImplicitAs(constants.%T) { +// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %T => Core.IntLiteral +// CHECK:STDOUT: %T.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%T) { +// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%T) { +// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%T, constants.%Self.2) { +// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/builtin/no_prelude/import.carbon b/toolchain/check/testdata/function/builtin/no_prelude/import.carbon index c89e29779b9ad..5c16dcc257c7a 100644 --- a/toolchain/check/testdata/function/builtin/no_prelude/import.carbon +++ b/toolchain/check/testdata/function/builtin/no_prelude/import.carbon @@ -15,11 +15,14 @@ package Core library "[[@TEST_NAME]]"; fn Int32() -> type = "int.make_type_32"; fn TestAdd(a: i32, b: i32) -> i32 = "int.sadd"; +fn IntLiteral() -> type = "int_literal.make_type"; +fn AsIntLiteral(a: i32) -> IntLiteral() = "int.convert_checked"; + // --- use.carbon import Core library "core"; -var arr: [i32; Core.TestAdd(1, 2)] = (1, 2, 3); +var arr: [i32; Core.AsIntLiteral(Core.TestAdd(1, 2))] = (1, 2, 3); // CHECK:STDOUT: --- core.carbon // CHECK:STDOUT: @@ -29,12 +32,18 @@ var arr: [i32; Core.TestAdd(1, 2)] = (1, 2, 3); // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %TestAdd.type: type = fn_type @TestAdd [template] // CHECK:STDOUT: %TestAdd: %TestAdd.type = struct_value () [template] +// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template] +// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template] +// CHECK:STDOUT: %AsIntLiteral.type: type = fn_type @AsIntLiteral [template] +// CHECK:STDOUT: %AsIntLiteral: %AsIntLiteral.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Int32 = %Int32.decl // CHECK:STDOUT: .TestAdd = %TestAdd.decl +// CHECK:STDOUT: .IntLiteral = %IntLiteral.decl +// CHECK:STDOUT: .AsIntLiteral = %AsIntLiteral.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Int32.decl: %Int32.type = fn_decl @Int32 [template = constants.%Int32] { // CHECK:STDOUT: %return.patt: type = return_slot_pattern @@ -67,38 +76,72 @@ var arr: [i32; Core.TestAdd(1, 2)] = (1, 2, 3); // CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref i32 = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %IntLiteral.decl: %IntLiteral.type = fn_decl @IntLiteral [template = constants.%IntLiteral] { +// CHECK:STDOUT: %return.patt: type = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %return.param: ref type = out_param runtime_param0 +// CHECK:STDOUT: %return: ref type = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %AsIntLiteral.decl: %AsIntLiteral.type = fn_decl @AsIntLiteral [template = constants.%AsIntLiteral] { +// CHECK:STDOUT: %a.patt: i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc8_20.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc8_20.2: type = converted %int.make_type_32, %.loc8_20.1 [template = i32] +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc8_39.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc8_39.2: type = converted %int_literal.make_type, %.loc8_39.1 [template = Core.IntLiteral] +// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1 +// CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: fn @TestAdd(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @IntLiteral() -> type = "int_literal.make_type"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @AsIntLiteral(%a.param_patt: i32) -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: --- use.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %AsIntLiteral.type: type = fn_type @AsIntLiteral [template] +// CHECK:STDOUT: %AsIntLiteral: %AsIntLiteral.type = struct_value () [template] // CHECK:STDOUT: %TestAdd.type: type = fn_type @TestAdd [template] // CHECK:STDOUT: %TestAdd: %TestAdd.type = struct_value () [template] // CHECK:STDOUT: %.1: i32 = int_value 1 [template] // CHECK:STDOUT: %.2: i32 = int_value 2 [template] // CHECK:STDOUT: %.3: i32 = int_value 3 [template] -// CHECK:STDOUT: %.4: type = array_type %.3, i32 [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.5: type = array_type %.4, i32 [template] +// CHECK:STDOUT: %.6: type = ptr_type %.5 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (i32, i32, i32) [template] -// CHECK:STDOUT: %.6: i32 = int_value 0 [template] -// CHECK:STDOUT: %array: %.4 = tuple_value (%.1, %.2, %.3) [template] +// CHECK:STDOUT: %.7: i32 = int_value 0 [template] +// CHECK:STDOUT: %array: %.5 = tuple_value (%.1, %.2, %.3) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.1 -// CHECK:STDOUT: .TestAdd = %import_ref.2 +// CHECK:STDOUT: .AsIntLiteral = %import_ref.2 +// CHECK:STDOUT: .TestAdd = %import_ref.3 // CHECK:STDOUT: import Core//core // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//core, inst+5, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %TestAdd.type = import_ref Core//core, inst+30, loaded [template = constants.%TestAdd] +// CHECK:STDOUT: %import_ref.2: %AsIntLiteral.type = import_ref Core//core, inst+55, loaded [template = constants.%AsIntLiteral] +// CHECK:STDOUT: %import_ref.3: %TestAdd.type = import_ref Core//core, inst+30, loaded [template = constants.%TestAdd] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -108,40 +151,49 @@ var arr: [i32; Core.TestAdd(1, 2)] = (1, 2, 3); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %TestAdd.ref: %TestAdd.type = name_ref TestAdd, imports.%import_ref.2 [template = constants.%TestAdd] -// CHECK:STDOUT: %.loc4_29: i32 = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc4_32: i32 = int_value 2 [template = constants.%.2] -// CHECK:STDOUT: %int.sadd: init i32 = call %TestAdd.ref(%.loc4_29, %.loc4_32) [template = constants.%.3] +// CHECK:STDOUT: %Core.ref.loc4_16: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: %AsIntLiteral.ref: %AsIntLiteral.type = name_ref AsIntLiteral, imports.%import_ref.2 [template = constants.%AsIntLiteral] +// CHECK:STDOUT: %Core.ref.loc4_34: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: %TestAdd.ref: %TestAdd.type = name_ref TestAdd, imports.%import_ref.3 [template = constants.%TestAdd] +// CHECK:STDOUT: %.loc4_47: i32 = int_value 1 [template = constants.%.1] +// CHECK:STDOUT: %.loc4_50: i32 = int_value 2 [template = constants.%.2] +// CHECK:STDOUT: %int.sadd: init i32 = call %TestAdd.ref(%.loc4_47, %.loc4_50) [template = constants.%.3] +// CHECK:STDOUT: %.loc4_46.1: i32 = value_of_initializer %int.sadd [template = constants.%.3] +// CHECK:STDOUT: %.loc4_46.2: i32 = converted %int.sadd, %.loc4_46.1 [template = constants.%.3] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %AsIntLiteral.ref(%.loc4_46.2) [template = constants.%.4] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_34: type = array_type %int.sadd, i32 [template = constants.%.4] -// CHECK:STDOUT: %arr.var: ref %.4 = var arr -// CHECK:STDOUT: %arr: ref %.4 = bind_name arr, %arr.var +// CHECK:STDOUT: %.loc4_33.1: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.4] +// CHECK:STDOUT: %.loc4_33.2: Core.IntLiteral = converted %int.convert_checked, %.loc4_33.1 [template = constants.%.4] +// CHECK:STDOUT: %.loc4_53: type = array_type %.loc4_33.2, i32 [template = constants.%.5] +// CHECK:STDOUT: %arr.var: ref %.5 = var arr +// CHECK:STDOUT: %arr: ref %.5 = bind_name arr, %arr.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @AsIntLiteral(%a.param_patt: i32) -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @TestAdd(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc4_39: i32 = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc4_42: i32 = int_value 2 [template = constants.%.2] -// CHECK:STDOUT: %.loc4_45: i32 = int_value 3 [template = constants.%.3] -// CHECK:STDOUT: %.loc4_46.1: %tuple.type = tuple_literal (%.loc4_39, %.loc4_42, %.loc4_45) -// CHECK:STDOUT: %.loc4_46.2: i32 = int_value 0 [template = constants.%.6] -// CHECK:STDOUT: %.loc4_46.3: ref i32 = array_index file.%arr.var, %.loc4_46.2 -// CHECK:STDOUT: %.loc4_46.4: init i32 = initialize_from %.loc4_39 to %.loc4_46.3 [template = constants.%.1] -// CHECK:STDOUT: %.loc4_46.5: i32 = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc4_46.6: ref i32 = array_index file.%arr.var, %.loc4_46.5 -// CHECK:STDOUT: %.loc4_46.7: init i32 = initialize_from %.loc4_42 to %.loc4_46.6 [template = constants.%.2] -// CHECK:STDOUT: %.loc4_46.8: i32 = int_value 2 [template = constants.%.2] -// CHECK:STDOUT: %.loc4_46.9: ref i32 = array_index file.%arr.var, %.loc4_46.8 -// CHECK:STDOUT: %.loc4_46.10: init i32 = initialize_from %.loc4_45 to %.loc4_46.9 [template = constants.%.3] -// CHECK:STDOUT: %.loc4_46.11: init %.4 = array_init (%.loc4_46.4, %.loc4_46.7, %.loc4_46.10) to file.%arr.var [template = constants.%array] -// CHECK:STDOUT: %.loc4_47: init %.4 = converted %.loc4_46.1, %.loc4_46.11 [template = constants.%array] -// CHECK:STDOUT: assign file.%arr.var, %.loc4_47 +// CHECK:STDOUT: %.loc4_58: i32 = int_value 1 [template = constants.%.1] +// CHECK:STDOUT: %.loc4_61: i32 = int_value 2 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_64: i32 = int_value 3 [template = constants.%.3] +// CHECK:STDOUT: %.loc4_65.1: %tuple.type = tuple_literal (%.loc4_58, %.loc4_61, %.loc4_64) +// CHECK:STDOUT: %.loc4_65.2: i32 = int_value 0 [template = constants.%.7] +// CHECK:STDOUT: %.loc4_65.3: ref i32 = array_index file.%arr.var, %.loc4_65.2 +// CHECK:STDOUT: %.loc4_65.4: init i32 = initialize_from %.loc4_58 to %.loc4_65.3 [template = constants.%.1] +// CHECK:STDOUT: %.loc4_65.5: i32 = int_value 1 [template = constants.%.1] +// CHECK:STDOUT: %.loc4_65.6: ref i32 = array_index file.%arr.var, %.loc4_65.5 +// CHECK:STDOUT: %.loc4_65.7: init i32 = initialize_from %.loc4_61 to %.loc4_65.6 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_65.8: i32 = int_value 2 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_65.9: ref i32 = array_index file.%arr.var, %.loc4_65.8 +// CHECK:STDOUT: %.loc4_65.10: init i32 = initialize_from %.loc4_64 to %.loc4_65.9 [template = constants.%.3] +// CHECK:STDOUT: %.loc4_65.11: init %.5 = array_init (%.loc4_65.4, %.loc4_65.7, %.loc4_65.10) to file.%arr.var [template = constants.%array] +// CHECK:STDOUT: %.loc4_66: init %.5 = converted %.loc4_65.1, %.loc4_65.11 [template = constants.%array] +// CHECK:STDOUT: assign file.%arr.var, %.loc4_66 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/call/fail_param_type.carbon b/toolchain/check/testdata/function/call/fail_param_type.carbon index 875252e6a0f29..47009bd912b08 100644 --- a/toolchain/check/testdata/function/call/fail_param_type.carbon +++ b/toolchain/check/testdata/function/call/fail_param_type.carbon @@ -408,6 +408,8 @@ fn F() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.7)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.7) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -415,6 +417,8 @@ fn F() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -422,6 +426,8 @@ fn F() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.7)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.7)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -429,6 +435,8 @@ fn F() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -444,6 +452,8 @@ fn F() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.7)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.7) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -451,6 +461,8 @@ fn F() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -458,6 +470,8 @@ fn F() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.7)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.7)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -465,6 +479,8 @@ fn F() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon index badacfe4edaaa..9550273336d43 100644 --- a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon +++ b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon @@ -419,6 +419,8 @@ fn Run() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.8)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.8) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -426,6 +428,8 @@ fn Run() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.10) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -433,6 +437,8 @@ fn Run() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.8)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.8)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -440,6 +446,8 @@ fn Run() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -455,6 +463,8 @@ fn Run() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.8)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.8) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -462,6 +472,8 @@ fn Run() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.10) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -469,6 +481,8 @@ fn Run() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.8)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.8)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -476,6 +490,8 @@ fn Run() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon b/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon index 359f6e7d8a9d9..35e75ce965508 100644 --- a/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon +++ b/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon @@ -49,6 +49,8 @@ fn F(n: i32, a: [i32; n]*); // CHECK:STDOUT: %.loc14_9.2: type = converted %int.make_type_32.loc14_9, %.loc14_9.1 [template = i32] // CHECK:STDOUT: %int.make_type_32.loc14_18: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %n.ref: i32 = name_ref n, %n +// CHECK:STDOUT: %.loc14_18.1: type = value_of_initializer %int.make_type_32.loc14_18 [template = i32] +// CHECK:STDOUT: %.loc14_18.2: type = converted %int.make_type_32.loc14_18, %.loc14_18.1 [template = i32] // CHECK:STDOUT: %.loc14_25: type = ptr_type [template = ] // CHECK:STDOUT: %n.param: i32 = value_param runtime_param0 // CHECK:STDOUT: %n: i32 = bind_name n, %n.param diff --git a/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon b/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon index 2839a71d70ec3..de81d1c0c6d4a 100644 --- a/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon +++ b/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon @@ -19,19 +19,147 @@ fn F(N:! i32, a: [i32; N]*); // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %N: i32 = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %N.1: i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt.1: i32 = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.1: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.2: %.1 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.3: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.5: %.1 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N.2: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.8: type = int_type signed, %N.2 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.8)> [symbolic] +// CHECK:STDOUT: %N.patt.2: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.9: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.10: type = int_type unsigned, %N.2 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.10)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.11: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.15: %.14 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.16: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.17: %.16 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.8)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.18: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.10)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.19: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.20: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.21: %.20 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N.2) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.25: = bound_method %N.1, %Convert.15 [symbolic] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.25(%N.1) [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.1) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.5)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.24] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.8)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.10)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.8)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.10)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -41,8 +169,8 @@ fn F(N:! i32, a: [i32; N]*); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %N.patt.loc14_6.1: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_6.2 (constants.%N.patt)] -// CHECK:STDOUT: %N.param_patt: i32 = value_param_pattern %N.patt.loc14_6.1, runtime_param [symbolic = %N.patt.loc14_6.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.patt.loc14_6.1: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_6.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.param_patt: i32 = value_param_pattern %N.patt.loc14_6.1, runtime_param [symbolic = %N.patt.loc14_6.2 (constants.%N.patt.1)] // CHECK:STDOUT: %a.patt: = binding_pattern a // CHECK:STDOUT: %a.param_patt: = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { @@ -50,29 +178,598 @@ fn F(N:! i32, a: [i32; N]*); // CHECK:STDOUT: %.loc14_10.1: type = value_of_initializer %int.make_type_32.loc14_10 [template = i32] // CHECK:STDOUT: %.loc14_10.2: type = converted %int.make_type_32.loc14_10, %.loc14_10.1 [template = i32] // CHECK:STDOUT: %int.make_type_32.loc14_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %N.ref: i32 = name_ref N, %N.loc14_6.1 [symbolic = %N.loc14_6.2 (constants.%N)] +// CHECK:STDOUT: %N.ref: i32 = name_ref N, %N.loc14_6.1 [symbolic = %N.loc14_6.2 (constants.%N.1)] // CHECK:STDOUT: %.loc14_19.1: type = value_of_initializer %int.make_type_32.loc14_19 [template = i32] // CHECK:STDOUT: %.loc14_19.2: type = converted %int.make_type_32.loc14_19, %.loc14_19.1 [template = i32] -// CHECK:STDOUT: %.loc14_25: type = array_type %N.ref, i32 [template = ] +// CHECK:STDOUT: %.loc14_24.1: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc14_24.2: = bound_method %N.ref, %.loc14_24.1 [symbolic = %.loc14_24.5 (constants.%.25)] +// CHECK:STDOUT: %int.convert_checked.loc14_24.1: init Core.IntLiteral = call %.loc14_24.2(%N.ref) [symbolic = %int.convert_checked.loc14_24.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc14_24.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc14_24.1 [symbolic = %int.convert_checked.loc14_24.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc14_24.4: Core.IntLiteral = converted %N.ref, %.loc14_24.3 [symbolic = %int.convert_checked.loc14_24.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc14_25: type = array_type %.loc14_24.4, i32 [template = ] // CHECK:STDOUT: %.loc14_26: type = ptr_type [template = ] // CHECK:STDOUT: %N.param: i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc14_6.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc14_6.2 (constants.%N)] +// CHECK:STDOUT: %N.loc14_6.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc14_6.2 (constants.%N.1)] // CHECK:STDOUT: %a.param: = value_param runtime_param0 // CHECK:STDOUT: %a: = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.1)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.1) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: %.2: @As.%.1 (%.14) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.8)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.8)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.8)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.18)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.8)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.23)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.8)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.8) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.10) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.8)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.8)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.8)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.8) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.10) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.8)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.8)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N.2: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%N.loc14_6.1: i32) { -// CHECK:STDOUT: %N.loc14_6.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc14_6.2 (constants.%N)] -// CHECK:STDOUT: %N.patt.loc14_6.2: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_6.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.loc14_6.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc14_6.2 (constants.%N.1)] +// CHECK:STDOUT: %N.patt.loc14_6.2: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_6.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %.loc14_24.5: = bound_method %N.loc14_6.2, constants.%Convert.15 [symbolic = %.loc14_24.5 (constants.%.25)] +// CHECK:STDOUT: %int.convert_checked.loc14_24.2: init Core.IntLiteral = call %.loc14_24.5(%N.loc14_6.2) [symbolic = %int.convert_checked.loc14_24.2 (constants.%int.convert_checked)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%N.param_patt: i32, %a.param_patt: ); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(constants.%N) { -// CHECK:STDOUT: %N.loc14_6.2 => constants.%N -// CHECK:STDOUT: %N.patt.loc14_6.2 => constants.%N +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.3 +// CHECK:STDOUT: %.2 => constants.%.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.2 => constants.%.7 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.8) { +// CHECK:STDOUT: %Dest => constants.%.8 +// CHECK:STDOUT: %Dest.patt => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.8 +// CHECK:STDOUT: %Dest.patt => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.10) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.16 +// CHECK:STDOUT: %.2 => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.8) { +// CHECK:STDOUT: %Dest => constants.%.8 +// CHECK:STDOUT: %Dest.patt => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.8 +// CHECK:STDOUT: %Dest.patt => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.10) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: %Dest.patt => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.20 +// CHECK:STDOUT: %.2 => constants.%.21 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F(constants.%N.1) { +// CHECK:STDOUT: %N.loc14_6.2 => constants.%N.1 +// CHECK:STDOUT: %N.patt.loc14_6.2 => constants.%N.1 +// CHECK:STDOUT: %.loc14_24.5 => constants.%.25 +// CHECK:STDOUT: %int.convert_checked.loc14_24.2 => constants.%int.convert_checked // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/generic/resolve_used.carbon b/toolchain/check/testdata/function/generic/resolve_used.carbon index cebeb623af7b7..80318a443a169 100644 --- a/toolchain/check/testdata/function/generic/resolve_used.carbon +++ b/toolchain/check/testdata/function/generic/resolve_used.carbon @@ -447,6 +447,8 @@ fn CallNegative() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.1)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.1) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -454,6 +456,8 @@ fn CallNegative() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -461,6 +465,8 @@ fn CallNegative() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.1)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.1)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -468,6 +474,8 @@ fn CallNegative() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -483,6 +491,8 @@ fn CallNegative() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.1)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.1) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -490,6 +500,8 @@ fn CallNegative() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -497,6 +509,8 @@ fn CallNegative() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.1)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.1)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -504,6 +518,8 @@ fn CallNegative() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/generic/return_slot.carbon b/toolchain/check/testdata/function/generic/return_slot.carbon index ad2b4dff551ff..6c15d1e11872b 100644 --- a/toolchain/check/testdata/function/generic/return_slot.carbon +++ b/toolchain/check/testdata/function/generic/return_slot.carbon @@ -38,37 +38,165 @@ fn G() { // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.4: i32 = int_value 100 [template] -// CHECK:STDOUT: %.5: type = array_type %.4, i32 [template] -// CHECK:STDOUT: %.6: type = ptr_type %.5 [template] -// CHECK:STDOUT: %.7: type = unbound_element_type %C, %.5 [template] -// CHECK:STDOUT: %.8: type = struct_type {.arr: %.5} [template] -// CHECK:STDOUT: %.9: = complete_type_witness %.8 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.5: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.9: %.5 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.10: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.12: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.12)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.14: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.14)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.17: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.18: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.19: %.18 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.20: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.21: %.20 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.12)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.14)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.24: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.25: %.24 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.28: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.29: = bound_method %.4, %Convert.15 [template] +// CHECK:STDOUT: %.30: Core.IntLiteral = int_value 100 [template] +// CHECK:STDOUT: %.31: type = array_type %.30, i32 [template] +// CHECK:STDOUT: %.32: type = ptr_type %.31 [template] +// CHECK:STDOUT: %.33: type = unbound_element_type %C, %.31 [template] +// CHECK:STDOUT: %.34: type = struct_type {.arr: %.31} [template] +// CHECK:STDOUT: %.35: = complete_type_witness %.34 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %Wrap.3: type = class_type @Wrap, @Wrap(i32) [template] // CHECK:STDOUT: %Make.type.2: type = fn_type @Make, @Wrap(i32) [template] // CHECK:STDOUT: %Make.2: %Make.type.2 = struct_value () [template] -// CHECK:STDOUT: %.10: type = ptr_type %.1 [template] -// CHECK:STDOUT: %.11: = specific_function %Make.2, @Make(i32) [template] +// CHECK:STDOUT: %.36: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.37: = specific_function %Make.2, @Make(i32) [template] // CHECK:STDOUT: %Wrap.4: type = class_type @Wrap, @Wrap(%empty_tuple.type) [template] // CHECK:STDOUT: %Make.type.3: type = fn_type @Make, @Wrap(%empty_tuple.type) [template] // CHECK:STDOUT: %Make.3: %Make.type.3 = struct_value () [template] -// CHECK:STDOUT: %.12: = specific_function %Make.3, @Make(%empty_tuple.type) [template] -// CHECK:STDOUT: %.13: type = struct_type {.arr: %.6} [template] -// CHECK:STDOUT: %.14: type = ptr_type %.8 [template] +// CHECK:STDOUT: %.38: = specific_function %Make.3, @Make(%empty_tuple.type) [template] +// CHECK:STDOUT: %.39: type = struct_type {.arr: %.32} [template] +// CHECK:STDOUT: %.40: type = ptr_type %.34 [template] // CHECK:STDOUT: %Wrap.5: type = class_type @Wrap, @Wrap(%C) [template] // CHECK:STDOUT: %Make.type.4: type = fn_type @Make, @Wrap(%C) [template] // CHECK:STDOUT: %Make.4: %Make.type.4 = struct_value () [template] -// CHECK:STDOUT: %.15: = specific_function %Make.4, @Make(%C) [template] +// CHECK:STDOUT: %.41: = specific_function %Make.4, @Make(%C) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.5) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.9)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.28] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.12)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.14)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.12)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.14)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -90,6 +218,198 @@ fn G() { // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.5) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.18)] +// CHECK:STDOUT: %.2: @As.%.1 (%.18) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.17)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.23)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.26)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.27)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: generic class @Wrap(%T.loc11_12.1: type) { // CHECK:STDOUT: %T.loc11_12.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc11_12.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc11_12.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_12.2 (constants.%T.patt)] @@ -117,12 +437,17 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_26: i32 = int_value 100 [template = constants.%.4] +// CHECK:STDOUT: %.loc15_26.1: i32 = int_value 100 [template = constants.%.4] // CHECK:STDOUT: %.loc15_21.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc15_21.2: type = converted %int.make_type_32, %.loc15_21.1 [template = i32] -// CHECK:STDOUT: %.loc15_29: type = array_type %.loc15_26, i32 [template = constants.%.5] -// CHECK:STDOUT: %.loc15_18: %.7 = field_decl arr, element0 [template] -// CHECK:STDOUT: %.loc15_32: = complete_type_witness %.8 [template = constants.%.9] +// CHECK:STDOUT: %.loc15_26.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc15_26.3: = bound_method %.loc15_26.1, %.loc15_26.2 [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc15_26.3(%.loc15_26.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc15_26.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.30] +// CHECK:STDOUT: %.loc15_26.5: Core.IntLiteral = converted %.loc15_26.1, %.loc15_26.4 [template = constants.%.30] +// CHECK:STDOUT: %.loc15_29: type = array_type %.loc15_26.5, i32 [template = constants.%.31] +// CHECK:STDOUT: %.loc15_18: %.33 = field_decl arr, element0 [template] +// CHECK:STDOUT: %.loc15_32: = complete_type_witness %.34 [template = constants.%.35] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -151,6 +476,96 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.12) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.14) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.14)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.12) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.14) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.14)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @G() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int.make_type_32.loc18_10: init type = call constants.%Int32() [template = i32] @@ -165,7 +580,7 @@ fn G() { // CHECK:STDOUT: %Wrap.loc18: type = class_type @Wrap, @Wrap(i32) [template = constants.%Wrap.3] // CHECK:STDOUT: %.loc18_25.1: %Make.type.2 = specific_constant @Wrap.%Make.decl, @Wrap(i32) [template = constants.%Make.2] // CHECK:STDOUT: %Make.ref.loc18: %Make.type.2 = name_ref Make, %.loc18_25.1 [template = constants.%Make.2] -// CHECK:STDOUT: %.loc18_25.2: = specific_function %Make.ref.loc18, @Make(i32) [template = constants.%.11] +// CHECK:STDOUT: %.loc18_25.2: = specific_function %Make.ref.loc18, @Make(i32) [template = constants.%.37] // CHECK:STDOUT: %Make.call.loc18: init i32 = call %.loc18_25.2() // CHECK:STDOUT: assign %a.var, %Make.call.loc18 // CHECK:STDOUT: %.loc19_11.1: %empty_tuple.type = tuple_literal () @@ -178,7 +593,7 @@ fn G() { // CHECK:STDOUT: %Wrap.loc19: type = class_type @Wrap, @Wrap(constants.%empty_tuple.type) [template = constants.%Wrap.4] // CHECK:STDOUT: %.loc19_23.1: %Make.type.3 = specific_constant @Wrap.%Make.decl, @Wrap(constants.%empty_tuple.type) [template = constants.%Make.3] // CHECK:STDOUT: %Make.ref.loc19: %Make.type.3 = name_ref Make, %.loc19_23.1 [template = constants.%Make.3] -// CHECK:STDOUT: %.loc19_23.2: = specific_function %Make.ref.loc19, @Make(constants.%empty_tuple.type) [template = constants.%.12] +// CHECK:STDOUT: %.loc19_23.2: = specific_function %Make.ref.loc19, @Make(constants.%empty_tuple.type) [template = constants.%.38] // CHECK:STDOUT: %Make.call.loc19: init %empty_tuple.type = call %.loc19_23.2() // CHECK:STDOUT: assign %b.var, %Make.call.loc19 // CHECK:STDOUT: %C.ref.loc20_10: type = name_ref C, file.%C.decl [template = constants.%C] @@ -189,7 +604,7 @@ fn G() { // CHECK:STDOUT: %Wrap.loc20: type = class_type @Wrap, @Wrap(constants.%C) [template = constants.%Wrap.5] // CHECK:STDOUT: %.loc20_21.1: %Make.type.4 = specific_constant @Wrap.%Make.decl, @Wrap(constants.%C) [template = constants.%Make.4] // CHECK:STDOUT: %Make.ref.loc20: %Make.type.4 = name_ref Make, %.loc20_21.1 [template = constants.%Make.4] -// CHECK:STDOUT: %.loc20_21.2: = specific_function %Make.ref.loc20, @Make(constants.%C) [template = constants.%.15] +// CHECK:STDOUT: %.loc20_21.2: = specific_function %Make.ref.loc20, @Make(constants.%C) [template = constants.%.41] // CHECK:STDOUT: %.loc20_7: ref %C = splice_block %c.var {} // CHECK:STDOUT: %Make.call.loc20: init %C = call %.loc20_21.2() to %.loc20_7 // CHECK:STDOUT: assign %c.var, %Make.call.loc20 @@ -228,6 +643,284 @@ fn G() { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %.2 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.12) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.14) { +// CHECK:STDOUT: %Dest => constants.%.14 +// CHECK:STDOUT: %Dest.patt => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.14 +// CHECK:STDOUT: %Dest.patt => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.20 +// CHECK:STDOUT: %.2 => constants.%.21 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.12) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.12 +// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.14) { +// CHECK:STDOUT: %Dest => constants.%.14 +// CHECK:STDOUT: %Dest.patt => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.14 +// CHECK:STDOUT: %Dest.patt => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.24 +// CHECK:STDOUT: %.2 => constants.%.25 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @Wrap(i32) { // CHECK:STDOUT: %T.loc11_12.2 => i32 // CHECK:STDOUT: %T.patt.loc11_12.2 => i32 @@ -243,7 +936,7 @@ fn G() { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Make.type => constants.%Make.type.2 // CHECK:STDOUT: %Make => constants.%Make.2 -// CHECK:STDOUT: %.loc12_27.3 => constants.%.11 +// CHECK:STDOUT: %.loc12_27.3 => constants.%.37 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Wrap(constants.%empty_tuple.type) { @@ -261,7 +954,7 @@ fn G() { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Make.type => constants.%Make.type.3 // CHECK:STDOUT: %Make => constants.%Make.3 -// CHECK:STDOUT: %.loc12_27.3 => constants.%.12 +// CHECK:STDOUT: %.loc12_27.3 => constants.%.38 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Wrap(constants.%C) { @@ -279,6 +972,6 @@ fn G() { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Make.type => constants.%Make.type.4 // CHECK:STDOUT: %Make => constants.%Make.4 -// CHECK:STDOUT: %.loc12_27.3 => constants.%.15 +// CHECK:STDOUT: %.loc12_27.3 => constants.%.41 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/if_expr/basic.carbon b/toolchain/check/testdata/if_expr/basic.carbon index d774017c83bcf..24c0c6737c7e9 100644 --- a/toolchain/check/testdata/if_expr/basic.carbon +++ b/toolchain/check/testdata/if_expr/basic.carbon @@ -24,22 +24,150 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %.1: i32 = int_value 1 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] -// CHECK:STDOUT: %.4: i32 = int_value 0 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.2: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.3: %.2 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.7 [template] +// CHECK:STDOUT: %.6: %.2 = assoc_entity element0, imports.%import_ref.8 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.9: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.9)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.10: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.11: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.34 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.35 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.9)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.19: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.20: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.21: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.22: %.21 = assoc_entity element0, imports.%import_ref.45 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.28: type = array_type %.27, i32 [template] +// CHECK:STDOUT: %.29: type = ptr_type %.28 [template] +// CHECK:STDOUT: %.30: i32 = int_value 0 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (i32) [template] -// CHECK:STDOUT: %array: %.2 = tuple_value (%.4) [template] +// CHECK:STDOUT: %array: %.28 = tuple_value (%.30) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Bool = %import_ref.1 // CHECK:STDOUT: .Int32 = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.3 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+5, loaded [template = constants.%Bool] // CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.3: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.5: @ImplicitAs.%.1 (%.2) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.6)] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.10: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.14: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.15 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.17: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.18 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.20: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.21: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.25] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.23: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.24 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.26: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.30 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.32: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.37: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.38 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.40: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.41 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.43: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.45 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.47: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.48 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.50: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.51 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -81,6 +209,198 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.2) = assoc_entity element0, imports.%import_ref.7 [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: .Convert = imports.%import_ref.5 +// CHECK:STDOUT: witness = (imports.%import_ref.6) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %.2: @As.%.1 (%.15) = assoc_entity element0, imports.%import_ref.34 [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.28 +// CHECK:STDOUT: .Convert = imports.%import_ref.29 +// CHECK:STDOUT: witness = (imports.%import_ref.30) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.9 as imports.%import_ref.10 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.13 as imports.%import_ref.14 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.16 as imports.%import_ref.17 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.18 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.19 as imports.%import_ref.20 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.21 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.22 as imports.%import_ref.23 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.24 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.25 as imports.%import_ref.26 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.27 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.31 as imports.%import_ref.32 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.33 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.36 as imports.%import_ref.37 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.38 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.20)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.39 as imports.%import_ref.40 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.41 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.42 as imports.%import_ref.43 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.44 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.23)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.46 as imports.%import_ref.47 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.48 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.49 as imports.%import_ref.50 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.51 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; @@ -88,32 +408,37 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: fn @F(%b.param_patt: bool, %n.param_patt: i32, %m.param_patt: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_16: i32 = int_value 1 [template = constants.%.1] +// CHECK:STDOUT: %.loc12_16.1: i32 = int_value 1 [template = constants.%.1] // CHECK:STDOUT: %.loc12_11.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] // CHECK:STDOUT: %.loc12_11.2: type = converted %int.make_type_32.loc12, %.loc12_11.1 [template = i32] -// CHECK:STDOUT: %.loc12_17: type = array_type %.loc12_16, i32 [template = constants.%.2] -// CHECK:STDOUT: %x.var: ref %.2 = var x -// CHECK:STDOUT: %x: ref %.2 = bind_name x, %x.var -// CHECK:STDOUT: %.loc12_22: i32 = int_value 0 [template = constants.%.4] +// CHECK:STDOUT: %.loc12_16.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc12_16.3: = bound_method %.loc12_16.1, %.loc12_16.2 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc12_16.3(%.loc12_16.1) [template = constants.%.27] +// CHECK:STDOUT: %.loc12_16.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.27] +// CHECK:STDOUT: %.loc12_16.5: Core.IntLiteral = converted %.loc12_16.1, %.loc12_16.4 [template = constants.%.27] +// CHECK:STDOUT: %.loc12_17: type = array_type %.loc12_16.5, i32 [template = constants.%.28] +// CHECK:STDOUT: %x.var: ref %.28 = var x +// CHECK:STDOUT: %x: ref %.28 = bind_name x, %x.var +// CHECK:STDOUT: %.loc12_22: i32 = int_value 0 [template = constants.%.30] // CHECK:STDOUT: %.loc12_24.1: %tuple.type = tuple_literal (%.loc12_22) -// CHECK:STDOUT: %.loc12_24.2: i32 = int_value 0 [template = constants.%.4] +// CHECK:STDOUT: %.loc12_24.2: i32 = int_value 0 [template = constants.%.30] // CHECK:STDOUT: %.loc12_24.3: ref i32 = array_index %x.var, %.loc12_24.2 -// CHECK:STDOUT: %.loc12_24.4: init i32 = initialize_from %.loc12_22 to %.loc12_24.3 [template = constants.%.4] -// CHECK:STDOUT: %.loc12_24.5: init %.2 = array_init (%.loc12_24.4) to %x.var [template = constants.%array] -// CHECK:STDOUT: %.loc12_25: init %.2 = converted %.loc12_24.1, %.loc12_24.5 [template = constants.%array] +// CHECK:STDOUT: %.loc12_24.4: init i32 = initialize_from %.loc12_22 to %.loc12_24.3 [template = constants.%.30] +// CHECK:STDOUT: %.loc12_24.5: init %.28 = array_init (%.loc12_24.4) to %x.var [template = constants.%array] +// CHECK:STDOUT: %.loc12_25: init %.28 = converted %.loc12_24.1, %.loc12_24.5 [template = constants.%array] // CHECK:STDOUT: assign %x.var, %.loc12_25 // CHECK:STDOUT: %b.ref: bool = name_ref b, %b // CHECK:STDOUT: if %b.ref br !if.expr.then else br !if.expr.else // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then: -// CHECK:STDOUT: %x.ref.loc13_20: ref %.2 = name_ref x, %x +// CHECK:STDOUT: %x.ref.loc13_20: ref %.28 = name_ref x, %x // CHECK:STDOUT: %m.ref: i32 = name_ref m, %m // CHECK:STDOUT: %.loc13_23.1: ref i32 = array_index %x.ref.loc13_20, %m.ref // CHECK:STDOUT: %.loc13_23.2: i32 = bind_value %.loc13_23.1 // CHECK:STDOUT: br !if.expr.result(%.loc13_23.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else: -// CHECK:STDOUT: %x.ref.loc13_30: ref %.2 = name_ref x, %x +// CHECK:STDOUT: %x.ref.loc13_30: ref %.28 = name_ref x, %x // CHECK:STDOUT: %n.ref: i32 = name_ref n, %n // CHECK:STDOUT: %.loc13_33.1: ref i32 = array_index %x.ref.loc13_30, %n.ref // CHECK:STDOUT: %.loc13_33.2: i32 = bind_value %.loc13_33.1 @@ -124,3 +449,371 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: return %.loc13_10 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.2 => constants.%.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %.2 => constants.%.18 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.21 +// CHECK:STDOUT: %.2 => constants.%.22 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon index 8008b9734d842..0ca0b07687cfd 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon @@ -278,38 +278,166 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%.7, %.8) [symbolic] // CHECK:STDOUT: %.9: i32 = int_value 4 [template] -// CHECK:STDOUT: %.10: type = array_type %.9, %Self.3 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.4: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.5: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.10: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.12: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.7 [template] +// CHECK:STDOUT: %.14: %.10 = assoc_entity element0, imports.%import_ref.8 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.15: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.17: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.17)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.15(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.18: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.19: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.19)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.16(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.20: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.18(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.21: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.19(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.6: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.7: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.23: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.24: %.23 = assoc_entity element0, imports.%import_ref.34 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.25: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.26: %.25 = assoc_entity element0, imports.%import_ref.35 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.17)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.21(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.19)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.22(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.28: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.29: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.30: %.29 = assoc_entity element0, imports.%import_ref.45 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.24(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.31: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.25(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.32: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.33: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.34: = bound_method %.9, %Convert.15 [template] +// CHECK:STDOUT: %.35: Core.IntLiteral = int_value 4 [template] +// CHECK:STDOUT: %.36: type = array_type %.35, %Self.3 [symbolic] // CHECK:STDOUT: %F.type.13: type = fn_type @F.13 [template] // CHECK:STDOUT: %F.14: %F.type.13 = struct_value () [template] -// CHECK:STDOUT: %.11: type = assoc_entity_type %SelfNested.type, %F.type.13 [template] -// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, @SelfNested.%F.decl [template] +// CHECK:STDOUT: %.37: type = assoc_entity_type %SelfNested.type, %F.type.13 [template] +// CHECK:STDOUT: %.38: %.37 = assoc_entity element0, @SelfNested.%F.decl [template] // CHECK:STDOUT: %SelfNestedBadParam: type = class_type @SelfNestedBadParam [template] -// CHECK:STDOUT: %.13: type = ptr_type %SelfNestedBadParam [template] -// CHECK:STDOUT: %.14: type = struct_type {.x: i32, .y: i32} [template] -// CHECK:STDOUT: %tuple.type.3: type = tuple_type (%.13, %.14) [template] -// CHECK:STDOUT: %.15: type = array_type %.9, %SelfNestedBadParam [template] +// CHECK:STDOUT: %.39: type = ptr_type %SelfNestedBadParam [template] +// CHECK:STDOUT: %.40: type = struct_type {.x: i32, .y: i32} [template] +// CHECK:STDOUT: %tuple.type.3: type = tuple_type (%.39, %.40) [template] +// CHECK:STDOUT: %.41: type = array_type %.35, %SelfNestedBadParam [template] // CHECK:STDOUT: %F.type.14: type = fn_type @F.14 [template] // CHECK:STDOUT: %F.15: %F.type.14 = struct_value () [template] -// CHECK:STDOUT: %.16: type = struct_type {.x: %SelfNestedBadParam, .y: i32} [template] -// CHECK:STDOUT: %tuple.type.4: type = tuple_type (%.13, %.16) [template] +// CHECK:STDOUT: %.42: type = struct_type {.x: %SelfNestedBadParam, .y: i32} [template] +// CHECK:STDOUT: %tuple.type.4: type = tuple_type (%.39, %.42) [template] // CHECK:STDOUT: %SelfNestedBadReturnType: type = class_type @SelfNestedBadReturnType [template] -// CHECK:STDOUT: %.17: type = ptr_type %SelfNestedBadReturnType [template] -// CHECK:STDOUT: %.18: type = struct_type {.x: %SelfNestedBadReturnType, .y: i32} [template] -// CHECK:STDOUT: %tuple.type.5: type = tuple_type (%.17, %.18) [template] +// CHECK:STDOUT: %.43: type = ptr_type %SelfNestedBadReturnType [template] +// CHECK:STDOUT: %.44: type = struct_type {.x: %SelfNestedBadReturnType, .y: i32} [template] +// CHECK:STDOUT: %tuple.type.5: type = tuple_type (%.43, %.44) [template] // CHECK:STDOUT: %F.type.15: type = fn_type @F.15 [template] // CHECK:STDOUT: %F.16: %F.type.15 = struct_value () [template] -// CHECK:STDOUT: %.19: type = array_type %.9, %SelfNestedBadReturnType [template] +// CHECK:STDOUT: %.45: type = array_type %.35, %SelfNestedBadReturnType [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Bool = %import_ref.1 // CHECK:STDOUT: .Int32 = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.3 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+5, loaded [template = constants.%Bool] // CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.3: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.5: @ImplicitAs.%.1 (%.10) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.14)] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.10: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.14: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.15.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.15 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.17: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.16.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.18 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.20: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.21: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.33] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.18.%.1 (constants.%.17)] +// CHECK:STDOUT: %import_ref.23: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.24 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.19.%.1 (constants.%.19)] +// CHECK:STDOUT: %import_ref.26: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.30 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.32: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.37: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.21.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.38 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.40: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.22.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.41 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.43: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.45 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.24.%.1 (constants.%.17)] +// CHECK:STDOUT: %import_ref.47: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.48 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.25.%.1 (constants.%.19)] +// CHECK:STDOUT: %import_ref.50: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.51 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -407,8 +535,8 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %F.decl: %F.type.13 = fn_decl @F.13 [template = constants.%F.14] { // CHECK:STDOUT: %x.patt: @F.13.%tuple.type (%tuple.type.2) = binding_pattern x // CHECK:STDOUT: %x.param_patt: @F.13.%tuple.type (%tuple.type.2) = value_param_pattern %x.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: @F.13.%.loc188_52.1 (%.10) = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: @F.13.%.loc188_52.1 (%.10) = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: @F.13.%.loc188_52.1 (%.36) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @F.13.%.loc188_52.1 (%.36) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc188_12: %SelfNested.type = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.3)] // CHECK:STDOUT: %.loc188_16.2: type = facet_type_access %Self.ref.loc188_12 [symbolic = %Self (constants.%Self.3)] @@ -424,16 +552,21 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %.loc188_38.1: %tuple.type.1 = tuple_literal (%.loc188_16.4, %.loc188_37.2) // CHECK:STDOUT: %.loc188_38.2: type = converted %.loc188_38.1, constants.%tuple.type.2 [symbolic = %tuple.type (constants.%tuple.type.2)] // CHECK:STDOUT: %Self.ref.loc188_45: %SelfNested.type = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.3)] -// CHECK:STDOUT: %.loc188_51: i32 = int_value 4 [template = constants.%.9] +// CHECK:STDOUT: %.loc188_51.1: i32 = int_value 4 [template = constants.%.9] // CHECK:STDOUT: %.loc188_45.1: type = facet_type_access %Self.ref.loc188_45 [symbolic = %Self (constants.%Self.3)] // CHECK:STDOUT: %.loc188_45.2: type = converted %Self.ref.loc188_45, %.loc188_45.1 [symbolic = %Self (constants.%Self.3)] -// CHECK:STDOUT: %.loc188_52.2: type = array_type %.loc188_51, %Self.3 [symbolic = %.loc188_52.1 (constants.%.10)] +// CHECK:STDOUT: %.loc188_51.2: %Convert.type.2 = interface_witness_access constants.%.33, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc188_51.3: = bound_method %.loc188_51.1, %.loc188_51.2 [template = constants.%.34] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc188_51.3(%.loc188_51.1) [template = constants.%.35] +// CHECK:STDOUT: %.loc188_51.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.35] +// CHECK:STDOUT: %.loc188_51.5: Core.IntLiteral = converted %.loc188_51.1, %.loc188_51.4 [template = constants.%.35] +// CHECK:STDOUT: %.loc188_52.2: type = array_type %.loc188_51.5, %Self.3 [symbolic = %.loc188_52.1 (constants.%.36)] // CHECK:STDOUT: %x.param: @F.13.%tuple.type (%tuple.type.2) = value_param runtime_param0 // CHECK:STDOUT: %x: @F.13.%tuple.type (%tuple.type.2) = bind_name x, %x.param -// CHECK:STDOUT: %return.param: ref @F.13.%.loc188_52.1 (%.10) = out_param runtime_param1 -// CHECK:STDOUT: %return: ref @F.13.%.loc188_52.1 (%.10) = return_slot %return.param +// CHECK:STDOUT: %return.param: ref @F.13.%.loc188_52.1 (%.36) = out_param runtime_param1 +// CHECK:STDOUT: %return: ref @F.13.%.loc188_52.1 (%.36) = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc188: %.11 = assoc_entity element0, %F.decl [template = constants.%.12] +// CHECK:STDOUT: %.loc188: %.37 = assoc_entity element0, %F.decl [template = constants.%.38] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self @@ -441,6 +574,46 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: witness = (%F.decl) // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.5)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.10) = assoc_entity element0, imports.%import_ref.7 [symbolic = %.2 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: .Convert = imports.%import_ref.5 +// CHECK:STDOUT: witness = (imports.%import_ref.6) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.7)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.23)] +// CHECK:STDOUT: %.2: @As.%.1 (%.23) = assoc_entity element0, imports.%import_ref.34 [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.28 +// CHECK:STDOUT: .Convert = imports.%import_ref.29 +// CHECK:STDOUT: witness = (imports.%import_ref.30) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %Self.ref as %I.ref { // CHECK:STDOUT: %.loc21: = interface_witness () [template = ] // CHECK:STDOUT: @@ -716,31 +889,188 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: witness = %.loc175 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.14: %Self.ref as %SelfNested.ref { +// CHECK:STDOUT: impl @impl.14: imports.%import_ref.9 as imports.%import_ref.10 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.15(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.15(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.15.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.18)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.13 as imports.%import_ref.14 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.16(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.19)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.16(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.16.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.20)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.16 as imports.%import_ref.17 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.18 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.17: imports.%import_ref.19 as imports.%import_ref.20 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.21 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.18(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.18(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.18.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.22 as imports.%import_ref.23 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.24 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.19(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.19(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.19.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.25 as imports.%import_ref.26 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.27 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.20: imports.%import_ref.31 as imports.%import_ref.32 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.33 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.21(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.21(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.21.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.27)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.36 as imports.%import_ref.37 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.38 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.22(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.19)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.22(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.22.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.28)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.39 as imports.%import_ref.40 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.41 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.23: imports.%import_ref.42 as imports.%import_ref.43 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.44 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.24(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.24(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.24.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.31)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.46 as imports.%import_ref.47 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.48 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.25(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.25(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.25.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.32)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.49 as imports.%import_ref.50 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.51 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.26: %Self.ref as %SelfNested.ref { // CHECK:STDOUT: %F.decl: %F.type.14 = fn_decl @F.14 [template = constants.%F.15] { // CHECK:STDOUT: %x.patt: %tuple.type.3 = binding_pattern x // CHECK:STDOUT: %x.param_patt: %tuple.type.3 = value_param_pattern %x.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.15 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.15 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %.41 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.41 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %SelfNestedBadParam.ref.loc200_14: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [template = constants.%SelfNestedBadParam] -// CHECK:STDOUT: %.loc200_32: type = ptr_type %SelfNestedBadParam [template = constants.%.13] +// CHECK:STDOUT: %.loc200_32: type = ptr_type %SelfNestedBadParam [template = constants.%.39] // CHECK:STDOUT: %int.make_type_32.loc200_40: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc200_40.1: type = value_of_initializer %int.make_type_32.loc200_40 [template = i32] // CHECK:STDOUT: %.loc200_40.2: type = converted %int.make_type_32.loc200_40, %.loc200_40.1 [template = i32] // CHECK:STDOUT: %int.make_type_32.loc200_49: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc200_49.1: type = value_of_initializer %int.make_type_32.loc200_49 [template = i32] // CHECK:STDOUT: %.loc200_49.2: type = converted %int.make_type_32.loc200_49, %.loc200_49.1 [template = i32] -// CHECK:STDOUT: %.loc200_52: type = struct_type {.x: i32, .y: i32} [template = constants.%.14] +// CHECK:STDOUT: %.loc200_52: type = struct_type {.x: i32, .y: i32} [template = constants.%.40] // CHECK:STDOUT: %.loc200_53.1: %tuple.type.1 = tuple_literal (%.loc200_32, %.loc200_52) // CHECK:STDOUT: %.loc200_53.2: type = converted %.loc200_53.1, constants.%tuple.type.3 [template = constants.%tuple.type.3] // CHECK:STDOUT: %SelfNestedBadParam.ref.loc200_60: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [template = constants.%SelfNestedBadParam] -// CHECK:STDOUT: %.loc200_80: i32 = int_value 4 [template = constants.%.9] -// CHECK:STDOUT: %.loc200_81: type = array_type %.loc200_80, %SelfNestedBadParam [template = constants.%.15] +// CHECK:STDOUT: %.loc200_80.1: i32 = int_value 4 [template = constants.%.9] +// CHECK:STDOUT: %.loc200_80.2: %Convert.type.2 = interface_witness_access constants.%.33, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc200_80.3: = bound_method %.loc200_80.1, %.loc200_80.2 [template = constants.%.34] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc200_80.3(%.loc200_80.1) [template = constants.%.35] +// CHECK:STDOUT: %.loc200_80.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.35] +// CHECK:STDOUT: %.loc200_80.5: Core.IntLiteral = converted %.loc200_80.1, %.loc200_80.4 [template = constants.%.35] +// CHECK:STDOUT: %.loc200_81: type = array_type %.loc200_80.5, %SelfNestedBadParam [template = constants.%.41] // CHECK:STDOUT: %x.param: %tuple.type.3 = value_param runtime_param0 // CHECK:STDOUT: %x: %tuple.type.3 = bind_name x, %x.param -// CHECK:STDOUT: %return.param: ref %.15 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.15 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %.41 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %.41 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc192: = interface_witness () [template = ] // CHECK:STDOUT: @@ -749,29 +1079,34 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: witness = %.loc192 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.15: %Self.ref as %SelfNested.ref { +// CHECK:STDOUT: impl @impl.27: %Self.ref as %SelfNested.ref { // CHECK:STDOUT: %F.decl: %F.type.15 = fn_decl @F.15 [template = constants.%F.16] { // CHECK:STDOUT: %x.patt: %tuple.type.5 = binding_pattern x // CHECK:STDOUT: %x.param_patt: %tuple.type.5 = value_param_pattern %x.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.15 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.15 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %.41 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.41 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %SelfNestedBadReturnType.ref.loc212_14: type = name_ref SelfNestedBadReturnType, file.%SelfNestedBadReturnType.decl [template = constants.%SelfNestedBadReturnType] -// CHECK:STDOUT: %.loc212_37: type = ptr_type %SelfNestedBadReturnType [template = constants.%.17] +// CHECK:STDOUT: %.loc212_37: type = ptr_type %SelfNestedBadReturnType [template = constants.%.43] // CHECK:STDOUT: %SelfNestedBadReturnType.ref.loc212_45: type = name_ref SelfNestedBadReturnType, file.%SelfNestedBadReturnType.decl [template = constants.%SelfNestedBadReturnType] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc212_74.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc212_74.2: type = converted %int.make_type_32, %.loc212_74.1 [template = i32] -// CHECK:STDOUT: %.loc212_77: type = struct_type {.x: %SelfNestedBadReturnType, .y: i32} [template = constants.%.18] +// CHECK:STDOUT: %.loc212_77: type = struct_type {.x: %SelfNestedBadReturnType, .y: i32} [template = constants.%.44] // CHECK:STDOUT: %.loc212_78.1: %tuple.type.1 = tuple_literal (%.loc212_37, %.loc212_77) // CHECK:STDOUT: %.loc212_78.2: type = converted %.loc212_78.1, constants.%tuple.type.5 [template = constants.%tuple.type.5] // CHECK:STDOUT: %SelfNestedBadParam.ref: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [template = constants.%SelfNestedBadParam] -// CHECK:STDOUT: %.loc212_105: i32 = int_value 4 [template = constants.%.9] -// CHECK:STDOUT: %.loc212_106: type = array_type %.loc212_105, %SelfNestedBadParam [template = constants.%.15] +// CHECK:STDOUT: %.loc212_105.1: i32 = int_value 4 [template = constants.%.9] +// CHECK:STDOUT: %.loc212_105.2: %Convert.type.2 = interface_witness_access constants.%.33, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc212_105.3: = bound_method %.loc212_105.1, %.loc212_105.2 [template = constants.%.34] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc212_105.3(%.loc212_105.1) [template = constants.%.35] +// CHECK:STDOUT: %.loc212_105.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.35] +// CHECK:STDOUT: %.loc212_105.5: Core.IntLiteral = converted %.loc212_105.1, %.loc212_105.4 [template = constants.%.35] +// CHECK:STDOUT: %.loc212_106: type = array_type %.loc212_105.5, %SelfNestedBadParam [template = constants.%.41] // CHECK:STDOUT: %x.param: %tuple.type.5 = value_param runtime_param0 // CHECK:STDOUT: %x: %tuple.type.5 = bind_name x, %x.param -// CHECK:STDOUT: %return.param: ref %.15 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.15 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %.41 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %.41 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc205: = interface_witness () [template = ] // CHECK:STDOUT: @@ -926,7 +1261,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @SelfNestedBadParam { -// CHECK:STDOUT: impl_decl @impl.14 [template] {} { +// CHECK:STDOUT: impl_decl @impl.26 [template] {} { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%SelfNestedBadParam [template = constants.%SelfNestedBadParam] // CHECK:STDOUT: %SelfNested.ref: type = name_ref SelfNested, file.%SelfNested.decl [template = constants.%SelfNested.type] // CHECK:STDOUT: } @@ -937,7 +1272,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @SelfNestedBadReturnType { -// CHECK:STDOUT: impl_decl @impl.15 [template] {} { +// CHECK:STDOUT: impl_decl @impl.27 [template] {} { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%SelfNestedBadReturnType [template = constants.%SelfNestedBadReturnType] // CHECK:STDOUT: %SelfNested.ref: type = name_ref SelfNested, file.%SelfNested.decl [template = constants.%SelfNested.type] // CHECK:STDOUT: } @@ -983,19 +1318,109 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.4: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.5)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.17) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.19) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.17)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.19)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.6: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.7)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.7)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.17) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.19) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.17)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.19)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: generic fn @F.13(@SelfNested.%Self: %SelfNested.type) { // CHECK:STDOUT: %Self: %SelfNested.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.3)] // CHECK:STDOUT: %.loc188_16.1: type = ptr_type @F.13.%Self (%Self.3) [symbolic = %.loc188_16.1 (constants.%.7)] // CHECK:STDOUT: %.loc188_37.1: type = struct_type {.x: @F.13.%Self (%Self.3), .y: i32} [symbolic = %.loc188_37.1 (constants.%.8)] // CHECK:STDOUT: %tuple.type: type = tuple_type (@F.13.%.loc188_16.1 (%.7), @F.13.%.loc188_37.1 (%.8)) [symbolic = %tuple.type (constants.%tuple.type.2)] -// CHECK:STDOUT: %.loc188_52.1: type = array_type constants.%.9, @F.13.%Self (%Self.3) [symbolic = %.loc188_52.1 (constants.%.10)] +// CHECK:STDOUT: %.loc188_52.1: type = array_type constants.%.35, @F.13.%Self (%Self.3) [symbolic = %.loc188_52.1 (constants.%.36)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%x.param_patt: @F.13.%tuple.type (%tuple.type.2)) -> @F.13.%.loc188_52.1 (%.10); +// CHECK:STDOUT: fn(%x.param_patt: @F.13.%tuple.type (%tuple.type.2)) -> @F.13.%.loc188_52.1 (%.36); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.14(%x.param_patt: %tuple.type.3) -> %.15; +// CHECK:STDOUT: fn @F.14(%x.param_patt: %tuple.type.3) -> %.41; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.15(%x.param_patt: %tuple.type.5) -> %.15; +// CHECK:STDOUT: fn @F.15(%x.param_patt: %tuple.type.5) -> %.41; // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%Self.1) {} // CHECK:STDOUT: @@ -1021,27 +1446,305 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: specific @F.5(constants.%FDifferentParamName) {} // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.4) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.5 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %.2 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.5 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: %.2 => constants.%.16 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.17) { +// CHECK:STDOUT: %Dest => constants.%.17 +// CHECK:STDOUT: %Dest.patt => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.15.%.1) { +// CHECK:STDOUT: %Dest => constants.%.17 +// CHECK:STDOUT: %Dest.patt => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.15(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.15(@impl.15.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.19) { +// CHECK:STDOUT: %Dest => constants.%.19 +// CHECK:STDOUT: %Dest.patt => constants.%.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.16.%.1) { +// CHECK:STDOUT: %Dest => constants.%.19 +// CHECK:STDOUT: %Dest.patt => constants.%.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.16(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.16(@impl.16.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.18(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.18(@impl.18.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.19(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.19(@impl.19.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.7 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.25 +// CHECK:STDOUT: %.2 => constants.%.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.6) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.17) { +// CHECK:STDOUT: %Dest => constants.%.17 +// CHECK:STDOUT: %Dest.patt => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.21.%.1) { +// CHECK:STDOUT: %Dest => constants.%.17 +// CHECK:STDOUT: %Dest.patt => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.21(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.21(@impl.21.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.19) { +// CHECK:STDOUT: %Dest => constants.%.19 +// CHECK:STDOUT: %Dest.patt => constants.%.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.22.%.1) { +// CHECK:STDOUT: %Dest => constants.%.19 +// CHECK:STDOUT: %Dest.patt => constants.%.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.22(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.22(@impl.22.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.7 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.29 +// CHECK:STDOUT: %.2 => constants.%.30 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.24(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.24(@impl.24.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.25(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.25(@impl.25.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @F.13(constants.%Self.3) { // CHECK:STDOUT: %Self => constants.%Self.3 // CHECK:STDOUT: %.loc188_16.1 => constants.%.7 // CHECK:STDOUT: %.loc188_37.1 => constants.%.8 // CHECK:STDOUT: %tuple.type => constants.%tuple.type.2 -// CHECK:STDOUT: %.loc188_52.1 => constants.%.10 +// CHECK:STDOUT: %.loc188_52.1 => constants.%.36 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.13(constants.%SelfNestedBadParam) { // CHECK:STDOUT: %Self => constants.%SelfNestedBadParam -// CHECK:STDOUT: %.loc188_16.1 => constants.%.13 -// CHECK:STDOUT: %.loc188_37.1 => constants.%.16 +// CHECK:STDOUT: %.loc188_16.1 => constants.%.39 +// CHECK:STDOUT: %.loc188_37.1 => constants.%.42 // CHECK:STDOUT: %tuple.type => constants.%tuple.type.4 -// CHECK:STDOUT: %.loc188_52.1 => constants.%.15 +// CHECK:STDOUT: %.loc188_52.1 => constants.%.41 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.13(constants.%SelfNestedBadReturnType) { // CHECK:STDOUT: %Self => constants.%SelfNestedBadReturnType -// CHECK:STDOUT: %.loc188_16.1 => constants.%.17 -// CHECK:STDOUT: %.loc188_37.1 => constants.%.18 +// CHECK:STDOUT: %.loc188_16.1 => constants.%.43 +// CHECK:STDOUT: %.loc188_37.1 => constants.%.44 // CHECK:STDOUT: %tuple.type => constants.%tuple.type.5 -// CHECK:STDOUT: %.loc188_52.1 => constants.%.19 +// CHECK:STDOUT: %.loc188_52.1 => constants.%.45 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon b/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon index bbdc37b1c828b..aeb915ed1b92e 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon @@ -415,6 +415,8 @@ impl f64 as type where .Self impls type {} // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -422,6 +424,8 @@ impl f64 as type where .Self impls type {} // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -429,6 +433,8 @@ impl f64 as type where .Self impls type {} // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -436,6 +442,8 @@ impl f64 as type where .Self impls type {} // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -451,6 +459,8 @@ impl f64 as type where .Self impls type {} // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -458,6 +468,8 @@ impl f64 as type where .Self impls type {} // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -465,6 +477,8 @@ impl f64 as type where .Self impls type {} // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -472,6 +486,8 @@ impl f64 as type where .Self impls type {} // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon b/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon index 6b8a575742415..48c61ddecee87 100644 --- a/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon +++ b/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon @@ -419,6 +419,8 @@ impl bool as I where .T = bool {} // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.10) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -426,6 +428,8 @@ impl bool as I where .T = bool {} // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.12) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -433,6 +437,8 @@ impl bool as I where .T = bool {} // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -440,6 +446,8 @@ impl bool as I where .T = bool {} // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -455,6 +463,8 @@ impl bool as I where .T = bool {} // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.10) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -462,6 +472,8 @@ impl bool as I where .T = bool {} // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.12) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -469,6 +481,8 @@ impl bool as I where .T = bool {} // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -476,6 +490,8 @@ impl bool as I where .T = bool {} // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/index/array_element_access.carbon b/toolchain/check/testdata/index/array_element_access.carbon index 70d7a774325a7..99c7808b31999 100644 --- a/toolchain/check/testdata/index/array_element_access.carbon +++ b/toolchain/check/testdata/index/array_element_access.carbon @@ -20,23 +20,151 @@ var d: i32 = a[b]; // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.1: i32 = int_value 2 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] -// CHECK:STDOUT: %.4: i32 = int_value 12 [template] -// CHECK:STDOUT: %.5: i32 = int_value 24 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.2: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.3: %.2 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.6: %.2 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.9: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.9)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.10: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.11: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.9)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.19: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.20: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.21: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.22: %.21 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.28: type = array_type %.27, i32 [template] +// CHECK:STDOUT: %.29: type = ptr_type %.28 [template] +// CHECK:STDOUT: %.30: i32 = int_value 12 [template] +// CHECK:STDOUT: %.31: i32 = int_value 24 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (i32, i32) [template] -// CHECK:STDOUT: %.6: i32 = int_value 0 [template] -// CHECK:STDOUT: %.7: i32 = int_value 1 [template] -// CHECK:STDOUT: %array: %.2 = tuple_value (%.4, %.5) [template] +// CHECK:STDOUT: %.32: i32 = int_value 0 [template] +// CHECK:STDOUT: %.33: i32 = int_value 1 [template] +// CHECK:STDOUT: %array: %.28 = tuple_value (%.30, %.31) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.2) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.6)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.25] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -49,12 +177,17 @@ var d: i32 = a[b]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_14: i32 = int_value 2 [template = constants.%.1] +// CHECK:STDOUT: %.loc11_14.1: i32 = int_value 2 [template = constants.%.1] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] // CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32.loc11, %.loc11_9.1 [template = i32] -// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, i32 [template = constants.%.2] -// CHECK:STDOUT: %a.var: ref %.2 = var a -// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var +// CHECK:STDOUT: %.loc11_14.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc11_14.3: = bound_method %.loc11_14.1, %.loc11_14.2 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc11_14.3(%.loc11_14.1) [template = constants.%.27] +// CHECK:STDOUT: %.loc11_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.27] +// CHECK:STDOUT: %.loc11_14.5: Core.IntLiteral = converted %.loc11_14.1, %.loc11_14.4 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14.5, i32 [template = constants.%.28] +// CHECK:STDOUT: %a.var: ref %.28 = var a +// CHECK:STDOUT: %a: ref %.28 = bind_name a, %a.var // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] // CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_32.loc12, %.loc12_8.1 [template = i32] @@ -72,30 +205,312 @@ var d: i32 = a[b]; // CHECK:STDOUT: %d: ref i32 = bind_name d, %d.var // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.2) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %.2: @As.%.1 (%.15) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.20)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.23)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_20: i32 = int_value 12 [template = constants.%.4] -// CHECK:STDOUT: %.loc11_24: i32 = int_value 24 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_20: i32 = int_value 12 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_24: i32 = int_value 24 [template = constants.%.31] // CHECK:STDOUT: %.loc11_26.1: %tuple.type = tuple_literal (%.loc11_20, %.loc11_24) -// CHECK:STDOUT: %.loc11_26.2: i32 = int_value 0 [template = constants.%.6] +// CHECK:STDOUT: %.loc11_26.2: i32 = int_value 0 [template = constants.%.32] // CHECK:STDOUT: %.loc11_26.3: ref i32 = array_index file.%a.var, %.loc11_26.2 -// CHECK:STDOUT: %.loc11_26.4: init i32 = initialize_from %.loc11_20 to %.loc11_26.3 [template = constants.%.4] -// CHECK:STDOUT: %.loc11_26.5: i32 = int_value 1 [template = constants.%.7] +// CHECK:STDOUT: %.loc11_26.4: init i32 = initialize_from %.loc11_20 to %.loc11_26.3 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_26.5: i32 = int_value 1 [template = constants.%.33] // CHECK:STDOUT: %.loc11_26.6: ref i32 = array_index file.%a.var, %.loc11_26.5 -// CHECK:STDOUT: %.loc11_26.7: init i32 = initialize_from %.loc11_24 to %.loc11_26.6 [template = constants.%.5] -// CHECK:STDOUT: %.loc11_26.8: init %.2 = array_init (%.loc11_26.4, %.loc11_26.7) to file.%a.var [template = constants.%array] -// CHECK:STDOUT: %.loc11_27: init %.2 = converted %.loc11_26.1, %.loc11_26.8 [template = constants.%array] +// CHECK:STDOUT: %.loc11_26.7: init i32 = initialize_from %.loc11_24 to %.loc11_26.6 [template = constants.%.31] +// CHECK:STDOUT: %.loc11_26.8: init %.28 = array_init (%.loc11_26.4, %.loc11_26.7) to file.%a.var [template = constants.%array] +// CHECK:STDOUT: %.loc11_27: init %.28 = converted %.loc11_26.1, %.loc11_26.8 [template = constants.%array] // CHECK:STDOUT: assign file.%a.var, %.loc11_27 -// CHECK:STDOUT: %.loc12: i32 = int_value 1 [template = constants.%.7] +// CHECK:STDOUT: %.loc12: i32 = int_value 1 [template = constants.%.33] // CHECK:STDOUT: assign file.%b.var, %.loc12 -// CHECK:STDOUT: %a.ref.loc13: ref %.2 = name_ref a, file.%a -// CHECK:STDOUT: %.loc13_16: i32 = int_value 0 [template = constants.%.6] +// CHECK:STDOUT: %a.ref.loc13: ref %.28 = name_ref a, file.%a +// CHECK:STDOUT: %.loc13_16: i32 = int_value 0 [template = constants.%.32] // CHECK:STDOUT: %.loc13_17.1: ref i32 = array_index %a.ref.loc13, %.loc13_16 // CHECK:STDOUT: %.loc13_17.2: i32 = bind_value %.loc13_17.1 // CHECK:STDOUT: assign file.%c.var, %.loc13_17.2 -// CHECK:STDOUT: %a.ref.loc14: ref %.2 = name_ref a, file.%a +// CHECK:STDOUT: %a.ref.loc14: ref %.28 = name_ref a, file.%a // CHECK:STDOUT: %b.ref: ref i32 = name_ref b, file.%b // CHECK:STDOUT: %.loc14_16: i32 = bind_value %b.ref // CHECK:STDOUT: %.loc14_17.1: ref i32 = array_index %a.ref.loc14, %.loc14_16 @@ -104,3 +519,281 @@ var d: i32 = a[b]; // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.2 => constants.%.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %.2 => constants.%.18 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.21 +// CHECK:STDOUT: %.2 => constants.%.22 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/index/expr_category.carbon b/toolchain/check/testdata/index/expr_category.carbon index 8871ca8eaef58..8f21243075549 100644 --- a/toolchain/check/testdata/index/expr_category.carbon +++ b/toolchain/check/testdata/index/expr_category.carbon @@ -35,30 +35,158 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.1: i32 = int_value 3 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.2: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.3: %.2 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.6: %.2 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.9: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.9)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.10: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.11: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.9)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.19: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.20: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.21: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.22: %.21 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.28: type = array_type %.27, i32 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] -// CHECK:STDOUT: %.4: i32 = int_value 1 [template] -// CHECK:STDOUT: %.5: i32 = int_value 2 [template] +// CHECK:STDOUT: %.29: type = ptr_type %.28 [template] +// CHECK:STDOUT: %.30: i32 = int_value 1 [template] +// CHECK:STDOUT: %.31: i32 = int_value 2 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (i32, i32, i32) [template] -// CHECK:STDOUT: %.6: i32 = int_value 0 [template] -// CHECK:STDOUT: %array: %.2 = tuple_value (%.4, %.5, %.1) [template] -// CHECK:STDOUT: %.7: type = ptr_type i32 [template] -// CHECK:STDOUT: %.8: i32 = int_value 4 [template] +// CHECK:STDOUT: %.32: i32 = int_value 0 [template] +// CHECK:STDOUT: %array: %.28 = tuple_value (%.30, %.31, %.1) [template] +// CHECK:STDOUT: %.33: type = ptr_type i32 [template] +// CHECK:STDOUT: %.34: i32 = int_value 4 [template] // CHECK:STDOUT: %ValueBinding.type: type = fn_type @ValueBinding [template] // CHECK:STDOUT: %ValueBinding: %ValueBinding.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.2) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.6)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.25] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -70,131 +198,716 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %return.patt: %.2 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.2 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %.28 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.28 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_17: i32 = int_value 3 [template = constants.%.1] +// CHECK:STDOUT: %.loc11_17.1: i32 = int_value 3 [template = constants.%.1] // CHECK:STDOUT: %.loc11_12.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_12.2: type = converted %int.make_type_32, %.loc11_12.1 [template = i32] -// CHECK:STDOUT: %.loc11_18: type = array_type %.loc11_17, i32 [template = constants.%.2] -// CHECK:STDOUT: %return.param: ref %.2 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref %.2 = return_slot %return.param +// CHECK:STDOUT: %.loc11_17.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc11_17.3: = bound_method %.loc11_17.1, %.loc11_17.2 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc11_17.3(%.loc11_17.1) [template = constants.%.27] +// CHECK:STDOUT: %.loc11_17.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.27] +// CHECK:STDOUT: %.loc11_17.5: Core.IntLiteral = converted %.loc11_17.1, %.loc11_17.4 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_18: type = array_type %.loc11_17.5, i32 [template = constants.%.28] +// CHECK:STDOUT: %return.param: ref %.28 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %.28 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %b.patt: %.2 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %.2 = value_param_pattern %b.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %.28 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %.28 = value_param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_15: i32 = int_value 3 [template = constants.%.1] +// CHECK:STDOUT: %.loc13_15.1: i32 = int_value 3 [template = constants.%.1] // CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] // CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_32.loc13, %.loc13_10.1 [template = i32] -// CHECK:STDOUT: %.loc13_16: type = array_type %.loc13_15, i32 [template = constants.%.2] -// CHECK:STDOUT: %b.param: %.2 = value_param runtime_param0 -// CHECK:STDOUT: %b: %.2 = bind_name b, %b.param +// CHECK:STDOUT: %.loc13_15.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc13_15.3: = bound_method %.loc13_15.1, %.loc13_15.2 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc13: init Core.IntLiteral = call %.loc13_15.3(%.loc13_15.1) [template = constants.%.27] +// CHECK:STDOUT: %.loc13_15.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc13 [template = constants.%.27] +// CHECK:STDOUT: %.loc13_15.5: Core.IntLiteral = converted %.loc13_15.1, %.loc13_15.4 [template = constants.%.27] +// CHECK:STDOUT: %.loc13_16: type = array_type %.loc13_15.5, i32 [template = constants.%.28] +// CHECK:STDOUT: %b.param: %.28 = value_param runtime_param0 +// CHECK:STDOUT: %b: %.28 = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: %ValueBinding.decl: %ValueBinding.type = fn_decl @ValueBinding [template = constants.%ValueBinding] { -// CHECK:STDOUT: %b.patt: %.2 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %.2 = value_param_pattern %b.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %.28 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %.28 = value_param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc21: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_26: i32 = int_value 3 [template = constants.%.1] +// CHECK:STDOUT: %.loc21_26.1: i32 = int_value 3 [template = constants.%.1] // CHECK:STDOUT: %.loc21_21.1: type = value_of_initializer %int.make_type_32.loc21 [template = i32] // CHECK:STDOUT: %.loc21_21.2: type = converted %int.make_type_32.loc21, %.loc21_21.1 [template = i32] -// CHECK:STDOUT: %.loc21_27: type = array_type %.loc21_26, i32 [template = constants.%.2] -// CHECK:STDOUT: %b.param: %.2 = value_param runtime_param0 -// CHECK:STDOUT: %b: %.2 = bind_name b, %b.param +// CHECK:STDOUT: %.loc21_26.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc21_26.3: = bound_method %.loc21_26.1, %.loc21_26.2 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc21: init Core.IntLiteral = call %.loc21_26.3(%.loc21_26.1) [template = constants.%.27] +// CHECK:STDOUT: %.loc21_26.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc21 [template = constants.%.27] +// CHECK:STDOUT: %.loc21_26.5: Core.IntLiteral = converted %.loc21_26.1, %.loc21_26.4 [template = constants.%.27] +// CHECK:STDOUT: %.loc21_27: type = array_type %.loc21_26.5, i32 [template = constants.%.28] +// CHECK:STDOUT: %b.param: %.28 = value_param runtime_param0 +// CHECK:STDOUT: %b: %.28 = bind_name b, %b.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.2) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %.2: @As.%.1 (%.15) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.20)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.23)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F() -> %.2; +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%b.param_patt: %.2) { +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @F() -> %.28; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @G(%b.param_patt: %.28) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_16: i32 = int_value 3 [template = constants.%.1] +// CHECK:STDOUT: %.loc14_16.1: i32 = int_value 3 [template = constants.%.1] // CHECK:STDOUT: %.loc14_11.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] // CHECK:STDOUT: %.loc14_11.2: type = converted %int.make_type_32.loc14, %.loc14_11.1 [template = i32] -// CHECK:STDOUT: %.loc14_17: type = array_type %.loc14_16, i32 [template = constants.%.2] -// CHECK:STDOUT: %a.var: ref %.2 = var a -// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var -// CHECK:STDOUT: %.loc14_22: i32 = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc14_25: i32 = int_value 2 [template = constants.%.5] +// CHECK:STDOUT: %.loc14_16.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc14_16.3: = bound_method %.loc14_16.1, %.loc14_16.2 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc14: init Core.IntLiteral = call %.loc14_16.3(%.loc14_16.1) [template = constants.%.27] +// CHECK:STDOUT: %.loc14_16.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc14 [template = constants.%.27] +// CHECK:STDOUT: %.loc14_16.5: Core.IntLiteral = converted %.loc14_16.1, %.loc14_16.4 [template = constants.%.27] +// CHECK:STDOUT: %.loc14_17: type = array_type %.loc14_16.5, i32 [template = constants.%.28] +// CHECK:STDOUT: %a.var: ref %.28 = var a +// CHECK:STDOUT: %a: ref %.28 = bind_name a, %a.var +// CHECK:STDOUT: %.loc14_22: i32 = int_value 1 [template = constants.%.30] +// CHECK:STDOUT: %.loc14_25: i32 = int_value 2 [template = constants.%.31] // CHECK:STDOUT: %.loc14_28: i32 = int_value 3 [template = constants.%.1] // CHECK:STDOUT: %.loc14_29.1: %tuple.type = tuple_literal (%.loc14_22, %.loc14_25, %.loc14_28) -// CHECK:STDOUT: %.loc14_29.2: i32 = int_value 0 [template = constants.%.6] +// CHECK:STDOUT: %.loc14_29.2: i32 = int_value 0 [template = constants.%.32] // CHECK:STDOUT: %.loc14_29.3: ref i32 = array_index %a.var, %.loc14_29.2 -// CHECK:STDOUT: %.loc14_29.4: init i32 = initialize_from %.loc14_22 to %.loc14_29.3 [template = constants.%.4] -// CHECK:STDOUT: %.loc14_29.5: i32 = int_value 1 [template = constants.%.4] +// CHECK:STDOUT: %.loc14_29.4: init i32 = initialize_from %.loc14_22 to %.loc14_29.3 [template = constants.%.30] +// CHECK:STDOUT: %.loc14_29.5: i32 = int_value 1 [template = constants.%.30] // CHECK:STDOUT: %.loc14_29.6: ref i32 = array_index %a.var, %.loc14_29.5 -// CHECK:STDOUT: %.loc14_29.7: init i32 = initialize_from %.loc14_25 to %.loc14_29.6 [template = constants.%.5] -// CHECK:STDOUT: %.loc14_29.8: i32 = int_value 2 [template = constants.%.5] +// CHECK:STDOUT: %.loc14_29.7: init i32 = initialize_from %.loc14_25 to %.loc14_29.6 [template = constants.%.31] +// CHECK:STDOUT: %.loc14_29.8: i32 = int_value 2 [template = constants.%.31] // CHECK:STDOUT: %.loc14_29.9: ref i32 = array_index %a.var, %.loc14_29.8 // CHECK:STDOUT: %.loc14_29.10: init i32 = initialize_from %.loc14_28 to %.loc14_29.9 [template = constants.%.1] -// CHECK:STDOUT: %.loc14_29.11: init %.2 = array_init (%.loc14_29.4, %.loc14_29.7, %.loc14_29.10) to %a.var [template = constants.%array] -// CHECK:STDOUT: %.loc14_30: init %.2 = converted %.loc14_29.1, %.loc14_29.11 [template = constants.%array] +// CHECK:STDOUT: %.loc14_29.11: init %.28 = array_init (%.loc14_29.4, %.loc14_29.7, %.loc14_29.10) to %a.var [template = constants.%array] +// CHECK:STDOUT: %.loc14_30: init %.28 = converted %.loc14_29.1, %.loc14_29.11 [template = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc14_30 // CHECK:STDOUT: %int.make_type_32.loc17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc17_14.1: type = value_of_initializer %int.make_type_32.loc17 [template = i32] // CHECK:STDOUT: %.loc17_14.2: type = converted %int.make_type_32.loc17, %.loc17_14.1 [template = i32] -// CHECK:STDOUT: %.loc17_14.3: type = ptr_type i32 [template = constants.%.7] -// CHECK:STDOUT: %pa.var: ref %.7 = var pa -// CHECK:STDOUT: %pa: ref %.7 = bind_name pa, %pa.var -// CHECK:STDOUT: %a.ref.loc17: ref %.2 = name_ref a, %a -// CHECK:STDOUT: %.loc17_21: i32 = int_value 0 [template = constants.%.6] +// CHECK:STDOUT: %.loc17_14.3: type = ptr_type i32 [template = constants.%.33] +// CHECK:STDOUT: %pa.var: ref %.33 = var pa +// CHECK:STDOUT: %pa: ref %.33 = bind_name pa, %pa.var +// CHECK:STDOUT: %a.ref.loc17: ref %.28 = name_ref a, %a +// CHECK:STDOUT: %.loc17_21: i32 = int_value 0 [template = constants.%.32] // CHECK:STDOUT: %.loc17_22: ref i32 = array_index %a.ref.loc17, %.loc17_21 -// CHECK:STDOUT: %.loc17_18: %.7 = addr_of %.loc17_22 +// CHECK:STDOUT: %.loc17_18: %.33 = addr_of %.loc17_22 // CHECK:STDOUT: assign %pa.var, %.loc17_18 -// CHECK:STDOUT: %a.ref.loc18: ref %.2 = name_ref a, %a -// CHECK:STDOUT: %.loc18_5: i32 = int_value 0 [template = constants.%.6] +// CHECK:STDOUT: %a.ref.loc18: ref %.28 = name_ref a, %a +// CHECK:STDOUT: %.loc18_5: i32 = int_value 0 [template = constants.%.32] // CHECK:STDOUT: %.loc18_6: ref i32 = array_index %a.ref.loc18, %.loc18_5 -// CHECK:STDOUT: %.loc18_10: i32 = int_value 4 [template = constants.%.8] +// CHECK:STDOUT: %.loc18_10: i32 = int_value 4 [template = constants.%.34] // CHECK:STDOUT: assign %.loc18_6, %.loc18_10 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @ValueBinding(%b.param_patt: %.2) { +// CHECK:STDOUT: fn @ValueBinding(%b.param_patt: %.28) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int.make_type_32.loc22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc22_16: i32 = int_value 3 [template = constants.%.1] +// CHECK:STDOUT: %.loc22_16.1: i32 = int_value 3 [template = constants.%.1] // CHECK:STDOUT: %.loc22_11.1: type = value_of_initializer %int.make_type_32.loc22 [template = i32] // CHECK:STDOUT: %.loc22_11.2: type = converted %int.make_type_32.loc22, %.loc22_11.1 [template = i32] -// CHECK:STDOUT: %.loc22_17: type = array_type %.loc22_16, i32 [template = constants.%.2] -// CHECK:STDOUT: %a.var: ref %.2 = var a -// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var -// CHECK:STDOUT: %.loc22_22: i32 = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc22_25: i32 = int_value 2 [template = constants.%.5] +// CHECK:STDOUT: %.loc22_16.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc22_16.3: = bound_method %.loc22_16.1, %.loc22_16.2 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc22: init Core.IntLiteral = call %.loc22_16.3(%.loc22_16.1) [template = constants.%.27] +// CHECK:STDOUT: %.loc22_16.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc22 [template = constants.%.27] +// CHECK:STDOUT: %.loc22_16.5: Core.IntLiteral = converted %.loc22_16.1, %.loc22_16.4 [template = constants.%.27] +// CHECK:STDOUT: %.loc22_17: type = array_type %.loc22_16.5, i32 [template = constants.%.28] +// CHECK:STDOUT: %a.var: ref %.28 = var a +// CHECK:STDOUT: %a: ref %.28 = bind_name a, %a.var +// CHECK:STDOUT: %.loc22_22: i32 = int_value 1 [template = constants.%.30] +// CHECK:STDOUT: %.loc22_25: i32 = int_value 2 [template = constants.%.31] // CHECK:STDOUT: %.loc22_28: i32 = int_value 3 [template = constants.%.1] // CHECK:STDOUT: %.loc22_29.1: %tuple.type = tuple_literal (%.loc22_22, %.loc22_25, %.loc22_28) -// CHECK:STDOUT: %.loc22_29.2: i32 = int_value 0 [template = constants.%.6] +// CHECK:STDOUT: %.loc22_29.2: i32 = int_value 0 [template = constants.%.32] // CHECK:STDOUT: %.loc22_29.3: ref i32 = array_index %a.var, %.loc22_29.2 -// CHECK:STDOUT: %.loc22_29.4: init i32 = initialize_from %.loc22_22 to %.loc22_29.3 [template = constants.%.4] -// CHECK:STDOUT: %.loc22_29.5: i32 = int_value 1 [template = constants.%.4] +// CHECK:STDOUT: %.loc22_29.4: init i32 = initialize_from %.loc22_22 to %.loc22_29.3 [template = constants.%.30] +// CHECK:STDOUT: %.loc22_29.5: i32 = int_value 1 [template = constants.%.30] // CHECK:STDOUT: %.loc22_29.6: ref i32 = array_index %a.var, %.loc22_29.5 -// CHECK:STDOUT: %.loc22_29.7: init i32 = initialize_from %.loc22_25 to %.loc22_29.6 [template = constants.%.5] -// CHECK:STDOUT: %.loc22_29.8: i32 = int_value 2 [template = constants.%.5] +// CHECK:STDOUT: %.loc22_29.7: init i32 = initialize_from %.loc22_25 to %.loc22_29.6 [template = constants.%.31] +// CHECK:STDOUT: %.loc22_29.8: i32 = int_value 2 [template = constants.%.31] // CHECK:STDOUT: %.loc22_29.9: ref i32 = array_index %a.var, %.loc22_29.8 // CHECK:STDOUT: %.loc22_29.10: init i32 = initialize_from %.loc22_28 to %.loc22_29.9 [template = constants.%.1] -// CHECK:STDOUT: %.loc22_29.11: init %.2 = array_init (%.loc22_29.4, %.loc22_29.7, %.loc22_29.10) to %a.var [template = constants.%array] -// CHECK:STDOUT: %.loc22_30: init %.2 = converted %.loc22_29.1, %.loc22_29.11 [template = constants.%array] +// CHECK:STDOUT: %.loc22_29.11: init %.28 = array_init (%.loc22_29.4, %.loc22_29.7, %.loc22_29.10) to %a.var [template = constants.%array] +// CHECK:STDOUT: %.loc22_30: init %.28 = converted %.loc22_29.1, %.loc22_29.11 [template = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc22_30 -// CHECK:STDOUT: %a.ref: ref %.2 = name_ref a, %a -// CHECK:STDOUT: %.loc26_5: i32 = int_value 0 [template = constants.%.6] +// CHECK:STDOUT: %a.ref: ref %.28 = name_ref a, %a +// CHECK:STDOUT: %.loc26_5: i32 = int_value 0 [template = constants.%.32] // CHECK:STDOUT: %.loc26_6: ref i32 = array_index %a.ref, %.loc26_5 -// CHECK:STDOUT: %b.ref: %.2 = name_ref b, %b -// CHECK:STDOUT: %.loc27_5: i32 = int_value 0 [template = constants.%.6] -// CHECK:STDOUT: %.loc27_6.1: ref %.2 = value_as_ref %b.ref +// CHECK:STDOUT: %b.ref: %.28 = name_ref b, %b +// CHECK:STDOUT: %.loc27_5: i32 = int_value 0 [template = constants.%.32] +// CHECK:STDOUT: %.loc27_6.1: ref %.28 = value_as_ref %b.ref // CHECK:STDOUT: %.loc27_6.2: ref i32 = array_index %.loc27_6.1, %.loc27_5 // CHECK:STDOUT: %.loc27_6.3: i32 = bind_value %.loc27_6.2 // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] -// CHECK:STDOUT: %.loc28_4.1: ref %.2 = temporary_storage -// CHECK:STDOUT: %F.call: init %.2 = call %F.ref() to %.loc28_4.1 -// CHECK:STDOUT: %.loc28_7: i32 = int_value 0 [template = constants.%.6] -// CHECK:STDOUT: %.loc28_4.2: ref %.2 = temporary %.loc28_4.1, %F.call +// CHECK:STDOUT: %.loc28_4.1: ref %.28 = temporary_storage +// CHECK:STDOUT: %F.call: init %.28 = call %F.ref() to %.loc28_4.1 +// CHECK:STDOUT: %.loc28_7: i32 = int_value 0 [template = constants.%.32] +// CHECK:STDOUT: %.loc28_4.2: ref %.28 = temporary %.loc28_4.1, %F.call // CHECK:STDOUT: %.loc28_8.1: ref i32 = array_index %.loc28_4.2, %.loc28_7 // CHECK:STDOUT: %.loc28_8.2: i32 = bind_value %.loc28_8.1 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.2 => constants.%.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %.2 => constants.%.18 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.21 +// CHECK:STDOUT: %.2 => constants.%.22 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/index/fail_array_large_index.carbon b/toolchain/check/testdata/index/fail_array_large_index.carbon index ebd9600672821..7c9e60659ee7d 100644 --- a/toolchain/check/testdata/index/fail_array_large_index.carbon +++ b/toolchain/check/testdata/index/fail_array_large_index.carbon @@ -28,22 +28,150 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.1: i32 = int_value 1 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] -// CHECK:STDOUT: %.4: i32 = int_value 12 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.2: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.3: %.2 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.6: %.2 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.9: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.9)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.10: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.11: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.9)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.19: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.20: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.21: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.22: %.21 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.28: type = array_type %.27, i32 [template] +// CHECK:STDOUT: %.29: type = ptr_type %.28 [template] +// CHECK:STDOUT: %.30: i32 = int_value 12 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (i32) [template] -// CHECK:STDOUT: %.5: i32 = int_value 0 [template] -// CHECK:STDOUT: %array: %.2 = tuple_value (%.4) [template] -// CHECK:STDOUT: %.6: i32 = int_value 2147483647 [template] +// CHECK:STDOUT: %.31: i32 = int_value 0 [template] +// CHECK:STDOUT: %array: %.28 = tuple_value (%.30) [template] +// CHECK:STDOUT: %.32: i32 = int_value 2147483647 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.2) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.6)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.25] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -55,12 +183,17 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_14: i32 = int_value 1 [template = constants.%.1] +// CHECK:STDOUT: %.loc11_14.1: i32 = int_value 1 [template = constants.%.1] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] // CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32.loc11, %.loc11_9.1 [template = i32] -// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, i32 [template = constants.%.2] -// CHECK:STDOUT: %a.var: ref %.2 = var a -// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var +// CHECK:STDOUT: %.loc11_14.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc11_14.3: = bound_method %.loc11_14.1, %.loc11_14.2 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc11_14.3(%.loc11_14.1) [template = constants.%.27] +// CHECK:STDOUT: %.loc11_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.27] +// CHECK:STDOUT: %.loc11_14.5: Core.IntLiteral = converted %.loc11_14.1, %.loc11_14.4 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14.5, i32 [template = constants.%.28] +// CHECK:STDOUT: %a.var: ref %.28 = var a +// CHECK:STDOUT: %a: ref %.28 = bind_name a, %a.var // CHECK:STDOUT: %int.make_type_32.loc17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc17_8.1: type = value_of_initializer %int.make_type_32.loc17 [template = i32] // CHECK:STDOUT: %.loc17_8.2: type = converted %int.make_type_32.loc17, %.loc17_8.1 [template = i32] @@ -73,28 +206,588 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: %c: ref i32 = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.2) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %.2: @As.%.1 (%.15) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.20)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.23)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_20: i32 = int_value 12 [template = constants.%.4] +// CHECK:STDOUT: %.loc11_20: i32 = int_value 12 [template = constants.%.30] // CHECK:STDOUT: %.loc11_23.1: %tuple.type = tuple_literal (%.loc11_20) -// CHECK:STDOUT: %.loc11_23.2: i32 = int_value 0 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_23.2: i32 = int_value 0 [template = constants.%.31] // CHECK:STDOUT: %.loc11_23.3: ref i32 = array_index file.%a.var, %.loc11_23.2 -// CHECK:STDOUT: %.loc11_23.4: init i32 = initialize_from %.loc11_20 to %.loc11_23.3 [template = constants.%.4] -// CHECK:STDOUT: %.loc11_23.5: init %.2 = array_init (%.loc11_23.4) to file.%a.var [template = constants.%array] -// CHECK:STDOUT: %.loc11_24: init %.2 = converted %.loc11_23.1, %.loc11_23.5 [template = constants.%array] +// CHECK:STDOUT: %.loc11_23.4: init i32 = initialize_from %.loc11_20 to %.loc11_23.3 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_23.5: init %.28 = array_init (%.loc11_23.4) to file.%a.var [template = constants.%array] +// CHECK:STDOUT: %.loc11_24: init %.28 = converted %.loc11_23.1, %.loc11_23.5 [template = constants.%array] // CHECK:STDOUT: assign file.%a.var, %.loc11_24 -// CHECK:STDOUT: %a.ref.loc17: ref %.2 = name_ref a, file.%a +// CHECK:STDOUT: %a.ref.loc17: ref %.28 = name_ref a, file.%a // CHECK:STDOUT: %.loc17_16: i32 = int_value 1 [template = constants.%.1] // CHECK:STDOUT: %.loc17_17.1: ref i32 = array_index %a.ref.loc17, %.loc17_16 [template = ] // CHECK:STDOUT: %.loc17_17.2: i32 = bind_value %.loc17_17.1 // CHECK:STDOUT: assign file.%b.var, %.loc17_17.2 -// CHECK:STDOUT: %a.ref.loc22: ref %.2 = name_ref a, file.%a -// CHECK:STDOUT: %.loc22_16: i32 = int_value 2147483647 [template = constants.%.6] +// CHECK:STDOUT: %a.ref.loc22: ref %.28 = name_ref a, file.%a +// CHECK:STDOUT: %.loc22_16: i32 = int_value 2147483647 [template = constants.%.32] // CHECK:STDOUT: %.loc22_27.1: ref i32 = array_index %a.ref.loc22, %.loc22_16 [template = ] // CHECK:STDOUT: %.loc22_27.2: i32 = bind_value %.loc22_27.1 // CHECK:STDOUT: assign file.%c.var, %.loc22_27.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.2 => constants.%.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %.2 => constants.%.18 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.21 +// CHECK:STDOUT: %.2 => constants.%.22 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: 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 ce8ea8e15619d..be624eb1ce011 100644 --- a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon +++ b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon @@ -24,13 +24,6 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.1: i32 = int_value 1 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] -// CHECK:STDOUT: %.4: i32 = int_value 12 [template] -// CHECK:STDOUT: %tuple.type: type = tuple_type (i32) [template] -// CHECK:STDOUT: %.5: i32 = int_value 0 [template] -// CHECK:STDOUT: %array: %.2 = tuple_value (%.4) [template] -// CHECK:STDOUT: %.6: f64 = float_literal 2.6000000000000001 [template] // CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] // CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] @@ -40,37 +33,37 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.7: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] -// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.6 [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %.2: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.3: %.2 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] -// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.6 [template] -// CHECK:STDOUT: %.11: %.7 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.6: %.2 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.11 [template] // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %.12: type = int_type signed, %N [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(%.12)> [symbolic] +// CHECK:STDOUT: %.9: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.9)> [symbolic] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] -// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.2, @impl.2(%N) [symbolic] -// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [symbolic] -// CHECK:STDOUT: %.13: = interface_witness (%Convert.3) [symbolic] -// CHECK:STDOUT: %.14: type = int_type unsigned, %N [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.14)> [symbolic] -// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] // CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] -// CHECK:STDOUT: %.15: = interface_witness (%Convert.4) [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [template] -// CHECK:STDOUT: %.16: type = assoc_entity_type %ImplicitAs.type.6, %Convert.type.5 [template] -// CHECK:STDOUT: %.17: %.16 = assoc_entity element0, imports.%import_ref.20 [template] +// CHECK:STDOUT: %.10: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.11: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.5) [symbolic] // CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] // CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] -// CHECK:STDOUT: %.18: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.6) [symbolic] // CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] // CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] -// CHECK:STDOUT: %.19: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.7) [symbolic] // CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] // CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] // CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] @@ -79,31 +72,43 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] // CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] -// CHECK:STDOUT: %.20: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] -// CHECK:STDOUT: %.21: %.20 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %.15: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.33 [symbolic] // CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] // CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] -// CHECK:STDOUT: %.22: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] -// CHECK:STDOUT: %.23: %.22 = assoc_entity element0, imports.%import_ref.34 [template] -// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.12)> [symbolic] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.9)> [symbolic] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] -// CHECK:STDOUT: %.24: = interface_witness (%Convert.10) [symbolic] -// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.14)> [symbolic] +// CHECK:STDOUT: %.19: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.11)> [symbolic] // CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] // CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %.20: = interface_witness (%Convert.11) [symbolic] // CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] // CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] -// CHECK:STDOUT: %.26: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] -// CHECK:STDOUT: %.27: %.26 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %.21: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.22: %.21 = assoc_entity element0, imports.%import_ref.44 [template] // CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] // CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] -// CHECK:STDOUT: %.28: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.13) [symbolic] // CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] // CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] -// CHECK:STDOUT: %.29: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.28: type = array_type %.27, i32 [template] +// CHECK:STDOUT: %.29: type = ptr_type %.28 [template] +// CHECK:STDOUT: %.30: i32 = int_value 12 [template] +// CHECK:STDOUT: %tuple.type: type = tuple_type (i32) [template] +// CHECK:STDOUT: %.31: i32 = int_value 0 [template] +// CHECK:STDOUT: %array: %.28 = tuple_value (%.30) [template] +// CHECK:STDOUT: %.32: f64 = float_literal 2.6000000000000001 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -116,28 +121,28 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] // CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] // CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.7) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.11)] +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.2) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.6)] // CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded // CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded // CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] // CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.4)] -// CHECK:STDOUT: %import_ref.13 = import_ref Core//prelude/operators/as, inst+196, unloaded -// CHECK:STDOUT: %import_ref.14: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.5)] -// CHECK:STDOUT: %import_ref.16 = import_ref Core//prelude/operators/as, inst+260, unloaded -// CHECK:STDOUT: %import_ref.17: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] -// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.19 = import_ref Core//prelude/operators/as, inst+296, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Core//prelude/operators/as, inst+76, unloaded -// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.12)] -// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.6] +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.25] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] // CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded -// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.14)] -// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.6] +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] // CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded // CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded // CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded @@ -157,10 +162,10 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] // CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded // CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded -// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.12)] +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.9)] // CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] // CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded -// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.14)] +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.11)] // CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] // CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } @@ -173,12 +178,17 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_14: i32 = int_value 1 [template = constants.%.1] +// CHECK:STDOUT: %.loc11_14.1: i32 = int_value 1 [template = constants.%.1] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] // CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32.loc11, %.loc11_9.1 [template = i32] -// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, i32 [template = constants.%.2] -// CHECK:STDOUT: %a.var: ref %.2 = var a -// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var +// CHECK:STDOUT: %.loc11_14.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc11_14.3: = bound_method %.loc11_14.1, %.loc11_14.2 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc11_14.3(%.loc11_14.1) [template = constants.%.27] +// CHECK:STDOUT: %.loc11_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.27] +// CHECK:STDOUT: %.loc11_14.5: Core.IntLiteral = converted %.loc11_14.1, %.loc11_14.4 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14.5, i32 [template = constants.%.28] +// CHECK:STDOUT: %a.var: ref %.28 = var a +// CHECK:STDOUT: %a: ref %.28 = bind_name a, %a.var // CHECK:STDOUT: %int.make_type_32.loc18: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_8.1: type = value_of_initializer %int.make_type_32.loc18 [template = i32] // CHECK:STDOUT: %.loc18_8.2: type = converted %int.make_type_32.loc18, %.loc18_8.1 [template = i32] @@ -195,8 +205,8 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] -// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.7) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.2) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.3)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: @@ -215,8 +225,8 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] // CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] -// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.20)] -// CHECK:STDOUT: %.2: @As.%.1 (%.20) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.21)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %.2: @As.%.1 (%.15) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.16)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: @@ -234,51 +244,51 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.4)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.3)] -// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.3) = struct_value () [symbolic = %Convert (constants.%Convert.3)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.10)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.11 as imports.%import_ref.12 { +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.13 +// CHECK:STDOUT: witness = imports.%import_ref.14 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] -// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.15)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.14 as imports.%import_ref.15 { +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.16 +// CHECK:STDOUT: witness = imports.%import_ref.17 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.4: imports.%import_ref.17 as imports.%import_ref.18 { +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.19 +// CHECK:STDOUT: witness = imports.%import_ref.20 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] // CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.18)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] // CHECK:STDOUT: // CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { // CHECK:STDOUT: !members: @@ -289,12 +299,12 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] // CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.19)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] // CHECK:STDOUT: // CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { // CHECK:STDOUT: !members: @@ -310,13 +320,13 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] // CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.19)] // CHECK:STDOUT: // CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { // CHECK:STDOUT: !members: @@ -327,13 +337,13 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] // CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.25)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.20)] // CHECK:STDOUT: // CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { // CHECK:STDOUT: !members: @@ -349,12 +359,12 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] // CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.28)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.23)] // CHECK:STDOUT: // CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { // CHECK:STDOUT: !members: @@ -365,12 +375,12 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] // CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.29)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.24)] // CHECK:STDOUT: // CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { // CHECK:STDOUT: !members: @@ -390,30 +400,38 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.12) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.14) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.14)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { @@ -426,44 +444,54 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.12) = "int.convert_checked"; +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.14) = "int.convert_checked"; +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.12)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.14)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_20: i32 = int_value 12 [template = constants.%.4] +// CHECK:STDOUT: %.loc11_20: i32 = int_value 12 [template = constants.%.30] // CHECK:STDOUT: %.loc11_23.1: %tuple.type = tuple_literal (%.loc11_20) -// CHECK:STDOUT: %.loc11_23.2: i32 = int_value 0 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_23.2: i32 = int_value 0 [template = constants.%.31] // CHECK:STDOUT: %.loc11_23.3: ref i32 = array_index file.%a.var, %.loc11_23.2 -// CHECK:STDOUT: %.loc11_23.4: init i32 = initialize_from %.loc11_20 to %.loc11_23.3 [template = constants.%.4] -// CHECK:STDOUT: %.loc11_23.5: init %.2 = array_init (%.loc11_23.4) to file.%a.var [template = constants.%array] -// CHECK:STDOUT: %.loc11_24: init %.2 = converted %.loc11_23.1, %.loc11_23.5 [template = constants.%array] +// CHECK:STDOUT: %.loc11_23.4: init i32 = initialize_from %.loc11_20 to %.loc11_23.3 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_23.5: init %.28 = array_init (%.loc11_23.4) to file.%a.var [template = constants.%array] +// CHECK:STDOUT: %.loc11_24: init %.28 = converted %.loc11_23.1, %.loc11_23.5 [template = constants.%array] // CHECK:STDOUT: assign file.%a.var, %.loc11_24 -// CHECK:STDOUT: %a.ref: ref %.2 = name_ref a, file.%a -// CHECK:STDOUT: %.loc18_16.1: f64 = float_literal 2.6000000000000001 [template = constants.%.6] +// CHECK:STDOUT: %a.ref: ref %.28 = name_ref a, file.%a +// CHECK:STDOUT: %.loc18_16.1: f64 = float_literal 2.6000000000000001 [template = constants.%.32] // CHECK:STDOUT: %.loc18_16.2: i32 = converted %.loc18_16.1, [template = ] // CHECK:STDOUT: %.loc18_19.1: ref i32 = array_index %a.ref, [template = ] // CHECK:STDOUT: %.loc18_19.2: i32 = bind_value %.loc18_19.1 @@ -492,122 +520,122 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(i32) { -// CHECK:STDOUT: %Dest => i32 -// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 // CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.1 => constants.%.9 -// CHECK:STDOUT: %.2 => constants.%.10 +// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.2 => constants.%.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%.12) { -// CHECK:STDOUT: %Dest => constants.%.12 -// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: specific @ImplicitAs(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { -// CHECK:STDOUT: %Dest => constants.%.12 -// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.12 -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(@impl.2.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.12 -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.2(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %.1 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%.14) { -// CHECK:STDOUT: %Dest => constants.%.14 -// CHECK:STDOUT: %Dest.patt => constants.%.14 +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { -// CHECK:STDOUT: %Dest => constants.%.14 -// CHECK:STDOUT: %Dest.patt => constants.%.14 +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.3(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.14 -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.3(@impl.3.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.14 -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.3(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.14 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { -// CHECK:STDOUT: %Dest => Core.IntLiteral -// CHECK:STDOUT: %Dest.patt => Core.IntLiteral -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 -// CHECK:STDOUT: %Self => constants.%Self.2 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.5 -// CHECK:STDOUT: %Convert => constants.%Convert.5 -// CHECK:STDOUT: %.1 => constants.%.16 -// CHECK:STDOUT: %.2 => constants.%.17 +// CHECK:STDOUT: %.1 => constants.%.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.5(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %.1 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.5(@impl.5.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %.1 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.4(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %.1 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.6(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %.1 => constants.%.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.6(@impl.6.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %.1 => constants.%.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.5(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %.1 => constants.%.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(constants.%Dest) { @@ -624,8 +652,8 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: %Self => constants.%Self.4 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 // CHECK:STDOUT: %Convert => constants.%Convert.9 -// CHECK:STDOUT: %.1 => constants.%.22 -// CHECK:STDOUT: %.2 => constants.%.23 +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %.2 => constants.%.18 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(@As.%Dest) { @@ -644,62 +672,62 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: %Self => constants.%Self.3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(constants.%.12) { -// CHECK:STDOUT: %Dest => constants.%.12 -// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: specific @As(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(@impl.8.%.1) { -// CHECK:STDOUT: %Dest => constants.%.12 -// CHECK:STDOUT: %Dest.patt => constants.%.12 +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.8(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %.1 => constants.%.9 // CHECK:STDOUT: %As.type => constants.%As.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.8(@impl.8.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %.1 => constants.%.9 // CHECK:STDOUT: %As.type => constants.%As.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.7(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %.1 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(constants.%.14) { -// CHECK:STDOUT: %Dest => constants.%.14 -// CHECK:STDOUT: %Dest.patt => constants.%.14 +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(@impl.9.%.1) { -// CHECK:STDOUT: %Dest => constants.%.14 -// CHECK:STDOUT: %Dest.patt => constants.%.14 +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.9(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %.1 => constants.%.11 // CHECK:STDOUT: %As.type => constants.%As.type.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.9(@impl.9.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %.1 => constants.%.11 // CHECK:STDOUT: %As.type => constants.%As.type.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.8(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %.1 => constants.%.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(Core.IntLiteral) { @@ -711,41 +739,41 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: %Self => constants.%Self.4 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 // CHECK:STDOUT: %Convert => constants.%Convert.12 -// CHECK:STDOUT: %.1 => constants.%.26 -// CHECK:STDOUT: %.2 => constants.%.27 +// CHECK:STDOUT: %.1 => constants.%.21 +// CHECK:STDOUT: %.2 => constants.%.22 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.11(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %.1 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.11(@impl.11.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %.1 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.9(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %.1 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.12(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %.1 => constants.%.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.12(@impl.12.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %.1 => constants.%.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.10(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %.1 => constants.%.11 // CHECK:STDOUT: } // CHECK:STDOUT: 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 943f3517ab407..649b2fb207507 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 @@ -21,21 +21,149 @@ var b: i32 = a[1]; // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.1: i32 = int_value 1 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] -// CHECK:STDOUT: %.4: i32 = int_value 12 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.2: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.3: %.2 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.6: %.2 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.9: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.9)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.10: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.11: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.9)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.19: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.20: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.21: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.22: %.21 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.28: type = array_type %.27, i32 [template] +// CHECK:STDOUT: %.29: type = ptr_type %.28 [template] +// CHECK:STDOUT: %.30: i32 = int_value 12 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (i32) [template] -// CHECK:STDOUT: %.5: i32 = int_value 0 [template] -// CHECK:STDOUT: %array: %.2 = tuple_value (%.4) [template] +// CHECK:STDOUT: %.31: i32 = int_value 0 [template] +// CHECK:STDOUT: %array: %.28 = tuple_value (%.30) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.2) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.6)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.25] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -46,12 +174,17 @@ var b: i32 = a[1]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_14: i32 = int_value 1 [template = constants.%.1] +// CHECK:STDOUT: %.loc11_14.1: i32 = int_value 1 [template = constants.%.1] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] // CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32.loc11, %.loc11_9.1 [template = i32] -// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, i32 [template = constants.%.2] -// CHECK:STDOUT: %a.var: ref %.2 = var a -// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var +// CHECK:STDOUT: %.loc11_14.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc11_14.3: = bound_method %.loc11_14.1, %.loc11_14.2 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc11_14.3(%.loc11_14.1) [template = constants.%.27] +// CHECK:STDOUT: %.loc11_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.27] +// CHECK:STDOUT: %.loc11_14.5: Core.IntLiteral = converted %.loc11_14.1, %.loc11_14.4 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14.5, i32 [template = constants.%.28] +// CHECK:STDOUT: %a.var: ref %.28 = var a +// CHECK:STDOUT: %a: ref %.28 = bind_name a, %a.var // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] @@ -59,19 +192,301 @@ var b: i32 = a[1]; // CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.2) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %.2: @As.%.1 (%.15) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.20)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.23)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_20: i32 = int_value 12 [template = constants.%.4] +// CHECK:STDOUT: %.loc11_20: i32 = int_value 12 [template = constants.%.30] // CHECK:STDOUT: %.loc11_23.1: %tuple.type = tuple_literal (%.loc11_20) -// CHECK:STDOUT: %.loc11_23.2: i32 = int_value 0 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_23.2: i32 = int_value 0 [template = constants.%.31] // CHECK:STDOUT: %.loc11_23.3: ref i32 = array_index file.%a.var, %.loc11_23.2 -// CHECK:STDOUT: %.loc11_23.4: init i32 = initialize_from %.loc11_20 to %.loc11_23.3 [template = constants.%.4] -// CHECK:STDOUT: %.loc11_23.5: init %.2 = array_init (%.loc11_23.4) to file.%a.var [template = constants.%array] -// CHECK:STDOUT: %.loc11_24: init %.2 = converted %.loc11_23.1, %.loc11_23.5 [template = constants.%array] +// CHECK:STDOUT: %.loc11_23.4: init i32 = initialize_from %.loc11_20 to %.loc11_23.3 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_23.5: init %.28 = array_init (%.loc11_23.4) to file.%a.var [template = constants.%array] +// CHECK:STDOUT: %.loc11_24: init %.28 = converted %.loc11_23.1, %.loc11_23.5 [template = constants.%array] // CHECK:STDOUT: assign file.%a.var, %.loc11_24 -// CHECK:STDOUT: %a.ref: ref %.2 = name_ref a, file.%a +// CHECK:STDOUT: %a.ref: ref %.28 = name_ref a, file.%a // CHECK:STDOUT: %.loc15_16: i32 = int_value 1 [template = constants.%.1] // CHECK:STDOUT: %.loc15_17.1: ref i32 = array_index %a.ref, %.loc15_16 [template = ] // CHECK:STDOUT: %.loc15_17.2: i32 = bind_value %.loc15_17.1 @@ -79,3 +494,281 @@ var b: i32 = a[1]; // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.2 => constants.%.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %.2 => constants.%.18 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.21 +// CHECK:STDOUT: %.2 => constants.%.22 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/index/fail_expr_category.carbon b/toolchain/check/testdata/index/fail_expr_category.carbon index b3e14476d5327..3119f4521bae2 100644 --- a/toolchain/check/testdata/index/fail_expr_category.carbon +++ b/toolchain/check/testdata/index/fail_expr_category.carbon @@ -43,24 +43,152 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.1: i32 = int_value 3 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.2: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.3: %.2 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.6: %.2 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.9: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.9)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.10: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.11: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.9)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.19: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.20: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.21: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.22: %.21 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.28: type = array_type %.27, i32 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] -// CHECK:STDOUT: %.4: type = ptr_type i32 [template] -// CHECK:STDOUT: %.5: i32 = int_value 0 [template] -// CHECK:STDOUT: %.6: i32 = int_value 4 [template] +// CHECK:STDOUT: %.29: type = ptr_type %.28 [template] +// CHECK:STDOUT: %.30: type = ptr_type i32 [template] +// CHECK:STDOUT: %.31: i32 = int_value 0 [template] +// CHECK:STDOUT: %.32: i32 = int_value 4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.2) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.6)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.25] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -71,81 +199,651 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %return.patt: %.2 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.2 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %.28 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.28 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_17: i32 = int_value 3 [template = constants.%.1] +// CHECK:STDOUT: %.loc11_17.1: i32 = int_value 3 [template = constants.%.1] // CHECK:STDOUT: %.loc11_12.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_12.2: type = converted %int.make_type_32, %.loc11_12.1 [template = i32] -// CHECK:STDOUT: %.loc11_18: type = array_type %.loc11_17, i32 [template = constants.%.2] -// CHECK:STDOUT: %return.param: ref %.2 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref %.2 = return_slot %return.param +// CHECK:STDOUT: %.loc11_17.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc11_17.3: = bound_method %.loc11_17.1, %.loc11_17.2 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc11_17.3(%.loc11_17.1) [template = constants.%.27] +// CHECK:STDOUT: %.loc11_17.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.27] +// CHECK:STDOUT: %.loc11_17.5: Core.IntLiteral = converted %.loc11_17.1, %.loc11_17.4 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_18: type = array_type %.loc11_17.5, i32 [template = constants.%.28] +// CHECK:STDOUT: %return.param: ref %.28 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %.28 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %b.patt: %.2 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %.2 = value_param_pattern %b.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %.28 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %.28 = value_param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_15: i32 = int_value 3 [template = constants.%.1] +// CHECK:STDOUT: %.loc13_15.1: i32 = int_value 3 [template = constants.%.1] // CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] // CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_32.loc13, %.loc13_10.1 [template = i32] -// CHECK:STDOUT: %.loc13_16: type = array_type %.loc13_15, i32 [template = constants.%.2] -// CHECK:STDOUT: %b.param: %.2 = value_param runtime_param0 -// CHECK:STDOUT: %b: %.2 = bind_name b, %b.param +// CHECK:STDOUT: %.loc13_15.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc13_15.3: = bound_method %.loc13_15.1, %.loc13_15.2 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc13_15.3(%.loc13_15.1) [template = constants.%.27] +// CHECK:STDOUT: %.loc13_15.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.27] +// CHECK:STDOUT: %.loc13_15.5: Core.IntLiteral = converted %.loc13_15.1, %.loc13_15.4 [template = constants.%.27] +// CHECK:STDOUT: %.loc13_16: type = array_type %.loc13_15.5, i32 [template = constants.%.28] +// CHECK:STDOUT: %b.param: %.28 = value_param runtime_param0 +// CHECK:STDOUT: %b: %.28 = bind_name b, %b.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.2) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %.2: @As.%.1 (%.15) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.20)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.23)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F() -> %.2; +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%b.param_patt: %.2) { +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @F() -> %.28; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @G(%b.param_patt: %.28) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int.make_type_32.loc19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_14.1: type = value_of_initializer %int.make_type_32.loc19 [template = i32] // CHECK:STDOUT: %.loc19_14.2: type = converted %int.make_type_32.loc19, %.loc19_14.1 [template = i32] -// CHECK:STDOUT: %.loc19_14.3: type = ptr_type i32 [template = constants.%.4] -// CHECK:STDOUT: %pb.var: ref %.4 = var pb -// CHECK:STDOUT: %pb: ref %.4 = bind_name pb, %pb.var -// CHECK:STDOUT: %b.ref.loc19: %.2 = name_ref b, %b -// CHECK:STDOUT: %.loc19_21: i32 = int_value 0 [template = constants.%.5] -// CHECK:STDOUT: %.loc19_22.1: ref %.2 = value_as_ref %b.ref.loc19 +// CHECK:STDOUT: %.loc19_14.3: type = ptr_type i32 [template = constants.%.30] +// CHECK:STDOUT: %pb.var: ref %.30 = var pb +// CHECK:STDOUT: %pb: ref %.30 = bind_name pb, %pb.var +// CHECK:STDOUT: %b.ref.loc19: %.28 = name_ref b, %b +// CHECK:STDOUT: %.loc19_21: i32 = int_value 0 [template = constants.%.31] +// CHECK:STDOUT: %.loc19_22.1: ref %.28 = value_as_ref %b.ref.loc19 // CHECK:STDOUT: %.loc19_22.2: ref i32 = array_index %.loc19_22.1, %.loc19_21 // CHECK:STDOUT: %.loc19_22.3: i32 = bind_value %.loc19_22.2 -// CHECK:STDOUT: %.loc19_18: %.4 = addr_of [template = ] +// CHECK:STDOUT: %.loc19_18: %.30 = addr_of [template = ] // CHECK:STDOUT: assign %pb.var, %.loc19_18 -// CHECK:STDOUT: %b.ref.loc24: %.2 = name_ref b, %b -// CHECK:STDOUT: %.loc24_5: i32 = int_value 0 [template = constants.%.5] -// CHECK:STDOUT: %.loc24_6.1: ref %.2 = value_as_ref %b.ref.loc24 +// CHECK:STDOUT: %b.ref.loc24: %.28 = name_ref b, %b +// CHECK:STDOUT: %.loc24_5: i32 = int_value 0 [template = constants.%.31] +// CHECK:STDOUT: %.loc24_6.1: ref %.28 = value_as_ref %b.ref.loc24 // CHECK:STDOUT: %.loc24_6.2: ref i32 = array_index %.loc24_6.1, %.loc24_5 // CHECK:STDOUT: %.loc24_6.3: i32 = bind_value %.loc24_6.2 -// CHECK:STDOUT: %.loc24_10: i32 = int_value 4 [template = constants.%.6] +// CHECK:STDOUT: %.loc24_10: i32 = int_value 4 [template = constants.%.32] // CHECK:STDOUT: assign %.loc24_6.3, %.loc24_10 // CHECK:STDOUT: %int.make_type_32.loc32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc32_14.1: type = value_of_initializer %int.make_type_32.loc32 [template = i32] // CHECK:STDOUT: %.loc32_14.2: type = converted %int.make_type_32.loc32, %.loc32_14.1 [template = i32] -// CHECK:STDOUT: %.loc32_14.3: type = ptr_type i32 [template = constants.%.4] -// CHECK:STDOUT: %pf.var: ref %.4 = var pf -// CHECK:STDOUT: %pf: ref %.4 = bind_name pf, %pf.var +// CHECK:STDOUT: %.loc32_14.3: type = ptr_type i32 [template = constants.%.30] +// CHECK:STDOUT: %pf.var: ref %.30 = var pf +// CHECK:STDOUT: %pf: ref %.30 = bind_name pf, %pf.var // CHECK:STDOUT: %F.ref.loc32: %F.type = name_ref F, file.%F.decl [template = constants.%F] -// CHECK:STDOUT: %.loc32_20.1: ref %.2 = temporary_storage -// CHECK:STDOUT: %F.call.loc32: init %.2 = call %F.ref.loc32() to %.loc32_20.1 -// CHECK:STDOUT: %.loc32_23: i32 = int_value 0 [template = constants.%.5] -// CHECK:STDOUT: %.loc32_20.2: ref %.2 = temporary %.loc32_20.1, %F.call.loc32 +// CHECK:STDOUT: %.loc32_20.1: ref %.28 = temporary_storage +// CHECK:STDOUT: %F.call.loc32: init %.28 = call %F.ref.loc32() to %.loc32_20.1 +// CHECK:STDOUT: %.loc32_23: i32 = int_value 0 [template = constants.%.31] +// CHECK:STDOUT: %.loc32_20.2: ref %.28 = temporary %.loc32_20.1, %F.call.loc32 // CHECK:STDOUT: %.loc32_24.1: ref i32 = array_index %.loc32_20.2, %.loc32_23 // CHECK:STDOUT: %.loc32_24.2: i32 = bind_value %.loc32_24.1 -// CHECK:STDOUT: %.loc32_18: %.4 = addr_of [template = ] +// CHECK:STDOUT: %.loc32_18: %.30 = addr_of [template = ] // CHECK:STDOUT: assign %pf.var, %.loc32_18 // CHECK:STDOUT: %F.ref.loc36: %F.type = name_ref F, file.%F.decl [template = constants.%F] -// CHECK:STDOUT: %.loc36_4.1: ref %.2 = temporary_storage -// CHECK:STDOUT: %F.call.loc36: init %.2 = call %F.ref.loc36() to %.loc36_4.1 -// CHECK:STDOUT: %.loc36_7: i32 = int_value 0 [template = constants.%.5] -// CHECK:STDOUT: %.loc36_4.2: ref %.2 = temporary %.loc36_4.1, %F.call.loc36 +// CHECK:STDOUT: %.loc36_4.1: ref %.28 = temporary_storage +// CHECK:STDOUT: %F.call.loc36: init %.28 = call %F.ref.loc36() to %.loc36_4.1 +// CHECK:STDOUT: %.loc36_7: i32 = int_value 0 [template = constants.%.31] +// CHECK:STDOUT: %.loc36_4.2: ref %.28 = temporary %.loc36_4.1, %F.call.loc36 // CHECK:STDOUT: %.loc36_8.1: ref i32 = array_index %.loc36_4.2, %.loc36_7 // CHECK:STDOUT: %.loc36_8.2: i32 = bind_value %.loc36_8.1 -// CHECK:STDOUT: %.loc36_12: i32 = int_value 4 [template = constants.%.6] +// CHECK:STDOUT: %.loc36_12: i32 = int_value 4 [template = constants.%.32] // CHECK:STDOUT: assign %.loc36_8.2, %.loc36_12 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.2 => constants.%.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %.2 => constants.%.18 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.21 +// CHECK:STDOUT: %.2 => constants.%.22 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/index/fail_negative_indexing.carbon b/toolchain/check/testdata/index/fail_negative_indexing.carbon index 72d162d45acb7..a3107d34b5d94 100644 --- a/toolchain/check/testdata/index/fail_negative_indexing.carbon +++ b/toolchain/check/testdata/index/fail_negative_indexing.carbon @@ -22,35 +22,163 @@ var d: i32 = c[-10]; // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.1: i32 = int_value 2 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] -// CHECK:STDOUT: %.4: i32 = int_value 42 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.2: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.3: %.2 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.6: %.2 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.9: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.9)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.10: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.11: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.15: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.17: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.9)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.19: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.11)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.20: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.21: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.22: %.21 = assoc_entity element0, imports.%import_ref.44 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.28: type = array_type %.27, i32 [template] +// CHECK:STDOUT: %.29: type = ptr_type %.28 [template] +// CHECK:STDOUT: %.30: i32 = int_value 42 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (i32, i32) [template] -// CHECK:STDOUT: %.5: i32 = int_value 0 [template] -// CHECK:STDOUT: %.6: i32 = int_value 1 [template] -// CHECK:STDOUT: %array: %.2 = tuple_value (%.4, %.4) [template] -// CHECK:STDOUT: %.7: i32 = int_value 10 [template] +// CHECK:STDOUT: %.31: i32 = int_value 0 [template] +// CHECK:STDOUT: %.32: i32 = int_value 1 [template] +// CHECK:STDOUT: %array: %.28 = tuple_value (%.30, %.30) [template] +// CHECK:STDOUT: %.33: i32 = int_value 10 [template] // CHECK:STDOUT: %Negate.type: type = facet_type <@Negate> [template] -// CHECK:STDOUT: %Self: %Negate.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %Self.5: %Negate.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %Op.type: type = fn_type @Op [template] // CHECK:STDOUT: %Op: %Op.type = struct_value () [template] -// CHECK:STDOUT: %.8: type = assoc_entity_type %Negate.type, %Op.type [template] -// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.34: type = assoc_entity_type %Negate.type, %Op.type [template] +// CHECK:STDOUT: %.35: %.34 = assoc_entity element0, imports.%import_ref.55 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.1 -// CHECK:STDOUT: .Negate = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .Negate = %import_ref.51 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: type = import_ref Core//prelude/operators/arithmetic, inst+85, loaded [template = constants.%Negate.type] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/arithmetic, inst+87, unloaded -// CHECK:STDOUT: %import_ref.4: %.8 = import_ref Core//prelude/operators/arithmetic, inst+108, loaded [template = constants.%.9] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+103, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+103, unloaded +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.2) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.6)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.20: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.25] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.39: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.40 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.42: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.43 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.44 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.45: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.9)] +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.47 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.48: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.11)] +// CHECK:STDOUT: %import_ref.49: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.50 = import_ref Core//prelude/operators/as, inst+648, unloaded +// CHECK:STDOUT: %import_ref.51: type = import_ref Core//prelude/operators/arithmetic, inst+85, loaded [template = constants.%Negate.type] +// CHECK:STDOUT: %import_ref.52 = import_ref Core//prelude/operators/arithmetic, inst+87, unloaded +// CHECK:STDOUT: %import_ref.53: %.34 = import_ref Core//prelude/operators/arithmetic, inst+108, loaded [template = constants.%.35] +// CHECK:STDOUT: %import_ref.54 = import_ref Core//prelude/operators/arithmetic, inst+103, unloaded +// CHECK:STDOUT: %import_ref.55 = import_ref Core//prelude/operators/arithmetic, inst+103, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -61,12 +189,17 @@ var d: i32 = c[-10]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_14: i32 = int_value 2 [template = constants.%.1] +// CHECK:STDOUT: %.loc11_14.1: i32 = int_value 2 [template = constants.%.1] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] // CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32.loc11, %.loc11_9.1 [template = i32] -// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, i32 [template = constants.%.2] -// CHECK:STDOUT: %c.var: ref %.2 = var c -// CHECK:STDOUT: %c: ref %.2 = bind_name c, %c.var +// CHECK:STDOUT: %.loc11_14.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc11_14.3: = bound_method %.loc11_14.1, %.loc11_14.2 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc11_14.3(%.loc11_14.1) [template = constants.%.27] +// CHECK:STDOUT: %.loc11_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.27] +// CHECK:STDOUT: %.loc11_14.5: Core.IntLiteral = converted %.loc11_14.1, %.loc11_14.4 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14.5, i32 [template = constants.%.28] +// CHECK:STDOUT: %c.var: ref %.28 = var c +// CHECK:STDOUT: %c: ref %.28 = bind_name c, %c.var // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] @@ -74,44 +207,604 @@ var d: i32 = c[-10]; // CHECK:STDOUT: %d: ref i32 = bind_name d, %d.var // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.2) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Convert = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %.2: @As.%.1 (%.15) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: interface @Negate { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: .Op = imports.%import_ref.4 -// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: .Self = imports.%import_ref.52 +// CHECK:STDOUT: .Op = imports.%import_ref.53 +// CHECK:STDOUT: witness = (imports.%import_ref.54) +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.10)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.20)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.23)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.47 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op(constants.%Self: %Negate.type) { -// CHECK:STDOUT: %Self: %Negate.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Op.%Self (%Self)]() -> @Op.%Self (%Self); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Op(constants.%Self.5: %Negate.type) { +// CHECK:STDOUT: %Self: %Negate.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Op.%Self (%Self.5)]() -> @Op.%Self (%Self.5); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_20: i32 = int_value 42 [template = constants.%.4] -// CHECK:STDOUT: %.loc11_24: i32 = int_value 42 [template = constants.%.4] +// CHECK:STDOUT: %.loc11_20: i32 = int_value 42 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_24: i32 = int_value 42 [template = constants.%.30] // CHECK:STDOUT: %.loc11_26.1: %tuple.type = tuple_literal (%.loc11_20, %.loc11_24) -// CHECK:STDOUT: %.loc11_26.2: i32 = int_value 0 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_26.2: i32 = int_value 0 [template = constants.%.31] // CHECK:STDOUT: %.loc11_26.3: ref i32 = array_index file.%c.var, %.loc11_26.2 -// CHECK:STDOUT: %.loc11_26.4: init i32 = initialize_from %.loc11_20 to %.loc11_26.3 [template = constants.%.4] -// CHECK:STDOUT: %.loc11_26.5: i32 = int_value 1 [template = constants.%.6] +// CHECK:STDOUT: %.loc11_26.4: init i32 = initialize_from %.loc11_20 to %.loc11_26.3 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_26.5: i32 = int_value 1 [template = constants.%.32] // CHECK:STDOUT: %.loc11_26.6: ref i32 = array_index file.%c.var, %.loc11_26.5 -// CHECK:STDOUT: %.loc11_26.7: init i32 = initialize_from %.loc11_24 to %.loc11_26.6 [template = constants.%.4] -// CHECK:STDOUT: %.loc11_26.8: init %.2 = array_init (%.loc11_26.4, %.loc11_26.7) to file.%c.var [template = constants.%array] -// CHECK:STDOUT: %.loc11_27: init %.2 = converted %.loc11_26.1, %.loc11_26.8 [template = constants.%array] +// CHECK:STDOUT: %.loc11_26.7: init i32 = initialize_from %.loc11_24 to %.loc11_26.6 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_26.8: init %.28 = array_init (%.loc11_26.4, %.loc11_26.7) to file.%c.var [template = constants.%array] +// CHECK:STDOUT: %.loc11_27: init %.28 = converted %.loc11_26.1, %.loc11_26.8 [template = constants.%array] // CHECK:STDOUT: assign file.%c.var, %.loc11_27 -// CHECK:STDOUT: %c.ref: ref %.2 = name_ref c, file.%c -// CHECK:STDOUT: %.loc15_17: i32 = int_value 10 [template = constants.%.7] +// CHECK:STDOUT: %c.ref: ref %.28 = name_ref c, file.%c +// CHECK:STDOUT: %.loc15_17: i32 = int_value 10 [template = constants.%.33] // CHECK:STDOUT: %.loc15_19.1: ref i32 = array_index %c.ref, [template = ] // CHECK:STDOUT: %.loc15_19.2: i32 = bind_value %.loc15_19.1 // CHECK:STDOUT: assign file.%d.var, %.loc15_19.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Op(constants.%Self) { -// CHECK:STDOUT: %Self => constants.%Self +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.2 => constants.%.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %.2 => constants.%.18 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.9) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.9 +// CHECK:STDOUT: %Dest.patt => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.11) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.11 +// CHECK:STDOUT: %Dest.patt => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.21 +// CHECK:STDOUT: %.2 => constants.%.22 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Op(constants.%Self.5) { +// CHECK:STDOUT: %Self => constants.%Self.5 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon b/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon index 7947a93a9528a..801021a189d4e 100644 --- a/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon +++ b/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon @@ -391,6 +391,8 @@ interface I { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -398,6 +400,8 @@ interface I { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -405,6 +409,8 @@ interface I { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -412,6 +418,8 @@ interface I { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -427,6 +435,8 @@ interface I { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -434,6 +444,8 @@ interface I { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -441,6 +453,8 @@ interface I { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -448,6 +462,8 @@ interface I { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon b/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon index a299782f72ee8..967dd18d24ec4 100644 --- a/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon +++ b/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon @@ -106,6 +106,7 @@ interface Interface { // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: generic fn @G(@Interface.%Self: %Interface.type) { +// CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: fn(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon b/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon index d396030459ed5..2310c2a478722 100644 --- a/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon +++ b/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon @@ -187,6 +187,7 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @.2(@Interface.%Self: %Interface.type) { +// CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: fn(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/todo_define_not_default.carbon b/toolchain/check/testdata/interface/todo_define_not_default.carbon index 22751178bea4a..65eec68845c7f 100644 --- a/toolchain/check/testdata/interface/todo_define_not_default.carbon +++ b/toolchain/check/testdata/interface/todo_define_not_default.carbon @@ -129,6 +129,7 @@ interface I { // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: generic fn @G(@I.%Self: %I.type) { +// CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: fn(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/let/compile_time_bindings.carbon b/toolchain/check/testdata/let/compile_time_bindings.carbon index d81b680817aa7..052e885bf781f 100644 --- a/toolchain/check/testdata/let/compile_time_bindings.carbon +++ b/toolchain/check/testdata/let/compile_time_bindings.carbon @@ -1032,6 +1032,8 @@ impl i32 as Empty { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.10) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1039,6 +1041,8 @@ impl i32 as Empty { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.12) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1046,6 +1050,8 @@ impl i32 as Empty { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1053,6 +1059,8 @@ impl i32 as Empty { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1068,6 +1076,8 @@ impl i32 as Empty { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.10) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1075,6 +1085,8 @@ impl i32 as Empty { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.12) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1082,6 +1094,8 @@ impl i32 as Empty { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1089,6 +1103,8 @@ impl i32 as Empty { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/fail_generic.carbon b/toolchain/check/testdata/let/fail_generic.carbon index 3d49c493632b1..75fc9edde1765 100644 --- a/toolchain/check/testdata/let/fail_generic.carbon +++ b/toolchain/check/testdata/let/fail_generic.carbon @@ -424,6 +424,8 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -431,6 +433,8 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -438,6 +442,8 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -445,6 +451,8 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -460,6 +468,8 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -467,6 +477,8 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -474,6 +486,8 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -481,6 +495,8 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon index 516d2b6e2445c..667d6624b1651 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon @@ -396,6 +396,8 @@ fn Main() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -403,6 +405,8 @@ fn Main() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -410,6 +414,8 @@ fn Main() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -417,6 +423,8 @@ fn Main() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -432,6 +440,8 @@ fn Main() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -439,6 +449,8 @@ fn Main() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -446,6 +458,8 @@ fn Main() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -453,6 +467,8 @@ fn Main() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon index 975a0d57ad3ac..f460e7f6a6086 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon @@ -394,6 +394,8 @@ fn Main() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.8)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.8) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -401,6 +403,8 @@ fn Main() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.10) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -408,6 +412,8 @@ fn Main() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.8)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.8)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -415,6 +421,8 @@ fn Main() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -430,6 +438,8 @@ fn Main() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.8)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.8) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -437,6 +447,8 @@ fn Main() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.10) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -444,6 +456,8 @@ fn Main() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.8)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.8)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -451,6 +465,8 @@ fn Main() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/eq.carbon b/toolchain/check/testdata/operators/overloaded/eq.carbon index 6486953111e97..158dff83ae6f2 100644 --- a/toolchain/check/testdata/operators/overloaded/eq.carbon +++ b/toolchain/check/testdata/operators/overloaded/eq.carbon @@ -998,6 +998,8 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.14)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.14) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1005,6 +1007,8 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.16)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.16) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1012,6 +1016,8 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.14)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.14)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1019,6 +1025,8 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.16)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.16)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1034,6 +1042,8 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.14)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.14) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1041,6 +1051,8 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.16)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.16) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1048,6 +1060,8 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.14)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.14)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1055,6 +1069,8 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.16)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.16)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon b/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon index d11e2812224cd..6c627c837b511 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon @@ -591,6 +591,8 @@ fn TestAssign(b: D) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.17)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.17) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -598,6 +600,8 @@ fn TestAssign(b: D) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.19)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.19) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -605,6 +609,8 @@ fn TestAssign(b: D) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.17)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.17)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -612,6 +618,8 @@ fn TestAssign(b: D) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.19)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.19)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -627,6 +635,8 @@ fn TestAssign(b: D) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.17)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.17) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -634,6 +644,8 @@ fn TestAssign(b: D) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.19)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.19) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -641,6 +653,8 @@ fn TestAssign(b: D) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.17)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.17)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -648,6 +662,8 @@ fn TestAssign(b: D) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.19)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.19)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon index 8d02df2c7de84..df16b777ac77f 100644 --- a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon +++ b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon @@ -605,6 +605,8 @@ fn Test() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.16)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.4.%.1 (%.16) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -612,6 +614,8 @@ fn Test() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.18)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.5.%.1 (%.18) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -619,6 +623,8 @@ fn Test() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.16)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%.1 (%.16)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -626,6 +632,8 @@ fn Test() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.18)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.7.%.1 (%.18)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -641,6 +649,8 @@ fn Test() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.16)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.9.%.1 (%.16) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -648,6 +658,8 @@ fn Test() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.18)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.10.%.1 (%.18) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -655,6 +667,8 @@ fn Test() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.16)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.11.%.1 (%.16)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -662,6 +676,8 @@ fn Test() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.18)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.12.%.1 (%.18)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/index.carbon b/toolchain/check/testdata/operators/overloaded/index.carbon index 0b7941752ddcc..65987625cc09d 100644 --- a/toolchain/check/testdata/operators/overloaded/index.carbon +++ b/toolchain/check/testdata/operators/overloaded/index.carbon @@ -1045,6 +1045,8 @@ let x: i32 = c[0]; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.17)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.17) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1052,6 +1054,8 @@ let x: i32 = c[0]; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.19)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.19) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1059,6 +1063,8 @@ let x: i32 = c[0]; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.17)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.17)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1066,6 +1072,8 @@ let x: i32 = c[0]; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.19)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.19)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1081,6 +1089,8 @@ let x: i32 = c[0]; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.17)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.17) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1088,6 +1098,8 @@ let x: i32 = c[0]; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.19)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.19) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1095,6 +1107,8 @@ let x: i32 = c[0]; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.17)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.17)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1102,6 +1116,8 @@ let x: i32 = c[0]; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.19)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.19)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/pointer/fail_type_mismatch.carbon b/toolchain/check/testdata/pointer/fail_type_mismatch.carbon index c2fcb15e5eeff..605e67053282c 100644 --- a/toolchain/check/testdata/pointer/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/pointer/fail_type_mismatch.carbon @@ -405,6 +405,8 @@ fn ConstMismatch(p: const {}*) -> const ({}*) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.13) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -412,6 +414,8 @@ fn ConstMismatch(p: const {}*) -> const ({}*) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.15) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -419,6 +423,8 @@ fn ConstMismatch(p: const {}*) -> const ({}*) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -426,6 +432,8 @@ fn ConstMismatch(p: const {}*) -> const ({}*) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.15)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -441,6 +449,8 @@ fn ConstMismatch(p: const {}*) -> const ({}*) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.13) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -448,6 +458,8 @@ fn ConstMismatch(p: const {}*) -> const ({}*) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.15) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -455,6 +467,8 @@ fn ConstMismatch(p: const {}*) -> const ({}*) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -462,6 +476,8 @@ fn ConstMismatch(p: const {}*) -> const ({}*) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.15)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/fail_type_mismatch.carbon b/toolchain/check/testdata/return/fail_type_mismatch.carbon index 5e1de66873c83..fbb568cc0e2fc 100644 --- a/toolchain/check/testdata/return/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/return/fail_type_mismatch.carbon @@ -392,6 +392,8 @@ fn Main() -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.7)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.7) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -399,6 +401,8 @@ fn Main() -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -406,6 +410,8 @@ fn Main() -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.7)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.7)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -413,6 +419,8 @@ fn Main() -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -428,6 +436,8 @@ fn Main() -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.7)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.7) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -435,6 +445,8 @@ fn Main() -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -442,6 +454,8 @@ fn Main() -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.7)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.7)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -449,6 +463,8 @@ fn Main() -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/struct/fail_type_assign.carbon b/toolchain/check/testdata/struct/fail_type_assign.carbon index 433d27cad5540..25af0c609df18 100644 --- a/toolchain/check/testdata/struct/fail_type_assign.carbon +++ b/toolchain/check/testdata/struct/fail_type_assign.carbon @@ -383,6 +383,8 @@ var x: {.a: i32} = {.a: i32}; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -390,6 +392,8 @@ var x: {.a: i32} = {.a: i32}; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -397,6 +401,8 @@ var x: {.a: i32} = {.a: i32}; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -404,6 +410,8 @@ var x: {.a: i32} = {.a: i32}; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -419,6 +427,8 @@ var x: {.a: i32} = {.a: i32}; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -426,6 +436,8 @@ var x: {.a: i32} = {.a: i32}; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -433,6 +445,8 @@ var x: {.a: i32} = {.a: i32}; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -440,6 +454,8 @@ var x: {.a: i32} = {.a: i32}; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/struct/fail_value_as_type.carbon b/toolchain/check/testdata/struct/fail_value_as_type.carbon index 67b3401b2c7c8..8e4ccd6060e0f 100644 --- a/toolchain/check/testdata/struct/fail_value_as_type.carbon +++ b/toolchain/check/testdata/struct/fail_value_as_type.carbon @@ -377,6 +377,8 @@ var x: {.a = 1}; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.10) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -384,6 +386,8 @@ var x: {.a = 1}; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.12) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -391,6 +395,8 @@ var x: {.a = 1}; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -398,6 +404,8 @@ var x: {.a = 1}; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -413,6 +421,8 @@ var x: {.a = 1}; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.10) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -420,6 +430,8 @@ var x: {.a = 1}; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.12) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -427,6 +439,8 @@ var x: {.a = 1}; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -434,6 +448,8 @@ var x: {.a = 1}; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/struct/import.carbon b/toolchain/check/testdata/struct/import.carbon index 43aa19f7119d1..06be50f9afa99 100644 --- a/toolchain/check/testdata/struct/import.carbon +++ b/toolchain/check/testdata/struct/import.carbon @@ -870,6 +870,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.17)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.17) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -877,6 +879,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.19)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.19) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -884,6 +888,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.17)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.17)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -891,6 +897,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.19)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.19)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -906,6 +914,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.17)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.17) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -913,6 +923,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.19)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.19) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -920,6 +932,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.17)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.17)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -927,6 +941,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.19)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.19)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: 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 3a466107f6eec..dc2f3374439df 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon @@ -394,6 +394,8 @@ var b: i32 = a.(2.6); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.10) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -401,6 +403,8 @@ var b: i32 = a.(2.6); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.12) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -408,6 +412,8 @@ var b: i32 = a.(2.6); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -415,6 +421,8 @@ var b: i32 = a.(2.6); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -430,6 +438,8 @@ var b: i32 = a.(2.6); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.10) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -437,6 +447,8 @@ var b: i32 = a.(2.6); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.12) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -444,6 +456,8 @@ var b: i32 = a.(2.6); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -451,6 +465,8 @@ var b: i32 = a.(2.6); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: 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 153f143723dbe..41da7351f6360 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon @@ -46,17 +46,96 @@ fn Main() { // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.5: i32 = int_value 2 [template] -// CHECK:STDOUT: %.6: type = array_type %.5, i32 [template] -// CHECK:STDOUT: %.7: type = ptr_type %.6 [template] -// CHECK:STDOUT: %.8: i32 = int_value 5 [template] +// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] +// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.3: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Self.4: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.11 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] +// CHECK:STDOUT: %.8: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %.10: %.6 = assoc_entity element0, imports.%import_ref.12 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] +// CHECK:STDOUT: %.11: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template] +// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, imports.%import_ref.16 [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %.13: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.13)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %.15: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.15)> [symbolic] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] +// CHECK:STDOUT: %.17: = interface_witness (%Convert.6) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.18: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] +// CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] +// CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.5: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %Self.6: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.19: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.20: %.19 = assoc_entity element0, imports.%import_ref.38 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %.21: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] +// CHECK:STDOUT: %.22: %.21 = assoc_entity element0, imports.%import_ref.39 [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.13)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.15)> [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.25: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] +// CHECK:STDOUT: %.26: %.25 = assoc_entity element0, imports.%import_ref.49 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.13) [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] +// CHECK:STDOUT: %.28: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.29: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.30: = bound_method %.5, %Convert.15 [template] +// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.32: type = array_type %.31, i32 [template] +// CHECK:STDOUT: %.33: type = ptr_type %.32 [template] +// CHECK:STDOUT: %.34: i32 = int_value 5 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (i32, i32) [template] -// CHECK:STDOUT: %array: %.6 = tuple_value (%.8, %.8) [template] +// CHECK:STDOUT: %array: %.32 = tuple_value (%.34, %.34) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .IndexWith = %import_ref.1 // CHECK:STDOUT: .Int32 = %import_ref.6 +// CHECK:STDOUT: .ImplicitAs = %import_ref.7 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -66,6 +145,55 @@ fn Main() { // CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/index, inst+42, unloaded // CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/index, inst+42, unloaded // CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.7: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.8 = import_ref Core//prelude/operators/as, inst+61, unloaded +// CHECK:STDOUT: %import_ref.9: @ImplicitAs.%.1 (%.6) = import_ref Core//prelude/operators/as, inst+83, loaded [symbolic = @ImplicitAs.%.2 (constants.%.10)] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/as, inst+100, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.14: type = import_ref Core//prelude/operators/as, inst+111, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.15 = import_ref Core//prelude/operators/as, inst+133, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref Core//prelude/operators/as, inst+76, unloaded +// CHECK:STDOUT: %import_ref.17: type = import_ref Core//prelude/operators/as, inst+147, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.18: type = import_ref Core//prelude/operators/as, inst+165, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.19 = import_ref Core//prelude/operators/as, inst+196, unloaded +// CHECK:STDOUT: %import_ref.20: type = import_ref Core//prelude/operators/as, inst+211, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//prelude/operators/as, inst+229, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %import_ref.22 = import_ref Core//prelude/operators/as, inst+260, unloaded +// CHECK:STDOUT: %import_ref.23: type = import_ref Core//prelude/operators/as, inst+267, loaded [template = i32] +// CHECK:STDOUT: %import_ref.24: type = import_ref Core//prelude/operators/as, inst+273, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.25: = import_ref Core//prelude/operators/as, inst+296, loaded [template = constants.%.29] +// CHECK:STDOUT: %import_ref.26: type = import_ref Core//prelude/operators/as, inst+309, loaded [symbolic = @impl.5.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.27: type = import_ref Core//prelude/operators/as, inst+315, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.28 = import_ref Core//prelude/operators/as, inst+339, unloaded +// CHECK:STDOUT: %import_ref.29: type = import_ref Core//prelude/operators/as, inst+355, loaded [symbolic = @impl.6.%.1 (constants.%.15)] +// CHECK:STDOUT: %import_ref.30: type = import_ref Core//prelude/operators/as, inst+361, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.31 = import_ref Core//prelude/operators/as, inst+385, unloaded +// CHECK:STDOUT: %import_ref.32 = import_ref Core//prelude/operators/as, inst+21, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Core//prelude/operators/as, inst+43, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Core//prelude/operators/as, inst+393, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Core//prelude/operators/as, inst+398, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.37 = import_ref Core//prelude/operators/as, inst+420, unloaded +// CHECK:STDOUT: %import_ref.38 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.39 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.40: type = import_ref Core//prelude/operators/as, inst+432, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.41: type = import_ref Core//prelude/operators/as, inst+439, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.42 = import_ref Core//prelude/operators/as, inst+470, unloaded +// CHECK:STDOUT: %import_ref.43: type = import_ref Core//prelude/operators/as, inst+485, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.44: type = import_ref Core//prelude/operators/as, inst+492, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] +// CHECK:STDOUT: %import_ref.45 = import_ref Core//prelude/operators/as, inst+523, unloaded +// CHECK:STDOUT: %import_ref.46: type = import_ref Core//prelude/operators/as, inst+530, loaded [template = i32] +// CHECK:STDOUT: %import_ref.47: type = import_ref Core//prelude/operators/as, inst+536, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.48 = import_ref Core//prelude/operators/as, inst+559, unloaded +// CHECK:STDOUT: %import_ref.49 = import_ref Core//prelude/operators/as, inst+36, unloaded +// CHECK:STDOUT: %import_ref.50: type = import_ref Core//prelude/operators/as, inst+572, loaded [symbolic = @impl.11.%.1 (constants.%.13)] +// CHECK:STDOUT: %import_ref.51: type = import_ref Core//prelude/operators/as, inst+578, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.52 = import_ref Core//prelude/operators/as, inst+602, unloaded +// CHECK:STDOUT: %import_ref.53: type = import_ref Core//prelude/operators/as, inst+618, loaded [symbolic = @impl.12.%.1 (constants.%.15)] +// CHECK:STDOUT: %import_ref.54: type = import_ref Core//prelude/operators/as, inst+624, loaded [template = constants.%As.type.6] +// CHECK:STDOUT: %import_ref.55 = import_ref Core//prelude/operators/as, inst+648, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -99,35 +227,232 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.6)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.6) = assoc_entity element0, imports.%import_ref.11 [symbolic = %.2 (constants.%.7)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.8 +// CHECK:STDOUT: .Convert = imports.%import_ref.9 +// CHECK:STDOUT: witness = (imports.%import_ref.10) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(constants.%Dest: type) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.6)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.19)] +// CHECK:STDOUT: %.2: @As.%.1 (%.19) = assoc_entity element0, imports.%import_ref.38 [symbolic = %.2 (constants.%.20)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.32 +// CHECK:STDOUT: .Convert = imports.%import_ref.33 +// CHECK:STDOUT: witness = (imports.%import_ref.34) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.13 as imports.%import_ref.14 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.17 as imports.%import_ref.18 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.19 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.20 as imports.%import_ref.21 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.22 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.23 as imports.%import_ref.24 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.25 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.17)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.26 as imports.%import_ref.27 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.28 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.18)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.29 as imports.%import_ref.30 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.31 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.23)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.40 as imports.%import_ref.41 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.42 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.43 as imports.%import_ref.44 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.45 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.10: imports.%import_ref.46 as imports.%import_ref.47 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.48 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.27)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.50 as imports.%import_ref.51 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.52 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] +// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] +// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.28)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.53 as imports.%import_ref.54 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.55 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc16_3: i32 = int_value 0 [template = constants.%.1] // CHECK:STDOUT: %.loc16_5: i32 = int_value 1 [template = constants.%.2] // CHECK:STDOUT: %int.make_type_32.loc18: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_24: i32 = int_value 2 [template = constants.%.5] +// CHECK:STDOUT: %.loc18_24.1: i32 = int_value 2 [template = constants.%.5] // CHECK:STDOUT: %.loc18_19.1: type = value_of_initializer %int.make_type_32.loc18 [template = i32] // CHECK:STDOUT: %.loc18_19.2: type = converted %int.make_type_32.loc18, %.loc18_19.1 [template = i32] -// CHECK:STDOUT: %.loc18_25: type = array_type %.loc18_24, i32 [template = constants.%.6] -// CHECK:STDOUT: %non_tuple.var: ref %.6 = var non_tuple -// CHECK:STDOUT: %non_tuple: ref %.6 = bind_name non_tuple, %non_tuple.var -// CHECK:STDOUT: %.loc18_30: i32 = int_value 5 [template = constants.%.8] -// CHECK:STDOUT: %.loc18_33: i32 = int_value 5 [template = constants.%.8] +// CHECK:STDOUT: %.loc18_24.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc18_24.3: = bound_method %.loc18_24.1, %.loc18_24.2 [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc18_24.3(%.loc18_24.1) [template = constants.%.31] +// CHECK:STDOUT: %.loc18_24.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.31] +// CHECK:STDOUT: %.loc18_24.5: Core.IntLiteral = converted %.loc18_24.1, %.loc18_24.4 [template = constants.%.31] +// CHECK:STDOUT: %.loc18_25: type = array_type %.loc18_24.5, i32 [template = constants.%.32] +// CHECK:STDOUT: %non_tuple.var: ref %.32 = var non_tuple +// CHECK:STDOUT: %non_tuple: ref %.32 = bind_name non_tuple, %non_tuple.var +// CHECK:STDOUT: %.loc18_30: i32 = int_value 5 [template = constants.%.34] +// CHECK:STDOUT: %.loc18_33: i32 = int_value 5 [template = constants.%.34] // CHECK:STDOUT: %.loc18_34.1: %tuple.type = tuple_literal (%.loc18_30, %.loc18_33) // CHECK:STDOUT: %.loc18_34.2: i32 = int_value 0 [template = constants.%.1] // CHECK:STDOUT: %.loc18_34.3: ref i32 = array_index %non_tuple.var, %.loc18_34.2 -// CHECK:STDOUT: %.loc18_34.4: init i32 = initialize_from %.loc18_30 to %.loc18_34.3 [template = constants.%.8] +// CHECK:STDOUT: %.loc18_34.4: init i32 = initialize_from %.loc18_30 to %.loc18_34.3 [template = constants.%.34] // CHECK:STDOUT: %.loc18_34.5: i32 = int_value 1 [template = constants.%.2] // CHECK:STDOUT: %.loc18_34.6: ref i32 = array_index %non_tuple.var, %.loc18_34.5 -// CHECK:STDOUT: %.loc18_34.7: init i32 = initialize_from %.loc18_33 to %.loc18_34.6 [template = constants.%.8] -// CHECK:STDOUT: %.loc18_34.8: init %.6 = array_init (%.loc18_34.4, %.loc18_34.7) to %non_tuple.var [template = constants.%array] -// CHECK:STDOUT: %.loc18_35: init %.6 = converted %.loc18_34.1, %.loc18_34.8 [template = constants.%array] +// CHECK:STDOUT: %.loc18_34.7: init i32 = initialize_from %.loc18_33 to %.loc18_34.6 [template = constants.%.34] +// CHECK:STDOUT: %.loc18_34.8: init %.32 = array_init (%.loc18_34.4, %.loc18_34.7) to %non_tuple.var [template = constants.%array] +// CHECK:STDOUT: %.loc18_35: init %.32 = converted %.loc18_34.1, %.loc18_34.8 [template = constants.%array] // CHECK:STDOUT: assign %non_tuple.var, %.loc18_35 // CHECK:STDOUT: %int.make_type_32.loc22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc22_14.1: type = value_of_initializer %int.make_type_32.loc22 [template = i32] // CHECK:STDOUT: %.loc22_14.2: type = converted %int.make_type_32.loc22, %.loc22_14.1 [template = i32] // CHECK:STDOUT: %first.var: ref i32 = var first // CHECK:STDOUT: %first: ref i32 = bind_name first, %first.var -// CHECK:STDOUT: %non_tuple.ref: ref %.6 = name_ref non_tuple, %non_tuple +// CHECK:STDOUT: %non_tuple.ref: ref %.32 = name_ref non_tuple, %non_tuple // CHECK:STDOUT: %.loc22_30: i32 = int_value 0 [template = constants.%.1] // CHECK:STDOUT: assign %first.var, // CHECK:STDOUT: return @@ -144,6 +469,96 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.3: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.4)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.15) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.15)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.5: @As.%As.type (%As.type.2)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] +// CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.6)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.6)]() -> @Convert.6.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.13) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.15) = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.15)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Convert.11[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: // CHECK:STDOUT: specific @IndexWith(constants.%SubscriptType, constants.%ElementType) { // CHECK:STDOUT: %SubscriptType => constants.%SubscriptType // CHECK:STDOUT: %SubscriptType.patt => constants.%SubscriptType @@ -172,3 +587,281 @@ fn Main() { // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2 +// CHECK:STDOUT: %Self => constants.%Self.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 +// CHECK:STDOUT: %Convert => constants.%Convert.2 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: %.2 => constants.%.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: %Self => constants.%Self.4 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 +// CHECK:STDOUT: %Convert => constants.%Convert.3 +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %.2 => constants.%.12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.2(@impl.2.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%.15) { +// CHECK:STDOUT: %Dest => constants.%.15 +// CHECK:STDOUT: %Dest.patt => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { +// CHECK:STDOUT: %Dest => constants.%.15 +// CHECK:STDOUT: %Dest.patt => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.3(@impl.3.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.3(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(@impl.5.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.4(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.6(@impl.6.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(i32) { +// CHECK:STDOUT: %Dest => i32 +// CHECK:STDOUT: %Dest.patt => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: %Self => constants.%Self.6 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 +// CHECK:STDOUT: %Convert => constants.%Convert.9 +// CHECK:STDOUT: %.1 => constants.%.21 +// CHECK:STDOUT: %.2 => constants.%.22 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@As.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.6.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.5) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.2 +// CHECK:STDOUT: %Self => constants.%Self.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.13) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.8.%.1) { +// CHECK:STDOUT: %Dest => constants.%.13 +// CHECK:STDOUT: %Dest.patt => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.8(@impl.8.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %As.type => constants.%As.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.7(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%.15) { +// CHECK:STDOUT: %Dest => constants.%.15 +// CHECK:STDOUT: %Dest.patt => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.9.%.1) { +// CHECK:STDOUT: %Dest => constants.%.15 +// CHECK:STDOUT: %Dest.patt => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.9(@impl.9.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.8(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(Core.IntLiteral) { +// CHECK:STDOUT: %Dest => Core.IntLiteral +// CHECK:STDOUT: %Dest.patt => Core.IntLiteral +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %Self => constants.%Self.6 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.25 +// CHECK:STDOUT: %.2 => constants.%.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.11(@impl.11.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.9(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.12(@impl.12.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.10(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon b/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon index a3b9ce7a95c15..3eaa049041a13 100644 --- a/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon +++ b/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon @@ -386,6 +386,8 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -393,6 +395,8 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -400,6 +404,8 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -407,6 +413,8 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -422,6 +430,8 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -429,6 +439,8 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -436,6 +448,8 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -443,6 +457,8 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/tuple/fail_type_assign.carbon b/toolchain/check/testdata/tuple/fail_type_assign.carbon index 47b3c688d6470..d9c60b8173cdb 100644 --- a/toolchain/check/testdata/tuple/fail_type_assign.carbon +++ b/toolchain/check/testdata/tuple/fail_type_assign.carbon @@ -379,6 +379,8 @@ var x: (i32, ) = (i32, ); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.6)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.6) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -386,6 +388,8 @@ var x: (i32, ) = (i32, ); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.8)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.8) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -393,6 +397,8 @@ var x: (i32, ) = (i32, ); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.6)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.6)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -400,6 +406,8 @@ var x: (i32, ) = (i32, ); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.8)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.8)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -415,6 +423,8 @@ var x: (i32, ) = (i32, ); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.6)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.6) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -422,6 +432,8 @@ var x: (i32, ) = (i32, ); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.8)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.8) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -429,6 +441,8 @@ var x: (i32, ) = (i32, ); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.6)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.6)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -436,6 +450,8 @@ var x: (i32, ) = (i32, ); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.8)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.8)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/tuple/fail_value_as_type.carbon b/toolchain/check/testdata/tuple/fail_value_as_type.carbon index fc7387cba3cc6..e2c4379225d05 100644 --- a/toolchain/check/testdata/tuple/fail_value_as_type.carbon +++ b/toolchain/check/testdata/tuple/fail_value_as_type.carbon @@ -377,6 +377,8 @@ var x: (1, ); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -384,6 +386,8 @@ var x: (1, ); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -391,6 +395,8 @@ var x: (1, ); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -398,6 +404,8 @@ var x: (1, ); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -413,6 +421,8 @@ var x: (1, ); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -420,6 +430,8 @@ var x: (1, ); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -427,6 +439,8 @@ var x: (1, ); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -434,6 +448,8 @@ var x: (1, ); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/tuple/import.carbon b/toolchain/check/testdata/tuple/import.carbon index cde44481d2400..ff0e8f2b0e09c 100644 --- a/toolchain/check/testdata/tuple/import.carbon +++ b/toolchain/check/testdata/tuple/import.carbon @@ -911,6 +911,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.16)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.16) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -918,6 +920,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.18)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.18) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -925,6 +929,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.16)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.16)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -932,6 +938,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.18)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.18)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -947,6 +955,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.16)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.16) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -954,6 +964,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.18)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.18) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -961,6 +973,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.16)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.16)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -968,6 +982,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.18)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.18)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/var/fail_storage_is_literal.carbon b/toolchain/check/testdata/var/fail_storage_is_literal.carbon index fdcf6e8fb57e1..971e0cd24b776 100644 --- a/toolchain/check/testdata/var/fail_storage_is_literal.carbon +++ b/toolchain/check/testdata/var/fail_storage_is_literal.carbon @@ -387,6 +387,8 @@ fn Main() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -394,6 +396,8 @@ fn Main() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -401,6 +405,8 @@ fn Main() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -408,6 +414,8 @@ fn Main() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -423,6 +431,8 @@ fn Main() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -430,6 +440,8 @@ fn Main() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -437,6 +449,8 @@ fn Main() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -444,6 +458,8 @@ fn Main() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/where_expr/constraints.carbon b/toolchain/check/testdata/where_expr/constraints.carbon index d6a59808d92db..0154dffff6809 100644 --- a/toolchain/check/testdata/where_expr/constraints.carbon +++ b/toolchain/check/testdata/where_expr/constraints.carbon @@ -730,6 +730,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -737,6 +739,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.13) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -744,6 +748,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -751,6 +757,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -766,6 +774,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -773,6 +783,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.13) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -780,6 +792,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -787,6 +801,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1511,6 +1527,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.10) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1518,6 +1536,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.12) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1525,6 +1545,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1532,6 +1554,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1547,6 +1571,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.10) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1554,6 +1580,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.12) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1561,6 +1589,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1568,6 +1598,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2280,6 +2312,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2287,6 +2321,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.13) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2294,6 +2330,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2301,6 +2339,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2316,6 +2356,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2323,6 +2365,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.13) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2330,6 +2374,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2337,6 +2383,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3017,6 +3065,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3024,6 +3074,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3031,6 +3083,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3038,6 +3092,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3053,6 +3109,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3060,6 +3118,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3067,6 +3127,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3074,6 +3136,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3755,6 +3819,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3762,6 +3828,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3769,6 +3837,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3776,6 +3846,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3791,6 +3863,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.9) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3798,6 +3872,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3805,6 +3881,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.9)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.9)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3812,6 +3890,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -4628,6 +4708,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -4635,6 +4717,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.13) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -4642,6 +4726,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -4649,6 +4735,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -4664,6 +4752,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -4671,6 +4761,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.13) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -4678,6 +4770,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -4685,6 +4779,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -5415,6 +5511,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -5422,6 +5520,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.13) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -5429,6 +5529,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -5436,6 +5538,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -5451,6 +5555,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.11) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -5458,6 +5564,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.13) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -5465,6 +5573,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.11)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -5472,6 +5582,8 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.13)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.13)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/while/fail_bad_condition.carbon b/toolchain/check/testdata/while/fail_bad_condition.carbon index 48a012c749645..1bf73f0f48e4f 100644 --- a/toolchain/check/testdata/while/fail_bad_condition.carbon +++ b/toolchain/check/testdata/while/fail_bad_condition.carbon @@ -393,6 +393,8 @@ fn While() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.10) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -400,6 +402,8 @@ fn While() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.12) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -407,6 +411,8 @@ fn While() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -414,6 +420,8 @@ fn While() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -429,6 +437,8 @@ fn While() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.10) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -436,6 +446,8 @@ fn While() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.12) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -443,6 +455,8 @@ fn While() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.10)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: @@ -450,6 +464,8 @@ fn While() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.12)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: