From 1ec8ac7ef9f690cdf478219a72cbc1ec04fe6870 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 10 Sep 2025 16:55:55 -0700 Subject: [PATCH] Add `Copy` interface and use it for making copies. (#6034) Instead of hardcoding which types are copyable, add a `Core.Copy` interface to perform copying. Move almost all the current copy support to that interface. Some remaining pieces are still using builtin logic after this PR: * For tuples and structs, builtin logic is used to perform elementwise copies. This also supports copying *adapters of* tuples and structs, which seems like it may not be desirable, especially for non-extending adapters. A `Copy` impl is provided for tuples of at most 2 elements, so that `Core.Copy` constraints are satisfied, but we can't implement this generally until we have variadics support, and don't yet have a mechanism to generalize this to structs. * For `enum` types imported from C++, builtin logic is used to perform a copy. This is temporary until we have a mechanism to identify these types from an impl in the prelude. One lowering test in `toolchain/lower/testdata/class/generic.carbon` is disabled for now, as it causes a crash in the lowering code due to an ABI mismatch between the call signature in the lowered declaration of a specific function and the call that is generated in the specific callee. Fixing this is a little involved, and will be done in a separate PR. --------- Co-authored-by: Geoff Romer --- core/prelude.carbon | 1 + core/prelude/copy.carbon | 57 + core/prelude/iterate.carbon | 6 +- core/prelude/types/char.carbon | 5 + core/prelude/types/float.carbon | 7 + core/prelude/types/int.carbon | 7 + core/prelude/types/optional.carbon | 3 +- core/prelude/types/uint.carbon | 7 + toolchain/check/convert.cpp | 55 +- toolchain/check/eval.cpp | 4 + toolchain/check/testdata/alias/basics.carbon | 12 +- .../check/testdata/alias/export_name.carbon | 110 +- .../check/testdata/array/bound_values.carbon | 4 +- .../testdata/array/element_mismatches.carbon | 17 +- .../testdata/array/index_not_literal.carbon | 4 +- .../array/init_dependent_bound.carbon | 2 +- .../testdata/as/adapter_conversion.carbon | 14 +- toolchain/check/testdata/basics/parens.carbon | 2 +- .../basics/raw_sem_ir/one_file.carbon | 1268 ++++++++++++++--- .../testdata/builtins/bool/make_type.carbon | 7 +- .../builtins/char_literal/make_type.carbon | 21 +- .../builtins/float/convert_checked.carbon | 12 +- .../builtins/float_literal/make_type.carbon | 7 +- .../builtins/int/convert_checked.carbon | 2 +- .../check/testdata/builtins/print/char.carbon | 2 +- .../check/testdata/builtins/print/int.carbon | 2 +- toolchain/check/testdata/choice/basic.carbon | 83 +- .../testdata/class/access_modifers.carbon | 8 +- .../testdata/class/adapter/adapt_copy.carbon | 425 ++++-- .../testdata/class/adapter/init_adapt.carbon | 4 +- toolchain/check/testdata/class/base.carbon | 31 +- .../check/testdata/class/base_method.carbon | 2 +- toolchain/check/testdata/class/basic.carbon | 2 +- .../testdata/class/derived_to_base.carbon | 2 +- .../class/fail_init_as_inplace.carbon | 5 +- .../check/testdata/class/fail_self.carbon | 5 +- .../check/testdata/class/field_access.carbon | 39 +- .../class/field_access_in_value.carbon | 39 +- .../check/testdata/class/generic/call.carbon | 2 +- .../generic/complete_in_conversion.carbon | 4 +- .../testdata/class/generic/import.carbon | 2 +- .../check/testdata/class/generic/init.carbon | 275 ++-- .../testdata/class/generic/member_type.carbon | 476 ++++--- .../testdata/class/generic/stringify.carbon | 4 +- toolchain/check/testdata/class/import.carbon | 28 +- .../check/testdata/class/import_base.carbon | 2 +- .../testdata/class/import_indirect.carbon | 168 ++- .../testdata/class/import_struct_cyle.carbon | 32 +- .../testdata/class/inheritance_access.carbon | 39 +- toolchain/check/testdata/class/init.carbon | 54 +- toolchain/check/testdata/class/init_as.carbon | 2 +- toolchain/check/testdata/class/local.carbon | 2 +- toolchain/check/testdata/class/method.carbon | 2 +- toolchain/check/testdata/class/nested.carbon | 65 +- .../check/testdata/class/raw_self.carbon | 36 +- .../check/testdata/class/raw_self_type.carbon | 26 +- toolchain/check/testdata/class/reorder.carbon | 2 +- .../testdata/class/reorder_qualified.carbon | 2 +- toolchain/check/testdata/class/scope.carbon | 2 +- .../testdata/class/self_conversion.carbon | 2 +- .../check/testdata/class/self_type.carbon | 22 +- .../class/syntactic_merge_literal.carbon | 4 +- .../testdata/class/virtual_modifiers.carbon | 31 +- toolchain/check/testdata/const/import.carbon | 63 +- toolchain/check/testdata/deduce/array.carbon | 10 +- .../check/testdata/deduce/generic_type.carbon | 2 +- toolchain/check/testdata/deduce/tuple.carbon | 2 +- .../value_with_type_through_access.carbon | 50 +- .../check/testdata/eval/aggregates.carbon | 60 +- toolchain/check/testdata/facet/access.carbon | 2 +- .../facet/call_combined_impl_witness.carbon | 2 +- ..._facet_value_to_narrowed_facet_type.carbon | 6 +- toolchain/check/testdata/for/actual.carbon | 225 ++- toolchain/check/testdata/for/basic.carbon | 85 +- toolchain/check/testdata/for/pattern.carbon | 878 ++++++------ .../testdata/function/builtin/call.carbon | 4 +- .../testdata/function/builtin/method.carbon | 6 +- .../call/fail_return_type_mismatch.carbon | 2 +- .../check/testdata/function/call/i32.carbon | 2 +- .../function/call/more_param_ir.carbon | 2 +- .../testdata/function/call/params_one.carbon | 2 +- .../function/call/params_one_comma.carbon | 2 +- .../testdata/function/call/params_two.carbon | 2 +- .../function/call/params_two_comma.carbon | 2 +- .../call/prefer_unqualified_lookup.carbon | 2 +- .../function/declaration/import.carbon | 10 +- .../function/definition/import.carbon | 2 +- .../testdata/function/generic/deduce.carbon | 4 +- .../generic/deduce_nested_facet_value.carbon | 2 +- .../function/generic/param_in_type.carbon | 2 +- .../function/generic/resolve_used.carbon | 4 +- .../function/generic/undefined.carbon | 6 +- .../testdata/generic/call_basic_depth.carbon | 2 +- .../testdata/generic/dependent_param.carbon | 2 +- toolchain/check/testdata/generic/local.carbon | 2 +- toolchain/check/testdata/if_expr/basic.carbon | 2 +- .../if_expr/constant_condition.carbon | 55 +- .../testdata/if_expr/control_flow.carbon | 2 +- .../check/testdata/if_expr/nested.carbon | 2 +- .../check/testdata/if_expr/struct.carbon | 2 +- .../testdata/impl/assoc_const_self.carbon | 2 +- .../testdata/impl/extend_impl_generic.carbon | 64 +- .../check/testdata/impl/forward_decls.carbon | 4 +- .../impl/impl_assoc_const_with_prelude.carbon | 4 +- .../check/testdata/impl/impl_thunk.carbon | 39 +- .../impl/lookup/canonical_query_self.carbon | 2 +- ...g_generic_inside_rewrite_constraint.carbon | 2 +- .../testdata/impl/use_assoc_const.carbon | 51 +- .../index/array_element_access.carbon | 43 +- .../check/testdata/index/expr_category.carbon | 38 +- .../index/fail_array_large_index.carbon | 51 +- .../index/fail_array_non_int_indexing.carbon | 36 +- .../fail_array_out_of_bound_access.carbon | 36 +- .../testdata/index/fail_expr_category.carbon | 47 +- .../index/fail_negative_indexing.carbon | 36 +- .../interface/compound_member_access.carbon | 338 ++--- .../fail_todo_assoc_const_default.carbon | 2 +- .../testdata/interface/generic_method.carbon | 464 +++--- .../check/testdata/interface/import.carbon | 63 +- .../interface/todo_define_not_default.carbon | 2 +- .../interop/cpp/class/constructor.carbon | 12 +- .../testdata/interop/cpp/class/field.carbon | 34 +- .../interop/cpp/class/template.carbon | 2 +- .../testdata/interop/cpp/enum/convert.carbon | 2 +- .../testdata/interop/cpp/enum/copy.carbon | 28 +- .../function/arithmetic_types_bridged.carbon | 557 ++++++-- .../function/arithmetic_types_direct.carbon | 24 +- .../interop/cpp/function/full_semir.carbon | 42 +- .../interop/cpp/function/in_template.carbon | 2 +- .../interop/cpp/function/operators.carbon | 2 +- .../interop/cpp/function/pointer.carbon | 24 +- .../check/testdata/interop/cpp/import.carbon | 4 +- .../check/testdata/interop/cpp/typedef.carbon | 69 +- .../testdata/let/compile_time_bindings.carbon | 6 +- .../testdata/let/fail_duplicate_decl.carbon | 2 +- .../check/testdata/let/fail_modifiers.carbon | 2 +- toolchain/check/testdata/let/generic.carbon | 42 +- toolchain/check/testdata/let/global.carbon | 2 +- .../check/testdata/let/shadowed_decl.carbon | 2 +- .../check/testdata/main_run/return_i32.carbon | 2 +- .../testdata/namespace/add_to_import.carbon | 2 +- .../check/testdata/namespace/alias.carbon | 2 +- .../namespace/fail_decl_in_alias.carbon | 2 +- .../testdata/namespace/name_poisoning.carbon | 2 +- .../check/testdata/namespace/shadow.carbon | 2 +- .../testdata/operators/builtin/and.carbon | 21 +- .../operators/builtin/assignment.carbon | 28 +- .../fail_assignment_to_non_assignable.carbon | 54 +- .../fail_redundant_compound_access.carbon | 32 +- .../fail_type_mismatch_assignment.carbon | 2 +- .../testdata/operators/builtin/or.carbon | 48 +- .../operators/builtin/unary_op.carbon | 21 +- .../operators/overloaded/implicit_as.carbon | 56 +- .../overloaded/index_with_prelude.carbon | 2 +- .../check/testdata/package_expr/syntax.carbon | 68 +- .../packages/implicit_imports_prelude.carbon | 24 +- .../check/testdata/packages/raw_core.carbon | 36 +- .../testdata/pointer/address_of_deref.carbon | 2 +- .../testdata/pointer/address_of_lvalue.carbon | 78 +- toolchain/check/testdata/pointer/basic.carbon | 36 +- .../check/testdata/pointer/import.carbon | 94 +- .../testdata/primitives/type_literals.carbon | 31 +- .../return/code_after_return_value.carbon | 5 +- .../fail_return_with_returned_var.carbon | 2 +- .../return/fail_returned_var_shadow.carbon | 2 +- .../return/fail_returned_var_type.carbon | 2 +- .../testdata/return/fail_var_in_type.carbon | 17 +- .../return/import_convert_function.carbon | 4 +- .../check/testdata/return/returned_var.carbon | 2 +- .../testdata/return/returned_var_scope.carbon | 2 +- toolchain/check/testdata/return/struct.carbon | 2 +- toolchain/check/testdata/return/tuple.carbon | 2 +- toolchain/check/testdata/return/value.carbon | 2 +- .../struct/fail_member_access_type.carbon | 2 +- .../struct/fail_non_member_access.carbon | 2 +- toolchain/check/testdata/struct/import.carbon | 41 +- .../testdata/struct/member_access.carbon | 33 +- .../check/testdata/struct/one_entry.carbon | 32 +- .../testdata/struct/partially_const.carbon | 24 +- .../testdata/struct/reorder_fields.carbon | 39 +- .../testdata/struct/tuple_as_element.carbon | 31 +- .../check/testdata/struct/two_entries.carbon | 31 +- .../testdata/tuple/element_access.carbon | 53 +- toolchain/check/testdata/tuple/import.carbon | 48 +- .../testdata/tuple/in_place_tuple_init.carbon | 2 +- .../testdata/var/fail_not_copyable.carbon | 5 +- toolchain/lower/handle_call.cpp | 27 +- toolchain/lower/testdata/array/iterate.carbon | 86 +- .../lower/testdata/builtins/types.carbon | 2 +- toolchain/lower/testdata/class/generic.carbon | 87 +- toolchain/lower/testdata/for/bindings.carbon | 44 +- .../lower/testdata/for/break_continue.carbon | 50 +- toolchain/lower/testdata/for/for.carbon | 50 +- .../lower/testdata/operators/increment.carbon | 10 +- toolchain/sem_ir/builtin_function_kind.cpp | 20 + toolchain/sem_ir/builtin_function_kind.def | 4 + .../testdata/min_prelude/convert.carbon | 2 + .../testdata/min_prelude/facet_types.carbon | 2 + .../testing/testdata/min_prelude/for.carbon | 2 + .../testdata/min_prelude/parts/bool.carbon | 4 + .../testdata/min_prelude/parts/copy.carbon | 50 + .../testdata/min_prelude/parts/float.carbon | 6 + .../testdata/min_prelude/parts/int.carbon | 8 + .../testdata/min_prelude/parts/iterate.carbon | 4 +- .../min_prelude/parts/optional.carbon | 4 +- .../testdata/min_prelude/parts/uint.carbon | 8 + .../testdata/min_prelude/primitives.carbon | 2 + 207 files changed, 6195 insertions(+), 2566 deletions(-) create mode 100644 core/prelude/copy.carbon create mode 100644 toolchain/testing/testdata/min_prelude/parts/copy.carbon diff --git a/core/prelude.carbon b/core/prelude.carbon index 79ffe4b85d61..dfe0ad409d0c 100644 --- a/core/prelude.carbon +++ b/core/prelude.carbon @@ -6,6 +6,7 @@ package Core library "prelude"; +export import library "prelude/copy"; export import library "prelude/destroy"; export import library "prelude/iterate"; export import library "prelude/operators"; diff --git a/core/prelude/copy.carbon b/core/prelude/copy.carbon new file mode 100644 index 000000000000..bef8ac845fb8 --- /dev/null +++ b/core/prelude/copy.carbon @@ -0,0 +1,57 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +package Core library "prelude/copy"; + +// Copying an object, which is a conversion from a value representation to an +// initializing representation. +interface Copy { + fn Op[self: Self]() -> Self; +} + +private fn Bool() -> type = "bool.make_type"; +private fn CharLiteral() -> type = "char_literal.make_type"; +private fn FloatLiteral() -> type = "float_literal.make_type"; +private fn IntLiteral() -> type = "int_literal.make_type"; + +impl Bool() as Copy { + fn Op[self: Self]() -> Self = "primitive_copy"; +} + +impl CharLiteral() as Copy { + fn Op[self: Self]() -> Self = "primitive_copy"; +} + +impl FloatLiteral() as Copy { + fn Op[self: Self]() -> Self = "primitive_copy"; +} + +impl IntLiteral() as Copy { + fn Op[self: Self]() -> Self = "primitive_copy"; +} + +impl type as Copy { + fn Op[self: Self]() -> Self = "primitive_copy"; +} + +impl forall [T:! type] T* as Copy { + fn Op[self: Self]() -> Self = "primitive_copy"; +} + +// TODO: Implement tuple copy as a variadic generic impl. +impl () as Copy { + fn Op[self: Self]() -> Self = "no_op"; +} + +impl forall [T:! Copy] (T,) as Copy { + fn Op[self: Self]() -> Self { + return (self.0.Op(),); + } +} + +impl forall [T:! Copy, U:! Copy] (T, U) as Copy { + fn Op[self: Self]() -> Self { + return (self.0.Op(), self.1.Op()); + } +} diff --git a/core/prelude/iterate.carbon b/core/prelude/iterate.carbon index 983227650ee9..9f0da2f0a645 100644 --- a/core/prelude/iterate.carbon +++ b/core/prelude/iterate.carbon @@ -4,18 +4,20 @@ package Core library "prelude/iterate"; +export import library "prelude/copy"; export import library "prelude/destroy"; export import library "prelude/types"; export import library "prelude/operators"; interface Iterate { - let ElementType:! type; + // TODO: Support iterating ranges of non-copyable values. + let ElementType:! Copy; let CursorType:! type; fn NewCursor[self: Self]() -> CursorType; fn Next[self: Self](cursor: CursorType*) -> Optional(ElementType); } -impl forall [T:! type, N:! IntLiteral()] +impl forall [T:! Copy, N:! IntLiteral()] array(T, N) as Iterate where .ElementType = T and .CursorType = i32 { fn NewCursor[self: Self]() -> i32 { return 0; } diff --git a/core/prelude/types/char.carbon b/core/prelude/types/char.carbon index 2e039c7ea10d..426875527466 100644 --- a/core/prelude/types/char.carbon +++ b/core/prelude/types/char.carbon @@ -4,6 +4,7 @@ package Core library "prelude/types/char"; +import library "prelude/copy"; import library "prelude/destroy"; import library "prelude/operators"; import library "prelude/types/uint"; @@ -14,6 +15,10 @@ class Char { adapt u8; } +impl Char as Copy { + fn Op[self: Self]() -> Self = "primitive_copy"; +} + impl CharLiteral() as ImplicitAs(Char) { fn Convert[self: Self]() -> Char = "char.convert_checked"; } diff --git a/core/prelude/types/float.carbon b/core/prelude/types/float.carbon index 2639862071d5..695ce8b42331 100644 --- a/core/prelude/types/float.carbon +++ b/core/prelude/types/float.carbon @@ -4,6 +4,7 @@ package Core library "prelude/types/float"; +import library "prelude/copy"; import library "prelude/destroy"; import library "prelude/operators"; import library "prelude/types/float_literal"; @@ -15,6 +16,12 @@ class Float(N:! IntLiteral()) { adapt MakeFloat(N); } +// Copy. + +impl forall [N:! IntLiteral()] Float(N) as Copy { + fn Op[self: Self]() -> Self = "primitive_copy"; +} + // Conversions. // TODO: Support mixed-size conversions. // TODO: Support int-to-float conversions. diff --git a/core/prelude/types/int.carbon b/core/prelude/types/int.carbon index 35e783d98cc7..f2082e0f1a0b 100644 --- a/core/prelude/types/int.carbon +++ b/core/prelude/types/int.carbon @@ -4,6 +4,7 @@ package Core library "prelude/types/int"; +import library "prelude/copy"; import library "prelude/destroy"; import library "prelude/operators"; import library "prelude/types/int_literal"; @@ -14,6 +15,12 @@ class Int(N:! IntLiteral()) { adapt MakeInt(N); } +// Copy. + +impl forall [N:! IntLiteral()] Int(N) as Copy { + fn Op[self: Self]() -> Self = "primitive_copy"; +} + // Conversions. impl forall [To:! IntLiteral()] IntLiteral() as ImplicitAs(Int(To)) { diff --git a/core/prelude/types/optional.carbon b/core/prelude/types/optional.carbon index 3d788a32c266..0f0804efaeaa 100644 --- a/core/prelude/types/optional.carbon +++ b/core/prelude/types/optional.carbon @@ -4,6 +4,7 @@ package Core library "prelude/types/optional"; +import library "prelude/copy"; import library "prelude/destroy"; import library "prelude/types/bool"; @@ -15,7 +16,7 @@ import library "prelude/types/bool"; // // TODO: We don't have an approved design for an `Optional` type yet, but it's // used by the design for `Iterate`. The API here is a placeholder. -class Optional(T:! type) { +class Optional(T:! Copy) { fn None() -> Self { returned var me: Self; me.has_value = false; diff --git a/core/prelude/types/uint.carbon b/core/prelude/types/uint.carbon index 6fa01b224f7d..9bb2175535c0 100644 --- a/core/prelude/types/uint.carbon +++ b/core/prelude/types/uint.carbon @@ -4,6 +4,7 @@ package Core library "prelude/types/uint"; +import library "prelude/copy"; import library "prelude/destroy"; import library "prelude/operators"; import library "prelude/types/int"; @@ -15,6 +16,12 @@ class UInt(N:! IntLiteral()) { adapt MakeUInt(N); } +// Copy. + +impl forall [N:! IntLiteral()] UInt(N) as Copy { + fn Op[self: Self]() -> Self = "primitive_copy"; +} + // Conversions. impl forall [To:! IntLiteral()] IntLiteral() as ImplicitAs(UInt(To)) { diff --git a/toolchain/check/convert.cpp b/toolchain/check/convert.cpp index f1c2a74fdb0b..e7a0e5dae4e3 100644 --- a/toolchain/check/convert.cpp +++ b/toolchain/check/convert.cpp @@ -1266,30 +1266,40 @@ static auto PerformBuiltinConversion( return value_id; } +// Determine whether this is a C++ enum type. +// TODO: This should be removed once we can properly add a `Copy` impl for C++ +// enum types. +static auto IsCppEnum(Context& context, SemIR::TypeId type_id) -> bool { + auto class_type = context.types().TryGetAs(type_id); + if (!class_type) { + return false; + } + + // A C++-imported class type that is an adapter is an enum. + auto& class_info = context.classes().Get(class_type->class_id); + return class_info.adapt_id.has_value() && + context.name_scopes().Get(class_info.scope_id).is_cpp_scope(); +} + // Given a value expression, form a corresponding initializer that copies from // that value, if it is possible to do so. static auto PerformCopy(Context& context, SemIR::InstId expr_id, bool diagnose) -> SemIR::InstId { - auto expr = context.insts().Get(expr_id); - auto type_id = expr.type_id(); - if (type_id == SemIR::ErrorInst::TypeId) { - return SemIR::ErrorInst::InstId; + // TODO: We don't have a mechanism yet to generate `Copy` impls for each enum + // type imported from C++. For now we fake it by providing a direct copy. + if (IsCppEnum(context, context.insts().Get(expr_id).type_id())) { + return CopyValueToTemporary(context, expr_id); } - if (InitReprIsCopyOfValueRepr(context.sem_ir(), type_id)) { - // For simple by-value types, no explicit action is required. Initializing - // from a value expression is treated as copying the value. - return expr_id; - } - - // TODO: We don't yet have rules for whether and when a class type is - // copyable, or how to perform the copy. - if (diagnose) { - CARBON_DIAGNOSTIC(CopyOfUncopyableType, Error, - "cannot copy value of type {0}", TypeOfInstId); - context.emitter().Emit(expr_id, CopyOfUncopyableType, expr_id); - } - return SemIR::ErrorInst::InstId; + return BuildUnaryOperator( + context, SemIR::LocId(expr_id), {"Copy"}, expr_id, [&] { + if (!diagnose) { + return context.emitter().BuildSuppressed(); + } + CARBON_DIAGNOSTIC(CopyOfUncopyableType, Error, + "cannot copy value of type {0}", TypeOfInstId); + return context.emitter().Build(expr_id, CopyOfUncopyableType, expr_id); + }); } // Convert a value expression so that it can be used to initialize a C++ thunk @@ -1310,14 +1320,7 @@ static auto ConvertValueForCppThunkRef(Context& context, SemIR::InstId expr_id, // Otherwise, we need a temporary to pass as the thunk argument. Create a copy // and initialize a temporary from it. expr_id = PerformCopy(context, expr_id, diagnose); - if (SemIR::GetExprCategory(context.sem_ir(), expr_id) == - SemIR::ExprCategory::Value) { - // If we still have a value expression, then it's a value expression - // whose value is being used directly to initialize the object. Copy - // it into a temporary to form an ephemeral reference. - expr_id = CopyValueToTemporary(context, expr_id); - } - return expr_id; + return MaterializeIfInitializing(context, expr_id); } // Returns the Core interface name to use for a given kind of conversion. diff --git a/toolchain/check/eval.cpp b/toolchain/check/eval.cpp index c2bbdd8f206d..7d920ec6c701 100644 --- a/toolchain/check/eval.cpp +++ b/toolchain/check/eval.cpp @@ -1656,6 +1656,10 @@ static auto MakeConstantForBuiltinCall(EvalContext& eval_context, phase); } + case SemIR::BuiltinFunctionKind::PrimitiveCopy: { + return context.constant_values().Get(arg_ids[0]); + } + case SemIR::BuiltinFunctionKind::PrintChar: case SemIR::BuiltinFunctionKind::PrintInt: case SemIR::BuiltinFunctionKind::ReadChar: diff --git a/toolchain/check/testdata/alias/basics.carbon b/toolchain/check/testdata/alias/basics.carbon index 4c76f03b6d93..dfd956817922 100644 --- a/toolchain/check/testdata/alias/basics.carbon +++ b/toolchain/check/testdata/alias/basics.carbon @@ -2,7 +2,7 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/none.carbon +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/convert.carbon // // AUTOUPDATE // TIP: To test this file alone, run: @@ -153,6 +153,9 @@ extern alias C = Class; // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [concrete = constants.%C] // CHECK:STDOUT: %c: type = bind_alias c, %C.decl [concrete = constants.%C] @@ -168,10 +171,13 @@ extern alias C = Class; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %pattern_type: type = pattern_type %C [concrete] +// CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete] // CHECK:STDOUT: %C.val: %C = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [concrete = constants.%C] // CHECK:STDOUT: %a: type = bind_alias a, %C.decl [concrete = constants.%C] @@ -180,7 +186,7 @@ extern alias C = Class; // CHECK:STDOUT: %b.ref: type = name_ref b, %b [concrete = constants.%C] // CHECK:STDOUT: %c: type = bind_alias c, %b [concrete = constants.%C] // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %d.patt: %pattern_type = binding_pattern d [concrete] +// CHECK:STDOUT: %d.patt: %pattern_type.c48 = binding_pattern d [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %c.ref: type = name_ref c, %c [concrete = constants.%C] // CHECK:STDOUT: %.loc10_13.1: ref %C = temporary_storage diff --git a/toolchain/check/testdata/alias/export_name.carbon b/toolchain/check/testdata/alias/export_name.carbon index 4c96b49dba2f..e16ee86d9073 100644 --- a/toolchain/check/testdata/alias/export_name.carbon +++ b/toolchain/check/testdata/alias/export_name.carbon @@ -2,7 +2,7 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/none.carbon +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/convert.carbon // EXTRA-ARGS: --dump-sem-ir-ranges=if-present // // AUTOUPDATE @@ -76,21 +76,59 @@ var d: D* = &c; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [concrete] +// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete] +// CHECK:STDOUT: %Destroy.impl_witness: = impl_witness @C.%Destroy.impl_witness_table [concrete] +// CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete] +// CHECK:STDOUT: %pattern_type.44a: type = pattern_type %ptr.019 [concrete] +// CHECK:STDOUT: %C.as.Destroy.impl.Op.type: type = fn_type @C.as.Destroy.impl.Op [concrete] +// CHECK:STDOUT: %C.as.Destroy.impl.Op: %C.as.Destroy.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: .Destroy = %Core.Destroy +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .D = %D // CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {} // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [concrete = constants.%C] // CHECK:STDOUT: %D: type = bind_alias D, %C.decl [concrete = constants.%C] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: impl @C.as.Destroy.impl: @C.%Self.ref as constants.%Destroy.type { +// CHECK:STDOUT: %C.as.Destroy.impl.Op.decl: %C.as.Destroy.impl.Op.type = fn_decl @C.as.Destroy.impl.Op [concrete = constants.%C.as.Destroy.impl.Op] { +// CHECK:STDOUT: %self.patt: %pattern_type.44a = binding_pattern self [concrete] +// CHECK:STDOUT: %self.param_patt: %pattern_type.44a = value_param_pattern %self.patt, call_param0 [concrete] +// CHECK:STDOUT: %.loc4: %pattern_type.f6d = addr_pattern %self.param_patt [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: %ptr.019 = value_param call_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C] +// CHECK:STDOUT: %self: %ptr.019 = bind_name self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Op = %C.as.Destroy.impl.Op.decl +// CHECK:STDOUT: witness = @C.%Destroy.impl_witness +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C] +// CHECK:STDOUT: impl_decl @C.as.Destroy.impl [concrete] {} {} +// CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@C.as.Destroy.impl.%C.as.Destroy.impl.Op.decl), @C.as.Destroy.impl [concrete] +// CHECK:STDOUT: %Destroy.impl_witness: = impl_witness %Destroy.impl_witness_table [concrete = constants.%Destroy.impl_witness] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: @@ -98,6 +136,8 @@ var d: D* = &c; // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @C.as.Destroy.impl.Op(%self.param: %ptr.019) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: --- export.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -109,15 +149,21 @@ var d: D* = &c; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Main.C = import_ref Main//base, C, unloaded // CHECK:STDOUT: %Main.D: type = import_ref Main//base, D, loaded [concrete = constants.%C] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } // CHECK:STDOUT: %Main.import_ref.8f2: = import_ref Main//base, loc4_10, loaded [concrete = constants.%complete_type] -// CHECK:STDOUT: %Main.import_ref.2c4 = import_ref Main//base, inst16 [no loc], unloaded +// CHECK:STDOUT: %Main.import_ref.2c4 = import_ref Main//base, inst18 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .C = imports.%Main.C // CHECK:STDOUT: .D = %D +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %D: type = export D, imports.%Main.D [concrete = constants.%C] // CHECK:STDOUT: } @@ -140,15 +186,21 @@ var d: D* = &c; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Main.C: type = import_ref Main//base, C, loaded [concrete = constants.%C] // CHECK:STDOUT: %Main.D = import_ref Main//base, D, unloaded +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } // CHECK:STDOUT: %Main.import_ref.8f2: = import_ref Main//base, loc4_10, loaded [concrete = constants.%complete_type] -// CHECK:STDOUT: %Main.import_ref.2c4 = import_ref Main//base, inst16 [no loc], unloaded +// CHECK:STDOUT: %Main.import_ref.2c4 = import_ref Main//base, inst18 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .C = %C // CHECK:STDOUT: .D = imports.%Main.D +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %C: type = export C, imports.%Main.C [concrete = constants.%C] // CHECK:STDOUT: } @@ -172,15 +224,21 @@ var d: D* = &c; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Main.D: type = import_ref Main//export, D, loaded [concrete = constants.%C] -// CHECK:STDOUT: %Main.import_ref.8db: = import_ref Main//export, inst22 [indirect], loaded [concrete = constants.%complete_type] -// CHECK:STDOUT: %Main.import_ref.6a9 = import_ref Main//export, inst23 [indirect], unloaded +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: %Main.import_ref.8db: = import_ref Main//export, inst24 [indirect], loaded [concrete = constants.%complete_type] +// CHECK:STDOUT: %Main.import_ref.6a9 = import_ref Main//export, inst25 [indirect], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .D = imports.%Main.D +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .d = %d // CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %d.patt: %pattern_type = binding_pattern d [concrete] @@ -215,14 +273,20 @@ var d: D* = &c; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Main.D = import_ref Main//export, D, unloaded +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .D = imports.%Main.D +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .C = // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %c.patt: = binding_pattern c [concrete] @@ -245,28 +309,51 @@ var d: D* = &c; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete] // CHECK:STDOUT: %C.val: %C = struct_value () [concrete] // CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete] // CHECK:STDOUT: %pattern_type.44a: type = pattern_type %ptr.019 [concrete] // CHECK:STDOUT: %addr: %ptr.019 = addr_of file.%c.var [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.f23: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.8b3) [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.abf: %ptr.as.Copy.impl.Op.type.f23 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.a94: = impl_witness imports.%Copy.impl_witness_table.a71, @ptr.as.Copy.impl(%C) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.0f5: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%C) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.fd1: %ptr.as.Copy.impl.Op.type.0f5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.9a6: %Copy.type = facet_value %ptr.019, (%Copy.impl_witness.a94) [concrete] +// CHECK:STDOUT: %.a98: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.9a6 [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.bound: = bound_method %addr, %ptr.as.Copy.impl.Op.fd1 [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.fd1, @ptr.as.Copy.impl.Op(%C) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %addr, %ptr.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Main.D: type = import_ref Main//export, D, loaded [concrete = constants.%C] // CHECK:STDOUT: %Main.C: type = import_ref Main//export_orig, C, loaded [concrete = constants.%C] -// CHECK:STDOUT: %Main.import_ref.8db: = import_ref Main//export_orig, inst22 [indirect], loaded [concrete = constants.%complete_type] -// CHECK:STDOUT: %Main.import_ref.6a9 = import_ref Main//export_orig, inst23 [indirect], unloaded +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: .Copy = %Core.Copy +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: %Main.import_ref.8db: = import_ref Main//export_orig, inst24 [indirect], loaded [concrete = constants.%complete_type.357] +// CHECK:STDOUT: %Main.import_ref.6a9 = import_ref Main//export_orig, inst25 [indirect], unloaded +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.de9: @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op.type (%ptr.as.Copy.impl.Op.type.f23) = import_ref Core//prelude/parts/copy, loc32_31, loaded [symbolic = @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op (constants.%ptr.as.Copy.impl.Op.abf)] +// CHECK:STDOUT: %Copy.impl_witness_table.a71 = impl_witness_table (%Core.import_ref.de9), @ptr.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .D = imports.%Main.D // CHECK:STDOUT: .C = imports.%Main.C +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .c = %c // CHECK:STDOUT: .d = %d // CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %c.patt: %pattern_type.c48 = binding_pattern c [concrete] @@ -302,7 +389,12 @@ var d: D* = &c; // CHECK:STDOUT: assign file.%c.var, %.loc7_1 // CHECK:STDOUT: %c.ref: ref %C = name_ref c, file.%c [concrete = file.%c.var] // CHECK:STDOUT: %addr: %ptr.019 = addr_of %c.ref [concrete = constants.%addr] -// CHECK:STDOUT: assign file.%d.var, %addr +// CHECK:STDOUT: %impl.elem0: %.a98 = impl_witness_access constants.%Copy.impl_witness.a94, element0 [concrete = constants.%ptr.as.Copy.impl.Op.fd1] +// CHECK:STDOUT: %bound_method.loc8_13.1: = bound_method %addr, %impl.elem0 [concrete = constants.%ptr.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @ptr.as.Copy.impl.Op(constants.%C) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_13.2: = bound_method %addr, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.019 = call %bound_method.loc8_13.2(%addr) [concrete = constants.%addr] +// CHECK:STDOUT: assign file.%d.var, %ptr.as.Copy.impl.Op.call // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/bound_values.carbon b/toolchain/check/testdata/array/bound_values.carbon index e5f900ce5218..54b0531a038b 100644 --- a/toolchain/check/testdata/array/bound_values.carbon +++ b/toolchain/check/testdata/array/bound_values.carbon @@ -148,9 +148,9 @@ var b: array(1, 39999999999999999993); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core.import_ref.564: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.6e4) = import_ref Core//prelude/types/uint, loc30_40, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.483)] +// CHECK:STDOUT: %Core.import_ref.564: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.6e4) = import_ref Core//prelude/types/uint, loc37_40, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.483)] // CHECK:STDOUT: %As.impl_witness_table.526 = impl_witness_table (%Core.import_ref.564), @Core.IntLiteral.as.As.impl [concrete] -// CHECK:STDOUT: %Core.import_ref.71e: @UInt.as.ImplicitAs.impl.%UInt.as.ImplicitAs.impl.Convert.type (%UInt.as.ImplicitAs.impl.Convert.type.ebd) = import_ref Core//prelude/types/uint, loc25_44, loaded [symbolic = @UInt.as.ImplicitAs.impl.%UInt.as.ImplicitAs.impl.Convert (constants.%UInt.as.ImplicitAs.impl.Convert.55e)] +// CHECK:STDOUT: %Core.import_ref.71e: @UInt.as.ImplicitAs.impl.%UInt.as.ImplicitAs.impl.Convert.type (%UInt.as.ImplicitAs.impl.Convert.type.ebd) = import_ref Core//prelude/types/uint, loc32_44, loaded [symbolic = @UInt.as.ImplicitAs.impl.%UInt.as.ImplicitAs.impl.Convert (constants.%UInt.as.ImplicitAs.impl.Convert.55e)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.526 = impl_witness_table (%Core.import_ref.71e), @UInt.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/element_mismatches.carbon b/toolchain/check/testdata/array/element_mismatches.carbon index 8a474fce3262..57ce9aa23873 100644 --- a/toolchain/check/testdata/array/element_mismatches.carbon +++ b/toolchain/check/testdata/array/element_mismatches.carbon @@ -32,13 +32,26 @@ library "[[@TEST_NAME]]"; class C {} class D {} -var a: (C, D, D); -// CHECK:STDERR: fail_var_wrong_type.carbon:[[@LINE+4]]:22: error: cannot copy value of type `C` [CopyOfUncopyableType] +var a: (D, C, D); +// CHECK:STDERR: fail_var_wrong_type.carbon:[[@LINE+7]]:22: error: cannot implicitly convert expression of type `D` to `C` [ConversionFailure] +// CHECK:STDERR: var b: array(C, 3) = a; +// CHECK:STDERR: ^ +// CHECK:STDERR: fail_var_wrong_type.carbon:[[@LINE+4]]:22: note: type `D` does not implement interface `Core.ImplicitAs(C)` [MissingImplInMemberAccessNote] // CHECK:STDERR: var b: array(C, 3) = a; // CHECK:STDERR: ^ // CHECK:STDERR: var b: array(C, 3) = a; +var c: (C, D, D); +// CHECK:STDERR: fail_var_wrong_type.carbon:[[@LINE+7]]:22: error: cannot copy value of type `C` [CopyOfUncopyableType] +// CHECK:STDERR: var d: array(C, 3) = c; +// CHECK:STDERR: ^ +// CHECK:STDERR: fail_var_wrong_type.carbon:[[@LINE+4]]:22: note: type `C` does not implement interface `Core.Copy` [MissingImplInMemberAccessNote] +// CHECK:STDERR: var d: array(C, 3) = c; +// CHECK:STDERR: ^ +// CHECK:STDERR: +var d: array(C, 3) = c; + // --- fail_arg_too_short.carbon library "[[@TEST_NAME]]"; diff --git a/toolchain/check/testdata/array/index_not_literal.carbon b/toolchain/check/testdata/array/index_not_literal.carbon index a83b71a36b76..173f41de0a34 100644 --- a/toolchain/check/testdata/array/index_not_literal.carbon +++ b/toolchain/check/testdata/array/index_not_literal.carbon @@ -87,7 +87,7 @@ fn F(a: array({}, 3)) -> {} { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -190,7 +190,7 @@ fn F(a: array({}, 3)) -> {} { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/init_dependent_bound.carbon b/toolchain/check/testdata/array/init_dependent_bound.carbon index d0879c553db2..5dc539824fa7 100644 --- a/toolchain/check/testdata/array/init_dependent_bound.carbon +++ b/toolchain/check/testdata/array/init_dependent_bound.carbon @@ -199,7 +199,7 @@ fn H() { G(3); } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core.import_ref.02e: @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert.type (%Int.as.ImplicitAs.impl.Convert.type.eb9) = import_ref Core//prelude/parts/int, loc20_44, loaded [symbolic = @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert (constants.%Int.as.ImplicitAs.impl.Convert.958)] +// CHECK:STDOUT: %Core.import_ref.02e: @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert.type (%Int.as.ImplicitAs.impl.Convert.type.eb9) = import_ref Core//prelude/parts/int, loc27_44, loaded [symbolic = @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert (constants.%Int.as.ImplicitAs.impl.Convert.958)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.13c = impl_witness_table (%Core.import_ref.02e), @Int.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/as/adapter_conversion.carbon b/toolchain/check/testdata/as/adapter_conversion.carbon index 774411527fe9..b83143c170cf 100644 --- a/toolchain/check/testdata/as/adapter_conversion.carbon +++ b/toolchain/check/testdata/as/adapter_conversion.carbon @@ -100,7 +100,10 @@ class B { // a copy to perform initialization. It's not clear whether that is the right // behavior. -// CHECK:STDERR: fail_init_class_variable.carbon:[[@LINE+4]]:17: error: cannot copy value of type `B` [CopyOfUncopyableType] +// CHECK:STDERR: fail_init_class_variable.carbon:[[@LINE+7]]:17: error: cannot copy value of type `B` [CopyOfUncopyableType] +// CHECK:STDERR: var b_init: B = ({.x = 1, .y = 2} as A) as B; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_init_class_variable.carbon:[[@LINE+4]]:17: note: type `B` does not implement interface `Core.Copy` [MissingImplInMemberAccessNote] // CHECK:STDERR: var b_init: B = ({.x = 1, .y = 2} as A) as B; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -142,7 +145,10 @@ fn F(a: A) { // a copy to perform initialization. It's not clear whether that is the right // behavior. - // CHECK:STDERR: fail_init_tuple_variable.carbon:[[@LINE+7]]:3: error: cannot copy value of type `Noncopyable` [CopyOfUncopyableType] + // CHECK:STDERR: fail_init_tuple_variable.carbon:[[@LINE+10]]:3: error: cannot copy value of type `Noncopyable` [CopyOfUncopyableType] + // CHECK:STDERR: var a_init: A = (a as ({}, Noncopyable)) as A; + // CHECK:STDERR: ^~~~~~~~~~~~~ + // CHECK:STDERR: fail_init_tuple_variable.carbon:[[@LINE+7]]:3: note: type `Noncopyable` does not implement interface `Core.Copy` [MissingImplInMemberAccessNote] // CHECK:STDERR: var a_init: A = (a as ({}, Noncopyable)) as A; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: fail_init_tuple_variable.carbon:[[@LINE+4]]:19: note: in copy of `A` [InCopy] @@ -266,7 +272,7 @@ var b: B = {.x = ()} as B; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/parts/int, loc25_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] +// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/parts/int, loc32_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] // CHECK:STDOUT: %As.impl_witness_table.3fe = impl_witness_table (%Core.import_ref.52c), @Core.IntLiteral.as.As.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -372,7 +378,7 @@ var b: B = {.x = ()} as B; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/parens.carbon b/toolchain/check/testdata/basics/parens.carbon index 1cd9e79459c3..1cf7e2f00e79 100644 --- a/toolchain/check/testdata/basics/parens.carbon +++ b/toolchain/check/testdata/basics/parens.carbon @@ -54,7 +54,7 @@ var b: i32 = ((2)); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon b/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon index cfde94f0fdc0..df982f5bc0ef 100644 --- a/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon +++ b/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon @@ -2,7 +2,7 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/none.carbon +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/convert.carbon // EXTRA-ARGS: --dump-raw-sem-ir --no-dump-sem-ir // // Check that raw IR dumping works as expected. @@ -13,8 +13,8 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon -fn Foo[T:! type](n: T) -> (T, ()) { - return (n, ()); +fn Foo[T:! type](p: T*) -> (T*, ()) { + return (p, ()); } // CHECK:STDOUT: --- @@ -23,20 +23,184 @@ fn Foo[T:! type](n: T) -> (T, ()) { // CHECK:STDOUT: import_irs: // CHECK:STDOUT: ir0: {decl_id: inst, is_export: false} // CHECK:STDOUT: ir1: {decl_id: inst, is_export: false} -// CHECK:STDOUT: import_ir_insts: {} +// CHECK:STDOUT: ir2: {decl_id: inst15, is_export: false} +// CHECK:STDOUT: ir3: {decl_id: inst15, is_export: false} +// CHECK:STDOUT: ir4: {decl_id: inst15, is_export: false} +// CHECK:STDOUT: ir5: {decl_id: inst15, is_export: false} +// CHECK:STDOUT: import_ir_insts: +// CHECK:STDOUT: import_ir_inst0: {ir_id: ir4, inst_id: inst15} +// CHECK:STDOUT: import_ir_inst1: {ir_id: ir4, inst_id: inst15} +// CHECK:STDOUT: import_ir_inst2: {ir_id: ir4, inst_id: inst17} +// CHECK:STDOUT: import_ir_inst3: {ir_id: ir4, inst_id: inst45} +// CHECK:STDOUT: import_ir_inst4: {ir_id: ir4, inst_id: inst40} +// CHECK:STDOUT: import_ir_inst5: {ir_id: ir4, inst_id: inst40} +// CHECK:STDOUT: import_ir_inst6: {ir_id: ir4, inst_id: inst40} +// CHECK:STDOUT: import_ir_inst7: {ir_id: ir4, inst_id: inst34} +// CHECK:STDOUT: import_ir_inst8: {ir_id: ir4, inst_id: inst35} +// CHECK:STDOUT: import_ir_inst9: {ir_id: ir4, inst_id: inst28} +// CHECK:STDOUT: import_ir_inst10: {ir_id: ir4, inst_id: inst30} +// CHECK:STDOUT: import_ir_inst11: {ir_id: ir4, inst_id: inst17} +// CHECK:STDOUT: import_ir_inst12: {ir_id: ir4, inst_id: inst21} +// CHECK:STDOUT: import_ir_inst13: {ir_id: ir4, inst_id: inst24} +// CHECK:STDOUT: import_ir_inst14: {ir_id: ir4, inst_id: inst29} +// CHECK:STDOUT: import_ir_inst15: {ir_id: ir4, inst_id: inst83} +// CHECK:STDOUT: import_ir_inst16: {ir_id: ir4, inst_id: inst81} +// CHECK:STDOUT: import_ir_inst17: {ir_id: ir4, inst_id: inst79} +// CHECK:STDOUT: import_ir_inst18: {ir_id: ir4, inst_id: inst80} +// CHECK:STDOUT: import_ir_inst19: {ir_id: ir4, inst_id: inst107} +// CHECK:STDOUT: import_ir_inst20: {ir_id: ir4, inst_id: inst105} +// CHECK:STDOUT: import_ir_inst21: {ir_id: ir4, inst_id: inst103} +// CHECK:STDOUT: import_ir_inst22: {ir_id: ir4, inst_id: inst104} +// CHECK:STDOUT: import_ir_inst23: {ir_id: ir4, inst_id: inst131} +// CHECK:STDOUT: import_ir_inst24: {ir_id: ir4, inst_id: inst129} +// CHECK:STDOUT: import_ir_inst25: {ir_id: ir4, inst_id: inst127} +// CHECK:STDOUT: import_ir_inst26: {ir_id: ir4, inst_id: inst128} +// CHECK:STDOUT: import_ir_inst27: {ir_id: ir4, inst_id: inst155} +// CHECK:STDOUT: import_ir_inst28: {ir_id: ir4, inst_id: inst153} +// CHECK:STDOUT: import_ir_inst29: {ir_id: ir4, inst_id: inst151} +// CHECK:STDOUT: import_ir_inst30: {ir_id: ir4, inst_id: inst152} +// CHECK:STDOUT: import_ir_inst31: {ir_id: ir4, inst_id: inst186} +// CHECK:STDOUT: import_ir_inst32: {ir_id: ir4, inst_id: inst184} +// CHECK:STDOUT: import_ir_inst33: {ir_id: ir4, inst_id: inst178} +// CHECK:STDOUT: import_ir_inst34: {ir_id: ir4, inst_id: inst175} +// CHECK:STDOUT: import_ir_inst35: {ir_id: ir4, inst_id: inst180} +// CHECK:STDOUT: import_ir_inst36: {ir_id: ir4, inst_id: inst183} +// CHECK:STDOUT: import_ir_inst37: {ir_id: ir4, inst_id: inst203} +// CHECK:STDOUT: import_ir_inst38: {ir_id: ir4, inst_id: inst185} +// CHECK:STDOUT: import_ir_inst39: {ir_id: ir4, inst_id: inst177} +// CHECK:STDOUT: import_ir_inst40: {ir_id: ir4, inst_id: inst182} +// CHECK:STDOUT: import_ir_inst41: {ir_id: ir4, inst_id: inst188} +// CHECK:STDOUT: import_ir_inst42: {ir_id: ir4, inst_id: inst203} +// CHECK:STDOUT: import_ir_inst43: {ir_id: ir4, inst_id: inst198} +// CHECK:STDOUT: import_ir_inst44: {ir_id: ir4, inst_id: inst199} +// CHECK:STDOUT: import_ir_inst45: {ir_id: ir4, inst_id: inst194} +// CHECK:STDOUT: import_ir_inst46: {ir_id: ir4, inst_id: inst196} +// CHECK:STDOUT: import_ir_inst47: {ir_id: ir4, inst_id: inst175} +// CHECK:STDOUT: import_ir_inst48: {ir_id: ir4, inst_id: inst206} +// CHECK:STDOUT: import_ir_inst49: {ir_id: ir4, inst_id: inst207} +// CHECK:STDOUT: import_ir_inst50: {ir_id: ir4, inst_id: inst210} +// CHECK:STDOUT: import_ir_inst51: {ir_id: ir4, inst_id: inst190} +// CHECK:STDOUT: import_ir_inst52: {ir_id: ir4, inst_id: inst191} +// CHECK:STDOUT: import_ir_inst53: {ir_id: ir4, inst_id: inst195} +// CHECK:STDOUT: import_ir_inst54: {ir_id: ir4, inst_id: inst216} +// CHECK:STDOUT: import_ir_inst55: {ir_id: ir4, inst_id: inst214} +// CHECK:STDOUT: import_ir_inst56: {ir_id: ir4, inst_id: inst(TypeType)} +// CHECK:STDOUT: import_ir_inst57: {ir_id: ir4, inst_id: inst213} +// CHECK:STDOUT: import_ir_inst58: {ir_id: ir4, inst_id: inst237} +// CHECK:STDOUT: import_ir_inst59: {ir_id: ir4, inst_id: inst235} +// CHECK:STDOUT: import_ir_inst60: {ir_id: ir4, inst_id: inst233} +// CHECK:STDOUT: import_ir_inst61: {ir_id: ir4, inst_id: inst234} +// CHECK:STDOUT: import_ir_inst62: {ir_id: ir4, inst_id: inst288} +// CHECK:STDOUT: import_ir_inst63: {ir_id: ir4, inst_id: inst286} +// CHECK:STDOUT: import_ir_inst64: {ir_id: ir4, inst_id: inst266} +// CHECK:STDOUT: import_ir_inst65: {ir_id: ir4, inst_id: inst260} +// CHECK:STDOUT: import_ir_inst66: {ir_id: ir4, inst_id: inst256} +// CHECK:STDOUT: import_ir_inst67: {ir_id: ir4, inst_id: inst263} +// CHECK:STDOUT: import_ir_inst68: {ir_id: ir4, inst_id: inst281} +// CHECK:STDOUT: import_ir_inst69: {ir_id: ir4, inst_id: inst283} +// CHECK:STDOUT: import_ir_inst70: {ir_id: ir4, inst_id: inst310} +// CHECK:STDOUT: import_ir_inst71: {ir_id: ir4, inst_id: inst287} +// CHECK:STDOUT: import_ir_inst72: {ir_id: ir4, inst_id: inst258} +// CHECK:STDOUT: import_ir_inst73: {ir_id: ir4, inst_id: inst265} +// CHECK:STDOUT: import_ir_inst74: {ir_id: ir4, inst_id: inst274} +// CHECK:STDOUT: import_ir_inst75: {ir_id: ir4, inst_id: inst278} +// CHECK:STDOUT: import_ir_inst76: {ir_id: ir4, inst_id: inst282} +// CHECK:STDOUT: import_ir_inst77: {ir_id: ir4, inst_id: inst290} +// CHECK:STDOUT: import_ir_inst78: {ir_id: ir4, inst_id: inst310} +// CHECK:STDOUT: import_ir_inst79: {ir_id: ir4, inst_id: inst305} +// CHECK:STDOUT: import_ir_inst80: {ir_id: ir4, inst_id: inst306} +// CHECK:STDOUT: import_ir_inst81: {ir_id: ir4, inst_id: inst301} +// CHECK:STDOUT: import_ir_inst82: {ir_id: ir4, inst_id: inst303} +// CHECK:STDOUT: import_ir_inst83: {ir_id: ir4, inst_id: inst256} +// CHECK:STDOUT: import_ir_inst84: {ir_id: ir4, inst_id: inst263} +// CHECK:STDOUT: import_ir_inst85: {ir_id: ir4, inst_id: inst313} +// CHECK:STDOUT: import_ir_inst86: {ir_id: ir4, inst_id: inst314} +// CHECK:STDOUT: import_ir_inst87: {ir_id: ir4, inst_id: inst294} +// CHECK:STDOUT: import_ir_inst88: {ir_id: ir4, inst_id: inst295} +// CHECK:STDOUT: import_ir_inst89: {ir_id: ir4, inst_id: inst296} +// CHECK:STDOUT: import_ir_inst90: {ir_id: ir4, inst_id: inst297} +// CHECK:STDOUT: import_ir_inst91: {ir_id: ir4, inst_id: inst298} +// CHECK:STDOUT: import_ir_inst92: {ir_id: ir4, inst_id: inst302} +// CHECK:STDOUT: import_ir_inst93: {ir_id: ir4, inst_id: inst319} +// CHECK:STDOUT: import_ir_inst94: {ir_id: ir4, inst_id: inst328} +// CHECK:STDOUT: import_ir_inst95: {ir_id: ir4, inst_id: inst335} +// CHECK:STDOUT: import_ir_inst96: {ir_id: ir4, inst_id: inst340} +// CHECK:STDOUT: import_ir_inst97: {ir_id: ir4, inst_id: inst341} +// CHECK:STDOUT: import_ir_inst98: {ir_id: ir4, inst_id: inst342} +// CHECK:STDOUT: import_ir_inst99: {ir_id: ir4, inst_id: inst347} +// CHECK:STDOUT: import_ir_inst100: {ir_id: ir4, inst_id: inst358} +// CHECK:STDOUT: import_ir_inst101: {ir_id: ir4, inst_id: inst365} +// CHECK:STDOUT: import_ir_inst102: {ir_id: ir4, inst_id: inst370} +// CHECK:STDOUT: import_ir_inst103: {ir_id: ir4, inst_id: inst371} +// CHECK:STDOUT: import_ir_inst104: {ir_id: ir4, inst_id: inst372} +// CHECK:STDOUT: import_ir_inst105: {ir_id: ir4, inst_id: inst377} // CHECK:STDOUT: name_scopes: -// CHECK:STDOUT: name_scope0: {inst: inst14, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name0: inst46}} +// CHECK:STDOUT: name_scope0: {inst: inst14, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name(Core): inst16, name0: inst53}} +// CHECK:STDOUT: name_scope1: {inst: inst16, parent_scope: name_scope0, has_error: false, extended_scopes: [], names: {name3: inst69}} +// CHECK:STDOUT: name_scope2: {inst: inst70, parent_scope: name_scope1, has_error: false, extended_scopes: [], names: {name(SelfType): inst73, name4: inst74}} +// CHECK:STDOUT: name_scope3: {inst: inst94, parent_scope: name_scope1, has_error: false, extended_scopes: [], names: {}} +// CHECK:STDOUT: name_scope4: {inst: inst98, parent_scope: name_scope1, has_error: false, extended_scopes: [], names: {}} +// CHECK:STDOUT: name_scope5: {inst: inst102, parent_scope: name_scope1, has_error: false, extended_scopes: [], names: {}} +// CHECK:STDOUT: name_scope6: {inst: inst106, parent_scope: name_scope1, has_error: false, extended_scopes: [], names: {}} +// CHECK:STDOUT: name_scope7: {inst: inst110, parent_scope: name_scope1, has_error: false, extended_scopes: [], names: {}} +// CHECK:STDOUT: name_scope8: {inst: inst136, parent_scope: name_scope1, has_error: false, extended_scopes: [], names: {}} +// CHECK:STDOUT: name_scope9: {inst: inst140, parent_scope: name_scope1, has_error: false, extended_scopes: [], names: {}} +// CHECK:STDOUT: name_scope10: {inst: inst144, parent_scope: name_scope1, has_error: false, extended_scopes: [], names: {}} // CHECK:STDOUT: entity_names: // CHECK:STDOUT: entity_name0: {name: name(PeriodSelf), parent_scope: name_scope, index: -1, is_template: 0, clang_decl_id: clang_decl_id} // CHECK:STDOUT: entity_name1: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, clang_decl_id: clang_decl_id} // CHECK:STDOUT: entity_name2: {name: name2, parent_scope: name_scope, index: -1, is_template: 0, clang_decl_id: clang_decl_id} +// CHECK:STDOUT: entity_name3: {name: name3, parent_scope: name_scope1, index: -1, is_template: 0, clang_decl_id: clang_decl_id} +// CHECK:STDOUT: entity_name4: {name: name(SelfType), parent_scope: name_scope, index: 0, is_template: 0, clang_decl_id: clang_decl_id} +// CHECK:STDOUT: entity_name5: {name: name4, parent_scope: name_scope2, index: -1, is_template: 0, clang_decl_id: clang_decl_id} +// CHECK:STDOUT: entity_name6: {name: name(SelfType), parent_scope: name_scope, index: 0, is_template: 0, clang_decl_id: clang_decl_id} +// CHECK:STDOUT: entity_name7: {name: name(SelfValue), parent_scope: name_scope, index: -1, is_template: 0, clang_decl_id: clang_decl_id} +// CHECK:STDOUT: entity_name8: {name: name(SelfType), parent_scope: name_scope, index: 0, is_template: 0, clang_decl_id: clang_decl_id} +// CHECK:STDOUT: entity_name9: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, clang_decl_id: clang_decl_id} +// CHECK:STDOUT: entity_name10: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, clang_decl_id: clang_decl_id} +// CHECK:STDOUT: entity_name11: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, clang_decl_id: clang_decl_id} +// CHECK:STDOUT: entity_name12: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, clang_decl_id: clang_decl_id} +// CHECK:STDOUT: entity_name13: {name: name(SelfValue), parent_scope: name_scope, index: -1, is_template: 0, clang_decl_id: clang_decl_id} +// CHECK:STDOUT: entity_name14: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, clang_decl_id: clang_decl_id} +// CHECK:STDOUT: entity_name15: {name: name5, parent_scope: name_scope, index: 1, is_template: 0, clang_decl_id: clang_decl_id} +// CHECK:STDOUT: entity_name16: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, clang_decl_id: clang_decl_id} +// CHECK:STDOUT: entity_name17: {name: name5, parent_scope: name_scope, index: 1, is_template: 0, clang_decl_id: clang_decl_id} +// CHECK:STDOUT: entity_name18: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, clang_decl_id: clang_decl_id} +// CHECK:STDOUT: entity_name19: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, clang_decl_id: clang_decl_id} +// CHECK:STDOUT: entity_name20: {name: name5, parent_scope: name_scope, index: 1, is_template: 0, clang_decl_id: clang_decl_id} +// CHECK:STDOUT: entity_name21: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, clang_decl_id: clang_decl_id} +// CHECK:STDOUT: entity_name22: {name: name5, parent_scope: name_scope, index: 1, is_template: 0, clang_decl_id: clang_decl_id} +// CHECK:STDOUT: entity_name23: {name: name(SelfValue), parent_scope: name_scope, index: -1, is_template: 0, clang_decl_id: clang_decl_id} +// CHECK:STDOUT: entity_name24: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, clang_decl_id: clang_decl_id} +// CHECK:STDOUT: entity_name25: {name: name5, parent_scope: name_scope, index: 1, is_template: 0, clang_decl_id: clang_decl_id} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, call_params_id: inst_block13, return_slot_pattern: inst42, body: [inst_block20]} +// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, call_params_id: inst_block13, return_slot_pattern: inst48, body: [inst_block20]} +// CHECK:STDOUT: function1: {name: name4, parent_scope: name_scope2, return_slot_pattern: inst85} +// CHECK:STDOUT: function2: {name: name4, parent_scope: name_scope7, return_slot_pattern: inst125} +// CHECK:STDOUT: function3: {name: name4, parent_scope: name_scope10, return_slot_pattern: inst171} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: generics: -// CHECK:STDOUT: generic0: {decl: inst46, bindings: inst_block16} +// CHECK:STDOUT: generic0: {decl: inst53, bindings: inst_block16} +// CHECK:STDOUT: generic1: {decl: inst79, bindings: inst_block24} +// CHECK:STDOUT: generic2: {decl: inst110, bindings: inst_block29} +// CHECK:STDOUT: generic3: {decl: inst121, bindings: inst_block35} +// CHECK:STDOUT: generic4: {decl: inst144, bindings: inst_block42} +// CHECK:STDOUT: generic5: {decl: inst166, bindings: inst_block50} // CHECK:STDOUT: specifics: // CHECK:STDOUT: specific0: {generic: generic0, args: inst_block17} +// CHECK:STDOUT: specific1: {generic: generic1, args: inst_block26} +// CHECK:STDOUT: specific2: {generic: generic2, args: inst_block17} +// CHECK:STDOUT: specific3: {generic: generic2, args: inst_block31} +// CHECK:STDOUT: specific4: {generic: generic3, args: inst_block17} +// CHECK:STDOUT: specific5: {generic: generic4, args: inst_block44} +// CHECK:STDOUT: specific6: {generic: generic4, args: inst_block46} +// CHECK:STDOUT: specific7: {generic: generic5, args: inst_block44} +// CHECK:STDOUT: specific8: {generic: generic1, args: inst_block57} +// CHECK:STDOUT: specific9: {generic: generic1, args: inst_block59} +// CHECK:STDOUT: specific10: {generic: generic1, args: inst_block61} +// CHECK:STDOUT: specific11: {generic: generic1, args: inst_block63} +// CHECK:STDOUT: specific12: {generic: generic1, args: inst_block71} +// CHECK:STDOUT: specific13: {generic: generic1, args: inst_block73} // CHECK:STDOUT: struct_type_fields: // CHECK:STDOUT: struct_type_fields0: {} // CHECK:STDOUT: types: @@ -46,228 +210,946 @@ fn Foo[T:! type](n: T) -> (T, ()) { // CHECK:STDOUT: value_repr: {kind: copy, type: type(Error)} // CHECK:STDOUT: 'type(inst(NamespaceType))': // CHECK:STDOUT: value_repr: {kind: copy, type: type(inst(NamespaceType))} -// CHECK:STDOUT: 'type(inst30)': -// CHECK:STDOUT: value_repr: {kind: none, type: type(inst30)} -// CHECK:STDOUT: 'type(inst32)': -// CHECK:STDOUT: value_repr: {kind: pointer, type: type(inst34)} -// CHECK:STDOUT: 'type(inst34)': -// CHECK:STDOUT: value_repr: {kind: copy, type: type(inst34)} -// CHECK:STDOUT: 'type(inst47)': -// CHECK:STDOUT: value_repr: {kind: none, type: type(inst30)} -// CHECK:STDOUT: 'type(symbolic_constant1)': -// CHECK:STDOUT: value_repr: {kind: copy, type: type(symbolic_constant1)} -// CHECK:STDOUT: 'type(symbolic_constant5)': -// CHECK:STDOUT: value_repr: {kind: pointer, type: type(symbolic_constant9)} -// CHECK:STDOUT: 'type(symbolic_constant9)': -// CHECK:STDOUT: value_repr: {kind: copy, type: type(symbolic_constant9)} +// CHECK:STDOUT: 'type(inst36)': +// CHECK:STDOUT: value_repr: {kind: none, type: type(inst36)} +// CHECK:STDOUT: 'type(inst38)': +// CHECK:STDOUT: value_repr: {kind: pointer, type: type(inst40)} +// CHECK:STDOUT: 'type(inst40)': +// CHECK:STDOUT: value_repr: {kind: copy, type: type(inst40)} +// CHECK:STDOUT: 'type(inst54)': +// CHECK:STDOUT: value_repr: {kind: none, type: type(inst36)} +// CHECK:STDOUT: 'type(symbolic_constant3)': +// CHECK:STDOUT: value_repr: {kind: copy, type: type(symbolic_constant3)} +// CHECK:STDOUT: 'type(symbolic_constant7)': +// CHECK:STDOUT: value_repr: {kind: pointer, type: type(symbolic_constant11)} +// CHECK:STDOUT: 'type(symbolic_constant11)': +// CHECK:STDOUT: value_repr: {kind: copy, type: type(symbolic_constant11)} // CHECK:STDOUT: 'type(inst(WitnessType))': // CHECK:STDOUT: value_repr: {kind: copy, type: type(inst(WitnessType))} -// CHECK:STDOUT: 'type(symbolic_constant2)': -// CHECK:STDOUT: value_repr: {kind: copy, type: type(symbolic_constant2)} -// CHECK:STDOUT: 'type(symbolic_constant6)': -// CHECK:STDOUT: value_repr: {kind: pointer, type: type(symbolic_constant9)} +// CHECK:STDOUT: 'type(symbolic_constant4)': +// CHECK:STDOUT: value_repr: {kind: copy, type: type(symbolic_constant4)} +// CHECK:STDOUT: 'type(symbolic_constant8)': +// CHECK:STDOUT: value_repr: {kind: pointer, type: type(symbolic_constant11)} +// CHECK:STDOUT: 'type(inst71)': +// CHECK:STDOUT: value_repr: {kind: copy, type: type(inst71)} +// CHECK:STDOUT: 'type(inst(SpecificFunctionType))': +// CHECK:STDOUT: value_repr: {kind: copy, type: type(inst(SpecificFunctionType))} +// CHECK:STDOUT: 'type(symbolic_constant133)': +// CHECK:STDOUT: value_repr: {kind: none, type: type(inst36)} +// CHECK:STDOUT: 'type(symbolic_constant136)': +// CHECK:STDOUT: value_repr: {kind: none, type: type(inst36)} +// CHECK:STDOUT: 'type(inst(BoundMethodType))': +// CHECK:STDOUT: value_repr: {kind: copy, type: type(inst(BoundMethodType))} // CHECK:STDOUT: insts: // CHECK:STDOUT: inst14: {kind: Namespace, arg0: name_scope0, arg1: inst, type: type(inst(NamespaceType))} -// CHECK:STDOUT: inst15: {kind: FacetType, arg0: facet_type0, type: type(TypeType)} -// CHECK:STDOUT: inst16: {kind: BindSymbolicName, arg0: entity_name0, arg1: inst, type: type(inst15)} -// CHECK:STDOUT: inst17: {kind: BindSymbolicName, arg0: entity_name0, arg1: inst, type: type(inst15)} -// CHECK:STDOUT: inst18: {kind: BindSymbolicName, arg0: entity_name1, arg1: inst, type: type(TypeType)} -// CHECK:STDOUT: inst19: {kind: BindSymbolicName, arg0: entity_name1, arg1: inst, type: type(TypeType)} +// CHECK:STDOUT: inst15: {kind: ImportDecl, arg0: name(Core)} +// CHECK:STDOUT: inst16: {kind: Namespace, arg0: name_scope1, arg1: inst15, type: type(inst(NamespaceType))} +// CHECK:STDOUT: inst17: {kind: FacetType, arg0: facet_type0, type: type(TypeType)} +// CHECK:STDOUT: inst18: {kind: BindSymbolicName, arg0: entity_name0, arg1: inst, type: type(inst17)} +// CHECK:STDOUT: inst19: {kind: BindSymbolicName, arg0: entity_name0, arg1: inst, type: type(inst17)} // CHECK:STDOUT: inst20: {kind: BindSymbolicName, arg0: entity_name1, arg1: inst, type: type(TypeType)} -// CHECK:STDOUT: inst21: {kind: PatternType, arg0: inst(TypeType), type: type(TypeType)} -// CHECK:STDOUT: inst22: {kind: SymbolicBindingPattern, arg0: entity_name1, type: type(inst21)} -// CHECK:STDOUT: inst23: {kind: NameRef, arg0: name1, arg1: inst18, type: type(TypeType)} -// CHECK:STDOUT: inst24: {kind: BindName, arg0: entity_name2, arg1: inst43, type: type(symbolic_constant2)} -// CHECK:STDOUT: inst25: {kind: PatternType, arg0: inst19, type: type(TypeType)} -// CHECK:STDOUT: inst26: {kind: BindingPattern, arg0: entity_name2, type: type(symbolic_constant4)} -// CHECK:STDOUT: inst27: {kind: PatternType, arg0: inst20, type: type(TypeType)} -// CHECK:STDOUT: inst28: {kind: ValueParamPattern, arg0: inst26, arg1: call_param0, type: type(symbolic_constant4)} -// CHECK:STDOUT: inst29: {kind: NameRef, arg0: name1, arg1: inst18, type: type(TypeType)} -// CHECK:STDOUT: inst30: {kind: TupleType, arg0: inst_block_empty, type: type(TypeType)} -// CHECK:STDOUT: inst31: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst30)} -// CHECK:STDOUT: inst32: {kind: TupleType, arg0: inst_block9, type: type(TypeType)} -// CHECK:STDOUT: inst33: {kind: TupleLiteral, arg0: inst_block8, type: type(inst32)} -// CHECK:STDOUT: inst34: {kind: PointerType, arg0: inst32, type: type(TypeType)} -// CHECK:STDOUT: inst35: {kind: Converted, arg0: inst31, arg1: inst30, type: type(TypeType)} -// CHECK:STDOUT: inst36: {kind: TupleType, arg0: inst_block11, type: type(TypeType)} -// CHECK:STDOUT: inst37: {kind: Converted, arg0: inst33, arg1: inst36, type: type(TypeType)} -// CHECK:STDOUT: inst38: {kind: TupleType, arg0: inst_block12, type: type(TypeType)} -// CHECK:STDOUT: inst39: {kind: PatternType, arg0: inst36, type: type(TypeType)} -// CHECK:STDOUT: inst40: {kind: ReturnSlotPattern, arg0: inst37, type: type(symbolic_constant8)} -// CHECK:STDOUT: inst41: {kind: PatternType, arg0: inst38, type: type(TypeType)} -// CHECK:STDOUT: inst42: {kind: OutParamPattern, arg0: inst40, arg1: call_param1, type: type(symbolic_constant8)} -// CHECK:STDOUT: inst43: {kind: ValueParam, arg0: call_param0, arg1: name2, type: type(symbolic_constant2)} -// CHECK:STDOUT: inst44: {kind: OutParam, arg0: call_param1, arg1: name(ReturnSlot), type: type(symbolic_constant6)} -// CHECK:STDOUT: inst45: {kind: ReturnSlot, arg0: inst36, arg1: inst44, type: type(symbolic_constant6)} -// CHECK:STDOUT: inst46: {kind: FunctionDecl, arg0: function0, arg1: inst_block15, type: type(inst47)} -// CHECK:STDOUT: inst47: {kind: FunctionType, arg0: function0, arg1: specific, type: type(TypeType)} -// CHECK:STDOUT: inst48: {kind: StructValue, arg0: inst_block_empty, type: type(inst47)} -// CHECK:STDOUT: inst49: {kind: PointerType, arg0: inst36, type: type(TypeType)} -// CHECK:STDOUT: inst50: {kind: RequireCompleteType, arg0: inst36, type: type(inst(WitnessType))} -// CHECK:STDOUT: inst51: {kind: RequireCompleteType, arg0: inst36, type: type(inst(WitnessType))} -// CHECK:STDOUT: inst52: {kind: RequireCompleteType, arg0: inst38, type: type(inst(WitnessType))} -// CHECK:STDOUT: inst53: {kind: RequireCompleteType, arg0: inst19, type: type(inst(WitnessType))} -// CHECK:STDOUT: inst54: {kind: RequireCompleteType, arg0: inst19, type: type(inst(WitnessType))} -// CHECK:STDOUT: inst55: {kind: RequireCompleteType, arg0: inst20, type: type(inst(WitnessType))} -// CHECK:STDOUT: inst56: {kind: NameRef, arg0: name2, arg1: inst24, type: type(symbolic_constant2)} -// CHECK:STDOUT: inst57: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst30)} -// CHECK:STDOUT: inst58: {kind: TupleLiteral, arg0: inst_block21, type: type(symbolic_constant6)} -// CHECK:STDOUT: inst59: {kind: RequireCompleteType, arg0: inst36, type: type(inst(WitnessType))} -// CHECK:STDOUT: inst60: {kind: TupleAccess, arg0: inst45, arg1: element0, type: type(symbolic_constant2)} -// CHECK:STDOUT: inst61: {kind: RequireCompleteType, arg0: inst19, type: type(inst(WitnessType))} -// CHECK:STDOUT: inst62: {kind: InitializeFrom, arg0: inst56, arg1: inst60, type: type(symbolic_constant2)} -// CHECK:STDOUT: inst63: {kind: TupleAccess, arg0: inst45, arg1: element1, type: type(inst30)} -// CHECK:STDOUT: inst64: {kind: TupleInit, arg0: inst_block_empty, arg1: inst63, type: type(inst30)} -// CHECK:STDOUT: inst65: {kind: TupleValue, arg0: inst_block_empty, type: type(inst30)} -// CHECK:STDOUT: inst66: {kind: Converted, arg0: inst57, arg1: inst64, type: type(inst30)} -// CHECK:STDOUT: inst67: {kind: TupleInit, arg0: inst_block22, arg1: inst45, type: type(symbolic_constant6)} -// CHECK:STDOUT: inst68: {kind: Converted, arg0: inst58, arg1: inst67, type: type(symbolic_constant6)} -// CHECK:STDOUT: inst69: {kind: ReturnExpr, arg0: inst68, arg1: inst45} +// CHECK:STDOUT: inst21: {kind: BindSymbolicName, arg0: entity_name1, arg1: inst, type: type(TypeType)} +// CHECK:STDOUT: inst22: {kind: BindSymbolicName, arg0: entity_name1, arg1: inst, type: type(TypeType)} +// CHECK:STDOUT: inst23: {kind: PatternType, arg0: inst(TypeType), type: type(TypeType)} +// CHECK:STDOUT: inst24: {kind: SymbolicBindingPattern, arg0: entity_name1, type: type(inst23)} +// CHECK:STDOUT: inst25: {kind: NameRef, arg0: name1, arg1: inst20, type: type(TypeType)} +// CHECK:STDOUT: inst26: {kind: PointerType, arg0: inst25, type: type(TypeType)} +// CHECK:STDOUT: inst27: {kind: PointerType, arg0: inst21, type: type(TypeType)} +// CHECK:STDOUT: inst28: {kind: PointerType, arg0: inst22, type: type(TypeType)} +// CHECK:STDOUT: inst29: {kind: BindName, arg0: entity_name2, arg1: inst49, type: type(symbolic_constant4)} +// CHECK:STDOUT: inst30: {kind: PatternType, arg0: inst27, type: type(TypeType)} +// CHECK:STDOUT: inst31: {kind: BindingPattern, arg0: entity_name2, type: type(symbolic_constant6)} +// CHECK:STDOUT: inst32: {kind: PatternType, arg0: inst28, type: type(TypeType)} +// CHECK:STDOUT: inst33: {kind: ValueParamPattern, arg0: inst31, arg1: call_param0, type: type(symbolic_constant6)} +// CHECK:STDOUT: inst34: {kind: NameRef, arg0: name1, arg1: inst20, type: type(TypeType)} +// CHECK:STDOUT: inst35: {kind: PointerType, arg0: inst34, type: type(TypeType)} +// CHECK:STDOUT: inst36: {kind: TupleType, arg0: inst_block_empty, type: type(TypeType)} +// CHECK:STDOUT: inst37: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst36)} +// CHECK:STDOUT: inst38: {kind: TupleType, arg0: inst_block9, type: type(TypeType)} +// CHECK:STDOUT: inst39: {kind: TupleLiteral, arg0: inst_block8, type: type(inst38)} +// CHECK:STDOUT: inst40: {kind: PointerType, arg0: inst38, type: type(TypeType)} +// CHECK:STDOUT: inst41: {kind: Converted, arg0: inst37, arg1: inst36, type: type(TypeType)} +// CHECK:STDOUT: inst42: {kind: TupleType, arg0: inst_block11, type: type(TypeType)} +// CHECK:STDOUT: inst43: {kind: Converted, arg0: inst39, arg1: inst42, type: type(TypeType)} +// CHECK:STDOUT: inst44: {kind: TupleType, arg0: inst_block12, type: type(TypeType)} +// CHECK:STDOUT: inst45: {kind: PatternType, arg0: inst42, type: type(TypeType)} +// CHECK:STDOUT: inst46: {kind: ReturnSlotPattern, arg0: inst43, type: type(symbolic_constant10)} +// CHECK:STDOUT: inst47: {kind: PatternType, arg0: inst44, type: type(TypeType)} +// CHECK:STDOUT: inst48: {kind: OutParamPattern, arg0: inst46, arg1: call_param1, type: type(symbolic_constant10)} +// CHECK:STDOUT: inst49: {kind: ValueParam, arg0: call_param0, arg1: name2, type: type(symbolic_constant4)} +// CHECK:STDOUT: inst50: {kind: SpliceBlock, arg0: inst_block6, arg1: inst26, type: type(TypeType)} +// CHECK:STDOUT: inst51: {kind: OutParam, arg0: call_param1, arg1: name(ReturnSlot), type: type(symbolic_constant8)} +// CHECK:STDOUT: inst52: {kind: ReturnSlot, arg0: inst42, arg1: inst51, type: type(symbolic_constant8)} +// CHECK:STDOUT: inst53: {kind: FunctionDecl, arg0: function0, arg1: inst_block15, type: type(inst54)} +// CHECK:STDOUT: inst54: {kind: FunctionType, arg0: function0, arg1: specific, type: type(TypeType)} +// CHECK:STDOUT: inst55: {kind: StructValue, arg0: inst_block_empty, type: type(inst54)} +// CHECK:STDOUT: inst56: {kind: PointerType, arg0: inst42, type: type(TypeType)} +// CHECK:STDOUT: inst57: {kind: RequireCompleteType, arg0: inst42, type: type(inst(WitnessType))} +// CHECK:STDOUT: inst58: {kind: RequireCompleteType, arg0: inst42, type: type(inst(WitnessType))} +// CHECK:STDOUT: inst59: {kind: RequireCompleteType, arg0: inst44, type: type(inst(WitnessType))} +// CHECK:STDOUT: inst60: {kind: RequireCompleteType, arg0: inst27, type: type(inst(WitnessType))} +// CHECK:STDOUT: inst61: {kind: RequireCompleteType, arg0: inst27, type: type(inst(WitnessType))} +// CHECK:STDOUT: inst62: {kind: RequireCompleteType, arg0: inst28, type: type(inst(WitnessType))} +// CHECK:STDOUT: inst63: {kind: NameRef, arg0: name2, arg1: inst29, type: type(symbolic_constant4)} +// CHECK:STDOUT: inst64: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst36)} +// CHECK:STDOUT: inst65: {kind: TupleLiteral, arg0: inst_block21, type: type(symbolic_constant8)} +// CHECK:STDOUT: inst66: {kind: RequireCompleteType, arg0: inst42, type: type(inst(WitnessType))} +// CHECK:STDOUT: inst67: {kind: TupleAccess, arg0: inst52, arg1: element0, type: type(symbolic_constant4)} +// CHECK:STDOUT: inst68: {kind: RequireCompleteType, arg0: inst27, type: type(inst(WitnessType))} +// CHECK:STDOUT: inst69: {kind: ImportRefLoaded, arg0: import_ir_inst0, arg1: entity_name3, type: type(TypeType)} +// CHECK:STDOUT: inst70: {kind: InterfaceDecl, arg0: interface0, arg1: inst_block_empty, type: type(TypeType)} +// CHECK:STDOUT: inst71: {kind: FacetType, arg0: facet_type1, type: type(TypeType)} +// CHECK:STDOUT: inst72: {kind: BindSymbolicName, arg0: entity_name4, arg1: inst, type: type(inst71)} +// CHECK:STDOUT: inst73: {kind: ImportRefUnloaded, arg0: import_ir_inst2, arg1: entity_name} +// CHECK:STDOUT: inst74: {kind: ImportRefLoaded, arg0: import_ir_inst3, arg1: entity_name, type: type(inst76)} +// CHECK:STDOUT: inst75: {kind: ImportRefUnloaded, arg0: import_ir_inst4, arg1: entity_name5} +// CHECK:STDOUT: inst76: {kind: AssociatedEntityType, arg0: interface0, arg1: specific, type: type(TypeType)} +// CHECK:STDOUT: inst77: {kind: ImportRefLoaded, arg0: import_ir_inst5, arg1: entity_name, type: type(inst80)} +// CHECK:STDOUT: inst78: {kind: AssociatedEntity, arg0: element0, arg1: inst77, type: type(inst76)} +// CHECK:STDOUT: inst79: {kind: FunctionDecl, arg0: function1, arg1: inst_block_empty, type: type(inst80)} +// CHECK:STDOUT: inst80: {kind: FunctionType, arg0: function1, arg1: specific, type: type(TypeType)} +// CHECK:STDOUT: inst81: {kind: StructValue, arg0: inst_block_empty, type: type(inst80)} +// CHECK:STDOUT: inst82: {kind: FacetAccessType, arg0: inst72, type: type(TypeType)} +// CHECK:STDOUT: inst83: {kind: PatternType, arg0: inst82, type: type(TypeType)} +// CHECK:STDOUT: inst84: {kind: ReturnSlotPattern, arg0: inst, type: type(symbolic_constant19)} +// CHECK:STDOUT: inst85: {kind: OutParamPattern, arg0: inst84, arg1: call_param1, type: type(symbolic_constant19)} +// CHECK:STDOUT: inst86: {kind: BindingPattern, arg0: entity_name7, type: type(symbolic_constant19)} +// CHECK:STDOUT: inst87: {kind: ValueParamPattern, arg0: inst86, arg1: call_param0, type: type(symbolic_constant19)} +// CHECK:STDOUT: inst88: {kind: ImportRefLoaded, arg0: import_ir_inst11, arg1: entity_name, type: type(inst71)} +// CHECK:STDOUT: inst89: {kind: BindSymbolicName, arg0: entity_name4, arg1: inst, type: type(inst71)} +// CHECK:STDOUT: inst90: {kind: FacetAccessType, arg0: inst89, type: type(TypeType)} +// CHECK:STDOUT: inst91: {kind: PatternType, arg0: inst90, type: type(TypeType)} +// CHECK:STDOUT: inst92: {kind: LookupImplWitness, arg0: inst27, arg1: specific_interface0, type: type(inst(WitnessType))} +// CHECK:STDOUT: inst93: {kind: ImportRefUnloaded, arg0: import_ir_inst15, arg1: entity_name} +// CHECK:STDOUT: inst94: {kind: ImplDecl, arg0: impl0, arg1: inst_block_empty} +// CHECK:STDOUT: inst95: {kind: ImportRefLoaded, arg0: import_ir_inst17, arg1: entity_name, type: type(TypeType)} +// CHECK:STDOUT: inst96: {kind: ImportRefLoaded, arg0: import_ir_inst18, arg1: entity_name, type: type(TypeType)} +// CHECK:STDOUT: inst97: {kind: ImportRefUnloaded, arg0: import_ir_inst19, arg1: entity_name} +// CHECK:STDOUT: inst98: {kind: ImplDecl, arg0: impl1, arg1: inst_block_empty} +// CHECK:STDOUT: inst99: {kind: ImportRefLoaded, arg0: import_ir_inst21, arg1: entity_name, type: type(TypeType)} +// CHECK:STDOUT: inst100: {kind: ImportRefLoaded, arg0: import_ir_inst22, arg1: entity_name, type: type(TypeType)} +// CHECK:STDOUT: inst101: {kind: ImportRefUnloaded, arg0: import_ir_inst23, arg1: entity_name} +// CHECK:STDOUT: inst102: {kind: ImplDecl, arg0: impl2, arg1: inst_block_empty} +// CHECK:STDOUT: inst103: {kind: ImportRefLoaded, arg0: import_ir_inst25, arg1: entity_name, type: type(TypeType)} +// CHECK:STDOUT: inst104: {kind: ImportRefLoaded, arg0: import_ir_inst26, arg1: entity_name, type: type(TypeType)} +// CHECK:STDOUT: inst105: {kind: ImportRefUnloaded, arg0: import_ir_inst27, arg1: entity_name} +// CHECK:STDOUT: inst106: {kind: ImplDecl, arg0: impl3, arg1: inst_block_empty} +// CHECK:STDOUT: inst107: {kind: ImportRefLoaded, arg0: import_ir_inst29, arg1: entity_name, type: type(TypeType)} +// CHECK:STDOUT: inst108: {kind: ImportRefLoaded, arg0: import_ir_inst30, arg1: entity_name, type: type(TypeType)} +// CHECK:STDOUT: inst109: {kind: ImportRefLoaded, arg0: import_ir_inst31, arg1: entity_name, type: type(inst(WitnessType))} +// CHECK:STDOUT: inst110: {kind: ImplDecl, arg0: impl4, arg1: inst_block_empty} +// CHECK:STDOUT: inst111: {kind: SymbolicBindingPattern, arg0: entity_name10, type: type(inst23)} +// CHECK:STDOUT: inst112: {kind: ImportRefLoaded, arg0: import_ir_inst34, arg1: entity_name, type: type(TypeType)} +// CHECK:STDOUT: inst113: {kind: ImportRefLoaded, arg0: import_ir_inst35, arg1: entity_name, type: type(TypeType)} +// CHECK:STDOUT: inst114: {kind: ImportRefLoaded, arg0: import_ir_inst36, arg1: entity_name, type: type(TypeType)} +// CHECK:STDOUT: inst115: {kind: ImportRefUnloaded, arg0: import_ir_inst37, arg1: entity_name} +// CHECK:STDOUT: inst116: {kind: ImplWitnessTable, arg0: inst_block30, arg1: impl4} +// CHECK:STDOUT: inst117: {kind: ImplWitness, arg0: inst116, arg1: specific2, type: type(inst(WitnessType))} +// CHECK:STDOUT: inst118: {kind: BindSymbolicName, arg0: entity_name1, arg1: inst, type: type(TypeType)} +// CHECK:STDOUT: inst119: {kind: PointerType, arg0: inst118, type: type(TypeType)} +// CHECK:STDOUT: inst120: {kind: ImplWitness, arg0: inst116, arg1: specific3, type: type(inst(WitnessType))} +// CHECK:STDOUT: inst121: {kind: FunctionDecl, arg0: function2, arg1: inst_block_empty, type: type(symbolic_constant33)} +// CHECK:STDOUT: inst122: {kind: FunctionType, arg0: function2, arg1: specific2, type: type(TypeType)} +// CHECK:STDOUT: inst123: {kind: StructValue, arg0: inst_block_empty, type: type(symbolic_constant33)} +// CHECK:STDOUT: inst124: {kind: ReturnSlotPattern, arg0: inst, type: type(symbolic_constant37)} +// CHECK:STDOUT: inst125: {kind: OutParamPattern, arg0: inst124, arg1: call_param1, type: type(symbolic_constant37)} +// CHECK:STDOUT: inst126: {kind: BindingPattern, arg0: entity_name13, type: type(symbolic_constant37)} +// CHECK:STDOUT: inst127: {kind: ValueParamPattern, arg0: inst126, arg1: call_param0, type: type(symbolic_constant37)} +// CHECK:STDOUT: inst128: {kind: ImportRefLoaded, arg0: import_ir_inst47, arg1: entity_name, type: type(TypeType)} +// CHECK:STDOUT: inst129: {kind: FunctionType, arg0: function2, arg1: specific3, type: type(TypeType)} +// CHECK:STDOUT: inst130: {kind: StructValue, arg0: inst_block_empty, type: type(symbolic_constant40)} +// CHECK:STDOUT: inst131: {kind: RequireCompleteType, arg0: inst119, type: type(inst(WitnessType))} +// CHECK:STDOUT: inst132: {kind: BindSymbolicName, arg0: entity_name1, arg1: inst, type: type(TypeType)} +// CHECK:STDOUT: inst133: {kind: PointerType, arg0: inst132, type: type(TypeType)} +// CHECK:STDOUT: inst134: {kind: PatternType, arg0: inst133, type: type(TypeType)} +// CHECK:STDOUT: inst135: {kind: ImportRefUnloaded, arg0: import_ir_inst54, arg1: entity_name} +// CHECK:STDOUT: inst136: {kind: ImplDecl, arg0: impl5, arg1: inst_block_empty} +// CHECK:STDOUT: inst137: {kind: ImportRefLoaded, arg0: import_ir_inst56, arg1: entity_name, type: type(TypeType)} +// CHECK:STDOUT: inst138: {kind: ImportRefLoaded, arg0: import_ir_inst57, arg1: entity_name, type: type(TypeType)} +// CHECK:STDOUT: inst139: {kind: ImportRefUnloaded, arg0: import_ir_inst58, arg1: entity_name} +// CHECK:STDOUT: inst140: {kind: ImplDecl, arg0: impl6, arg1: inst_block_empty} +// CHECK:STDOUT: inst141: {kind: ImportRefLoaded, arg0: import_ir_inst60, arg1: entity_name, type: type(TypeType)} +// CHECK:STDOUT: inst142: {kind: ImportRefLoaded, arg0: import_ir_inst61, arg1: entity_name, type: type(TypeType)} +// CHECK:STDOUT: inst143: {kind: ImportRefUnloaded, arg0: import_ir_inst62, arg1: entity_name} +// CHECK:STDOUT: inst144: {kind: ImplDecl, arg0: impl7, arg1: inst_block_empty} +// CHECK:STDOUT: inst145: {kind: BindSymbolicName, arg0: entity_name15, arg1: inst, type: type(inst71)} +// CHECK:STDOUT: inst146: {kind: FacetAccessType, arg0: inst145, type: type(TypeType)} +// CHECK:STDOUT: inst147: {kind: BindSymbolicName, arg0: entity_name1, arg1: inst, type: type(inst71)} +// CHECK:STDOUT: inst148: {kind: FacetAccessType, arg0: inst147, type: type(TypeType)} +// CHECK:STDOUT: inst149: {kind: TupleType, arg0: inst_block40, type: type(TypeType)} +// CHECK:STDOUT: inst150: {kind: PatternType, arg0: inst71, type: type(TypeType)} +// CHECK:STDOUT: inst151: {kind: SymbolicBindingPattern, arg0: entity_name17, type: type(inst150)} +// CHECK:STDOUT: inst152: {kind: SymbolicBindingPattern, arg0: entity_name18, type: type(inst150)} +// CHECK:STDOUT: inst153: {kind: ImportRefLoaded, arg0: import_ir_inst66, arg1: entity_name, type: type(inst71)} +// CHECK:STDOUT: inst154: {kind: ImportRefLoaded, arg0: import_ir_inst67, arg1: entity_name, type: type(inst71)} +// CHECK:STDOUT: inst155: {kind: ImportRefLoaded, arg0: import_ir_inst68, arg1: entity_name, type: type(TypeType)} +// CHECK:STDOUT: inst156: {kind: ImportRefLoaded, arg0: import_ir_inst69, arg1: entity_name, type: type(TypeType)} +// CHECK:STDOUT: inst157: {kind: ImportRefUnloaded, arg0: import_ir_inst70, arg1: entity_name} +// CHECK:STDOUT: inst158: {kind: ImplWitnessTable, arg0: inst_block43, arg1: impl7} +// CHECK:STDOUT: inst159: {kind: ImplWitness, arg0: inst158, arg1: specific5, type: type(inst(WitnessType))} +// CHECK:STDOUT: inst160: {kind: BindSymbolicName, arg0: entity_name1, arg1: inst, type: type(inst71)} +// CHECK:STDOUT: inst161: {kind: BindSymbolicName, arg0: entity_name15, arg1: inst, type: type(inst71)} +// CHECK:STDOUT: inst162: {kind: FacetAccessType, arg0: inst160, type: type(TypeType)} +// CHECK:STDOUT: inst163: {kind: FacetAccessType, arg0: inst161, type: type(TypeType)} +// CHECK:STDOUT: inst164: {kind: TupleType, arg0: inst_block45, type: type(TypeType)} +// CHECK:STDOUT: inst165: {kind: ImplWitness, arg0: inst158, arg1: specific6, type: type(inst(WitnessType))} +// CHECK:STDOUT: inst166: {kind: FunctionDecl, arg0: function3, arg1: inst_block_empty, type: type(symbolic_constant68)} +// CHECK:STDOUT: inst167: {kind: FunctionType, arg0: function3, arg1: specific5, type: type(TypeType)} +// CHECK:STDOUT: inst168: {kind: StructValue, arg0: inst_block_empty, type: type(symbolic_constant68)} +// CHECK:STDOUT: inst169: {kind: PatternType, arg0: inst149, type: type(TypeType)} +// CHECK:STDOUT: inst170: {kind: ReturnSlotPattern, arg0: inst, type: type(symbolic_constant73)} +// CHECK:STDOUT: inst171: {kind: OutParamPattern, arg0: inst170, arg1: call_param1, type: type(symbolic_constant73)} +// CHECK:STDOUT: inst172: {kind: BindingPattern, arg0: entity_name23, type: type(symbolic_constant73)} +// CHECK:STDOUT: inst173: {kind: ValueParamPattern, arg0: inst172, arg1: call_param0, type: type(symbolic_constant73)} +// CHECK:STDOUT: inst174: {kind: ImportRefLoaded, arg0: import_ir_inst83, arg1: entity_name, type: type(inst71)} +// CHECK:STDOUT: inst175: {kind: ImportRefLoaded, arg0: import_ir_inst84, arg1: entity_name, type: type(inst71)} +// CHECK:STDOUT: inst176: {kind: FunctionType, arg0: function3, arg1: specific6, type: type(TypeType)} +// CHECK:STDOUT: inst177: {kind: StructValue, arg0: inst_block_empty, type: type(symbolic_constant75)} +// CHECK:STDOUT: inst178: {kind: BindSymbolicName, arg0: entity_name1, arg1: inst, type: type(inst71)} +// CHECK:STDOUT: inst179: {kind: FacetAccessType, arg0: inst178, type: type(TypeType)} +// CHECK:STDOUT: inst180: {kind: BindSymbolicName, arg0: entity_name15, arg1: inst, type: type(inst71)} +// CHECK:STDOUT: inst181: {kind: FacetAccessType, arg0: inst180, type: type(TypeType)} +// CHECK:STDOUT: inst182: {kind: TupleType, arg0: inst_block53, type: type(TypeType)} +// CHECK:STDOUT: inst183: {kind: PatternType, arg0: inst182, type: type(TypeType)} +// CHECK:STDOUT: inst184: {kind: RequireCompleteType, arg0: inst149, type: type(inst(WitnessType))} +// CHECK:STDOUT: inst185: {kind: RequireCompleteType, arg0: inst148, type: type(inst(WitnessType))} +// CHECK:STDOUT: inst186: {kind: LookupImplWitness, arg0: inst147, arg1: specific_interface0, type: type(inst(WitnessType))} +// CHECK:STDOUT: inst187: {kind: FacetValue, arg0: inst148, arg1: inst_block56, type: type(inst71)} +// CHECK:STDOUT: inst188: {kind: FunctionTypeWithSelfType, arg0: inst80, arg1: inst187, type: type(TypeType)} +// CHECK:STDOUT: inst189: {kind: ImplWitnessAccess, arg0: inst186, arg1: element0, type: type(symbolic_constant96)} +// CHECK:STDOUT: inst190: {kind: SpecificImplFunction, arg0: inst189, arg1: specific8, type: type(inst(SpecificFunctionType))} +// CHECK:STDOUT: inst191: {kind: RequireCompleteType, arg0: inst146, type: type(inst(WitnessType))} +// CHECK:STDOUT: inst192: {kind: LookupImplWitness, arg0: inst145, arg1: specific_interface0, type: type(inst(WitnessType))} +// CHECK:STDOUT: inst193: {kind: FacetValue, arg0: inst146, arg1: inst_block58, type: type(inst71)} +// CHECK:STDOUT: inst194: {kind: FunctionTypeWithSelfType, arg0: inst80, arg1: inst193, type: type(TypeType)} +// CHECK:STDOUT: inst195: {kind: ImplWitnessAccess, arg0: inst192, arg1: element0, type: type(symbolic_constant108)} +// CHECK:STDOUT: inst196: {kind: SpecificImplFunction, arg0: inst195, arg1: specific9, type: type(inst(SpecificFunctionType))} +// CHECK:STDOUT: inst197: {kind: RequireCompleteType, arg0: inst182, type: type(inst(WitnessType))} +// CHECK:STDOUT: inst198: {kind: RequireCompleteType, arg0: inst179, type: type(inst(WitnessType))} +// CHECK:STDOUT: inst199: {kind: LookupImplWitness, arg0: inst178, arg1: specific_interface0, type: type(inst(WitnessType))} +// CHECK:STDOUT: inst200: {kind: FacetValue, arg0: inst179, arg1: inst_block60, type: type(inst71)} +// CHECK:STDOUT: inst201: {kind: FunctionTypeWithSelfType, arg0: inst80, arg1: inst200, type: type(TypeType)} +// CHECK:STDOUT: inst202: {kind: ImplWitnessAccess, arg0: inst199, arg1: element0, type: type(symbolic_constant118)} +// CHECK:STDOUT: inst203: {kind: SpecificImplFunction, arg0: inst202, arg1: specific10, type: type(inst(SpecificFunctionType))} +// CHECK:STDOUT: inst204: {kind: RequireCompleteType, arg0: inst181, type: type(inst(WitnessType))} +// CHECK:STDOUT: inst205: {kind: LookupImplWitness, arg0: inst180, arg1: specific_interface0, type: type(inst(WitnessType))} +// CHECK:STDOUT: inst206: {kind: FacetValue, arg0: inst181, arg1: inst_block62, type: type(inst71)} +// CHECK:STDOUT: inst207: {kind: FunctionTypeWithSelfType, arg0: inst80, arg1: inst206, type: type(TypeType)} +// CHECK:STDOUT: inst208: {kind: ImplWitnessAccess, arg0: inst205, arg1: element0, type: type(symbolic_constant124)} +// CHECK:STDOUT: inst209: {kind: SpecificImplFunction, arg0: inst208, arg1: specific11, type: type(inst(SpecificFunctionType))} +// CHECK:STDOUT: inst210: {kind: PatternType, arg0: inst146, type: type(TypeType)} +// CHECK:STDOUT: inst211: {kind: PatternType, arg0: inst148, type: type(TypeType)} +// CHECK:STDOUT: inst212: {kind: LookupImplWitness, arg0: inst27, arg1: specific_interface0, type: type(inst(WitnessType))} +// CHECK:STDOUT: inst213: {kind: LookupImplWitness, arg0: inst28, arg1: specific_interface0, type: type(inst(WitnessType))} +// CHECK:STDOUT: inst214: {kind: FacetValue, arg0: inst27, arg1: inst_block69, type: type(inst71)} +// CHECK:STDOUT: inst215: {kind: FunctionTypeWithSelfType, arg0: inst80, arg1: inst214, type: type(TypeType)} +// CHECK:STDOUT: inst216: {kind: ImplWitnessAccess, arg0: inst212, arg1: element0, type: type(symbolic_constant136)} +// CHECK:STDOUT: inst217: {kind: ImplWitnessAccess, arg0: inst212, arg1: element0, type: type(symbolic_constant133)} +// CHECK:STDOUT: inst218: {kind: FacetValue, arg0: inst28, arg1: inst_block70, type: type(inst71)} +// CHECK:STDOUT: inst219: {kind: FunctionTypeWithSelfType, arg0: inst80, arg1: inst218, type: type(TypeType)} +// CHECK:STDOUT: inst220: {kind: ImplWitnessAccess, arg0: inst213, arg1: element0, type: type(symbolic_constant136)} +// CHECK:STDOUT: inst221: {kind: BoundMethod, arg0: inst63, arg1: inst216, type: type(inst(BoundMethodType))} +// CHECK:STDOUT: inst222: {kind: SpecificImplFunction, arg0: inst216, arg1: specific12, type: type(inst(SpecificFunctionType))} +// CHECK:STDOUT: inst223: {kind: SpecificImplFunction, arg0: inst217, arg1: specific12, type: type(inst(SpecificFunctionType))} +// CHECK:STDOUT: inst224: {kind: SpecificImplFunction, arg0: inst220, arg1: specific13, type: type(inst(SpecificFunctionType))} +// CHECK:STDOUT: inst225: {kind: BoundMethod, arg0: inst63, arg1: inst222, type: type(inst(BoundMethodType))} +// CHECK:STDOUT: inst226: {kind: RequireCompleteType, arg0: inst27, type: type(inst(WitnessType))} +// CHECK:STDOUT: inst227: {kind: Call, arg0: inst225, arg1: inst_block74, type: type(symbolic_constant4)} +// CHECK:STDOUT: inst228: {kind: InitializeFrom, arg0: inst227, arg1: inst67, type: type(symbolic_constant4)} +// CHECK:STDOUT: inst229: {kind: TupleAccess, arg0: inst52, arg1: element1, type: type(inst36)} +// CHECK:STDOUT: inst230: {kind: TupleInit, arg0: inst_block_empty, arg1: inst229, type: type(inst36)} +// CHECK:STDOUT: inst231: {kind: TupleValue, arg0: inst_block_empty, type: type(inst36)} +// CHECK:STDOUT: inst232: {kind: Converted, arg0: inst64, arg1: inst230, type: type(inst36)} +// CHECK:STDOUT: inst233: {kind: TupleInit, arg0: inst_block75, arg1: inst52, type: type(symbolic_constant8)} +// CHECK:STDOUT: inst234: {kind: Converted, arg0: inst65, arg1: inst233, type: type(symbolic_constant8)} +// CHECK:STDOUT: inst235: {kind: ReturnExpr, arg0: inst234, arg1: inst52} // CHECK:STDOUT: constant_values: // CHECK:STDOUT: values: // CHECK:STDOUT: inst14: concrete_constant(inst14) -// CHECK:STDOUT: inst15: concrete_constant(inst15) -// CHECK:STDOUT: inst16: symbolic_constant0 -// CHECK:STDOUT: inst17: symbolic_constant0 -// CHECK:STDOUT: inst18: symbolic_constant2 -// CHECK:STDOUT: inst19: symbolic_constant1 +// CHECK:STDOUT: inst16: concrete_constant(inst16) +// CHECK:STDOUT: inst17: concrete_constant(inst17) +// CHECK:STDOUT: inst18: symbolic_constant0 +// CHECK:STDOUT: inst19: symbolic_constant0 // CHECK:STDOUT: inst20: symbolic_constant2 -// CHECK:STDOUT: inst21: concrete_constant(inst21) -// CHECK:STDOUT: inst22: concrete_constant(inst22) -// CHECK:STDOUT: inst23: symbolic_constant2 -// CHECK:STDOUT: inst25: symbolic_constant3 -// CHECK:STDOUT: inst26: concrete_constant(inst26) -// CHECK:STDOUT: inst27: symbolic_constant4 -// CHECK:STDOUT: inst28: concrete_constant(inst28) -// CHECK:STDOUT: inst29: symbolic_constant2 -// CHECK:STDOUT: inst30: concrete_constant(inst30) -// CHECK:STDOUT: inst32: concrete_constant(inst32) -// CHECK:STDOUT: inst34: concrete_constant(inst34) -// CHECK:STDOUT: inst35: concrete_constant(inst30) -// CHECK:STDOUT: inst36: symbolic_constant5 -// CHECK:STDOUT: inst37: symbolic_constant6 -// CHECK:STDOUT: inst38: symbolic_constant6 -// CHECK:STDOUT: inst39: symbolic_constant7 +// CHECK:STDOUT: inst21: symbolic_constant1 +// CHECK:STDOUT: inst22: symbolic_constant2 +// CHECK:STDOUT: inst23: concrete_constant(inst23) +// CHECK:STDOUT: inst24: concrete_constant(inst24) +// CHECK:STDOUT: inst25: symbolic_constant2 +// CHECK:STDOUT: inst26: symbolic_constant4 +// CHECK:STDOUT: inst27: symbolic_constant3 +// CHECK:STDOUT: inst28: symbolic_constant4 +// CHECK:STDOUT: inst30: symbolic_constant5 +// CHECK:STDOUT: inst31: concrete_constant(inst31) +// CHECK:STDOUT: inst32: symbolic_constant6 +// CHECK:STDOUT: inst33: concrete_constant(inst33) +// CHECK:STDOUT: inst34: symbolic_constant2 +// CHECK:STDOUT: inst35: symbolic_constant4 +// CHECK:STDOUT: inst36: concrete_constant(inst36) +// CHECK:STDOUT: inst38: concrete_constant(inst38) // CHECK:STDOUT: inst40: concrete_constant(inst40) -// CHECK:STDOUT: inst41: symbolic_constant8 -// CHECK:STDOUT: inst42: concrete_constant(inst42) -// CHECK:STDOUT: inst46: concrete_constant(inst48) -// CHECK:STDOUT: inst47: concrete_constant(inst47) +// CHECK:STDOUT: inst41: concrete_constant(inst36) +// CHECK:STDOUT: inst42: symbolic_constant7 +// CHECK:STDOUT: inst43: symbolic_constant8 +// CHECK:STDOUT: inst44: symbolic_constant8 +// CHECK:STDOUT: inst45: symbolic_constant9 +// CHECK:STDOUT: inst46: concrete_constant(inst46) +// CHECK:STDOUT: inst47: symbolic_constant10 // CHECK:STDOUT: inst48: concrete_constant(inst48) -// CHECK:STDOUT: inst49: symbolic_constant9 -// CHECK:STDOUT: inst50: symbolic_constant11 -// CHECK:STDOUT: inst51: symbolic_constant10 -// CHECK:STDOUT: inst52: symbolic_constant11 -// CHECK:STDOUT: inst53: symbolic_constant13 -// CHECK:STDOUT: inst54: symbolic_constant12 -// CHECK:STDOUT: inst55: symbolic_constant13 -// CHECK:STDOUT: inst59: symbolic_constant11 -// CHECK:STDOUT: inst61: symbolic_constant13 -// CHECK:STDOUT: inst64: concrete_constant(inst65) -// CHECK:STDOUT: inst65: concrete_constant(inst65) -// CHECK:STDOUT: inst66: concrete_constant(inst65) +// CHECK:STDOUT: inst50: symbolic_constant4 +// CHECK:STDOUT: inst53: concrete_constant(inst55) +// CHECK:STDOUT: inst54: concrete_constant(inst54) +// CHECK:STDOUT: inst55: concrete_constant(inst55) +// CHECK:STDOUT: inst56: symbolic_constant11 +// CHECK:STDOUT: inst57: symbolic_constant13 +// CHECK:STDOUT: inst58: symbolic_constant12 +// CHECK:STDOUT: inst59: symbolic_constant13 +// CHECK:STDOUT: inst60: symbolic_constant15 +// CHECK:STDOUT: inst61: symbolic_constant14 +// CHECK:STDOUT: inst62: symbolic_constant15 +// CHECK:STDOUT: inst66: symbolic_constant13 +// CHECK:STDOUT: inst68: symbolic_constant15 +// CHECK:STDOUT: inst69: concrete_constant(inst71) +// CHECK:STDOUT: inst70: concrete_constant(inst71) +// CHECK:STDOUT: inst71: concrete_constant(inst71) +// CHECK:STDOUT: inst72: symbolic_constant16 +// CHECK:STDOUT: inst73: constant +// CHECK:STDOUT: inst74: concrete_constant(inst78) +// CHECK:STDOUT: inst75: constant +// CHECK:STDOUT: inst76: concrete_constant(inst76) +// CHECK:STDOUT: inst77: concrete_constant(inst81) +// CHECK:STDOUT: inst78: concrete_constant(inst78) +// CHECK:STDOUT: inst79: concrete_constant(inst81) +// CHECK:STDOUT: inst80: concrete_constant(inst80) +// CHECK:STDOUT: inst81: concrete_constant(inst81) +// CHECK:STDOUT: inst82: symbolic_constant17 +// CHECK:STDOUT: inst83: symbolic_constant18 +// CHECK:STDOUT: inst84: concrete_constant(inst84) +// CHECK:STDOUT: inst85: concrete_constant(inst85) +// CHECK:STDOUT: inst86: concrete_constant(inst86) +// CHECK:STDOUT: inst87: concrete_constant(inst87) +// CHECK:STDOUT: inst88: symbolic_constant16 +// CHECK:STDOUT: inst89: symbolic_constant22 +// CHECK:STDOUT: inst90: symbolic_constant23 +// CHECK:STDOUT: inst91: symbolic_constant24 +// CHECK:STDOUT: inst92: symbolic_constant131 +// CHECK:STDOUT: inst93: constant +// CHECK:STDOUT: inst94: concrete_constant(inst94) +// CHECK:STDOUT: inst95: concrete_constant(inst(BoolType)) +// CHECK:STDOUT: inst96: concrete_constant(inst71) +// CHECK:STDOUT: inst97: constant +// CHECK:STDOUT: inst98: concrete_constant(inst98) +// CHECK:STDOUT: inst99: concrete_constant(inst(CharLiteralType)) +// CHECK:STDOUT: inst100: concrete_constant(inst71) +// CHECK:STDOUT: inst101: constant +// CHECK:STDOUT: inst102: concrete_constant(inst102) +// CHECK:STDOUT: inst103: concrete_constant(inst(FloatLiteralType)) +// CHECK:STDOUT: inst104: concrete_constant(inst71) +// CHECK:STDOUT: inst105: constant +// CHECK:STDOUT: inst106: concrete_constant(inst106) +// CHECK:STDOUT: inst107: concrete_constant(inst(IntLiteralType)) +// CHECK:STDOUT: inst108: concrete_constant(inst71) +// CHECK:STDOUT: inst109: symbolic_constant129 +// CHECK:STDOUT: inst110: concrete_constant(inst110) +// CHECK:STDOUT: inst111: concrete_constant(inst111) +// CHECK:STDOUT: inst112: symbolic_constant26 +// CHECK:STDOUT: inst113: symbolic_constant25 +// CHECK:STDOUT: inst114: concrete_constant(inst71) +// CHECK:STDOUT: inst115: constant +// CHECK:STDOUT: inst116: concrete_constant(inst116) +// CHECK:STDOUT: inst117: symbolic_constant28 +// CHECK:STDOUT: inst118: symbolic_constant30 +// CHECK:STDOUT: inst119: symbolic_constant31 +// CHECK:STDOUT: inst120: symbolic_constant32 +// CHECK:STDOUT: inst121: symbolic_constant35 +// CHECK:STDOUT: inst122: symbolic_constant33 +// CHECK:STDOUT: inst123: symbolic_constant34 +// CHECK:STDOUT: inst124: concrete_constant(inst124) +// CHECK:STDOUT: inst125: concrete_constant(inst125) +// CHECK:STDOUT: inst126: concrete_constant(inst126) +// CHECK:STDOUT: inst127: concrete_constant(inst127) +// CHECK:STDOUT: inst128: symbolic_constant26 +// CHECK:STDOUT: inst129: symbolic_constant40 +// CHECK:STDOUT: inst130: symbolic_constant41 +// CHECK:STDOUT: inst131: symbolic_constant42 +// CHECK:STDOUT: inst132: symbolic_constant45 +// CHECK:STDOUT: inst133: symbolic_constant46 +// CHECK:STDOUT: inst134: symbolic_constant47 +// CHECK:STDOUT: inst135: constant +// CHECK:STDOUT: inst136: concrete_constant(inst136) +// CHECK:STDOUT: inst137: concrete_constant(inst(TypeType)) +// CHECK:STDOUT: inst138: concrete_constant(inst71) +// CHECK:STDOUT: inst139: constant +// CHECK:STDOUT: inst140: concrete_constant(inst140) +// CHECK:STDOUT: inst141: concrete_constant(inst36) +// CHECK:STDOUT: inst142: concrete_constant(inst71) +// CHECK:STDOUT: inst143: constant +// CHECK:STDOUT: inst144: concrete_constant(inst144) +// CHECK:STDOUT: inst145: symbolic_constant48 +// CHECK:STDOUT: inst146: symbolic_constant49 +// CHECK:STDOUT: inst147: symbolic_constant50 +// CHECK:STDOUT: inst148: symbolic_constant51 +// CHECK:STDOUT: inst149: symbolic_constant52 +// CHECK:STDOUT: inst150: concrete_constant(inst150) +// CHECK:STDOUT: inst151: concrete_constant(inst151) +// CHECK:STDOUT: inst152: concrete_constant(inst152) +// CHECK:STDOUT: inst153: symbolic_constant54 +// CHECK:STDOUT: inst154: symbolic_constant55 +// CHECK:STDOUT: inst155: symbolic_constant53 +// CHECK:STDOUT: inst156: concrete_constant(inst71) +// CHECK:STDOUT: inst157: constant +// CHECK:STDOUT: inst158: concrete_constant(inst158) +// CHECK:STDOUT: inst159: symbolic_constant60 +// CHECK:STDOUT: inst160: symbolic_constant62 +// CHECK:STDOUT: inst161: symbolic_constant63 +// CHECK:STDOUT: inst162: symbolic_constant64 +// CHECK:STDOUT: inst163: symbolic_constant65 +// CHECK:STDOUT: inst164: symbolic_constant66 +// CHECK:STDOUT: inst165: symbolic_constant67 +// CHECK:STDOUT: inst166: symbolic_constant70 +// CHECK:STDOUT: inst167: symbolic_constant68 +// CHECK:STDOUT: inst168: symbolic_constant69 +// CHECK:STDOUT: inst169: symbolic_constant72 +// CHECK:STDOUT: inst170: concrete_constant(inst170) +// CHECK:STDOUT: inst171: concrete_constant(inst171) +// CHECK:STDOUT: inst172: concrete_constant(inst172) +// CHECK:STDOUT: inst173: concrete_constant(inst173) +// CHECK:STDOUT: inst174: symbolic_constant54 +// CHECK:STDOUT: inst175: symbolic_constant55 +// CHECK:STDOUT: inst176: symbolic_constant75 +// CHECK:STDOUT: inst177: symbolic_constant76 +// CHECK:STDOUT: inst178: symbolic_constant82 +// CHECK:STDOUT: inst179: symbolic_constant83 +// CHECK:STDOUT: inst180: symbolic_constant84 +// CHECK:STDOUT: inst181: symbolic_constant85 +// CHECK:STDOUT: inst182: symbolic_constant86 +// CHECK:STDOUT: inst183: symbolic_constant87 +// CHECK:STDOUT: inst184: symbolic_constant88 +// CHECK:STDOUT: inst185: symbolic_constant90 +// CHECK:STDOUT: inst186: symbolic_constant92 +// CHECK:STDOUT: inst187: symbolic_constant94 +// CHECK:STDOUT: inst188: symbolic_constant96 +// CHECK:STDOUT: inst189: symbolic_constant98 +// CHECK:STDOUT: inst190: symbolic_constant100 +// CHECK:STDOUT: inst191: symbolic_constant102 +// CHECK:STDOUT: inst192: symbolic_constant104 +// CHECK:STDOUT: inst193: symbolic_constant106 +// CHECK:STDOUT: inst194: symbolic_constant108 +// CHECK:STDOUT: inst195: symbolic_constant110 +// CHECK:STDOUT: inst196: symbolic_constant112 +// CHECK:STDOUT: inst197: symbolic_constant114 +// CHECK:STDOUT: inst198: symbolic_constant115 +// CHECK:STDOUT: inst199: symbolic_constant116 +// CHECK:STDOUT: inst200: symbolic_constant117 +// CHECK:STDOUT: inst201: symbolic_constant118 +// CHECK:STDOUT: inst202: symbolic_constant119 +// CHECK:STDOUT: inst203: symbolic_constant120 +// CHECK:STDOUT: inst204: symbolic_constant121 +// CHECK:STDOUT: inst205: symbolic_constant122 +// CHECK:STDOUT: inst206: symbolic_constant123 +// CHECK:STDOUT: inst207: symbolic_constant124 +// CHECK:STDOUT: inst208: symbolic_constant125 +// CHECK:STDOUT: inst209: symbolic_constant126 +// CHECK:STDOUT: inst210: symbolic_constant127 +// CHECK:STDOUT: inst211: symbolic_constant128 +// CHECK:STDOUT: inst212: symbolic_constant130 +// CHECK:STDOUT: inst213: symbolic_constant131 +// CHECK:STDOUT: inst214: symbolic_constant132 +// CHECK:STDOUT: inst215: symbolic_constant133 +// CHECK:STDOUT: inst216: symbolic_constant137 +// CHECK:STDOUT: inst217: symbolic_constant134 +// CHECK:STDOUT: inst218: symbolic_constant135 +// CHECK:STDOUT: inst219: symbolic_constant136 +// CHECK:STDOUT: inst220: symbolic_constant137 +// CHECK:STDOUT: inst222: symbolic_constant139 +// CHECK:STDOUT: inst223: symbolic_constant138 +// CHECK:STDOUT: inst224: symbolic_constant139 +// CHECK:STDOUT: inst226: symbolic_constant15 +// CHECK:STDOUT: inst230: concrete_constant(inst231) +// CHECK:STDOUT: inst231: concrete_constant(inst231) +// CHECK:STDOUT: inst232: concrete_constant(inst231) // CHECK:STDOUT: symbolic_constants: -// CHECK:STDOUT: symbolic_constant0: {inst: inst17, generic: generic, index: generic_inst, kind: self} -// CHECK:STDOUT: symbolic_constant1: {inst: inst19, generic: generic, index: generic_inst, kind: checked} -// CHECK:STDOUT: symbolic_constant2: {inst: inst19, generic: generic0, index: generic_inst_in_decl0, kind: checked} -// CHECK:STDOUT: symbolic_constant3: {inst: inst25, generic: generic, index: generic_inst, kind: checked} -// CHECK:STDOUT: symbolic_constant4: {inst: inst25, generic: generic0, index: generic_inst_in_decl1, kind: checked} -// CHECK:STDOUT: symbolic_constant5: {inst: inst36, generic: generic, index: generic_inst, kind: checked} -// CHECK:STDOUT: symbolic_constant6: {inst: inst36, generic: generic0, index: generic_inst_in_decl2, kind: checked} -// CHECK:STDOUT: symbolic_constant7: {inst: inst39, generic: generic, index: generic_inst, kind: checked} -// CHECK:STDOUT: symbolic_constant8: {inst: inst39, generic: generic0, index: generic_inst_in_decl3, kind: checked} -// CHECK:STDOUT: symbolic_constant9: {inst: inst49, generic: generic, index: generic_inst, kind: checked} -// CHECK:STDOUT: symbolic_constant10: {inst: inst51, generic: generic, index: generic_inst, kind: checked} -// CHECK:STDOUT: symbolic_constant11: {inst: inst51, generic: generic0, index: generic_inst_in_def0, kind: checked} -// CHECK:STDOUT: symbolic_constant12: {inst: inst54, generic: generic, index: generic_inst, kind: checked} -// CHECK:STDOUT: symbolic_constant13: {inst: inst54, generic: generic0, index: generic_inst_in_def1, kind: checked} +// CHECK:STDOUT: symbolic_constant0: {inst: inst19, generic: generic, index: generic_inst, kind: self} +// CHECK:STDOUT: symbolic_constant1: {inst: inst21, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant2: {inst: inst21, generic: generic0, index: generic_inst_in_decl0, kind: checked} +// CHECK:STDOUT: symbolic_constant3: {inst: inst27, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant4: {inst: inst27, generic: generic0, index: generic_inst_in_decl1, kind: checked} +// CHECK:STDOUT: symbolic_constant5: {inst: inst30, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant6: {inst: inst30, generic: generic0, index: generic_inst_in_decl2, kind: checked} +// CHECK:STDOUT: symbolic_constant7: {inst: inst42, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant8: {inst: inst42, generic: generic0, index: generic_inst_in_decl3, kind: checked} +// CHECK:STDOUT: symbolic_constant9: {inst: inst45, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant10: {inst: inst45, generic: generic0, index: generic_inst_in_decl4, kind: checked} +// CHECK:STDOUT: symbolic_constant11: {inst: inst56, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant12: {inst: inst58, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant13: {inst: inst58, generic: generic0, index: generic_inst_in_def0, kind: checked} +// CHECK:STDOUT: symbolic_constant14: {inst: inst61, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant15: {inst: inst61, generic: generic0, index: generic_inst_in_def1, kind: checked} +// CHECK:STDOUT: symbolic_constant16: {inst: inst72, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant17: {inst: inst82, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant18: {inst: inst83, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant19: {inst: inst83, generic: generic1, index: generic_inst_in_decl2, kind: checked} +// CHECK:STDOUT: symbolic_constant20: {inst: inst72, generic: generic1, index: generic_inst_in_decl0, kind: checked} +// CHECK:STDOUT: symbolic_constant21: {inst: inst82, generic: generic1, index: generic_inst_in_decl1, kind: checked} +// CHECK:STDOUT: symbolic_constant22: {inst: inst72, generic: generic1, index: generic_inst_in_decl0, kind: checked} +// CHECK:STDOUT: symbolic_constant23: {inst: inst82, generic: generic1, index: generic_inst_in_decl1, kind: checked} +// CHECK:STDOUT: symbolic_constant24: {inst: inst83, generic: generic1, index: generic_inst_in_decl2, kind: checked} +// CHECK:STDOUT: symbolic_constant25: {inst: inst27, generic: generic2, index: generic_inst_in_decl1, kind: checked} +// CHECK:STDOUT: symbolic_constant26: {inst: inst21, generic: generic2, index: generic_inst_in_decl0, kind: checked} +// CHECK:STDOUT: symbolic_constant27: {inst: inst21, generic: generic2, index: generic_inst_in_decl0, kind: checked} +// CHECK:STDOUT: symbolic_constant28: {inst: inst117, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant29: {inst: inst117, generic: generic2, index: generic_inst_in_decl2, kind: checked} +// CHECK:STDOUT: symbolic_constant30: {inst: inst21, generic: generic2, index: generic_inst_in_decl0, kind: checked} +// CHECK:STDOUT: symbolic_constant31: {inst: inst27, generic: generic2, index: generic_inst_in_decl1, kind: checked} +// CHECK:STDOUT: symbolic_constant32: {inst: inst117, generic: generic2, index: generic_inst_in_decl2, kind: checked} +// CHECK:STDOUT: symbolic_constant33: {inst: inst122, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant34: {inst: inst123, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant35: {inst: inst123, generic: generic2, index: generic_inst_in_def1, kind: checked} +// CHECK:STDOUT: symbolic_constant36: {inst: inst122, generic: generic2, index: generic_inst_in_def0, kind: checked} +// CHECK:STDOUT: symbolic_constant37: {inst: inst30, generic: generic3, index: generic_inst_in_decl2, kind: checked} +// CHECK:STDOUT: symbolic_constant38: {inst: inst123, generic: generic2, index: generic_inst_in_def1, kind: checked} +// CHECK:STDOUT: symbolic_constant39: {inst: inst61, generic: generic2, index: generic_inst_in_def2, kind: checked} +// CHECK:STDOUT: symbolic_constant40: {inst: inst122, generic: generic2, index: generic_inst_in_def0, kind: checked} +// CHECK:STDOUT: symbolic_constant41: {inst: inst123, generic: generic2, index: generic_inst_in_def1, kind: checked} +// CHECK:STDOUT: symbolic_constant42: {inst: inst61, generic: generic2, index: generic_inst_in_def2, kind: checked} +// CHECK:STDOUT: symbolic_constant43: {inst: inst21, generic: generic3, index: generic_inst_in_decl0, kind: checked} +// CHECK:STDOUT: symbolic_constant44: {inst: inst27, generic: generic3, index: generic_inst_in_decl1, kind: checked} +// CHECK:STDOUT: symbolic_constant45: {inst: inst21, generic: generic3, index: generic_inst_in_decl0, kind: checked} +// CHECK:STDOUT: symbolic_constant46: {inst: inst27, generic: generic3, index: generic_inst_in_decl1, kind: checked} +// CHECK:STDOUT: symbolic_constant47: {inst: inst30, generic: generic3, index: generic_inst_in_decl2, kind: checked} +// CHECK:STDOUT: symbolic_constant48: {inst: inst145, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant49: {inst: inst146, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant50: {inst: inst147, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant51: {inst: inst148, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant52: {inst: inst149, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant53: {inst: inst149, generic: generic4, index: generic_inst_in_decl4, kind: checked} +// CHECK:STDOUT: symbolic_constant54: {inst: inst147, generic: generic4, index: generic_inst_in_decl0, kind: checked} +// CHECK:STDOUT: symbolic_constant55: {inst: inst145, generic: generic4, index: generic_inst_in_decl1, kind: checked} +// CHECK:STDOUT: symbolic_constant56: {inst: inst147, generic: generic4, index: generic_inst_in_decl0, kind: checked} +// CHECK:STDOUT: symbolic_constant57: {inst: inst145, generic: generic4, index: generic_inst_in_decl1, kind: checked} +// CHECK:STDOUT: symbolic_constant58: {inst: inst148, generic: generic4, index: generic_inst_in_decl2, kind: checked} +// CHECK:STDOUT: symbolic_constant59: {inst: inst146, generic: generic4, index: generic_inst_in_decl3, kind: checked} +// CHECK:STDOUT: symbolic_constant60: {inst: inst159, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant61: {inst: inst159, generic: generic4, index: generic_inst_in_decl5, kind: checked} +// CHECK:STDOUT: symbolic_constant62: {inst: inst147, generic: generic4, index: generic_inst_in_decl0, kind: checked} +// CHECK:STDOUT: symbolic_constant63: {inst: inst145, generic: generic4, index: generic_inst_in_decl1, kind: checked} +// CHECK:STDOUT: symbolic_constant64: {inst: inst148, generic: generic4, index: generic_inst_in_decl2, kind: checked} +// CHECK:STDOUT: symbolic_constant65: {inst: inst146, generic: generic4, index: generic_inst_in_decl3, kind: checked} +// CHECK:STDOUT: symbolic_constant66: {inst: inst149, generic: generic4, index: generic_inst_in_decl4, kind: checked} +// CHECK:STDOUT: symbolic_constant67: {inst: inst159, generic: generic4, index: generic_inst_in_decl5, kind: checked} +// CHECK:STDOUT: symbolic_constant68: {inst: inst167, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant69: {inst: inst168, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant70: {inst: inst168, generic: generic4, index: generic_inst_in_def1, kind: checked} +// CHECK:STDOUT: symbolic_constant71: {inst: inst167, generic: generic4, index: generic_inst_in_def0, kind: checked} +// CHECK:STDOUT: symbolic_constant72: {inst: inst169, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant73: {inst: inst169, generic: generic5, index: generic_inst_in_decl5, kind: checked} +// CHECK:STDOUT: symbolic_constant74: {inst: inst168, generic: generic4, index: generic_inst_in_def1, kind: checked} +// CHECK:STDOUT: symbolic_constant75: {inst: inst167, generic: generic4, index: generic_inst_in_def0, kind: checked} +// CHECK:STDOUT: symbolic_constant76: {inst: inst168, generic: generic4, index: generic_inst_in_def1, kind: checked} +// CHECK:STDOUT: symbolic_constant77: {inst: inst147, generic: generic5, index: generic_inst_in_decl0, kind: checked} +// CHECK:STDOUT: symbolic_constant78: {inst: inst148, generic: generic5, index: generic_inst_in_decl1, kind: checked} +// CHECK:STDOUT: symbolic_constant79: {inst: inst145, generic: generic5, index: generic_inst_in_decl2, kind: checked} +// CHECK:STDOUT: symbolic_constant80: {inst: inst146, generic: generic5, index: generic_inst_in_decl3, kind: checked} +// CHECK:STDOUT: symbolic_constant81: {inst: inst149, generic: generic5, index: generic_inst_in_decl4, kind: checked} +// CHECK:STDOUT: symbolic_constant82: {inst: inst147, generic: generic5, index: generic_inst_in_decl0, kind: checked} +// CHECK:STDOUT: symbolic_constant83: {inst: inst148, generic: generic5, index: generic_inst_in_decl1, kind: checked} +// CHECK:STDOUT: symbolic_constant84: {inst: inst145, generic: generic5, index: generic_inst_in_decl2, kind: checked} +// CHECK:STDOUT: symbolic_constant85: {inst: inst146, generic: generic5, index: generic_inst_in_decl3, kind: checked} +// CHECK:STDOUT: symbolic_constant86: {inst: inst149, generic: generic5, index: generic_inst_in_decl4, kind: checked} +// CHECK:STDOUT: symbolic_constant87: {inst: inst169, generic: generic5, index: generic_inst_in_decl5, kind: checked} +// CHECK:STDOUT: symbolic_constant88: {inst: inst184, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant89: {inst: inst184, generic: generic5, index: generic_inst_in_def0, kind: checked} +// CHECK:STDOUT: symbolic_constant90: {inst: inst185, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant91: {inst: inst185, generic: generic5, index: generic_inst_in_def1, kind: checked} +// CHECK:STDOUT: symbolic_constant92: {inst: inst186, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant93: {inst: inst186, generic: generic5, index: generic_inst_in_def2, kind: checked} +// CHECK:STDOUT: symbolic_constant94: {inst: inst187, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant95: {inst: inst187, generic: generic5, index: generic_inst_in_def3, kind: checked} +// CHECK:STDOUT: symbolic_constant96: {inst: inst188, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant97: {inst: inst188, generic: generic5, index: generic_inst_in_def4, kind: checked} +// CHECK:STDOUT: symbolic_constant98: {inst: inst189, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant99: {inst: inst189, generic: generic5, index: generic_inst_in_def5, kind: checked} +// CHECK:STDOUT: symbolic_constant100: {inst: inst190, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant101: {inst: inst190, generic: generic5, index: generic_inst_in_def6, kind: checked} +// CHECK:STDOUT: symbolic_constant102: {inst: inst191, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant103: {inst: inst191, generic: generic5, index: generic_inst_in_def7, kind: checked} +// CHECK:STDOUT: symbolic_constant104: {inst: inst192, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant105: {inst: inst192, generic: generic5, index: generic_inst_in_def8, kind: checked} +// CHECK:STDOUT: symbolic_constant106: {inst: inst193, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant107: {inst: inst193, generic: generic5, index: generic_inst_in_def9, kind: checked} +// CHECK:STDOUT: symbolic_constant108: {inst: inst194, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant109: {inst: inst194, generic: generic5, index: generic_inst_in_def10, kind: checked} +// CHECK:STDOUT: symbolic_constant110: {inst: inst195, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant111: {inst: inst195, generic: generic5, index: generic_inst_in_def11, kind: checked} +// CHECK:STDOUT: symbolic_constant112: {inst: inst196, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant113: {inst: inst196, generic: generic5, index: generic_inst_in_def12, kind: checked} +// CHECK:STDOUT: symbolic_constant114: {inst: inst184, generic: generic5, index: generic_inst_in_def0, kind: checked} +// CHECK:STDOUT: symbolic_constant115: {inst: inst185, generic: generic5, index: generic_inst_in_def1, kind: checked} +// CHECK:STDOUT: symbolic_constant116: {inst: inst186, generic: generic5, index: generic_inst_in_def2, kind: checked} +// CHECK:STDOUT: symbolic_constant117: {inst: inst187, generic: generic5, index: generic_inst_in_def3, kind: checked} +// CHECK:STDOUT: symbolic_constant118: {inst: inst188, generic: generic5, index: generic_inst_in_def4, kind: checked} +// CHECK:STDOUT: symbolic_constant119: {inst: inst189, generic: generic5, index: generic_inst_in_def5, kind: checked} +// CHECK:STDOUT: symbolic_constant120: {inst: inst190, generic: generic5, index: generic_inst_in_def6, kind: checked} +// CHECK:STDOUT: symbolic_constant121: {inst: inst191, generic: generic5, index: generic_inst_in_def7, kind: checked} +// CHECK:STDOUT: symbolic_constant122: {inst: inst192, generic: generic5, index: generic_inst_in_def8, kind: checked} +// CHECK:STDOUT: symbolic_constant123: {inst: inst193, generic: generic5, index: generic_inst_in_def9, kind: checked} +// CHECK:STDOUT: symbolic_constant124: {inst: inst194, generic: generic5, index: generic_inst_in_def10, kind: checked} +// CHECK:STDOUT: symbolic_constant125: {inst: inst195, generic: generic5, index: generic_inst_in_def11, kind: checked} +// CHECK:STDOUT: symbolic_constant126: {inst: inst196, generic: generic5, index: generic_inst_in_def12, kind: checked} +// CHECK:STDOUT: symbolic_constant127: {inst: inst210, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant128: {inst: inst211, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant129: {inst: inst117, generic: generic2, index: generic_inst_in_decl2, kind: checked} +// CHECK:STDOUT: symbolic_constant130: {inst: inst212, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant131: {inst: inst212, generic: generic0, index: generic_inst_in_def2, kind: checked} +// CHECK:STDOUT: symbolic_constant132: {inst: inst214, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant133: {inst: inst215, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant134: {inst: inst217, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant135: {inst: inst214, generic: generic0, index: generic_inst_in_def3, kind: checked} +// CHECK:STDOUT: symbolic_constant136: {inst: inst215, generic: generic0, index: generic_inst_in_def4, kind: checked} +// CHECK:STDOUT: symbolic_constant137: {inst: inst217, generic: generic0, index: generic_inst_in_def5, kind: checked} +// CHECK:STDOUT: symbolic_constant138: {inst: inst223, generic: generic, index: generic_inst, kind: checked} +// CHECK:STDOUT: symbolic_constant139: {inst: inst223, generic: generic0, index: generic_inst_in_def6, kind: checked} // CHECK:STDOUT: inst_blocks: // CHECK:STDOUT: inst_block_empty: {} // CHECK:STDOUT: exports: -// CHECK:STDOUT: 0: inst46 -// CHECK:STDOUT: imports: {} +// CHECK:STDOUT: 0: inst53 +// CHECK:STDOUT: imports: +// CHECK:STDOUT: 0: inst16 +// CHECK:STDOUT: 1: inst69 +// CHECK:STDOUT: 2: inst70 +// CHECK:STDOUT: 3: inst73 +// CHECK:STDOUT: 4: inst74 +// CHECK:STDOUT: 5: inst75 +// CHECK:STDOUT: 6: inst77 +// CHECK:STDOUT: 7: inst79 +// CHECK:STDOUT: 8: inst84 +// CHECK:STDOUT: 9: inst85 +// CHECK:STDOUT: 10: inst86 +// CHECK:STDOUT: 11: inst87 +// CHECK:STDOUT: 12: inst88 +// CHECK:STDOUT: 13: inst93 +// CHECK:STDOUT: 14: inst94 +// CHECK:STDOUT: 15: inst95 +// CHECK:STDOUT: 16: inst96 +// CHECK:STDOUT: 17: inst97 +// CHECK:STDOUT: 18: inst98 +// CHECK:STDOUT: 19: inst99 +// CHECK:STDOUT: 20: inst100 +// CHECK:STDOUT: 21: inst101 +// CHECK:STDOUT: 22: inst102 +// CHECK:STDOUT: 23: inst103 +// CHECK:STDOUT: 24: inst104 +// CHECK:STDOUT: 25: inst105 +// CHECK:STDOUT: 26: inst106 +// CHECK:STDOUT: 27: inst107 +// CHECK:STDOUT: 28: inst108 +// CHECK:STDOUT: 29: inst109 +// CHECK:STDOUT: 30: inst110 +// CHECK:STDOUT: 31: inst111 +// CHECK:STDOUT: 32: inst112 +// CHECK:STDOUT: 33: inst113 +// CHECK:STDOUT: 34: inst114 +// CHECK:STDOUT: 35: inst115 +// CHECK:STDOUT: 36: inst116 +// CHECK:STDOUT: 37: inst121 +// CHECK:STDOUT: 38: inst124 +// CHECK:STDOUT: 39: inst125 +// CHECK:STDOUT: 40: inst126 +// CHECK:STDOUT: 41: inst127 +// CHECK:STDOUT: 42: inst128 +// CHECK:STDOUT: 43: inst135 +// CHECK:STDOUT: 44: inst136 +// CHECK:STDOUT: 45: inst137 +// CHECK:STDOUT: 46: inst138 +// CHECK:STDOUT: 47: inst139 +// CHECK:STDOUT: 48: inst140 +// CHECK:STDOUT: 49: inst141 +// CHECK:STDOUT: 50: inst142 +// CHECK:STDOUT: 51: inst143 +// CHECK:STDOUT: 52: inst144 +// CHECK:STDOUT: 53: inst151 +// CHECK:STDOUT: 54: inst152 +// CHECK:STDOUT: 55: inst153 +// CHECK:STDOUT: 56: inst154 +// CHECK:STDOUT: 57: inst155 +// CHECK:STDOUT: 58: inst156 +// CHECK:STDOUT: 59: inst157 +// CHECK:STDOUT: 60: inst158 +// CHECK:STDOUT: 61: inst166 +// CHECK:STDOUT: 62: inst170 +// CHECK:STDOUT: 63: inst171 +// CHECK:STDOUT: 64: inst172 +// CHECK:STDOUT: 65: inst173 +// CHECK:STDOUT: 66: inst174 +// CHECK:STDOUT: 67: inst175 // CHECK:STDOUT: global_init: {} // CHECK:STDOUT: inst_block4: -// CHECK:STDOUT: 0: inst16 +// CHECK:STDOUT: 0: inst18 // CHECK:STDOUT: inst_block5: -// CHECK:STDOUT: 0: inst22 +// CHECK:STDOUT: 0: inst24 // CHECK:STDOUT: inst_block6: -// CHECK:STDOUT: 0: inst23 +// CHECK:STDOUT: 0: inst25 +// CHECK:STDOUT: 1: inst26 // CHECK:STDOUT: inst_block7: -// CHECK:STDOUT: 0: inst28 +// CHECK:STDOUT: 0: inst33 // CHECK:STDOUT: inst_block8: -// CHECK:STDOUT: 0: inst29 -// CHECK:STDOUT: 1: inst31 +// CHECK:STDOUT: 0: inst35 +// CHECK:STDOUT: 1: inst37 // CHECK:STDOUT: inst_block9: // CHECK:STDOUT: 0: inst(TypeType) -// CHECK:STDOUT: 1: inst30 +// CHECK:STDOUT: 1: inst36 // CHECK:STDOUT: inst_block10: -// CHECK:STDOUT: 0: inst29 -// CHECK:STDOUT: 1: inst35 +// CHECK:STDOUT: 0: inst35 +// CHECK:STDOUT: 1: inst41 // CHECK:STDOUT: inst_block11: -// CHECK:STDOUT: 0: inst19 -// CHECK:STDOUT: 1: inst30 +// CHECK:STDOUT: 0: inst27 +// CHECK:STDOUT: 1: inst36 // CHECK:STDOUT: inst_block12: -// CHECK:STDOUT: 0: inst20 -// CHECK:STDOUT: 1: inst30 +// CHECK:STDOUT: 0: inst28 +// CHECK:STDOUT: 1: inst36 // CHECK:STDOUT: inst_block13: -// CHECK:STDOUT: 0: inst43 -// CHECK:STDOUT: 1: inst44 +// CHECK:STDOUT: 0: inst49 +// CHECK:STDOUT: 1: inst51 // CHECK:STDOUT: inst_block14: -// CHECK:STDOUT: 0: inst22 -// CHECK:STDOUT: 1: inst26 -// CHECK:STDOUT: 2: inst28 -// CHECK:STDOUT: 3: inst40 -// CHECK:STDOUT: 4: inst42 -// CHECK:STDOUT: inst_block15: -// CHECK:STDOUT: 0: inst29 +// CHECK:STDOUT: 0: inst24 // CHECK:STDOUT: 1: inst31 // CHECK:STDOUT: 2: inst33 -// CHECK:STDOUT: 3: inst35 -// CHECK:STDOUT: 4: inst37 -// CHECK:STDOUT: 5: inst16 -// CHECK:STDOUT: 6: inst18 -// CHECK:STDOUT: 7: inst43 -// CHECK:STDOUT: 8: inst23 -// CHECK:STDOUT: 9: inst24 -// CHECK:STDOUT: 10: inst44 -// CHECK:STDOUT: 11: inst45 -// CHECK:STDOUT: inst_block16: -// CHECK:STDOUT: 0: inst18 -// CHECK:STDOUT: inst_block17: -// CHECK:STDOUT: 0: inst19 -// CHECK:STDOUT: inst_block18: -// CHECK:STDOUT: 0: inst20 -// CHECK:STDOUT: 1: inst27 -// CHECK:STDOUT: 2: inst38 -// CHECK:STDOUT: 3: inst41 -// CHECK:STDOUT: inst_block19: -// CHECK:STDOUT: 0: inst19 -// CHECK:STDOUT: 1: inst25 -// CHECK:STDOUT: 2: inst36 +// CHECK:STDOUT: 3: inst46 +// CHECK:STDOUT: 4: inst48 +// CHECK:STDOUT: inst_block15: +// CHECK:STDOUT: 0: inst34 +// CHECK:STDOUT: 1: inst35 +// CHECK:STDOUT: 2: inst37 // CHECK:STDOUT: 3: inst39 +// CHECK:STDOUT: 4: inst41 +// CHECK:STDOUT: 5: inst43 +// CHECK:STDOUT: 6: inst18 +// CHECK:STDOUT: 7: inst20 +// CHECK:STDOUT: 8: inst49 +// CHECK:STDOUT: 9: inst50 +// CHECK:STDOUT: 10: inst29 +// CHECK:STDOUT: 11: inst51 +// CHECK:STDOUT: 12: inst52 +// CHECK:STDOUT: inst_block16: +// CHECK:STDOUT: 0: inst20 +// CHECK:STDOUT: inst_block17: +// CHECK:STDOUT: 0: inst21 +// CHECK:STDOUT: inst_block18: +// CHECK:STDOUT: 0: inst22 +// CHECK:STDOUT: 1: inst28 +// CHECK:STDOUT: 2: inst32 +// CHECK:STDOUT: 3: inst44 +// CHECK:STDOUT: 4: inst47 +// CHECK:STDOUT: inst_block19: +// CHECK:STDOUT: 0: inst21 +// CHECK:STDOUT: 1: inst27 +// CHECK:STDOUT: 2: inst30 +// CHECK:STDOUT: 3: inst42 +// CHECK:STDOUT: 4: inst45 // CHECK:STDOUT: inst_block20: -// CHECK:STDOUT: 0: inst56 -// CHECK:STDOUT: 1: inst57 -// CHECK:STDOUT: 2: inst58 -// CHECK:STDOUT: 3: inst60 -// CHECK:STDOUT: 4: inst62 -// CHECK:STDOUT: 5: inst63 -// CHECK:STDOUT: 6: inst64 -// CHECK:STDOUT: 7: inst66 +// CHECK:STDOUT: 0: inst63 +// CHECK:STDOUT: 1: inst64 +// CHECK:STDOUT: 2: inst65 +// CHECK:STDOUT: 3: inst216 +// CHECK:STDOUT: 4: inst221 +// CHECK:STDOUT: 5: inst222 +// CHECK:STDOUT: 6: inst225 +// CHECK:STDOUT: 7: inst227 // CHECK:STDOUT: 8: inst67 -// CHECK:STDOUT: 9: inst68 -// CHECK:STDOUT: 10: inst69 +// CHECK:STDOUT: 9: inst228 +// CHECK:STDOUT: 10: inst229 +// CHECK:STDOUT: 11: inst230 +// CHECK:STDOUT: 12: inst232 +// CHECK:STDOUT: 13: inst233 +// CHECK:STDOUT: 14: inst234 +// CHECK:STDOUT: 15: inst235 // CHECK:STDOUT: inst_block21: -// CHECK:STDOUT: 0: inst56 -// CHECK:STDOUT: 1: inst57 +// CHECK:STDOUT: 0: inst63 +// CHECK:STDOUT: 1: inst64 // CHECK:STDOUT: inst_block22: -// CHECK:STDOUT: 0: inst62 -// CHECK:STDOUT: 1: inst66 +// CHECK:STDOUT: 0: inst75 // CHECK:STDOUT: inst_block23: -// CHECK:STDOUT: 0: inst52 -// CHECK:STDOUT: 1: inst55 +// CHECK:STDOUT: 0: inst87 // CHECK:STDOUT: inst_block24: +// CHECK:STDOUT: 0: inst88 +// CHECK:STDOUT: inst_block25: +// CHECK:STDOUT: 0: inst89 +// CHECK:STDOUT: 1: inst90 +// CHECK:STDOUT: 2: inst91 +// CHECK:STDOUT: inst_block26: +// CHECK:STDOUT: 0: inst72 +// CHECK:STDOUT: inst_block27: +// CHECK:STDOUT: 0: inst72 +// CHECK:STDOUT: 1: inst82 +// CHECK:STDOUT: 2: inst83 +// CHECK:STDOUT: inst_block28: +// CHECK:STDOUT: 0: inst111 +// CHECK:STDOUT: inst_block29: +// CHECK:STDOUT: 0: inst112 +// CHECK:STDOUT: inst_block30: +// CHECK:STDOUT: 0: inst115 +// CHECK:STDOUT: inst_block31: +// CHECK:STDOUT: 0: inst118 +// CHECK:STDOUT: inst_block32: +// CHECK:STDOUT: 0: inst118 +// CHECK:STDOUT: 1: inst119 +// CHECK:STDOUT: 2: inst120 +// CHECK:STDOUT: inst_block33: +// CHECK:STDOUT: 0: inst21 +// CHECK:STDOUT: 1: inst27 +// CHECK:STDOUT: 2: inst117 +// CHECK:STDOUT: inst_block34: +// CHECK:STDOUT: 0: inst127 +// CHECK:STDOUT: inst_block35: +// CHECK:STDOUT: 0: inst128 +// CHECK:STDOUT: inst_block36: +// CHECK:STDOUT: 0: inst118 +// CHECK:STDOUT: inst_block37: +// CHECK:STDOUT: 0: inst129 +// CHECK:STDOUT: 1: inst130 +// CHECK:STDOUT: 2: inst131 +// CHECK:STDOUT: inst_block38: +// CHECK:STDOUT: 0: inst132 +// CHECK:STDOUT: 1: inst133 +// CHECK:STDOUT: 2: inst134 +// CHECK:STDOUT: inst_block39: +// CHECK:STDOUT: 0: inst21 +// CHECK:STDOUT: 1: inst27 +// CHECK:STDOUT: 2: inst30 +// CHECK:STDOUT: inst_block40: +// CHECK:STDOUT: 0: inst148 +// CHECK:STDOUT: 1: inst146 +// CHECK:STDOUT: inst_block41: +// CHECK:STDOUT: 0: inst152 +// CHECK:STDOUT: 1: inst151 +// CHECK:STDOUT: inst_block42: +// CHECK:STDOUT: 0: inst153 +// CHECK:STDOUT: 1: inst154 +// CHECK:STDOUT: inst_block43: +// CHECK:STDOUT: 0: inst157 +// CHECK:STDOUT: inst_block44: +// CHECK:STDOUT: 0: inst147 +// CHECK:STDOUT: 1: inst145 +// CHECK:STDOUT: inst_block45: +// CHECK:STDOUT: 0: inst162 +// CHECK:STDOUT: 1: inst163 +// CHECK:STDOUT: inst_block46: +// CHECK:STDOUT: 0: inst160 +// CHECK:STDOUT: 1: inst161 +// CHECK:STDOUT: inst_block47: +// CHECK:STDOUT: 0: inst160 +// CHECK:STDOUT: 1: inst161 +// CHECK:STDOUT: 2: inst162 +// CHECK:STDOUT: 3: inst163 +// CHECK:STDOUT: 4: inst164 +// CHECK:STDOUT: 5: inst165 +// CHECK:STDOUT: inst_block48: +// CHECK:STDOUT: 0: inst147 +// CHECK:STDOUT: 1: inst145 +// CHECK:STDOUT: 2: inst148 +// CHECK:STDOUT: 3: inst146 +// CHECK:STDOUT: 4: inst149 +// CHECK:STDOUT: 5: inst159 +// CHECK:STDOUT: inst_block49: +// CHECK:STDOUT: 0: inst173 +// CHECK:STDOUT: inst_block50: +// CHECK:STDOUT: 0: inst174 +// CHECK:STDOUT: 1: inst175 +// CHECK:STDOUT: inst_block51: +// CHECK:STDOUT: 0: inst160 +// CHECK:STDOUT: 1: inst161 +// CHECK:STDOUT: inst_block52: +// CHECK:STDOUT: 0: inst176 +// CHECK:STDOUT: 1: inst177 +// CHECK:STDOUT: inst_block53: +// CHECK:STDOUT: 0: inst179 +// CHECK:STDOUT: 1: inst181 +// CHECK:STDOUT: inst_block54: +// CHECK:STDOUT: 0: inst178 +// CHECK:STDOUT: 1: inst179 +// CHECK:STDOUT: 2: inst180 +// CHECK:STDOUT: 3: inst181 +// CHECK:STDOUT: 4: inst182 +// CHECK:STDOUT: 5: inst183 +// CHECK:STDOUT: inst_block55: +// CHECK:STDOUT: 0: inst147 +// CHECK:STDOUT: 1: inst148 +// CHECK:STDOUT: 2: inst145 +// CHECK:STDOUT: 3: inst146 +// CHECK:STDOUT: 4: inst149 +// CHECK:STDOUT: 5: inst169 +// CHECK:STDOUT: inst_block56: +// CHECK:STDOUT: 0: inst186 +// CHECK:STDOUT: inst_block57: +// CHECK:STDOUT: 0: inst187 +// CHECK:STDOUT: inst_block58: +// CHECK:STDOUT: 0: inst192 +// CHECK:STDOUT: inst_block59: +// CHECK:STDOUT: 0: inst193 +// CHECK:STDOUT: inst_block60: +// CHECK:STDOUT: 0: inst199 +// CHECK:STDOUT: inst_block61: +// CHECK:STDOUT: 0: inst200 +// CHECK:STDOUT: inst_block62: +// CHECK:STDOUT: 0: inst205 +// CHECK:STDOUT: inst_block63: +// CHECK:STDOUT: 0: inst206 +// CHECK:STDOUT: inst_block64: +// CHECK:STDOUT: 0: inst197 +// CHECK:STDOUT: 1: inst198 +// CHECK:STDOUT: 2: inst199 +// CHECK:STDOUT: 3: inst200 +// CHECK:STDOUT: 4: inst201 +// CHECK:STDOUT: 5: inst202 +// CHECK:STDOUT: 6: inst203 +// CHECK:STDOUT: 7: inst204 +// CHECK:STDOUT: 8: inst205 +// CHECK:STDOUT: 9: inst206 +// CHECK:STDOUT: 10: inst207 +// CHECK:STDOUT: 11: inst208 +// CHECK:STDOUT: 12: inst209 +// CHECK:STDOUT: inst_block65: +// CHECK:STDOUT: 0: inst193 +// CHECK:STDOUT: 1: inst146 +// CHECK:STDOUT: 2: inst210 +// CHECK:STDOUT: inst_block66: +// CHECK:STDOUT: 0: inst187 +// CHECK:STDOUT: 1: inst148 +// CHECK:STDOUT: 2: inst211 +// CHECK:STDOUT: inst_block67: +// CHECK:STDOUT: 0: inst167 +// CHECK:STDOUT: 1: inst168 +// CHECK:STDOUT: inst_block68: +// CHECK:STDOUT: 0: inst122 +// CHECK:STDOUT: 1: inst123 +// CHECK:STDOUT: 2: inst61 +// CHECK:STDOUT: inst_block69: +// CHECK:STDOUT: 0: inst212 +// CHECK:STDOUT: inst_block70: +// CHECK:STDOUT: 0: inst213 +// CHECK:STDOUT: inst_block71: +// CHECK:STDOUT: 0: inst214 +// CHECK:STDOUT: inst_block72: +// CHECK:STDOUT: 0: inst214 +// CHECK:STDOUT: 1: inst27 +// CHECK:STDOUT: 2: inst30 +// CHECK:STDOUT: inst_block73: +// CHECK:STDOUT: 0: inst218 +// CHECK:STDOUT: inst_block74: +// CHECK:STDOUT: 0: inst63 +// CHECK:STDOUT: inst_block75: +// CHECK:STDOUT: 0: inst228 +// CHECK:STDOUT: 1: inst232 +// CHECK:STDOUT: inst_block76: +// CHECK:STDOUT: 0: inst59 +// CHECK:STDOUT: 1: inst62 +// CHECK:STDOUT: 2: inst213 +// CHECK:STDOUT: 3: inst218 +// CHECK:STDOUT: 4: inst219 +// CHECK:STDOUT: 5: inst220 +// CHECK:STDOUT: 6: inst224 +// CHECK:STDOUT: inst_block77: // CHECK:STDOUT: 0: inst14 -// CHECK:STDOUT: 1: inst46 +// CHECK:STDOUT: 1: inst15 +// CHECK:STDOUT: 2: inst53 // CHECK:STDOUT: ... diff --git a/toolchain/check/testdata/builtins/bool/make_type.carbon b/toolchain/check/testdata/builtins/bool/make_type.carbon index f19a10725612..9df04b25ffc8 100644 --- a/toolchain/check/testdata/builtins/bool/make_type.carbon +++ b/toolchain/check/testdata/builtins/bool/make_type.carbon @@ -23,7 +23,7 @@ library "[[@TEST_NAME]]"; import library "types"; //@dump-sem-ir-begin -var b: Bool() = false; +let b: Bool() = false; //@dump-sem-ir-end // CHECK:STDOUT: --- use_types.carbon @@ -42,22 +42,19 @@ var b: Bool() = false; // CHECK:STDOUT: file { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %b.patt: %pattern_type.831 = binding_pattern b [concrete] -// CHECK:STDOUT: %b.var_patt: %pattern_type.831 = var_pattern %b.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %b.var: ref bool = var %b.var_patt [concrete] // CHECK:STDOUT: %.loc7_13.1: type = splice_block %.loc7_13.3 [concrete = bool] { // CHECK:STDOUT: %Bool.ref: %Bool.type = name_ref Bool, imports.%Main.Bool [concrete = constants.%Bool] // CHECK:STDOUT: %Bool.call: init type = call %Bool.ref() [concrete = bool] // CHECK:STDOUT: %.loc7_13.2: type = value_of_initializer %Bool.call [concrete = bool] // CHECK:STDOUT: %.loc7_13.3: type = converted %Bool.call, %.loc7_13.2 [concrete = bool] // CHECK:STDOUT: } -// CHECK:STDOUT: %b: ref bool = bind_name b, %b.var [concrete = %b.var] +// CHECK:STDOUT: %b: bool = bind_name b, @__global_init.%false // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %false: bool = bool_literal false [concrete = constants.%false] -// CHECK:STDOUT: assign file.%b.var, %false // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/char_literal/make_type.carbon b/toolchain/check/testdata/builtins/char_literal/make_type.carbon index 0bd95e289d78..e929ca67ae66 100644 --- a/toolchain/check/testdata/builtins/char_literal/make_type.carbon +++ b/toolchain/check/testdata/builtins/char_literal/make_type.carbon @@ -23,9 +23,9 @@ library "[[@TEST_NAME]]"; import library "types"; //@dump-sem-ir-begin -var ascii_x: CharLiteral() = 'x'; -var not_7_bit: CharLiteral() = '\u{80}'; -var not_8_bit: CharLiteral() = '\u{1E15}'; +let ascii_x: CharLiteral() = 'x'; +let not_7_bit: CharLiteral() = '\u{80}'; +let not_8_bit: CharLiteral() = '\u{1E15}'; //@dump-sem-ir-end // CHECK:STDOUT: --- use_types.carbon @@ -46,50 +46,41 @@ var not_8_bit: CharLiteral() = '\u{1E15}'; // CHECK:STDOUT: file { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %ascii_x.patt: %pattern_type.8c6 = binding_pattern ascii_x [concrete] -// CHECK:STDOUT: %ascii_x.var_patt: %pattern_type.8c6 = var_pattern %ascii_x.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %ascii_x.var: ref Core.CharLiteral = var %ascii_x.var_patt [concrete] // CHECK:STDOUT: %.loc7_26.1: type = splice_block %.loc7_26.3 [concrete = Core.CharLiteral] { // CHECK:STDOUT: %CharLiteral.ref.loc7: %CharLiteral.type = name_ref CharLiteral, imports.%Main.CharLiteral [concrete = constants.%CharLiteral] // CHECK:STDOUT: %CharLiteral.call.loc7: init type = call %CharLiteral.ref.loc7() [concrete = Core.CharLiteral] // CHECK:STDOUT: %.loc7_26.2: type = value_of_initializer %CharLiteral.call.loc7 [concrete = Core.CharLiteral] // CHECK:STDOUT: %.loc7_26.3: type = converted %CharLiteral.call.loc7, %.loc7_26.2 [concrete = Core.CharLiteral] // CHECK:STDOUT: } -// CHECK:STDOUT: %ascii_x: ref Core.CharLiteral = bind_name ascii_x, %ascii_x.var [concrete = %ascii_x.var] +// CHECK:STDOUT: %ascii_x: Core.CharLiteral = bind_name ascii_x, @__global_init.%.loc7 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %not_7_bit.patt: %pattern_type.8c6 = binding_pattern not_7_bit [concrete] -// CHECK:STDOUT: %not_7_bit.var_patt: %pattern_type.8c6 = var_pattern %not_7_bit.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %not_7_bit.var: ref Core.CharLiteral = var %not_7_bit.var_patt [concrete] // CHECK:STDOUT: %.loc8_28.1: type = splice_block %.loc8_28.3 [concrete = Core.CharLiteral] { // CHECK:STDOUT: %CharLiteral.ref.loc8: %CharLiteral.type = name_ref CharLiteral, imports.%Main.CharLiteral [concrete = constants.%CharLiteral] // CHECK:STDOUT: %CharLiteral.call.loc8: init type = call %CharLiteral.ref.loc8() [concrete = Core.CharLiteral] // CHECK:STDOUT: %.loc8_28.2: type = value_of_initializer %CharLiteral.call.loc8 [concrete = Core.CharLiteral] // CHECK:STDOUT: %.loc8_28.3: type = converted %CharLiteral.call.loc8, %.loc8_28.2 [concrete = Core.CharLiteral] // CHECK:STDOUT: } -// CHECK:STDOUT: %not_7_bit: ref Core.CharLiteral = bind_name not_7_bit, %not_7_bit.var [concrete = %not_7_bit.var] +// CHECK:STDOUT: %not_7_bit: Core.CharLiteral = bind_name not_7_bit, @__global_init.%.loc8 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %not_8_bit.patt: %pattern_type.8c6 = binding_pattern not_8_bit [concrete] -// CHECK:STDOUT: %not_8_bit.var_patt: %pattern_type.8c6 = var_pattern %not_8_bit.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %not_8_bit.var: ref Core.CharLiteral = var %not_8_bit.var_patt [concrete] // CHECK:STDOUT: %.loc9_28.1: type = splice_block %.loc9_28.3 [concrete = Core.CharLiteral] { // CHECK:STDOUT: %CharLiteral.ref.loc9: %CharLiteral.type = name_ref CharLiteral, imports.%Main.CharLiteral [concrete = constants.%CharLiteral] // CHECK:STDOUT: %CharLiteral.call.loc9: init type = call %CharLiteral.ref.loc9() [concrete = Core.CharLiteral] // CHECK:STDOUT: %.loc9_28.2: type = value_of_initializer %CharLiteral.call.loc9 [concrete = Core.CharLiteral] // CHECK:STDOUT: %.loc9_28.3: type = converted %CharLiteral.call.loc9, %.loc9_28.2 [concrete = Core.CharLiteral] // CHECK:STDOUT: } -// CHECK:STDOUT: %not_8_bit: ref Core.CharLiteral = bind_name not_8_bit, %not_8_bit.var [concrete = %not_8_bit.var] +// CHECK:STDOUT: %not_8_bit: Core.CharLiteral = bind_name not_8_bit, @__global_init.%.loc9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc7: Core.CharLiteral = char_value U+0078 [concrete = constants.%.4ac] -// CHECK:STDOUT: assign file.%ascii_x.var, %.loc7 // CHECK:STDOUT: %.loc8: Core.CharLiteral = char_value U+0080 [concrete = constants.%.ae7] -// CHECK:STDOUT: assign file.%not_7_bit.var, %.loc8 // CHECK:STDOUT: %.loc9: Core.CharLiteral = char_value U+1E15 [concrete = constants.%.a81] -// CHECK:STDOUT: assign file.%not_8_bit.var, %.loc9 // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/float/convert_checked.carbon b/toolchain/check/testdata/builtins/float/convert_checked.carbon index fed0ddb8c03d..b26a013ac44a 100644 --- a/toolchain/check/testdata/builtins/float/convert_checked.carbon +++ b/toolchain/check/testdata/builtins/float/convert_checked.carbon @@ -362,7 +362,7 @@ let convert_not_constant: f64 = Float64ToFloat64(not_constant_64); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Main.Float64ToFloat64: %Float64ToFloat64.type = import_ref Main//f64, Float64ToFloat64, loaded [concrete = constants.%Float64ToFloat64] -// CHECK:STDOUT: %Core.import_ref.175: @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type (%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type.261) = import_ref Core//prelude/parts/float, loc15_41, loaded [symbolic = @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert (constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.4dd)] +// CHECK:STDOUT: %Core.import_ref.175: @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type (%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type.261) = import_ref Core//prelude/parts/float, loc20_41, loaded [symbolic = @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert (constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.4dd)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table = impl_witness_table (%Core.import_ref.175), @Core.FloatLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -469,7 +469,7 @@ let convert_not_constant: f64 = Float64ToFloat64(not_constant_64); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Main.Float32ToFloat32: %Float32ToFloat32.type = import_ref Main//f32, Float32ToFloat32, loaded [concrete = constants.%Float32ToFloat32] -// CHECK:STDOUT: %Core.import_ref.175: @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type (%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type.261) = import_ref Core//prelude/parts/float, loc15_41, loaded [symbolic = @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert (constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.4dd)] +// CHECK:STDOUT: %Core.import_ref.175: @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type (%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type.261) = import_ref Core//prelude/parts/float, loc20_41, loaded [symbolic = @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert (constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.4dd)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table = impl_witness_table (%Core.import_ref.175), @Core.FloatLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -571,7 +571,7 @@ let convert_not_constant: f64 = Float64ToFloat64(not_constant_64); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Main.Float64ToFloat32: %Float64ToFloat32.type = import_ref Main//f32, Float64ToFloat32, loaded [concrete = constants.%Float64ToFloat32] -// CHECK:STDOUT: %Core.import_ref.175: @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type (%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type.261) = import_ref Core//prelude/parts/float, loc15_41, loaded [symbolic = @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert (constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.4dd)] +// CHECK:STDOUT: %Core.import_ref.175: @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type (%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type.261) = import_ref Core//prelude/parts/float, loc20_41, loaded [symbolic = @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert (constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.4dd)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table = impl_witness_table (%Core.import_ref.175), @Core.FloatLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -641,7 +641,7 @@ let convert_not_constant: f64 = Float64ToFloat64(not_constant_64); // CHECK:STDOUT: %Main.FloatLiteralToFloat32: %FloatLiteralToFloat32.type = import_ref Main//f32, FloatLiteralToFloat32, loaded [concrete = constants.%FloatLiteralToFloat32] // CHECK:STDOUT: %Main.Float64ToFloat32: %Float64ToFloat32.type = import_ref Main//f32, Float64ToFloat32, loaded [concrete = constants.%Float64ToFloat32] // CHECK:STDOUT: %Main.FloatLiteralToFloat64: %FloatLiteralToFloat64.type = import_ref Main//f64, FloatLiteralToFloat64, loaded [concrete = constants.%FloatLiteralToFloat64] -// CHECK:STDOUT: %Core.import_ref.175: @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type (%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type.261) = import_ref Core//prelude/parts/float, loc15_41, loaded [symbolic = @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert (constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.4dd)] +// CHECK:STDOUT: %Core.import_ref.175: @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type (%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type.261) = import_ref Core//prelude/parts/float, loc20_41, loaded [symbolic = @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert (constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.4dd)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table = impl_witness_table (%Core.import_ref.175), @Core.FloatLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -734,7 +734,7 @@ let convert_not_constant: f64 = Float64ToFloat64(not_constant_64); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Main.Float32ToFloat64: %Float32ToFloat64.type = import_ref Main//f32, Float32ToFloat64, loaded [concrete = constants.%Float32ToFloat64] -// CHECK:STDOUT: %Core.import_ref.175: @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type (%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type.261) = import_ref Core//prelude/parts/float, loc15_41, loaded [symbolic = @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert (constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.4dd)] +// CHECK:STDOUT: %Core.import_ref.175: @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type (%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type.261) = import_ref Core//prelude/parts/float, loc20_41, loaded [symbolic = @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert (constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.4dd)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table = impl_witness_table (%Core.import_ref.175), @Core.FloatLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -813,7 +813,7 @@ let convert_not_constant: f64 = Float64ToFloat64(not_constant_64); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Main.Float64ToFloat64: %Float64ToFloat64.type = import_ref Main//f64, Float64ToFloat64, loaded [concrete = constants.%Float64ToFloat64] -// CHECK:STDOUT: %Core.import_ref.175: @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type (%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type.261) = import_ref Core//prelude/parts/float, loc15_41, loaded [symbolic = @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert (constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.4dd)] +// CHECK:STDOUT: %Core.import_ref.175: @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type (%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type.261) = import_ref Core//prelude/parts/float, loc20_41, loaded [symbolic = @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert (constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.4dd)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table = impl_witness_table (%Core.import_ref.175), @Core.FloatLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/float_literal/make_type.carbon b/toolchain/check/testdata/builtins/float_literal/make_type.carbon index ec60b9a3a820..5f85650b6f1a 100644 --- a/toolchain/check/testdata/builtins/float_literal/make_type.carbon +++ b/toolchain/check/testdata/builtins/float_literal/make_type.carbon @@ -23,7 +23,7 @@ library "[[@TEST_NAME]]"; import library "types"; //@dump-sem-ir-begin -var f: FloatLiteral() = 1.0; +let f: FloatLiteral() = 1.0; //@dump-sem-ir-end // CHECK:STDOUT: --- use_types.carbon @@ -42,22 +42,19 @@ var f: FloatLiteral() = 1.0; // CHECK:STDOUT: file { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %f.patt: %pattern_type.dab = binding_pattern f [concrete] -// CHECK:STDOUT: %f.var_patt: %pattern_type.dab = var_pattern %f.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %f.var: ref Core.FloatLiteral = var %f.var_patt [concrete] // CHECK:STDOUT: %.loc7_21.1: type = splice_block %.loc7_21.3 [concrete = Core.FloatLiteral] { // CHECK:STDOUT: %FloatLiteral.ref: %FloatLiteral.type = name_ref FloatLiteral, imports.%Main.FloatLiteral [concrete = constants.%FloatLiteral] // CHECK:STDOUT: %FloatLiteral.call: init type = call %FloatLiteral.ref() [concrete = Core.FloatLiteral] // CHECK:STDOUT: %.loc7_21.2: type = value_of_initializer %FloatLiteral.call [concrete = Core.FloatLiteral] // CHECK:STDOUT: %.loc7_21.3: type = converted %FloatLiteral.call, %.loc7_21.2 [concrete = Core.FloatLiteral] // CHECK:STDOUT: } -// CHECK:STDOUT: %f: ref Core.FloatLiteral = bind_name f, %f.var [concrete = %f.var] +// CHECK:STDOUT: %f: Core.FloatLiteral = bind_name f, @__global_init.%float // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %float: Core.FloatLiteral = float_literal_value 10e-1 [concrete = constants.%float] -// CHECK:STDOUT: assign file.%f.var, %float // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/convert_checked.carbon b/toolchain/check/testdata/builtins/int/convert_checked.carbon index e5c0f7c495be..31bee117129e 100644 --- a/toolchain/check/testdata/builtins/int/convert_checked.carbon +++ b/toolchain/check/testdata/builtins/int/convert_checked.carbon @@ -305,7 +305,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Main.Int32ToUint32: %Int32ToUint32.type = import_ref Main//int_ops, Int32ToUint32, loaded [concrete = constants.%Int32ToUint32] // CHECK:STDOUT: %Main.Int32ToInt16: %Int32ToInt16.type = import_ref Main//int_ops, Int32ToInt16, loaded [concrete = constants.%Int32ToInt16] // CHECK:STDOUT: %Main.Int32ToInt64: %Int32ToInt64.type = import_ref Main//int_ops, Int32ToInt64, loaded [concrete = constants.%Int32ToInt64] -// CHECK:STDOUT: %Core.import_ref.7bb: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.8a0) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.1d6)] +// CHECK:STDOUT: %Core.import_ref.7bb: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.8a0) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.1d6)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.ba4 = impl_witness_table (%Core.import_ref.7bb), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/print/char.carbon b/toolchain/check/testdata/builtins/print/char.carbon index a234bec03c33..20bae109a86e 100644 --- a/toolchain/check/testdata/builtins/print/char.carbon +++ b/toolchain/check/testdata/builtins/print/char.carbon @@ -66,7 +66,7 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/types/int, loc20_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/types/int, loc27_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.PrintChar: %PrintChar.type.089 = import_ref Core//io, PrintChar, loaded [concrete = constants.%PrintChar.d75] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/builtins/print/int.carbon b/toolchain/check/testdata/builtins/print/int.carbon index 70c4ee4201bd..8e8359f7f8ff 100644 --- a/toolchain/check/testdata/builtins/print/int.carbon +++ b/toolchain/check/testdata/builtins/print/int.carbon @@ -67,7 +67,7 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/types/int, loc20_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/types/int, loc27_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.Print: %Print.type.6ed = import_ref Core//io, Print, loaded [concrete = constants.%Print.723] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/choice/basic.carbon b/toolchain/check/testdata/choice/basic.carbon index 7ac5026001a3..b6bd1c068b9c 100644 --- a/toolchain/check/testdata/choice/basic.carbon +++ b/toolchain/check/testdata/choice/basic.carbon @@ -139,6 +139,7 @@ let never: Never = {}; // CHECK:STDOUT: constants { // CHECK:STDOUT: %Ordering: type = class_type @Ordering [concrete] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %u2: type = class_type @UInt, @UInt(%int_2.ecc) [concrete] // CHECK:STDOUT: %struct_type.discriminant: type = struct_type {.discriminant: %u2} [concrete] // CHECK:STDOUT: %complete_type.de2: = complete_type_witness %struct_type.discriminant [concrete] @@ -157,27 +158,47 @@ let never: Never = {}; // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_2.ecc) [concrete] // CHECK:STDOUT: %bound_method.7b7: = bound_method %int_0.5c6, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.9fd: %u2 = int_value 0 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.type.464: type = fn_type @UInt.as.Copy.impl.Op, @UInt.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.be7: %UInt.as.Copy.impl.Op.type.464 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.9ce: = impl_witness imports.%Copy.impl_witness_table.70d, @UInt.as.Copy.impl(%int_2.ecc) [concrete] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.type.171: type = fn_type @UInt.as.Copy.impl.Op, @UInt.as.Copy.impl(%int_2.ecc) [concrete] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.766: %UInt.as.Copy.impl.Op.type.171 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.7d4: %Copy.type = facet_value %u2, (%Copy.impl_witness.9ce) [concrete] +// CHECK:STDOUT: %.140: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.7d4 [concrete] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.bound.931: = bound_method %int_0.9fd, %UInt.as.Copy.impl.Op.766 [concrete] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.specific_fn: = specific_function %UInt.as.Copy.impl.Op.766, @UInt.as.Copy.impl.Op(%int_2.ecc) [concrete] +// CHECK:STDOUT: %bound_method.9aa: = bound_method %int_0.9fd, %UInt.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %Ordering.val.a29: %Ordering = struct_value (%int_0.9fd) [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.fd2: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b2 [concrete] // CHECK:STDOUT: %bound_method.e28: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.b2c: %u2 = int_value 1 [concrete] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.bound.e18: = bound_method %int_1.b2c, %UInt.as.Copy.impl.Op.766 [concrete] +// CHECK:STDOUT: %bound_method.e8f: = bound_method %int_1.b2c, %UInt.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %Ordering.val.927: %Ordering = struct_value (%int_1.b2c) [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.53a: = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b2 [concrete] // CHECK:STDOUT: %bound_method.aa0: = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.788: %u2 = int_value 2 [concrete] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.bound.bf3: = bound_method %int_2.788, %UInt.as.Copy.impl.Op.766 [concrete] +// CHECK:STDOUT: %bound_method.b11: = bound_method %int_2.788, %UInt.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %Ordering.val.968: %Ordering = struct_value (%int_2.788) [concrete] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.9f9: = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b2 [concrete] // CHECK:STDOUT: %bound_method.b35: = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.975: %u2 = int_value 3 [concrete] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.bound.c45: = bound_method %int_3.975, %UInt.as.Copy.impl.Op.766 [concrete] +// CHECK:STDOUT: %bound_method.eed: = bound_method %int_3.975, %UInt.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %Ordering.val.8a7: %Ordering = struct_value (%int_3.975) [concrete] // CHECK:STDOUT: %pattern_type.308: type = pattern_type %Ordering [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core.import_ref.104: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.367) = import_ref Core//prelude/parts/uint, loc16_40, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.8f6)] +// CHECK:STDOUT: %Core.import_ref.104: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.367) = import_ref Core//prelude/parts/uint, loc23_40, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.8f6)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b63 = impl_witness_table (%Core.import_ref.104), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.46f: @UInt.as.Copy.impl.%UInt.as.Copy.impl.Op.type (%UInt.as.Copy.impl.Op.type.464) = import_ref Core//prelude/parts/uint, loc17_31, loaded [symbolic = @UInt.as.Copy.impl.%UInt.as.Copy.impl.Op (constants.%UInt.as.Copy.impl.Op.be7)] +// CHECK:STDOUT: %Copy.impl_witness_table.70d = impl_witness_table (%Core.import_ref.46f), @UInt.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -209,68 +230,88 @@ let never: Never = {}; // CHECK:STDOUT: %u2: type = class_type @UInt, @UInt(constants.%int_2.ecc) [concrete = constants.%u2] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%struct_type.discriminant [concrete = constants.%complete_type.de2] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] -// CHECK:STDOUT: %impl.elem0.loc5: %.a66 = impl_witness_access constants.%ImplicitAs.impl_witness.b0d, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b2] -// CHECK:STDOUT: %bound_method.loc5_7.1: = bound_method %int_0, %impl.elem0.loc5 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.289] -// CHECK:STDOUT: %specific_fn.loc5: = specific_function %impl.elem0.loc5, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_2.ecc) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc5_7.2: = bound_method %int_0, %specific_fn.loc5 [concrete = constants.%bound_method.7b7] +// CHECK:STDOUT: %impl.elem0.loc5_7.1: %.a66 = impl_witness_access constants.%ImplicitAs.impl_witness.b0d, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b2] +// CHECK:STDOUT: %bound_method.loc5_7.1: = bound_method %int_0, %impl.elem0.loc5_7.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.289] +// CHECK:STDOUT: %specific_fn.loc5_7.1: = specific_function %impl.elem0.loc5_7.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_2.ecc) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc5_7.2: = bound_method %int_0, %specific_fn.loc5_7.1 [concrete = constants.%bound_method.7b7] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc5: init %u2 = call %bound_method.loc5_7.2(%int_0) [concrete = constants.%int_0.9fd] // CHECK:STDOUT: %.loc5_7.1: %u2 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc5 [concrete = constants.%int_0.9fd] // CHECK:STDOUT: %.loc5_7.2: %u2 = converted %int_0, %.loc5_7.1 [concrete = constants.%int_0.9fd] // CHECK:STDOUT: %.loc5_7.3: %struct_type.discriminant = struct_literal (%.loc5_7.2) +// CHECK:STDOUT: %impl.elem0.loc5_7.2: %.140 = impl_witness_access constants.%Copy.impl_witness.9ce, element0 [concrete = constants.%UInt.as.Copy.impl.Op.766] +// CHECK:STDOUT: %bound_method.loc5_7.3: = bound_method %.loc5_7.2, %impl.elem0.loc5_7.2 [concrete = constants.%UInt.as.Copy.impl.Op.bound.931] +// CHECK:STDOUT: %specific_fn.loc5_7.2: = specific_function %impl.elem0.loc5_7.2, @UInt.as.Copy.impl.Op(constants.%int_2.ecc) [concrete = constants.%UInt.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc5_7.4: = bound_method %.loc5_7.2, %specific_fn.loc5_7.2 [concrete = constants.%bound_method.9aa] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.call.loc5: init %u2 = call %bound_method.loc5_7.4(%.loc5_7.2) [concrete = constants.%int_0.9fd] // CHECK:STDOUT: %.loc5_7.4: ref %Ordering = temporary_storage // CHECK:STDOUT: %.loc5_7.5: ref %u2 = class_element_access %.loc5_7.4, element0 -// CHECK:STDOUT: %.loc5_7.6: init %u2 = initialize_from %.loc5_7.2 to %.loc5_7.5 [concrete = constants.%int_0.9fd] +// CHECK:STDOUT: %.loc5_7.6: init %u2 = initialize_from %UInt.as.Copy.impl.Op.call.loc5 to %.loc5_7.5 [concrete = constants.%int_0.9fd] // CHECK:STDOUT: %.loc5_7.7: init %Ordering = class_init (%.loc5_7.6), %.loc5_7.4 [concrete = constants.%Ordering.val.a29] // CHECK:STDOUT: %.loc5_7.8: ref %Ordering = temporary %.loc5_7.4, %.loc5_7.7 // CHECK:STDOUT: %.loc5_7.9: ref %Ordering = converted %.loc5_7.3, %.loc5_7.8 // CHECK:STDOUT: %.loc5_7.10: %Ordering = bind_value %.loc5_7.9 // CHECK:STDOUT: %Less: %Ordering = bind_name Less, %.loc5_7.10 // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0.loc6: %.a66 = impl_witness_access constants.%ImplicitAs.impl_witness.b0d, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b2] -// CHECK:STDOUT: %bound_method.loc6_13.1: = bound_method %int_1, %impl.elem0.loc6 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.fd2] -// CHECK:STDOUT: %specific_fn.loc6: = specific_function %impl.elem0.loc6, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_2.ecc) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc6_13.2: = bound_method %int_1, %specific_fn.loc6 [concrete = constants.%bound_method.e28] +// CHECK:STDOUT: %impl.elem0.loc6_13.1: %.a66 = impl_witness_access constants.%ImplicitAs.impl_witness.b0d, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b2] +// CHECK:STDOUT: %bound_method.loc6_13.1: = bound_method %int_1, %impl.elem0.loc6_13.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.fd2] +// CHECK:STDOUT: %specific_fn.loc6_13.1: = specific_function %impl.elem0.loc6_13.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_2.ecc) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_13.2: = bound_method %int_1, %specific_fn.loc6_13.1 [concrete = constants.%bound_method.e28] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6: init %u2 = call %bound_method.loc6_13.2(%int_1) [concrete = constants.%int_1.b2c] // CHECK:STDOUT: %.loc6_13.1: %u2 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6 [concrete = constants.%int_1.b2c] // CHECK:STDOUT: %.loc6_13.2: %u2 = converted %int_1, %.loc6_13.1 [concrete = constants.%int_1.b2c] // CHECK:STDOUT: %.loc6_13.3: %struct_type.discriminant = struct_literal (%.loc6_13.2) +// CHECK:STDOUT: %impl.elem0.loc6_13.2: %.140 = impl_witness_access constants.%Copy.impl_witness.9ce, element0 [concrete = constants.%UInt.as.Copy.impl.Op.766] +// CHECK:STDOUT: %bound_method.loc6_13.3: = bound_method %.loc6_13.2, %impl.elem0.loc6_13.2 [concrete = constants.%UInt.as.Copy.impl.Op.bound.e18] +// CHECK:STDOUT: %specific_fn.loc6_13.2: = specific_function %impl.elem0.loc6_13.2, @UInt.as.Copy.impl.Op(constants.%int_2.ecc) [concrete = constants.%UInt.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_13.4: = bound_method %.loc6_13.2, %specific_fn.loc6_13.2 [concrete = constants.%bound_method.e8f] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.call.loc6: init %u2 = call %bound_method.loc6_13.4(%.loc6_13.2) [concrete = constants.%int_1.b2c] // CHECK:STDOUT: %.loc6_13.4: ref %Ordering = temporary_storage // CHECK:STDOUT: %.loc6_13.5: ref %u2 = class_element_access %.loc6_13.4, element0 -// CHECK:STDOUT: %.loc6_13.6: init %u2 = initialize_from %.loc6_13.2 to %.loc6_13.5 [concrete = constants.%int_1.b2c] +// CHECK:STDOUT: %.loc6_13.6: init %u2 = initialize_from %UInt.as.Copy.impl.Op.call.loc6 to %.loc6_13.5 [concrete = constants.%int_1.b2c] // CHECK:STDOUT: %.loc6_13.7: init %Ordering = class_init (%.loc6_13.6), %.loc6_13.4 [concrete = constants.%Ordering.val.927] // CHECK:STDOUT: %.loc6_13.8: ref %Ordering = temporary %.loc6_13.4, %.loc6_13.7 // CHECK:STDOUT: %.loc6_13.9: ref %Ordering = converted %.loc6_13.3, %.loc6_13.8 // CHECK:STDOUT: %.loc6_13.10: %Ordering = bind_value %.loc6_13.9 // CHECK:STDOUT: %Equivalent: %Ordering = bind_name Equivalent, %.loc6_13.10 // CHECK:STDOUT: %int_2.loc7: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] -// CHECK:STDOUT: %impl.elem0.loc7: %.a66 = impl_witness_access constants.%ImplicitAs.impl_witness.b0d, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b2] -// CHECK:STDOUT: %bound_method.loc7_10.1: = bound_method %int_2.loc7, %impl.elem0.loc7 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.53a] -// CHECK:STDOUT: %specific_fn.loc7: = specific_function %impl.elem0.loc7, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_2.ecc) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc7_10.2: = bound_method %int_2.loc7, %specific_fn.loc7 [concrete = constants.%bound_method.aa0] +// CHECK:STDOUT: %impl.elem0.loc7_10.1: %.a66 = impl_witness_access constants.%ImplicitAs.impl_witness.b0d, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b2] +// CHECK:STDOUT: %bound_method.loc7_10.1: = bound_method %int_2.loc7, %impl.elem0.loc7_10.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.53a] +// CHECK:STDOUT: %specific_fn.loc7_10.1: = specific_function %impl.elem0.loc7_10.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_2.ecc) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc7_10.2: = bound_method %int_2.loc7, %specific_fn.loc7_10.1 [concrete = constants.%bound_method.aa0] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7: init %u2 = call %bound_method.loc7_10.2(%int_2.loc7) [concrete = constants.%int_2.788] // CHECK:STDOUT: %.loc7_10.1: %u2 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7 [concrete = constants.%int_2.788] // CHECK:STDOUT: %.loc7_10.2: %u2 = converted %int_2.loc7, %.loc7_10.1 [concrete = constants.%int_2.788] // CHECK:STDOUT: %.loc7_10.3: %struct_type.discriminant = struct_literal (%.loc7_10.2) +// CHECK:STDOUT: %impl.elem0.loc7_10.2: %.140 = impl_witness_access constants.%Copy.impl_witness.9ce, element0 [concrete = constants.%UInt.as.Copy.impl.Op.766] +// CHECK:STDOUT: %bound_method.loc7_10.3: = bound_method %.loc7_10.2, %impl.elem0.loc7_10.2 [concrete = constants.%UInt.as.Copy.impl.Op.bound.bf3] +// CHECK:STDOUT: %specific_fn.loc7_10.2: = specific_function %impl.elem0.loc7_10.2, @UInt.as.Copy.impl.Op(constants.%int_2.ecc) [concrete = constants.%UInt.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc7_10.4: = bound_method %.loc7_10.2, %specific_fn.loc7_10.2 [concrete = constants.%bound_method.b11] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.call.loc7: init %u2 = call %bound_method.loc7_10.4(%.loc7_10.2) [concrete = constants.%int_2.788] // CHECK:STDOUT: %.loc7_10.4: ref %Ordering = temporary_storage // CHECK:STDOUT: %.loc7_10.5: ref %u2 = class_element_access %.loc7_10.4, element0 -// CHECK:STDOUT: %.loc7_10.6: init %u2 = initialize_from %.loc7_10.2 to %.loc7_10.5 [concrete = constants.%int_2.788] +// CHECK:STDOUT: %.loc7_10.6: init %u2 = initialize_from %UInt.as.Copy.impl.Op.call.loc7 to %.loc7_10.5 [concrete = constants.%int_2.788] // CHECK:STDOUT: %.loc7_10.7: init %Ordering = class_init (%.loc7_10.6), %.loc7_10.4 [concrete = constants.%Ordering.val.968] // CHECK:STDOUT: %.loc7_10.8: ref %Ordering = temporary %.loc7_10.4, %.loc7_10.7 // CHECK:STDOUT: %.loc7_10.9: ref %Ordering = converted %.loc7_10.3, %.loc7_10.8 // CHECK:STDOUT: %.loc7_10.10: %Ordering = bind_value %.loc7_10.9 // CHECK:STDOUT: %Greater: %Ordering = bind_name Greater, %.loc7_10.10 // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] -// CHECK:STDOUT: %impl.elem0.loc9: %.a66 = impl_witness_access constants.%ImplicitAs.impl_witness.b0d, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b2] -// CHECK:STDOUT: %bound_method.loc9_1.1: = bound_method %int_3, %impl.elem0.loc9 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.9f9] -// CHECK:STDOUT: %specific_fn.loc9: = specific_function %impl.elem0.loc9, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_2.ecc) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc9_1.2: = bound_method %int_3, %specific_fn.loc9 [concrete = constants.%bound_method.b35] +// CHECK:STDOUT: %impl.elem0.loc9_1.1: %.a66 = impl_witness_access constants.%ImplicitAs.impl_witness.b0d, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b2] +// CHECK:STDOUT: %bound_method.loc9_1.1: = bound_method %int_3, %impl.elem0.loc9_1.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.9f9] +// CHECK:STDOUT: %specific_fn.loc9_1.1: = specific_function %impl.elem0.loc9_1.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_2.ecc) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_1.2: = bound_method %int_3, %specific_fn.loc9_1.1 [concrete = constants.%bound_method.b35] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9: init %u2 = call %bound_method.loc9_1.2(%int_3) [concrete = constants.%int_3.975] // CHECK:STDOUT: %.loc9_1.1: %u2 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9 [concrete = constants.%int_3.975] // CHECK:STDOUT: %.loc9_1.2: %u2 = converted %int_3, %.loc9_1.1 [concrete = constants.%int_3.975] // CHECK:STDOUT: %.loc9_1.3: %struct_type.discriminant = struct_literal (%.loc9_1.2) +// CHECK:STDOUT: %impl.elem0.loc9_1.2: %.140 = impl_witness_access constants.%Copy.impl_witness.9ce, element0 [concrete = constants.%UInt.as.Copy.impl.Op.766] +// CHECK:STDOUT: %bound_method.loc9_1.3: = bound_method %.loc9_1.2, %impl.elem0.loc9_1.2 [concrete = constants.%UInt.as.Copy.impl.Op.bound.c45] +// CHECK:STDOUT: %specific_fn.loc9_1.2: = specific_function %impl.elem0.loc9_1.2, @UInt.as.Copy.impl.Op(constants.%int_2.ecc) [concrete = constants.%UInt.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_1.4: = bound_method %.loc9_1.2, %specific_fn.loc9_1.2 [concrete = constants.%bound_method.eed] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.call.loc9: init %u2 = call %bound_method.loc9_1.4(%.loc9_1.2) [concrete = constants.%int_3.975] // CHECK:STDOUT: %.loc9_1.4: ref %Ordering = temporary_storage // CHECK:STDOUT: %.loc9_1.5: ref %u2 = class_element_access %.loc9_1.4, element0 -// CHECK:STDOUT: %.loc9_1.6: init %u2 = initialize_from %.loc9_1.2 to %.loc9_1.5 [concrete = constants.%int_3.975] +// CHECK:STDOUT: %.loc9_1.6: init %u2 = initialize_from %UInt.as.Copy.impl.Op.call.loc9 to %.loc9_1.5 [concrete = constants.%int_3.975] // CHECK:STDOUT: %.loc9_1.7: init %Ordering = class_init (%.loc9_1.6), %.loc9_1.4 [concrete = constants.%Ordering.val.8a7] // CHECK:STDOUT: %.loc9_1.8: ref %Ordering = temporary %.loc9_1.4, %.loc9_1.7 // CHECK:STDOUT: %.loc9_1.9: ref %Ordering = converted %.loc9_1.3, %.loc9_1.8 diff --git a/toolchain/check/testdata/class/access_modifers.carbon b/toolchain/check/testdata/class/access_modifers.carbon index 257a11473eda..fec72f039cd1 100644 --- a/toolchain/check/testdata/class/access_modifers.carbon +++ b/toolchain/check/testdata/class/access_modifers.carbon @@ -212,7 +212,7 @@ class A { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } @@ -515,7 +515,7 @@ class A { // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -681,7 +681,7 @@ class A { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } @@ -805,7 +805,7 @@ class A { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/adapter/adapt_copy.carbon b/toolchain/check/testdata/class/adapter/adapt_copy.carbon index da3466579501..e9b92ea153c0 100644 --- a/toolchain/check/testdata/class/adapter/adapt_copy.carbon +++ b/toolchain/check/testdata/class/adapter/adapt_copy.carbon @@ -12,7 +12,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/adapter/adapt_copy.carbon -// --- adapt_copyable.carbon +// TODO: Decide whether an adapter for a copyable type is copyable. As +// demonstrated in this test, our behavior is currently inconsistent. + +// --- fail_adapt_copyable.carbon library "[[@TEST_NAME]]"; @@ -20,15 +23,34 @@ class AdaptCopyable { adapt i32; } -// We can copy an adapter by copying its value if its initializing -// representation is a copy of its value representation. fn F(c: AdaptCopyable) -> AdaptCopyable { + // CHECK:STDERR: fail_adapt_copyable.carbon:[[@LINE+7]]:26: error: cannot copy value of type `AdaptCopyable` [CopyOfUncopyableType] + // CHECK:STDERR: var d: AdaptCopyable = c; + // CHECK:STDERR: ^ + // CHECK:STDERR: fail_adapt_copyable.carbon:[[@LINE+4]]:26: note: type `AdaptCopyable` does not implement interface `Core.Copy` [MissingImplInMemberAccessNote] + // CHECK:STDERR: var d: AdaptCopyable = c; + // CHECK:STDERR: ^ + // CHECK:STDERR: var d: AdaptCopyable = c; return d; } fn InTuple(c: (AdaptCopyable, u32)) -> (AdaptCopyable, u32) { + // CHECK:STDERR: fail_adapt_copyable.carbon:[[@LINE+7]]:33: error: cannot copy value of type `AdaptCopyable` [CopyOfUncopyableType] + // CHECK:STDERR: var d: (AdaptCopyable, u32) = c; + // CHECK:STDERR: ^ + // CHECK:STDERR: fail_adapt_copyable.carbon:[[@LINE+4]]:33: note: type `AdaptCopyable` does not implement interface `Core.Copy` [MissingImplInMemberAccessNote] + // CHECK:STDERR: var d: (AdaptCopyable, u32) = c; + // CHECK:STDERR: ^ + // CHECK:STDERR: var d: (AdaptCopyable, u32) = c; + // CHECK:STDERR: fail_adapt_copyable.carbon:[[@LINE+7]]:10: error: cannot copy value of type `AdaptCopyable` [CopyOfUncopyableType] + // CHECK:STDERR: return d; + // CHECK:STDERR: ^ + // CHECK:STDERR: fail_adapt_copyable.carbon:[[@LINE+4]]:10: note: type `AdaptCopyable` does not implement interface `Core.Copy` [MissingImplInMemberAccessNote] + // CHECK:STDERR: return d; + // CHECK:STDERR: ^ + // CHECK:STDERR: return d; } @@ -63,12 +85,18 @@ class AdaptNoncopyable { } fn G(a: AdaptNoncopyable) -> AdaptNoncopyable { - // CHECK:STDERR: fail_adapt_not_copyable.carbon:[[@LINE+4]]:29: error: cannot copy value of type `AdaptNoncopyable` [CopyOfUncopyableType] + // CHECK:STDERR: fail_adapt_not_copyable.carbon:[[@LINE+7]]:29: error: cannot copy value of type `AdaptNoncopyable` [CopyOfUncopyableType] + // CHECK:STDERR: var b: AdaptNoncopyable = a; + // CHECK:STDERR: ^ + // CHECK:STDERR: fail_adapt_not_copyable.carbon:[[@LINE+4]]:29: note: type `AdaptNoncopyable` does not implement interface `Core.Copy` [MissingImplInMemberAccessNote] // CHECK:STDERR: var b: AdaptNoncopyable = a; // CHECK:STDERR: ^ // CHECK:STDERR: var b: AdaptNoncopyable = a; - // CHECK:STDERR: fail_adapt_not_copyable.carbon:[[@LINE+4]]:10: error: cannot copy value of type `AdaptNoncopyable` [CopyOfUncopyableType] + // CHECK:STDERR: fail_adapt_not_copyable.carbon:[[@LINE+7]]:10: error: cannot copy value of type `AdaptNoncopyable` [CopyOfUncopyableType] + // CHECK:STDERR: return b; + // CHECK:STDERR: ^ + // CHECK:STDERR: fail_adapt_not_copyable.carbon:[[@LINE+4]]:10: note: type `AdaptNoncopyable` does not implement interface `Core.Copy` [MissingImplInMemberAccessNote] // CHECK:STDERR: return b; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -88,7 +116,10 @@ class AdaptNoncopyableIndirect { } fn H(a: AdaptNoncopyableIndirect) -> AdaptNoncopyableIndirect { - // CHECK:STDERR: fail_adapt_not_copyable_indirect.carbon:[[@LINE+7]]:3: error: cannot copy value of type `Noncopyable` [CopyOfUncopyableType] + // CHECK:STDERR: fail_adapt_not_copyable_indirect.carbon:[[@LINE+10]]:3: error: cannot copy value of type `Noncopyable` [CopyOfUncopyableType] + // CHECK:STDERR: var b: AdaptNoncopyableIndirect = a; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_adapt_not_copyable_indirect.carbon:[[@LINE+7]]:3: note: type `Noncopyable` does not implement interface `Core.Copy` [MissingImplInMemberAccessNote] // CHECK:STDERR: var b: AdaptNoncopyableIndirect = a; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_adapt_not_copyable_indirect.carbon:[[@LINE+4]]:37: note: in copy of `AdaptNoncopyableIndirect` [InCopy] @@ -96,7 +127,10 @@ fn H(a: AdaptNoncopyableIndirect) -> AdaptNoncopyableIndirect { // CHECK:STDERR: ^ // CHECK:STDERR: var b: AdaptNoncopyableIndirect = a; - // CHECK:STDERR: fail_adapt_not_copyable_indirect.carbon:[[@LINE+7]]:3: error: cannot copy value of type `Noncopyable` [CopyOfUncopyableType] + // CHECK:STDERR: fail_adapt_not_copyable_indirect.carbon:[[@LINE+10]]:3: error: cannot copy value of type `Noncopyable` [CopyOfUncopyableType] + // CHECK:STDERR: return b; + // CHECK:STDERR: ^~~~~~~~~ + // CHECK:STDERR: fail_adapt_not_copyable_indirect.carbon:[[@LINE+7]]:3: note: type `Noncopyable` does not implement interface `Core.Copy` [MissingImplInMemberAccessNote] // CHECK:STDERR: return b; // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: fail_adapt_not_copyable_indirect.carbon:[[@LINE+4]]:10: note: in copy of `AdaptNoncopyableIndirect` [InCopy] @@ -124,7 +158,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { return d; } -// CHECK:STDOUT: --- adapt_copyable.carbon +// CHECK:STDOUT: --- fail_adapt_copyable.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %AdaptCopyable: type = class_type @AdaptCopyable [concrete] @@ -132,6 +166,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %complete_type.f8a: = complete_type_witness %i32.builtin [concrete] @@ -145,6 +180,8 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %pattern_type.cdf: type = pattern_type %AdaptCopyable [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] // CHECK:STDOUT: %UInt.type: type = generic_class_type @UInt [concrete] // CHECK:STDOUT: %UInt.generic: %UInt.type = struct_value () [concrete] // CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [concrete] @@ -154,6 +191,14 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %InTuple.type: type = fn_type @InTuple [concrete] // CHECK:STDOUT: %InTuple: %InTuple.type = struct_value () [concrete] // CHECK:STDOUT: %ptr.c30: type = ptr_type %tuple.type.2a3 [concrete] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.type.464: type = fn_type @UInt.as.Copy.impl.Op, @UInt.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.be7: %UInt.as.Copy.impl.Op.type.464 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.bf5: = impl_witness imports.%Copy.impl_witness_table.70d, @UInt.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.type.480: type = fn_type @UInt.as.Copy.impl.Op, @UInt.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.019: %UInt.as.Copy.impl.Op.type.480 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.bbf: %Copy.type = facet_value %u32, (%Copy.impl_witness.bf5) [concrete] +// CHECK:STDOUT: %.8fb: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.bbf [concrete] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.specific_fn: = specific_function %UInt.as.Copy.impl.Op.019, @UInt.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.type.cb6: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%tuple.type.2a3) [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.9b5: %T.as.Destroy.impl.Op.type.cb6 = struct_value () [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: = specific_function %T.as.Destroy.impl.Op.9b5, @T.as.Destroy.impl.Op(%tuple.type.2a3) [concrete] @@ -163,13 +208,17 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .Destroy = %Core.Destroy +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: .UInt = %Core.UInt // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] // CHECK:STDOUT: %Core.UInt: %UInt.type = import_ref Core//prelude/parts/uint, UInt, loaded [concrete = constants.%UInt.generic] +// CHECK:STDOUT: %Core.import_ref.46f: @UInt.as.Copy.impl.%UInt.as.Copy.impl.Op.type (%UInt.as.Copy.impl.Op.type.464) = import_ref Core//prelude/parts/uint, loc17_31, loaded [symbolic = @UInt.as.Copy.impl.%UInt.as.Copy.impl.Op (constants.%UInt.as.Copy.impl.Op.be7)] +// CHECK:STDOUT: %Copy.impl_witness_table.70d = impl_witness_table (%Core.import_ref.46f), @UInt.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -187,9 +236,9 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %return.patt: %pattern_type.cdf = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.cdf = out_param_pattern %return.patt, call_param1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %AdaptCopyable.ref.loc10_27: type = name_ref AdaptCopyable, file.%AdaptCopyable.decl [concrete = constants.%AdaptCopyable] +// CHECK:STDOUT: %AdaptCopyable.ref.loc8_27: type = name_ref AdaptCopyable, file.%AdaptCopyable.decl [concrete = constants.%AdaptCopyable] // CHECK:STDOUT: %c.param: %AdaptCopyable = value_param call_param0 -// CHECK:STDOUT: %AdaptCopyable.ref.loc10_9: type = name_ref AdaptCopyable, file.%AdaptCopyable.decl [concrete = constants.%AdaptCopyable] +// CHECK:STDOUT: %AdaptCopyable.ref.loc8_9: type = name_ref AdaptCopyable, file.%AdaptCopyable.decl [concrete = constants.%AdaptCopyable] // CHECK:STDOUT: %c: %AdaptCopyable = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref %AdaptCopyable = out_param call_param1 // CHECK:STDOUT: %return: ref %AdaptCopyable = return_slot %return.param @@ -200,18 +249,18 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %return.patt: %pattern_type.813 = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.813 = out_param_pattern %return.patt, call_param1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %AdaptCopyable.ref.loc15_41: type = name_ref AdaptCopyable, file.%AdaptCopyable.decl [concrete = constants.%AdaptCopyable] -// CHECK:STDOUT: %int_32.loc15_56: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %u32.loc15_56: type = class_type @UInt, @UInt(constants.%int_32) [concrete = constants.%u32] -// CHECK:STDOUT: %.loc15_59.1: %tuple.type.24b = tuple_literal (%AdaptCopyable.ref.loc15_41, %u32.loc15_56) -// CHECK:STDOUT: %.loc15_59.2: type = converted %.loc15_59.1, constants.%tuple.type.2a3 [concrete = constants.%tuple.type.2a3] +// CHECK:STDOUT: %AdaptCopyable.ref.loc20_41: type = name_ref AdaptCopyable, file.%AdaptCopyable.decl [concrete = constants.%AdaptCopyable] +// CHECK:STDOUT: %int_32.loc20_56: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %u32.loc20_56: type = class_type @UInt, @UInt(constants.%int_32) [concrete = constants.%u32] +// CHECK:STDOUT: %.loc20_59.1: %tuple.type.24b = tuple_literal (%AdaptCopyable.ref.loc20_41, %u32.loc20_56) +// CHECK:STDOUT: %.loc20_59.2: type = converted %.loc20_59.1, constants.%tuple.type.2a3 [concrete = constants.%tuple.type.2a3] // CHECK:STDOUT: %c.param: %tuple.type.2a3 = value_param call_param0 -// CHECK:STDOUT: %.loc15_34.1: type = splice_block %.loc15_34.3 [concrete = constants.%tuple.type.2a3] { -// CHECK:STDOUT: %AdaptCopyable.ref.loc15_16: type = name_ref AdaptCopyable, file.%AdaptCopyable.decl [concrete = constants.%AdaptCopyable] -// CHECK:STDOUT: %int_32.loc15_31: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %u32.loc15_31: type = class_type @UInt, @UInt(constants.%int_32) [concrete = constants.%u32] -// CHECK:STDOUT: %.loc15_34.2: %tuple.type.24b = tuple_literal (%AdaptCopyable.ref.loc15_16, %u32.loc15_31) -// CHECK:STDOUT: %.loc15_34.3: type = converted %.loc15_34.2, constants.%tuple.type.2a3 [concrete = constants.%tuple.type.2a3] +// CHECK:STDOUT: %.loc20_34.1: type = splice_block %.loc20_34.3 [concrete = constants.%tuple.type.2a3] { +// CHECK:STDOUT: %AdaptCopyable.ref.loc20_16: type = name_ref AdaptCopyable, file.%AdaptCopyable.decl [concrete = constants.%AdaptCopyable] +// CHECK:STDOUT: %int_32.loc20_31: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %u32.loc20_31: type = class_type @UInt, @UInt(constants.%int_32) [concrete = constants.%u32] +// CHECK:STDOUT: %.loc20_34.2: %tuple.type.24b = tuple_literal (%AdaptCopyable.ref.loc20_16, %u32.loc20_31) +// CHECK:STDOUT: %.loc20_34.3: type = converted %.loc20_34.2, constants.%tuple.type.2a3 [concrete = constants.%tuple.type.2a3] // CHECK:STDOUT: } // CHECK:STDOUT: %c: %tuple.type.2a3 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref %tuple.type.2a3 = out_param call_param1 @@ -260,15 +309,15 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: } // CHECK:STDOUT: %d.var: ref %AdaptCopyable = var %d.var_patt // CHECK:STDOUT: %c.ref: %AdaptCopyable = name_ref c, %c -// CHECK:STDOUT: assign %d.var, %c.ref -// CHECK:STDOUT: %AdaptCopyable.ref.loc11: type = name_ref AdaptCopyable, file.%AdaptCopyable.decl [concrete = constants.%AdaptCopyable] +// CHECK:STDOUT: assign %d.var, +// CHECK:STDOUT: %AdaptCopyable.ref.loc16: type = name_ref AdaptCopyable, file.%AdaptCopyable.decl [concrete = constants.%AdaptCopyable] // CHECK:STDOUT: %d: ref %AdaptCopyable = bind_name d, %d.var // CHECK:STDOUT: %d.ref: ref %AdaptCopyable = name_ref d, %d -// CHECK:STDOUT: %.loc12: %AdaptCopyable = bind_value %d.ref +// CHECK:STDOUT: %.loc17: %AdaptCopyable = bind_value %d.ref // CHECK:STDOUT: %AdaptCopyable.as.Destroy.impl.Op.bound: = bound_method %d.var, constants.%AdaptCopyable.as.Destroy.impl.Op // CHECK:STDOUT: %addr: %ptr.4c1 = addr_of %d.var // CHECK:STDOUT: %AdaptCopyable.as.Destroy.impl.Op.call: init %empty_tuple.type = call %AdaptCopyable.as.Destroy.impl.Op.bound(%addr) -// CHECK:STDOUT: return %.loc12 +// CHECK:STDOUT: return %.loc17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @InTuple(%c.param: %tuple.type.2a3) -> %return.param: %tuple.type.2a3 { @@ -279,40 +328,50 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: } // CHECK:STDOUT: %d.var: ref %tuple.type.2a3 = var %d.var_patt // CHECK:STDOUT: %c.ref: %tuple.type.2a3 = name_ref c, %c -// CHECK:STDOUT: %tuple.elem0.loc16_33.1: %AdaptCopyable = tuple_access %c.ref, element0 -// CHECK:STDOUT: %tuple.elem0.loc16_33.2: ref %AdaptCopyable = tuple_access %d.var, element0 -// CHECK:STDOUT: %.loc16_33.1: init %AdaptCopyable = initialize_from %tuple.elem0.loc16_33.1 to %tuple.elem0.loc16_33.2 -// CHECK:STDOUT: %tuple.elem1.loc16_33.1: %u32 = tuple_access %c.ref, element1 -// CHECK:STDOUT: %tuple.elem1.loc16_33.2: ref %u32 = tuple_access %d.var, element1 -// CHECK:STDOUT: %.loc16_33.2: init %u32 = initialize_from %tuple.elem1.loc16_33.1 to %tuple.elem1.loc16_33.2 -// CHECK:STDOUT: %.loc16_33.3: init %tuple.type.2a3 = tuple_init (%.loc16_33.1, %.loc16_33.2) to %d.var -// CHECK:STDOUT: %.loc16_3: init %tuple.type.2a3 = converted %c.ref, %.loc16_33.3 -// CHECK:STDOUT: assign %d.var, %.loc16_3 -// CHECK:STDOUT: %.loc16_29.1: type = splice_block %.loc16_29.3 [concrete = constants.%tuple.type.2a3] { -// CHECK:STDOUT: %AdaptCopyable.ref.loc16: type = name_ref AdaptCopyable, file.%AdaptCopyable.decl [concrete = constants.%AdaptCopyable] -// CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %u32.loc16: type = class_type @UInt, @UInt(constants.%int_32) [concrete = constants.%u32] -// CHECK:STDOUT: %.loc16_29.2: %tuple.type.24b = tuple_literal (%AdaptCopyable.ref.loc16, %u32.loc16) -// CHECK:STDOUT: %.loc16_29.3: type = converted %.loc16_29.2, constants.%tuple.type.2a3 [concrete = constants.%tuple.type.2a3] +// CHECK:STDOUT: %tuple.elem0.loc28_33.1: %AdaptCopyable = tuple_access %c.ref, element0 +// CHECK:STDOUT: %tuple.elem0.loc28_33.2: ref %AdaptCopyable = tuple_access %d.var, element0 +// CHECK:STDOUT: %.loc28_33.1: init %AdaptCopyable = initialize_from to %tuple.elem0.loc28_33.2 [concrete = ] +// CHECK:STDOUT: %tuple.elem1.loc28_33.1: %u32 = tuple_access %c.ref, element1 +// CHECK:STDOUT: %impl.elem0.loc28: %.8fb = impl_witness_access constants.%Copy.impl_witness.bf5, element0 [concrete = constants.%UInt.as.Copy.impl.Op.019] +// CHECK:STDOUT: %bound_method.loc28_33.1: = bound_method %tuple.elem1.loc28_33.1, %impl.elem0.loc28 +// CHECK:STDOUT: %specific_fn.loc28: = specific_function %impl.elem0.loc28, @UInt.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%UInt.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc28_33.2: = bound_method %tuple.elem1.loc28_33.1, %specific_fn.loc28 +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.call.loc28: init %u32 = call %bound_method.loc28_33.2(%tuple.elem1.loc28_33.1) +// CHECK:STDOUT: %tuple.elem1.loc28_33.2: ref %u32 = tuple_access %d.var, element1 +// CHECK:STDOUT: %.loc28_33.2: init %u32 = initialize_from %UInt.as.Copy.impl.Op.call.loc28 to %tuple.elem1.loc28_33.2 +// CHECK:STDOUT: %.loc28_33.3: init %tuple.type.2a3 = tuple_init (%.loc28_33.1, %.loc28_33.2) to %d.var +// CHECK:STDOUT: %.loc28_3: init %tuple.type.2a3 = converted %c.ref, %.loc28_33.3 +// CHECK:STDOUT: assign %d.var, %.loc28_3 +// CHECK:STDOUT: %.loc28_29.1: type = splice_block %.loc28_29.3 [concrete = constants.%tuple.type.2a3] { +// CHECK:STDOUT: %AdaptCopyable.ref.loc28: type = name_ref AdaptCopyable, file.%AdaptCopyable.decl [concrete = constants.%AdaptCopyable] +// CHECK:STDOUT: %int_32.loc28: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %u32.loc28: type = class_type @UInt, @UInt(constants.%int_32) [concrete = constants.%u32] +// CHECK:STDOUT: %.loc28_29.2: %tuple.type.24b = tuple_literal (%AdaptCopyable.ref.loc28, %u32.loc28) +// CHECK:STDOUT: %.loc28_29.3: type = converted %.loc28_29.2, constants.%tuple.type.2a3 [concrete = constants.%tuple.type.2a3] // CHECK:STDOUT: } // CHECK:STDOUT: %d: ref %tuple.type.2a3 = bind_name d, %d.var // CHECK:STDOUT: %d.ref: ref %tuple.type.2a3 = name_ref d, %d -// CHECK:STDOUT: %tuple.elem0.loc17_10.1: ref %AdaptCopyable = tuple_access %d.ref, element0 -// CHECK:STDOUT: %.loc17_10.1: %AdaptCopyable = bind_value %tuple.elem0.loc17_10.1 -// CHECK:STDOUT: %tuple.elem0.loc17_10.2: ref %AdaptCopyable = tuple_access %return, element0 -// CHECK:STDOUT: %.loc17_10.2: init %AdaptCopyable = initialize_from %.loc17_10.1 to %tuple.elem0.loc17_10.2 -// CHECK:STDOUT: %tuple.elem1.loc17_10.1: ref %u32 = tuple_access %d.ref, element1 -// CHECK:STDOUT: %.loc17_10.3: %u32 = bind_value %tuple.elem1.loc17_10.1 -// CHECK:STDOUT: %tuple.elem1.loc17_10.2: ref %u32 = tuple_access %return, element1 -// CHECK:STDOUT: %.loc17_10.4: init %u32 = initialize_from %.loc17_10.3 to %tuple.elem1.loc17_10.2 -// CHECK:STDOUT: %.loc17_10.5: init %tuple.type.2a3 = tuple_init (%.loc17_10.2, %.loc17_10.4) to %return -// CHECK:STDOUT: %.loc17_11: init %tuple.type.2a3 = converted %d.ref, %.loc17_10.5 +// CHECK:STDOUT: %tuple.elem0.loc36_10.1: ref %AdaptCopyable = tuple_access %d.ref, element0 +// CHECK:STDOUT: %.loc36_10.1: %AdaptCopyable = bind_value %tuple.elem0.loc36_10.1 +// CHECK:STDOUT: %tuple.elem0.loc36_10.2: ref %AdaptCopyable = tuple_access %return, element0 +// CHECK:STDOUT: %.loc36_10.2: init %AdaptCopyable = initialize_from to %tuple.elem0.loc36_10.2 [concrete = ] +// CHECK:STDOUT: %tuple.elem1.loc36_10.1: ref %u32 = tuple_access %d.ref, element1 +// CHECK:STDOUT: %.loc36_10.3: %u32 = bind_value %tuple.elem1.loc36_10.1 +// CHECK:STDOUT: %impl.elem0.loc36: %.8fb = impl_witness_access constants.%Copy.impl_witness.bf5, element0 [concrete = constants.%UInt.as.Copy.impl.Op.019] +// CHECK:STDOUT: %bound_method.loc36_10.1: = bound_method %.loc36_10.3, %impl.elem0.loc36 +// CHECK:STDOUT: %specific_fn.loc36: = specific_function %impl.elem0.loc36, @UInt.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%UInt.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc36_10.2: = bound_method %.loc36_10.3, %specific_fn.loc36 +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.call.loc36: init %u32 = call %bound_method.loc36_10.2(%.loc36_10.3) +// CHECK:STDOUT: %tuple.elem1.loc36_10.2: ref %u32 = tuple_access %return, element1 +// CHECK:STDOUT: %.loc36_10.4: init %u32 = initialize_from %UInt.as.Copy.impl.Op.call.loc36 to %tuple.elem1.loc36_10.2 +// CHECK:STDOUT: %.loc36_10.5: init %tuple.type.2a3 = tuple_init (%.loc36_10.2, %.loc36_10.4) to %return +// CHECK:STDOUT: %.loc36_11: init %tuple.type.2a3 = converted %d.ref, %.loc36_10.5 // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound: = bound_method %d.var, constants.%T.as.Destroy.impl.Op.9b5 // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: = specific_function constants.%T.as.Destroy.impl.Op.9b5, @T.as.Destroy.impl.Op(constants.%tuple.type.2a3) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method: = bound_method %d.var, %T.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %bound_method.loc28_3: = bound_method %d.var, %T.as.Destroy.impl.Op.specific_fn // CHECK:STDOUT: %addr: %ptr.c30 = addr_of %d.var -// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr) -// CHECK:STDOUT: return %.loc17_11 to %return +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc28_3(%addr) +// CHECK:STDOUT: return %.loc36_11 to %return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- adapt_copyable_tuple.carbon @@ -323,6 +382,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete] // CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [concrete] @@ -337,6 +397,16 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %pattern_type.562: type = pattern_type %AdaptTuple [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %UInt.type: type = generic_class_type @UInt [concrete] // CHECK:STDOUT: %UInt.generic: %UInt.type = struct_value () [concrete] // CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [concrete] @@ -344,6 +414,14 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %pattern_type.c9e: type = pattern_type %tuple.type.f69 [concrete] // CHECK:STDOUT: %InTuple.type: type = fn_type @InTuple [concrete] // CHECK:STDOUT: %InTuple: %InTuple.type = struct_value () [concrete] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.type.464: type = fn_type @UInt.as.Copy.impl.Op, @UInt.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.be7: %UInt.as.Copy.impl.Op.type.464 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.bf5: = impl_witness imports.%Copy.impl_witness_table.70d, @UInt.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.type.480: type = fn_type @UInt.as.Copy.impl.Op, @UInt.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.019: %UInt.as.Copy.impl.Op.type.480 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.bbf: %Copy.type = facet_value %u32, (%Copy.impl_witness.bf5) [concrete] +// CHECK:STDOUT: %.8fb: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.bbf [concrete] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.specific_fn: = specific_function %UInt.as.Copy.impl.Op.019, @UInt.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.type.b65: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%tuple.type.f69) [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.5e0: %T.as.Destroy.impl.Op.type.b65 = struct_value () [concrete] // CHECK:STDOUT: %ptr.ed5: type = ptr_type %tuple.type.f69 [concrete] @@ -354,13 +432,19 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .Destroy = %Core.Destroy +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: .UInt = %Core.UInt // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: %Core.UInt: %UInt.type = import_ref Core//prelude/parts/uint, UInt, loaded [concrete = constants.%UInt.generic] +// CHECK:STDOUT: %Core.import_ref.46f: @UInt.as.Copy.impl.%UInt.as.Copy.impl.Op.type (%UInt.as.Copy.impl.Op.type.464) = import_ref Core//prelude/parts/uint, loc17_31, loaded [symbolic = @UInt.as.Copy.impl.%UInt.as.Copy.impl.Op (constants.%UInt.as.Copy.impl.Op.be7)] +// CHECK:STDOUT: %Copy.impl_witness_table.70d = impl_witness_table (%Core.import_ref.46f), @UInt.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -457,12 +541,22 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %c.ref: %AdaptTuple = name_ref c, %c // CHECK:STDOUT: %.loc9_3.1: %tuple.type.d07 = as_compatible %c.ref // CHECK:STDOUT: %tuple.elem0.loc9_3.1: %i32 = tuple_access %.loc9_3.1, element0 +// CHECK:STDOUT: %impl.elem0.loc9_3.1: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc9_3.1: = bound_method %tuple.elem0.loc9_3.1, %impl.elem0.loc9_3.1 +// CHECK:STDOUT: %specific_fn.loc9_3.1: = specific_function %impl.elem0.loc9_3.1, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_3.2: = bound_method %tuple.elem0.loc9_3.1, %specific_fn.loc9_3.1 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc9_3.1: init %i32 = call %bound_method.loc9_3.2(%tuple.elem0.loc9_3.1) // CHECK:STDOUT: %.loc9_3.2: ref %tuple.type.d07 = as_compatible %d.var // CHECK:STDOUT: %tuple.elem0.loc9_3.2: ref %i32 = tuple_access %.loc9_3.2, element0 -// CHECK:STDOUT: %.loc9_3.3: init %i32 = initialize_from %tuple.elem0.loc9_3.1 to %tuple.elem0.loc9_3.2 +// CHECK:STDOUT: %.loc9_3.3: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc9_3.1 to %tuple.elem0.loc9_3.2 // CHECK:STDOUT: %tuple.elem1.loc9_3.1: %i32 = tuple_access %.loc9_3.1, element1 +// CHECK:STDOUT: %impl.elem0.loc9_3.2: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc9_3.3: = bound_method %tuple.elem1.loc9_3.1, %impl.elem0.loc9_3.2 +// CHECK:STDOUT: %specific_fn.loc9_3.2: = specific_function %impl.elem0.loc9_3.2, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_3.4: = bound_method %tuple.elem1.loc9_3.1, %specific_fn.loc9_3.2 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc9_3.2: init %i32 = call %bound_method.loc9_3.4(%tuple.elem1.loc9_3.1) // CHECK:STDOUT: %tuple.elem1.loc9_3.2: ref %i32 = tuple_access %.loc9_3.2, element1 -// CHECK:STDOUT: %.loc9_3.4: init %i32 = initialize_from %tuple.elem1.loc9_3.1 to %tuple.elem1.loc9_3.2 +// CHECK:STDOUT: %.loc9_3.4: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc9_3.2 to %tuple.elem1.loc9_3.2 // CHECK:STDOUT: %.loc9_3.5: init %tuple.type.d07 = tuple_init (%.loc9_3.3, %.loc9_3.4) to %.loc9_3.2 // CHECK:STDOUT: %.loc9_3.6: init %AdaptTuple = as_compatible %.loc9_3.5 // CHECK:STDOUT: %.loc9_3.7: init %AdaptTuple = converted %c.ref, %.loc9_3.6 @@ -473,13 +567,23 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %.loc10_11.1: ref %tuple.type.d07 = as_compatible %d.ref // CHECK:STDOUT: %tuple.elem0.loc10_11.1: ref %i32 = tuple_access %.loc10_11.1, element0 // CHECK:STDOUT: %.loc10_11.2: %i32 = bind_value %tuple.elem0.loc10_11.1 +// CHECK:STDOUT: %impl.elem0.loc10_11.1: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc10_11.1: = bound_method %.loc10_11.2, %impl.elem0.loc10_11.1 +// CHECK:STDOUT: %specific_fn.loc10_11.1: = specific_function %impl.elem0.loc10_11.1, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_11.2: = bound_method %.loc10_11.2, %specific_fn.loc10_11.1 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc10_11.1: init %i32 = call %bound_method.loc10_11.2(%.loc10_11.2) // CHECK:STDOUT: %.loc10_11.3: ref %tuple.type.d07 = as_compatible %return // CHECK:STDOUT: %tuple.elem0.loc10_11.2: ref %i32 = tuple_access %.loc10_11.3, element0 -// CHECK:STDOUT: %.loc10_11.4: init %i32 = initialize_from %.loc10_11.2 to %tuple.elem0.loc10_11.2 +// CHECK:STDOUT: %.loc10_11.4: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc10_11.1 to %tuple.elem0.loc10_11.2 // CHECK:STDOUT: %tuple.elem1.loc10_11.1: ref %i32 = tuple_access %.loc10_11.1, element1 // CHECK:STDOUT: %.loc10_11.5: %i32 = bind_value %tuple.elem1.loc10_11.1 +// CHECK:STDOUT: %impl.elem0.loc10_11.2: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc10_11.3: = bound_method %.loc10_11.5, %impl.elem0.loc10_11.2 +// CHECK:STDOUT: %specific_fn.loc10_11.2: = specific_function %impl.elem0.loc10_11.2, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_11.4: = bound_method %.loc10_11.5, %specific_fn.loc10_11.2 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc10_11.2: init %i32 = call %bound_method.loc10_11.4(%.loc10_11.5) // CHECK:STDOUT: %tuple.elem1.loc10_11.2: ref %i32 = tuple_access %.loc10_11.3, element1 -// CHECK:STDOUT: %.loc10_11.6: init %i32 = initialize_from %.loc10_11.5 to %tuple.elem1.loc10_11.2 +// CHECK:STDOUT: %.loc10_11.6: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc10_11.2 to %tuple.elem1.loc10_11.2 // CHECK:STDOUT: %.loc10_11.7: init %tuple.type.d07 = tuple_init (%.loc10_11.4, %.loc10_11.6) to %.loc10_11.3 // CHECK:STDOUT: %.loc10_11.8: init %AdaptTuple = as_compatible %.loc10_11.7 // CHECK:STDOUT: %.loc10_11.9: init %AdaptTuple = converted %d.ref, %.loc10_11.8 @@ -500,19 +604,34 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %tuple.elem0.loc14_30.1: %AdaptTuple = tuple_access %c.ref, element0 // CHECK:STDOUT: %.loc14_30.1: %tuple.type.d07 = as_compatible %tuple.elem0.loc14_30.1 // CHECK:STDOUT: %tuple.elem0.loc14_30.2: %i32 = tuple_access %.loc14_30.1, element0 +// CHECK:STDOUT: %impl.elem0.loc14_30.1: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc14_30.1: = bound_method %tuple.elem0.loc14_30.2, %impl.elem0.loc14_30.1 +// CHECK:STDOUT: %specific_fn.loc14_30.1: = specific_function %impl.elem0.loc14_30.1, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_30.2: = bound_method %tuple.elem0.loc14_30.2, %specific_fn.loc14_30.1 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc14_30.1: init %i32 = call %bound_method.loc14_30.2(%tuple.elem0.loc14_30.2) // CHECK:STDOUT: %tuple.elem0.loc14_30.3: ref %AdaptTuple = tuple_access %d.var, element0 // CHECK:STDOUT: %.loc14_30.2: ref %tuple.type.d07 = as_compatible %tuple.elem0.loc14_30.3 // CHECK:STDOUT: %tuple.elem0.loc14_30.4: ref %i32 = tuple_access %.loc14_30.2, element0 -// CHECK:STDOUT: %.loc14_30.3: init %i32 = initialize_from %tuple.elem0.loc14_30.2 to %tuple.elem0.loc14_30.4 +// CHECK:STDOUT: %.loc14_30.3: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc14_30.1 to %tuple.elem0.loc14_30.4 // CHECK:STDOUT: %tuple.elem1.loc14_30.1: %i32 = tuple_access %.loc14_30.1, element1 +// CHECK:STDOUT: %impl.elem0.loc14_30.2: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc14_30.3: = bound_method %tuple.elem1.loc14_30.1, %impl.elem0.loc14_30.2 +// CHECK:STDOUT: %specific_fn.loc14_30.2: = specific_function %impl.elem0.loc14_30.2, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_30.4: = bound_method %tuple.elem1.loc14_30.1, %specific_fn.loc14_30.2 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc14_30.2: init %i32 = call %bound_method.loc14_30.4(%tuple.elem1.loc14_30.1) // CHECK:STDOUT: %tuple.elem1.loc14_30.2: ref %i32 = tuple_access %.loc14_30.2, element1 -// CHECK:STDOUT: %.loc14_30.4: init %i32 = initialize_from %tuple.elem1.loc14_30.1 to %tuple.elem1.loc14_30.2 +// CHECK:STDOUT: %.loc14_30.4: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc14_30.2 to %tuple.elem1.loc14_30.2 // CHECK:STDOUT: %.loc14_30.5: init %tuple.type.d07 = tuple_init (%.loc14_30.3, %.loc14_30.4) to %.loc14_30.2 // CHECK:STDOUT: %.loc14_30.6: init %AdaptTuple = as_compatible %.loc14_30.5 // CHECK:STDOUT: %.loc14_30.7: init %AdaptTuple = converted %tuple.elem0.loc14_30.1, %.loc14_30.6 // CHECK:STDOUT: %tuple.elem1.loc14_30.3: %u32 = tuple_access %c.ref, element1 +// CHECK:STDOUT: %impl.elem0.loc14_30.3: %.8fb = impl_witness_access constants.%Copy.impl_witness.bf5, element0 [concrete = constants.%UInt.as.Copy.impl.Op.019] +// CHECK:STDOUT: %bound_method.loc14_30.5: = bound_method %tuple.elem1.loc14_30.3, %impl.elem0.loc14_30.3 +// CHECK:STDOUT: %specific_fn.loc14_30.3: = specific_function %impl.elem0.loc14_30.3, @UInt.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%UInt.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_30.6: = bound_method %tuple.elem1.loc14_30.3, %specific_fn.loc14_30.3 +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.call.loc14: init %u32 = call %bound_method.loc14_30.6(%tuple.elem1.loc14_30.3) // CHECK:STDOUT: %tuple.elem1.loc14_30.4: ref %u32 = tuple_access %d.var, element1 -// CHECK:STDOUT: %.loc14_30.8: init %u32 = initialize_from %tuple.elem1.loc14_30.3 to %tuple.elem1.loc14_30.4 +// CHECK:STDOUT: %.loc14_30.8: init %u32 = initialize_from %UInt.as.Copy.impl.Op.call.loc14 to %tuple.elem1.loc14_30.4 // CHECK:STDOUT: %.loc14_30.9: init %tuple.type.f69 = tuple_init (%.loc14_30.7, %.loc14_30.8) to %d.var // CHECK:STDOUT: %.loc14_3: init %tuple.type.f69 = converted %c.ref, %.loc14_30.9 // CHECK:STDOUT: assign %d.var, %.loc14_3 @@ -529,28 +648,43 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %.loc15_10.1: ref %tuple.type.d07 = as_compatible %tuple.elem0.loc15_10.1 // CHECK:STDOUT: %tuple.elem0.loc15_10.2: ref %i32 = tuple_access %.loc15_10.1, element0 // CHECK:STDOUT: %.loc15_10.2: %i32 = bind_value %tuple.elem0.loc15_10.2 +// CHECK:STDOUT: %impl.elem0.loc15_10.1: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc15_10.1: = bound_method %.loc15_10.2, %impl.elem0.loc15_10.1 +// CHECK:STDOUT: %specific_fn.loc15_10.1: = specific_function %impl.elem0.loc15_10.1, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc15_10.2: = bound_method %.loc15_10.2, %specific_fn.loc15_10.1 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc15_10.1: init %i32 = call %bound_method.loc15_10.2(%.loc15_10.2) // CHECK:STDOUT: %tuple.elem0.loc15_10.3: ref %AdaptTuple = tuple_access %return, element0 // CHECK:STDOUT: %.loc15_10.3: ref %tuple.type.d07 = as_compatible %tuple.elem0.loc15_10.3 // CHECK:STDOUT: %tuple.elem0.loc15_10.4: ref %i32 = tuple_access %.loc15_10.3, element0 -// CHECK:STDOUT: %.loc15_10.4: init %i32 = initialize_from %.loc15_10.2 to %tuple.elem0.loc15_10.4 +// CHECK:STDOUT: %.loc15_10.4: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc15_10.1 to %tuple.elem0.loc15_10.4 // CHECK:STDOUT: %tuple.elem1.loc15_10.1: ref %i32 = tuple_access %.loc15_10.1, element1 // CHECK:STDOUT: %.loc15_10.5: %i32 = bind_value %tuple.elem1.loc15_10.1 +// CHECK:STDOUT: %impl.elem0.loc15_10.2: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc15_10.3: = bound_method %.loc15_10.5, %impl.elem0.loc15_10.2 +// CHECK:STDOUT: %specific_fn.loc15_10.2: = specific_function %impl.elem0.loc15_10.2, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc15_10.4: = bound_method %.loc15_10.5, %specific_fn.loc15_10.2 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc15_10.2: init %i32 = call %bound_method.loc15_10.4(%.loc15_10.5) // CHECK:STDOUT: %tuple.elem1.loc15_10.2: ref %i32 = tuple_access %.loc15_10.3, element1 -// CHECK:STDOUT: %.loc15_10.6: init %i32 = initialize_from %.loc15_10.5 to %tuple.elem1.loc15_10.2 +// CHECK:STDOUT: %.loc15_10.6: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc15_10.2 to %tuple.elem1.loc15_10.2 // CHECK:STDOUT: %.loc15_10.7: init %tuple.type.d07 = tuple_init (%.loc15_10.4, %.loc15_10.6) to %.loc15_10.3 // CHECK:STDOUT: %.loc15_10.8: init %AdaptTuple = as_compatible %.loc15_10.7 // CHECK:STDOUT: %.loc15_10.9: init %AdaptTuple = converted %tuple.elem0.loc15_10.1, %.loc15_10.8 // CHECK:STDOUT: %tuple.elem1.loc15_10.3: ref %u32 = tuple_access %d.ref, element1 // CHECK:STDOUT: %.loc15_10.10: %u32 = bind_value %tuple.elem1.loc15_10.3 +// CHECK:STDOUT: %impl.elem0.loc15_10.3: %.8fb = impl_witness_access constants.%Copy.impl_witness.bf5, element0 [concrete = constants.%UInt.as.Copy.impl.Op.019] +// CHECK:STDOUT: %bound_method.loc15_10.5: = bound_method %.loc15_10.10, %impl.elem0.loc15_10.3 +// CHECK:STDOUT: %specific_fn.loc15_10.3: = specific_function %impl.elem0.loc15_10.3, @UInt.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%UInt.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc15_10.6: = bound_method %.loc15_10.10, %specific_fn.loc15_10.3 +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.call.loc15: init %u32 = call %bound_method.loc15_10.6(%.loc15_10.10) // CHECK:STDOUT: %tuple.elem1.loc15_10.4: ref %u32 = tuple_access %return, element1 -// CHECK:STDOUT: %.loc15_10.11: init %u32 = initialize_from %.loc15_10.10 to %tuple.elem1.loc15_10.4 +// CHECK:STDOUT: %.loc15_10.11: init %u32 = initialize_from %UInt.as.Copy.impl.Op.call.loc15 to %tuple.elem1.loc15_10.4 // CHECK:STDOUT: %.loc15_10.12: init %tuple.type.f69 = tuple_init (%.loc15_10.9, %.loc15_10.11) to %return // CHECK:STDOUT: %.loc15_11: init %tuple.type.f69 = converted %d.ref, %.loc15_10.12 // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound: = bound_method %d.var, constants.%T.as.Destroy.impl.Op.5e0 // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: = specific_function constants.%T.as.Destroy.impl.Op.5e0, @T.as.Destroy.impl.Op(constants.%tuple.type.f69) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method: = bound_method %d.var, %T.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %bound_method.loc14_3: = bound_method %d.var, %T.as.Destroy.impl.Op.specific_fn // CHECK:STDOUT: %addr: %ptr.ed5 = addr_of %d.var -// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr) +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc14_3(%addr) // CHECK:STDOUT: return %.loc15_11 to %return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -577,15 +711,18 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %pattern_type.8f9: type = pattern_type %AdaptNoncopyable [concrete] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Destroy = %Core.Destroy +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -685,10 +822,10 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %b.var: ref %AdaptNoncopyable = var %b.var_patt // CHECK:STDOUT: %a.ref: %AdaptNoncopyable = name_ref a, %a // CHECK:STDOUT: assign %b.var, -// CHECK:STDOUT: %AdaptNoncopyable.ref.loc17: type = name_ref AdaptNoncopyable, file.%AdaptNoncopyable.decl [concrete = constants.%AdaptNoncopyable] +// CHECK:STDOUT: %AdaptNoncopyable.ref.loc20: type = name_ref AdaptNoncopyable, file.%AdaptNoncopyable.decl [concrete = constants.%AdaptNoncopyable] // CHECK:STDOUT: %b: ref %AdaptNoncopyable = bind_name b, %b.var // CHECK:STDOUT: %b.ref: ref %AdaptNoncopyable = name_ref b, %b -// CHECK:STDOUT: %.loc22: %AdaptNoncopyable = bind_value %b.ref +// CHECK:STDOUT: %.loc28: %AdaptNoncopyable = bind_value %b.ref // CHECK:STDOUT: %AdaptNoncopyable.as.Destroy.impl.Op.bound: = bound_method %b.var, constants.%AdaptNoncopyable.as.Destroy.impl.Op // CHECK:STDOUT: %addr: %ptr.ed9 = addr_of %b.var // CHECK:STDOUT: %AdaptNoncopyable.as.Destroy.impl.Op.call: init %empty_tuple.type = call %AdaptNoncopyable.as.Destroy.impl.Op.bound(%addr) @@ -713,6 +850,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %tuple.type.ff9: type = tuple_type (type, type, type) [concrete] // CHECK:STDOUT: %tuple.type.c9a: type = tuple_type (%i32, %Noncopyable, %i32) [concrete] @@ -725,17 +863,31 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %pattern_type.7e5: type = pattern_type %AdaptNoncopyableIndirect [concrete] // CHECK:STDOUT: %H.type: type = fn_type @H [concrete] // CHECK:STDOUT: %H: %H.type = struct_value () [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: .Int = %Core.Int +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -840,24 +992,34 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: } // CHECK:STDOUT: %b.var: ref %AdaptNoncopyableIndirect = var %b.var_patt // CHECK:STDOUT: %a.ref: %AdaptNoncopyableIndirect = name_ref a, %a -// CHECK:STDOUT: %.loc20_3.1: %tuple.type.c9a = as_compatible %a.ref -// CHECK:STDOUT: %tuple.elem0.loc20_3.1: %i32 = tuple_access %.loc20_3.1, element0 -// CHECK:STDOUT: %.loc20_3.2: ref %tuple.type.c9a = as_compatible %b.var -// CHECK:STDOUT: %tuple.elem0.loc20_3.2: ref %i32 = tuple_access %.loc20_3.2, element0 -// CHECK:STDOUT: %.loc20_3.3: init %i32 = initialize_from %tuple.elem0.loc20_3.1 to %tuple.elem0.loc20_3.2 -// CHECK:STDOUT: %tuple.elem1.loc20: %Noncopyable = tuple_access %.loc20_3.1, element1 +// CHECK:STDOUT: %.loc23_3.1: %tuple.type.c9a = as_compatible %a.ref +// CHECK:STDOUT: %tuple.elem0.loc23_3.1: %i32 = tuple_access %.loc23_3.1, element0 +// CHECK:STDOUT: %impl.elem0.loc23: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc23_3.1: = bound_method %tuple.elem0.loc23_3.1, %impl.elem0.loc23 +// CHECK:STDOUT: %specific_fn.loc23: = specific_function %impl.elem0.loc23, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc23_3.2: = bound_method %tuple.elem0.loc23_3.1, %specific_fn.loc23 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc23: init %i32 = call %bound_method.loc23_3.2(%tuple.elem0.loc23_3.1) +// CHECK:STDOUT: %.loc23_3.2: ref %tuple.type.c9a = as_compatible %b.var +// CHECK:STDOUT: %tuple.elem0.loc23_3.2: ref %i32 = tuple_access %.loc23_3.2, element0 +// CHECK:STDOUT: %.loc23_3.3: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc23 to %tuple.elem0.loc23_3.2 +// CHECK:STDOUT: %tuple.elem1.loc23: %Noncopyable = tuple_access %.loc23_3.1, element1 // CHECK:STDOUT: assign %b.var, -// CHECK:STDOUT: %AdaptNoncopyableIndirect.ref.loc20: type = name_ref AdaptNoncopyableIndirect, file.%AdaptNoncopyableIndirect.decl [concrete = constants.%AdaptNoncopyableIndirect] +// CHECK:STDOUT: %AdaptNoncopyableIndirect.ref.loc23: type = name_ref AdaptNoncopyableIndirect, file.%AdaptNoncopyableIndirect.decl [concrete = constants.%AdaptNoncopyableIndirect] // CHECK:STDOUT: %b: ref %AdaptNoncopyableIndirect = bind_name b, %b.var // CHECK:STDOUT: %b.ref: ref %AdaptNoncopyableIndirect = name_ref b, %b -// CHECK:STDOUT: %.loc28_11.1: ref %tuple.type.c9a = as_compatible %b.ref -// CHECK:STDOUT: %tuple.elem0.loc28_11.1: ref %i32 = tuple_access %.loc28_11.1, element0 -// CHECK:STDOUT: %.loc28_11.2: %i32 = bind_value %tuple.elem0.loc28_11.1 -// CHECK:STDOUT: %.loc28_11.3: ref %tuple.type.c9a = as_compatible %return -// CHECK:STDOUT: %tuple.elem0.loc28_11.2: ref %i32 = tuple_access %.loc28_11.3, element0 -// CHECK:STDOUT: %.loc28_11.4: init %i32 = initialize_from %.loc28_11.2 to %tuple.elem0.loc28_11.2 -// CHECK:STDOUT: %tuple.elem1.loc28: ref %Noncopyable = tuple_access %.loc28_11.1, element1 -// CHECK:STDOUT: %.loc28_11.5: %Noncopyable = bind_value %tuple.elem1.loc28 +// CHECK:STDOUT: %.loc34_11.1: ref %tuple.type.c9a = as_compatible %b.ref +// CHECK:STDOUT: %tuple.elem0.loc34_11.1: ref %i32 = tuple_access %.loc34_11.1, element0 +// CHECK:STDOUT: %.loc34_11.2: %i32 = bind_value %tuple.elem0.loc34_11.1 +// CHECK:STDOUT: %impl.elem0.loc34: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc34_11.1: = bound_method %.loc34_11.2, %impl.elem0.loc34 +// CHECK:STDOUT: %specific_fn.loc34: = specific_function %impl.elem0.loc34, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc34_11.2: = bound_method %.loc34_11.2, %specific_fn.loc34 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc34: init %i32 = call %bound_method.loc34_11.2(%.loc34_11.2) +// CHECK:STDOUT: %.loc34_11.3: ref %tuple.type.c9a = as_compatible %return +// CHECK:STDOUT: %tuple.elem0.loc34_11.2: ref %i32 = tuple_access %.loc34_11.3, element0 +// CHECK:STDOUT: %.loc34_11.4: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc34 to %tuple.elem0.loc34_11.2 +// CHECK:STDOUT: %tuple.elem1.loc34: ref %Noncopyable = tuple_access %.loc34_11.1, element1 +// CHECK:STDOUT: %.loc34_11.5: %Noncopyable = bind_value %tuple.elem1.loc34 // CHECK:STDOUT: %AdaptNoncopyableIndirect.as.Destroy.impl.Op.bound: = bound_method %b.var, constants.%AdaptNoncopyableIndirect.as.Destroy.impl.Op // CHECK:STDOUT: %addr: %ptr.921 = addr_of %b.var // CHECK:STDOUT: %AdaptNoncopyableIndirect.as.Destroy.impl.Op.call: init %empty_tuple.type = call %AdaptNoncopyableIndirect.as.Destroy.impl.Op.bound(%addr) @@ -872,6 +1034,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %struct_type.e.f: type = struct_type {.e: %i32, .f: %i32} [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] @@ -885,6 +1048,16 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %pattern_type.f45: type = pattern_type %AdaptStruct [concrete] // CHECK:STDOUT: %I.type: type = fn_type @I [concrete] // CHECK:STDOUT: %I: %I.type = struct_value () [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %UInt.type: type = generic_class_type @UInt [concrete] // CHECK:STDOUT: %UInt.generic: %UInt.type = struct_value () [concrete] // CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [concrete] @@ -893,6 +1066,14 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %pattern_type.31d: type = pattern_type %tuple.type.80b [concrete] // CHECK:STDOUT: %InTuple.type: type = fn_type @InTuple [concrete] // CHECK:STDOUT: %InTuple: %InTuple.type = struct_value () [concrete] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.type.464: type = fn_type @UInt.as.Copy.impl.Op, @UInt.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.be7: %UInt.as.Copy.impl.Op.type.464 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.bf5: = impl_witness imports.%Copy.impl_witness_table.70d, @UInt.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.type.480: type = fn_type @UInt.as.Copy.impl.Op, @UInt.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.019: %UInt.as.Copy.impl.Op.type.480 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.bbf: %Copy.type = facet_value %u32, (%Copy.impl_witness.bf5) [concrete] +// CHECK:STDOUT: %.8fb: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.bbf [concrete] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.specific_fn: = specific_function %UInt.as.Copy.impl.Op.019, @UInt.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.type.e9a: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%tuple.type.80b) [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.3f2: %T.as.Destroy.impl.Op.type.e9a = struct_value () [concrete] // CHECK:STDOUT: %ptr.b09: type = ptr_type %tuple.type.80b [concrete] @@ -903,13 +1084,19 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .Destroy = %Core.Destroy +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: .UInt = %Core.UInt // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: %Core.UInt: %UInt.type = import_ref Core//prelude/parts/uint, UInt, loaded [concrete = constants.%UInt.generic] +// CHECK:STDOUT: %Core.import_ref.46f: @UInt.as.Copy.impl.%UInt.as.Copy.impl.Op.type (%UInt.as.Copy.impl.Op.type.464) = import_ref Core//prelude/parts/uint, loc17_31, loaded [symbolic = @UInt.as.Copy.impl.%UInt.as.Copy.impl.Op (constants.%UInt.as.Copy.impl.Op.be7)] +// CHECK:STDOUT: %Copy.impl_witness_table.70d = impl_witness_table (%Core.import_ref.46f), @UInt.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1005,12 +1192,22 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %g.ref: %AdaptStruct = name_ref g, %g // CHECK:STDOUT: %.loc9_3.1: %struct_type.e.f = as_compatible %g.ref // CHECK:STDOUT: %.loc9_3.2: %i32 = struct_access %.loc9_3.1, element0 +// CHECK:STDOUT: %impl.elem0.loc9_3.1: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc9_3.1: = bound_method %.loc9_3.2, %impl.elem0.loc9_3.1 +// CHECK:STDOUT: %specific_fn.loc9_3.1: = specific_function %impl.elem0.loc9_3.1, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_3.2: = bound_method %.loc9_3.2, %specific_fn.loc9_3.1 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc9_3.1: init %i32 = call %bound_method.loc9_3.2(%.loc9_3.2) // CHECK:STDOUT: %.loc9_3.3: ref %struct_type.e.f = as_compatible %h.var // CHECK:STDOUT: %.loc9_3.4: ref %i32 = struct_access %.loc9_3.3, element0 -// CHECK:STDOUT: %.loc9_3.5: init %i32 = initialize_from %.loc9_3.2 to %.loc9_3.4 +// CHECK:STDOUT: %.loc9_3.5: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc9_3.1 to %.loc9_3.4 // CHECK:STDOUT: %.loc9_3.6: %i32 = struct_access %.loc9_3.1, element1 +// CHECK:STDOUT: %impl.elem0.loc9_3.2: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc9_3.3: = bound_method %.loc9_3.6, %impl.elem0.loc9_3.2 +// CHECK:STDOUT: %specific_fn.loc9_3.2: = specific_function %impl.elem0.loc9_3.2, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_3.4: = bound_method %.loc9_3.6, %specific_fn.loc9_3.2 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc9_3.2: init %i32 = call %bound_method.loc9_3.4(%.loc9_3.6) // CHECK:STDOUT: %.loc9_3.7: ref %i32 = struct_access %.loc9_3.3, element1 -// CHECK:STDOUT: %.loc9_3.8: init %i32 = initialize_from %.loc9_3.6 to %.loc9_3.7 +// CHECK:STDOUT: %.loc9_3.8: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc9_3.2 to %.loc9_3.7 // CHECK:STDOUT: %.loc9_3.9: init %struct_type.e.f = struct_init (%.loc9_3.5, %.loc9_3.8) to %.loc9_3.3 // CHECK:STDOUT: %.loc9_3.10: init %AdaptStruct = as_compatible %.loc9_3.9 // CHECK:STDOUT: %.loc9_3.11: init %AdaptStruct = converted %g.ref, %.loc9_3.10 @@ -1021,13 +1218,23 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %.loc10_11.1: ref %struct_type.e.f = as_compatible %h.ref // CHECK:STDOUT: %.loc10_11.2: ref %i32 = struct_access %.loc10_11.1, element0 // CHECK:STDOUT: %.loc10_11.3: %i32 = bind_value %.loc10_11.2 +// CHECK:STDOUT: %impl.elem0.loc10_11.1: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc10_11.1: = bound_method %.loc10_11.3, %impl.elem0.loc10_11.1 +// CHECK:STDOUT: %specific_fn.loc10_11.1: = specific_function %impl.elem0.loc10_11.1, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_11.2: = bound_method %.loc10_11.3, %specific_fn.loc10_11.1 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc10_11.1: init %i32 = call %bound_method.loc10_11.2(%.loc10_11.3) // CHECK:STDOUT: %.loc10_11.4: ref %struct_type.e.f = as_compatible %return // CHECK:STDOUT: %.loc10_11.5: ref %i32 = struct_access %.loc10_11.4, element0 -// CHECK:STDOUT: %.loc10_11.6: init %i32 = initialize_from %.loc10_11.3 to %.loc10_11.5 +// CHECK:STDOUT: %.loc10_11.6: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc10_11.1 to %.loc10_11.5 // CHECK:STDOUT: %.loc10_11.7: ref %i32 = struct_access %.loc10_11.1, element1 // CHECK:STDOUT: %.loc10_11.8: %i32 = bind_value %.loc10_11.7 +// CHECK:STDOUT: %impl.elem0.loc10_11.2: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc10_11.3: = bound_method %.loc10_11.8, %impl.elem0.loc10_11.2 +// CHECK:STDOUT: %specific_fn.loc10_11.2: = specific_function %impl.elem0.loc10_11.2, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_11.4: = bound_method %.loc10_11.8, %specific_fn.loc10_11.2 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc10_11.2: init %i32 = call %bound_method.loc10_11.4(%.loc10_11.8) // CHECK:STDOUT: %.loc10_11.9: ref %i32 = struct_access %.loc10_11.4, element1 -// CHECK:STDOUT: %.loc10_11.10: init %i32 = initialize_from %.loc10_11.8 to %.loc10_11.9 +// CHECK:STDOUT: %.loc10_11.10: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc10_11.2 to %.loc10_11.9 // CHECK:STDOUT: %.loc10_11.11: init %struct_type.e.f = struct_init (%.loc10_11.6, %.loc10_11.10) to %.loc10_11.4 // CHECK:STDOUT: %.loc10_11.12: init %AdaptStruct = as_compatible %.loc10_11.11 // CHECK:STDOUT: %.loc10_11.13: init %AdaptStruct = converted %h.ref, %.loc10_11.12 @@ -1048,19 +1255,34 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %tuple.elem0.loc14_31.1: %AdaptStruct = tuple_access %c.ref, element0 // CHECK:STDOUT: %.loc14_31.1: %struct_type.e.f = as_compatible %tuple.elem0.loc14_31.1 // CHECK:STDOUT: %.loc14_31.2: %i32 = struct_access %.loc14_31.1, element0 +// CHECK:STDOUT: %impl.elem0.loc14_31.1: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc14_31.1: = bound_method %.loc14_31.2, %impl.elem0.loc14_31.1 +// CHECK:STDOUT: %specific_fn.loc14_31.1: = specific_function %impl.elem0.loc14_31.1, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_31.2: = bound_method %.loc14_31.2, %specific_fn.loc14_31.1 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc14_31.1: init %i32 = call %bound_method.loc14_31.2(%.loc14_31.2) // CHECK:STDOUT: %tuple.elem0.loc14_31.2: ref %AdaptStruct = tuple_access %d.var, element0 // CHECK:STDOUT: %.loc14_31.3: ref %struct_type.e.f = as_compatible %tuple.elem0.loc14_31.2 // CHECK:STDOUT: %.loc14_31.4: ref %i32 = struct_access %.loc14_31.3, element0 -// CHECK:STDOUT: %.loc14_31.5: init %i32 = initialize_from %.loc14_31.2 to %.loc14_31.4 +// CHECK:STDOUT: %.loc14_31.5: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc14_31.1 to %.loc14_31.4 // CHECK:STDOUT: %.loc14_31.6: %i32 = struct_access %.loc14_31.1, element1 +// CHECK:STDOUT: %impl.elem0.loc14_31.2: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc14_31.3: = bound_method %.loc14_31.6, %impl.elem0.loc14_31.2 +// CHECK:STDOUT: %specific_fn.loc14_31.2: = specific_function %impl.elem0.loc14_31.2, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_31.4: = bound_method %.loc14_31.6, %specific_fn.loc14_31.2 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc14_31.2: init %i32 = call %bound_method.loc14_31.4(%.loc14_31.6) // CHECK:STDOUT: %.loc14_31.7: ref %i32 = struct_access %.loc14_31.3, element1 -// CHECK:STDOUT: %.loc14_31.8: init %i32 = initialize_from %.loc14_31.6 to %.loc14_31.7 +// CHECK:STDOUT: %.loc14_31.8: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc14_31.2 to %.loc14_31.7 // CHECK:STDOUT: %.loc14_31.9: init %struct_type.e.f = struct_init (%.loc14_31.5, %.loc14_31.8) to %.loc14_31.3 // CHECK:STDOUT: %.loc14_31.10: init %AdaptStruct = as_compatible %.loc14_31.9 // CHECK:STDOUT: %.loc14_31.11: init %AdaptStruct = converted %tuple.elem0.loc14_31.1, %.loc14_31.10 // CHECK:STDOUT: %tuple.elem1.loc14_31.1: %u32 = tuple_access %c.ref, element1 +// CHECK:STDOUT: %impl.elem0.loc14_31.3: %.8fb = impl_witness_access constants.%Copy.impl_witness.bf5, element0 [concrete = constants.%UInt.as.Copy.impl.Op.019] +// CHECK:STDOUT: %bound_method.loc14_31.5: = bound_method %tuple.elem1.loc14_31.1, %impl.elem0.loc14_31.3 +// CHECK:STDOUT: %specific_fn.loc14_31.3: = specific_function %impl.elem0.loc14_31.3, @UInt.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%UInt.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_31.6: = bound_method %tuple.elem1.loc14_31.1, %specific_fn.loc14_31.3 +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.call.loc14: init %u32 = call %bound_method.loc14_31.6(%tuple.elem1.loc14_31.1) // CHECK:STDOUT: %tuple.elem1.loc14_31.2: ref %u32 = tuple_access %d.var, element1 -// CHECK:STDOUT: %.loc14_31.12: init %u32 = initialize_from %tuple.elem1.loc14_31.1 to %tuple.elem1.loc14_31.2 +// CHECK:STDOUT: %.loc14_31.12: init %u32 = initialize_from %UInt.as.Copy.impl.Op.call.loc14 to %tuple.elem1.loc14_31.2 // CHECK:STDOUT: %.loc14_31.13: init %tuple.type.80b = tuple_init (%.loc14_31.11, %.loc14_31.12) to %d.var // CHECK:STDOUT: %.loc14_3: init %tuple.type.80b = converted %c.ref, %.loc14_31.13 // CHECK:STDOUT: assign %d.var, %.loc14_3 @@ -1077,28 +1299,43 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %.loc15_10.1: ref %struct_type.e.f = as_compatible %tuple.elem0.loc15_10.1 // CHECK:STDOUT: %.loc15_10.2: ref %i32 = struct_access %.loc15_10.1, element0 // CHECK:STDOUT: %.loc15_10.3: %i32 = bind_value %.loc15_10.2 +// CHECK:STDOUT: %impl.elem0.loc15_10.1: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc15_10.1: = bound_method %.loc15_10.3, %impl.elem0.loc15_10.1 +// CHECK:STDOUT: %specific_fn.loc15_10.1: = specific_function %impl.elem0.loc15_10.1, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc15_10.2: = bound_method %.loc15_10.3, %specific_fn.loc15_10.1 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc15_10.1: init %i32 = call %bound_method.loc15_10.2(%.loc15_10.3) // CHECK:STDOUT: %tuple.elem0.loc15_10.2: ref %AdaptStruct = tuple_access %return, element0 // CHECK:STDOUT: %.loc15_10.4: ref %struct_type.e.f = as_compatible %tuple.elem0.loc15_10.2 // CHECK:STDOUT: %.loc15_10.5: ref %i32 = struct_access %.loc15_10.4, element0 -// CHECK:STDOUT: %.loc15_10.6: init %i32 = initialize_from %.loc15_10.3 to %.loc15_10.5 +// CHECK:STDOUT: %.loc15_10.6: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc15_10.1 to %.loc15_10.5 // CHECK:STDOUT: %.loc15_10.7: ref %i32 = struct_access %.loc15_10.1, element1 // CHECK:STDOUT: %.loc15_10.8: %i32 = bind_value %.loc15_10.7 +// CHECK:STDOUT: %impl.elem0.loc15_10.2: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc15_10.3: = bound_method %.loc15_10.8, %impl.elem0.loc15_10.2 +// CHECK:STDOUT: %specific_fn.loc15_10.2: = specific_function %impl.elem0.loc15_10.2, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc15_10.4: = bound_method %.loc15_10.8, %specific_fn.loc15_10.2 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc15_10.2: init %i32 = call %bound_method.loc15_10.4(%.loc15_10.8) // CHECK:STDOUT: %.loc15_10.9: ref %i32 = struct_access %.loc15_10.4, element1 -// CHECK:STDOUT: %.loc15_10.10: init %i32 = initialize_from %.loc15_10.8 to %.loc15_10.9 +// CHECK:STDOUT: %.loc15_10.10: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc15_10.2 to %.loc15_10.9 // CHECK:STDOUT: %.loc15_10.11: init %struct_type.e.f = struct_init (%.loc15_10.6, %.loc15_10.10) to %.loc15_10.4 // CHECK:STDOUT: %.loc15_10.12: init %AdaptStruct = as_compatible %.loc15_10.11 // CHECK:STDOUT: %.loc15_10.13: init %AdaptStruct = converted %tuple.elem0.loc15_10.1, %.loc15_10.12 // CHECK:STDOUT: %tuple.elem1.loc15_10.1: ref %u32 = tuple_access %d.ref, element1 // CHECK:STDOUT: %.loc15_10.14: %u32 = bind_value %tuple.elem1.loc15_10.1 +// CHECK:STDOUT: %impl.elem0.loc15_10.3: %.8fb = impl_witness_access constants.%Copy.impl_witness.bf5, element0 [concrete = constants.%UInt.as.Copy.impl.Op.019] +// CHECK:STDOUT: %bound_method.loc15_10.5: = bound_method %.loc15_10.14, %impl.elem0.loc15_10.3 +// CHECK:STDOUT: %specific_fn.loc15_10.3: = specific_function %impl.elem0.loc15_10.3, @UInt.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%UInt.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc15_10.6: = bound_method %.loc15_10.14, %specific_fn.loc15_10.3 +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.call.loc15: init %u32 = call %bound_method.loc15_10.6(%.loc15_10.14) // CHECK:STDOUT: %tuple.elem1.loc15_10.2: ref %u32 = tuple_access %return, element1 -// CHECK:STDOUT: %.loc15_10.15: init %u32 = initialize_from %.loc15_10.14 to %tuple.elem1.loc15_10.2 +// CHECK:STDOUT: %.loc15_10.15: init %u32 = initialize_from %UInt.as.Copy.impl.Op.call.loc15 to %tuple.elem1.loc15_10.2 // CHECK:STDOUT: %.loc15_10.16: init %tuple.type.80b = tuple_init (%.loc15_10.13, %.loc15_10.15) to %return // CHECK:STDOUT: %.loc15_11: init %tuple.type.80b = converted %d.ref, %.loc15_10.16 // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound: = bound_method %d.var, constants.%T.as.Destroy.impl.Op.3f2 // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: = specific_function constants.%T.as.Destroy.impl.Op.3f2, @T.as.Destroy.impl.Op(constants.%tuple.type.80b) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method: = bound_method %d.var, %T.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %bound_method.loc14_3: = bound_method %d.var, %T.as.Destroy.impl.Op.specific_fn // CHECK:STDOUT: %addr: %ptr.b09 = addr_of %d.var -// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr) +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc14_3(%addr) // CHECK:STDOUT: return %.loc15_11 to %return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/adapter/init_adapt.carbon b/toolchain/check/testdata/class/adapter/init_adapt.carbon index e187ac6ba507..3bdb8594ca92 100644 --- a/toolchain/check/testdata/class/adapter/init_adapt.carbon +++ b/toolchain/check/testdata/class/adapter/init_adapt.carbon @@ -162,7 +162,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -421,7 +421,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/base.carbon b/toolchain/check/testdata/class/base.carbon index ffcbf905893d..48f03a2679ef 100644 --- a/toolchain/check/testdata/class/base.carbon +++ b/toolchain/check/testdata/class/base.carbon @@ -56,6 +56,7 @@ class Derived { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %Base.elem: type = unbound_element_type %Base, %i32 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] @@ -110,6 +111,16 @@ class Derived { // CHECK:STDOUT: %pattern_type.511: type = pattern_type %tuple.type.d07 [concrete] // CHECK:STDOUT: %Access.type: type = fn_type @Access [concrete] // CHECK:STDOUT: %Access: %Access.type = struct_value () [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -117,14 +128,18 @@ class Derived { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -283,10 +298,20 @@ class Derived { // CHECK:STDOUT: %.loc18_22.1: ref %i32 = class_element_access %.loc18_17.2, element0 // CHECK:STDOUT: %.loc18_22.2: %i32 = bind_value %.loc18_22.1 // CHECK:STDOUT: %.loc18_24.1: %tuple.type.d07 = tuple_literal (%.loc18_12.2, %.loc18_22.2) +// CHECK:STDOUT: %impl.elem0.loc18_12: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc18_12.1: = bound_method %.loc18_12.2, %impl.elem0.loc18_12 +// CHECK:STDOUT: %specific_fn.loc18_12: = specific_function %impl.elem0.loc18_12, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc18_12.2: = bound_method %.loc18_12.2, %specific_fn.loc18_12 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc18_12: init %i32 = call %bound_method.loc18_12.2(%.loc18_12.2) // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %return, element0 -// CHECK:STDOUT: %.loc18_24.2: init %i32 = initialize_from %.loc18_12.2 to %tuple.elem0 +// CHECK:STDOUT: %.loc18_24.2: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc18_12 to %tuple.elem0 +// CHECK:STDOUT: %impl.elem0.loc18_22: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc18_22.1: = bound_method %.loc18_22.2, %impl.elem0.loc18_22 +// CHECK:STDOUT: %specific_fn.loc18_22: = specific_function %impl.elem0.loc18_22, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc18_22.2: = bound_method %.loc18_22.2, %specific_fn.loc18_22 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc18_22: init %i32 = call %bound_method.loc18_22.2(%.loc18_22.2) // CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access %return, element1 -// CHECK:STDOUT: %.loc18_24.3: init %i32 = initialize_from %.loc18_22.2 to %tuple.elem1 +// CHECK:STDOUT: %.loc18_24.3: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc18_22 to %tuple.elem1 // CHECK:STDOUT: %.loc18_24.4: init %tuple.type.d07 = tuple_init (%.loc18_24.2, %.loc18_24.3) to %return // CHECK:STDOUT: %.loc18_25: init %tuple.type.d07 = converted %.loc18_24.1, %.loc18_24.4 // CHECK:STDOUT: return %.loc18_25 to %return diff --git a/toolchain/check/testdata/class/base_method.carbon b/toolchain/check/testdata/class/base_method.carbon index 76959b0bb6e5..ed77d8bed1f5 100644 --- a/toolchain/check/testdata/class/base_method.carbon +++ b/toolchain/check/testdata/class/base_method.carbon @@ -92,7 +92,7 @@ fn Call(p: Derived*) { // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/basic.carbon b/toolchain/check/testdata/class/basic.carbon index 7b08eb943232..7cf48064004d 100644 --- a/toolchain/check/testdata/class/basic.carbon +++ b/toolchain/check/testdata/class/basic.carbon @@ -85,7 +85,7 @@ fn Run() -> i32 { // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/derived_to_base.carbon b/toolchain/check/testdata/class/derived_to_base.carbon index 70da0062ddf0..1253df92b905 100644 --- a/toolchain/check/testdata/class/derived_to_base.carbon +++ b/toolchain/check/testdata/class/derived_to_base.carbon @@ -179,7 +179,7 @@ fn PassConstB(p: const B) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_init_as_inplace.carbon b/toolchain/check/testdata/class/fail_init_as_inplace.carbon index e0a102820bd4..4ae9f58b6d14 100644 --- a/toolchain/check/testdata/class/fail_init_as_inplace.carbon +++ b/toolchain/check/testdata/class/fail_init_as_inplace.carbon @@ -21,7 +21,10 @@ fn F() { // TODO: This case should presumably work: `{...} as Class` should be an // initializing expression, not a value expression. // - // CHECK:STDERR: fail_init_as_inplace.carbon:[[@LINE+4]]:18: error: cannot copy value of type `Class` [CopyOfUncopyableType] + // CHECK:STDERR: fail_init_as_inplace.carbon:[[@LINE+7]]:18: error: cannot copy value of type `Class` [CopyOfUncopyableType] + // CHECK:STDERR: var c: Class = {.a = 1, .b = 2} as Class; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_init_as_inplace.carbon:[[@LINE+4]]:18: note: type `Class` does not implement interface `Core.Copy` [MissingImplInMemberAccessNote] // CHECK:STDERR: var c: Class = {.a = 1, .b = 2} as Class; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/class/fail_self.carbon b/toolchain/check/testdata/class/fail_self.carbon index 8a414e47490c..e3e94006c082 100644 --- a/toolchain/check/testdata/class/fail_self.carbon +++ b/toolchain/check/testdata/class/fail_self.carbon @@ -33,7 +33,10 @@ fn Class.G() -> Self { // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: var self: Self; - // CHECK:STDERR: fail_self.carbon:[[@LINE+4]]:10: error: cannot copy value of type `Class` [CopyOfUncopyableType] + // CHECK:STDERR: fail_self.carbon:[[@LINE+7]]:10: error: cannot copy value of type `Class` [CopyOfUncopyableType] + // CHECK:STDERR: return self; + // CHECK:STDERR: ^~~~ + // CHECK:STDERR: fail_self.carbon:[[@LINE+4]]:10: note: type `Class` does not implement interface `Core.Copy` [MissingImplInMemberAccessNote] // CHECK:STDERR: return self; // CHECK:STDERR: ^~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/class/field_access.carbon b/toolchain/check/testdata/class/field_access.carbon index 7291b32df714..88d6c08d9404 100644 --- a/toolchain/check/testdata/class/field_access.carbon +++ b/toolchain/check/testdata/class/field_access.carbon @@ -33,6 +33,7 @@ fn Run() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %i32 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] @@ -69,6 +70,16 @@ fn Run() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.2d9: = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.592 [concrete] // CHECK:STDOUT: %bound_method.f6f: = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Int.as.Destroy.impl.Op.type.11b: type = fn_type @Int.as.Destroy.impl.Op, @Int.as.Destroy.impl(%int_32) [concrete] // CHECK:STDOUT: %Int.as.Destroy.impl.Op.054: %Int.as.Destroy.impl.Op.type.11b = struct_value () [concrete] // CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [concrete] @@ -80,14 +91,18 @@ fn Run() { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -179,7 +194,12 @@ fn Run() { // CHECK:STDOUT: %j.ref.loc24: %Class.elem = name_ref j, @Class.%.loc16 [concrete = @Class.%.loc16] // CHECK:STDOUT: %.loc24_18.1: ref %i32 = class_element_access %c.ref.loc24, element0 // CHECK:STDOUT: %.loc24_18.2: %i32 = bind_value %.loc24_18.1 -// CHECK:STDOUT: assign %cj.var, %.loc24_18.2 +// CHECK:STDOUT: %impl.elem0.loc24: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc24_18.1: = bound_method %.loc24_18.2, %impl.elem0.loc24 +// CHECK:STDOUT: %specific_fn.loc24: = specific_function %impl.elem0.loc24, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc24_18.2: = bound_method %.loc24_18.2, %specific_fn.loc24 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc24: init %i32 = call %bound_method.loc24_18.2(%.loc24_18.2) +// CHECK:STDOUT: assign %cj.var, %Int.as.Copy.impl.Op.call.loc24 // CHECK:STDOUT: %.loc24_11: type = splice_block %i32.loc24 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc24: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc24: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] @@ -194,7 +214,12 @@ fn Run() { // CHECK:STDOUT: %k.ref.loc25: %Class.elem = name_ref k, @Class.%.loc17 [concrete = @Class.%.loc17] // CHECK:STDOUT: %.loc25_18.1: ref %i32 = class_element_access %c.ref.loc25, element1 // CHECK:STDOUT: %.loc25_18.2: %i32 = bind_value %.loc25_18.1 -// CHECK:STDOUT: assign %ck.var, %.loc25_18.2 +// CHECK:STDOUT: %impl.elem0.loc25: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc25_18.1: = bound_method %.loc25_18.2, %impl.elem0.loc25 +// CHECK:STDOUT: %specific_fn.loc25: = specific_function %impl.elem0.loc25, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc25_18.2: = bound_method %.loc25_18.2, %specific_fn.loc25 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc25: init %i32 = call %bound_method.loc25_18.2(%.loc25_18.2) +// CHECK:STDOUT: assign %ck.var, %Int.as.Copy.impl.Op.call.loc25 // CHECK:STDOUT: %.loc25_11: type = splice_block %i32.loc25 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc25: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc25: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] @@ -202,14 +227,14 @@ fn Run() { // CHECK:STDOUT: %ck: ref %i32 = bind_name ck, %ck.var // CHECK:STDOUT: %Int.as.Destroy.impl.Op.bound.loc25: = bound_method %ck.var, constants.%Int.as.Destroy.impl.Op.054 // CHECK:STDOUT: %Int.as.Destroy.impl.Op.specific_fn.1: = specific_function constants.%Int.as.Destroy.impl.Op.054, @Int.as.Destroy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Destroy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc25: = bound_method %ck.var, %Int.as.Destroy.impl.Op.specific_fn.1 +// CHECK:STDOUT: %bound_method.loc25_3: = bound_method %ck.var, %Int.as.Destroy.impl.Op.specific_fn.1 // CHECK:STDOUT: %addr.loc25: %ptr.235 = addr_of %ck.var -// CHECK:STDOUT: %Int.as.Destroy.impl.Op.call.loc25: init %empty_tuple.type = call %bound_method.loc25(%addr.loc25) +// CHECK:STDOUT: %Int.as.Destroy.impl.Op.call.loc25: init %empty_tuple.type = call %bound_method.loc25_3(%addr.loc25) // CHECK:STDOUT: %Int.as.Destroy.impl.Op.bound.loc24: = bound_method %cj.var, constants.%Int.as.Destroy.impl.Op.054 // CHECK:STDOUT: %Int.as.Destroy.impl.Op.specific_fn.2: = specific_function constants.%Int.as.Destroy.impl.Op.054, @Int.as.Destroy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Destroy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc24: = bound_method %cj.var, %Int.as.Destroy.impl.Op.specific_fn.2 +// CHECK:STDOUT: %bound_method.loc24_3: = bound_method %cj.var, %Int.as.Destroy.impl.Op.specific_fn.2 // CHECK:STDOUT: %addr.loc24: %ptr.235 = addr_of %cj.var -// CHECK:STDOUT: %Int.as.Destroy.impl.Op.call.loc24: init %empty_tuple.type = call %bound_method.loc24(%addr.loc24) +// CHECK:STDOUT: %Int.as.Destroy.impl.Op.call.loc24: init %empty_tuple.type = call %bound_method.loc24_3(%addr.loc24) // CHECK:STDOUT: %Class.as.Destroy.impl.Op.bound: = bound_method %c.var, constants.%Class.as.Destroy.impl.Op // CHECK:STDOUT: %addr.loc21: %ptr.e71 = addr_of %c.var // CHECK:STDOUT: %Class.as.Destroy.impl.Op.call: init %empty_tuple.type = call %Class.as.Destroy.impl.Op.bound(%addr.loc21) diff --git a/toolchain/check/testdata/class/field_access_in_value.carbon b/toolchain/check/testdata/class/field_access_in_value.carbon index 21a1ee6563d5..88d683bd8dd4 100644 --- a/toolchain/check/testdata/class/field_access_in_value.carbon +++ b/toolchain/check/testdata/class/field_access_in_value.carbon @@ -34,6 +34,7 @@ fn Test() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %i32 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] @@ -70,6 +71,16 @@ fn Test() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.2d9: = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.592 [concrete] // CHECK:STDOUT: %bound_method.f6f: = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Int.as.Destroy.impl.Op.type.11b: type = fn_type @Int.as.Destroy.impl.Op, @Int.as.Destroy.impl(%int_32) [concrete] // CHECK:STDOUT: %Int.as.Destroy.impl.Op.054: %Int.as.Destroy.impl.Op.type.11b = struct_value () [concrete] // CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [concrete] @@ -81,14 +92,18 @@ fn Test() { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -187,7 +202,12 @@ fn Test() { // CHECK:STDOUT: %j.ref.loc25: %Class.elem = name_ref j, @Class.%.loc16 [concrete = @Class.%.loc16] // CHECK:STDOUT: %.loc25_18.1: ref %i32 = class_element_access %c.ref.loc25, element0 // CHECK:STDOUT: %.loc25_18.2: %i32 = bind_value %.loc25_18.1 -// CHECK:STDOUT: assign %cj.var, %.loc25_18.2 +// CHECK:STDOUT: %impl.elem0.loc25: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc25_18.1: = bound_method %.loc25_18.2, %impl.elem0.loc25 +// CHECK:STDOUT: %specific_fn.loc25: = specific_function %impl.elem0.loc25, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc25_18.2: = bound_method %.loc25_18.2, %specific_fn.loc25 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc25: init %i32 = call %bound_method.loc25_18.2(%.loc25_18.2) +// CHECK:STDOUT: assign %cj.var, %Int.as.Copy.impl.Op.call.loc25 // CHECK:STDOUT: %.loc25_11: type = splice_block %i32.loc25 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc25: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc25: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] @@ -202,7 +222,12 @@ fn Test() { // CHECK:STDOUT: %k.ref.loc26: %Class.elem = name_ref k, @Class.%.loc17 [concrete = @Class.%.loc17] // CHECK:STDOUT: %.loc26_18.1: ref %i32 = class_element_access %c.ref.loc26, element1 // CHECK:STDOUT: %.loc26_18.2: %i32 = bind_value %.loc26_18.1 -// CHECK:STDOUT: assign %ck.var, %.loc26_18.2 +// CHECK:STDOUT: %impl.elem0.loc26: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc26_18.1: = bound_method %.loc26_18.2, %impl.elem0.loc26 +// CHECK:STDOUT: %specific_fn.loc26: = specific_function %impl.elem0.loc26, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc26_18.2: = bound_method %.loc26_18.2, %specific_fn.loc26 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc26: init %i32 = call %bound_method.loc26_18.2(%.loc26_18.2) +// CHECK:STDOUT: assign %ck.var, %Int.as.Copy.impl.Op.call.loc26 // CHECK:STDOUT: %.loc26_11: type = splice_block %i32.loc26 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc26: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc26: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] @@ -210,14 +235,14 @@ fn Test() { // CHECK:STDOUT: %ck: ref %i32 = bind_name ck, %ck.var // CHECK:STDOUT: %Int.as.Destroy.impl.Op.bound.loc26: = bound_method %ck.var, constants.%Int.as.Destroy.impl.Op.054 // CHECK:STDOUT: %Int.as.Destroy.impl.Op.specific_fn.1: = specific_function constants.%Int.as.Destroy.impl.Op.054, @Int.as.Destroy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Destroy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc26: = bound_method %ck.var, %Int.as.Destroy.impl.Op.specific_fn.1 +// CHECK:STDOUT: %bound_method.loc26_3: = bound_method %ck.var, %Int.as.Destroy.impl.Op.specific_fn.1 // CHECK:STDOUT: %addr.loc26: %ptr.235 = addr_of %ck.var -// CHECK:STDOUT: %Int.as.Destroy.impl.Op.call.loc26: init %empty_tuple.type = call %bound_method.loc26(%addr.loc26) +// CHECK:STDOUT: %Int.as.Destroy.impl.Op.call.loc26: init %empty_tuple.type = call %bound_method.loc26_3(%addr.loc26) // CHECK:STDOUT: %Int.as.Destroy.impl.Op.bound.loc25: = bound_method %cj.var, constants.%Int.as.Destroy.impl.Op.054 // CHECK:STDOUT: %Int.as.Destroy.impl.Op.specific_fn.2: = specific_function constants.%Int.as.Destroy.impl.Op.054, @Int.as.Destroy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Destroy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc25: = bound_method %cj.var, %Int.as.Destroy.impl.Op.specific_fn.2 +// CHECK:STDOUT: %bound_method.loc25_3: = bound_method %cj.var, %Int.as.Destroy.impl.Op.specific_fn.2 // CHECK:STDOUT: %addr.loc25: %ptr.235 = addr_of %cj.var -// CHECK:STDOUT: %Int.as.Destroy.impl.Op.call.loc25: init %empty_tuple.type = call %bound_method.loc25(%addr.loc25) +// CHECK:STDOUT: %Int.as.Destroy.impl.Op.call.loc25: init %empty_tuple.type = call %bound_method.loc25_3(%addr.loc25) // CHECK:STDOUT: %Class.as.Destroy.impl.Op.bound: = bound_method %cv.var, constants.%Class.as.Destroy.impl.Op // CHECK:STDOUT: %addr.loc21: %ptr.e71 = addr_of %cv.var // CHECK:STDOUT: %Class.as.Destroy.impl.Op.call: init %empty_tuple.type = call %Class.as.Destroy.impl.Op.bound(%addr.loc21) diff --git a/toolchain/check/testdata/class/generic/call.carbon b/toolchain/check/testdata/class/generic/call.carbon index fdb57655a7de..6f7457fe409b 100644 --- a/toolchain/check/testdata/class/generic/call.carbon +++ b/toolchain/check/testdata/class/generic/call.carbon @@ -155,7 +155,7 @@ class Outer(T:! type) { // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/complete_in_conversion.carbon b/toolchain/check/testdata/class/generic/complete_in_conversion.carbon index a4d8c55ef44b..7763916a06ba 100644 --- a/toolchain/check/testdata/class/generic/complete_in_conversion.carbon +++ b/toolchain/check/testdata/class/generic/complete_in_conversion.carbon @@ -130,9 +130,9 @@ fn F(a: A(0)*) { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.Int: %Int.type.878 = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] -// CHECK:STDOUT: %Core.import_ref.02e: @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert.type (%Int.as.ImplicitAs.impl.Convert.type.eb9) = import_ref Core//prelude/parts/int, loc20_44, loaded [symbolic = @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert (constants.%Int.as.ImplicitAs.impl.Convert.958)] +// CHECK:STDOUT: %Core.import_ref.02e: @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert.type (%Int.as.ImplicitAs.impl.Convert.type.eb9) = import_ref Core//prelude/parts/int, loc27_44, loaded [symbolic = @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert (constants.%Int.as.ImplicitAs.impl.Convert.958)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.13c = impl_witness_table (%Core.import_ref.02e), @Int.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/import.carbon b/toolchain/check/testdata/class/generic/import.carbon index 55d159cd8432..c371b43fc336 100644 --- a/toolchain/check/testdata/class/generic/import.carbon +++ b/toolchain/check/testdata/class/generic/import.carbon @@ -152,7 +152,7 @@ class Class(U:! type) { // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/init.carbon b/toolchain/check/testdata/class/generic/init.carbon index df02b912ad32..91b7e88630e0 100644 --- a/toolchain/check/testdata/class/generic/init.carbon +++ b/toolchain/check/testdata/class/generic/init.carbon @@ -20,7 +20,7 @@ class Class(T:! type) { var k: T; } -fn InitFromStructGeneric(T:! type, x: T) -> T { +fn InitFromStructGeneric(T:! Core.Copy, x: T) -> T { var v: Class(T) = {.k = x}; return v.k; } @@ -51,36 +51,57 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self] -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Class.generic: %Class.type = struct_value () [concrete] -// CHECK:STDOUT: %Class.fe1: type = class_type @Class, @Class(%T) [symbolic] -// CHECK:STDOUT: %require_complete.4ae: = require_complete_type %T [symbolic] -// CHECK:STDOUT: %Class.elem.e26: type = unbound_element_type %Class.fe1, %T [symbolic] +// CHECK:STDOUT: %Class.fe1: type = class_type @Class, @Class(%T.8b3) [symbolic] +// CHECK:STDOUT: %require_complete.4ae: = require_complete_type %T.8b3 [symbolic] +// CHECK:STDOUT: %Class.elem.e26: type = unbound_element_type %Class.fe1, %T.8b3 [symbolic] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete] -// CHECK:STDOUT: %Destroy.impl_witness.d1e: = impl_witness @Class.%Destroy.impl_witness_table, @Class.as.Destroy.impl(%T) [symbolic] +// CHECK:STDOUT: %Destroy.impl_witness.d1e: = impl_witness @Class.%Destroy.impl_witness_table, @Class.as.Destroy.impl(%T.8b3) [symbolic] // CHECK:STDOUT: %ptr.955: type = ptr_type %Class.fe1 [symbolic] // CHECK:STDOUT: %pattern_type.9e0: type = pattern_type %ptr.955 [symbolic] -// CHECK:STDOUT: %Class.as.Destroy.impl.Op.type.412: type = fn_type @Class.as.Destroy.impl.Op, @Class.as.Destroy.impl(%T) [symbolic] +// CHECK:STDOUT: %Class.as.Destroy.impl.Op.type.412: type = fn_type @Class.as.Destroy.impl.Op, @Class.as.Destroy.impl(%T.8b3) [symbolic] // CHECK:STDOUT: %Class.as.Destroy.impl.Op.9bc: %Class.as.Destroy.impl.Op.type.412 = struct_value () [symbolic] -// CHECK:STDOUT: %Destroy.facet.976: %Destroy.type = facet_value %Class.fe1, (%Destroy.impl_witness.d1e) [symbolic] -// CHECK:STDOUT: %struct_type.k.b21: type = struct_type {.k: %T} [symbolic] +// CHECK:STDOUT: %struct_type.k.b21: type = struct_type {.k: %T.8b3} [symbolic] // CHECK:STDOUT: %complete_type.b9e: = complete_type_witness %struct_type.k.b21 [symbolic] -// CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %T.578: %Copy.type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %pattern_type.ce2: type = pattern_type %Copy.type [concrete] +// CHECK:STDOUT: %T.as_type: type = facet_access_type %T.578 [symbolic] +// CHECK:STDOUT: %pattern_type.f8cebc.1: type = pattern_type %T.as_type [symbolic] // CHECK:STDOUT: %InitFromStructGeneric.type: type = fn_type @InitFromStructGeneric [concrete] // CHECK:STDOUT: %InitFromStructGeneric: %InitFromStructGeneric.type = struct_value () [concrete] -// CHECK:STDOUT: %require_complete.4f8: = require_complete_type %Class.fe1 [symbolic] -// CHECK:STDOUT: %pattern_type.3c1: type = pattern_type %Class.fe1 [symbolic] -// CHECK:STDOUT: %.0e5: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.976 [symbolic] -// CHECK:STDOUT: %Class.as.Destroy.impl.Op.specific_fn.e70: = specific_function %Class.as.Destroy.impl.Op.9bc, @Class.as.Destroy.impl.Op(%T) [symbolic] -// CHECK:STDOUT: %require_complete.2ae: = require_complete_type %ptr.955 [symbolic] +// CHECK:STDOUT: %require_complete.ecc: = require_complete_type %T.as_type [symbolic] +// CHECK:STDOUT: %Class.b1d: type = class_type @Class, @Class(%T.as_type) [symbolic] +// CHECK:STDOUT: %Class.elem.73a: type = unbound_element_type %Class.b1d, %T.as_type [symbolic] +// CHECK:STDOUT: %struct_type.k.c03: type = struct_type {.k: %T.as_type} [symbolic] +// CHECK:STDOUT: %complete_type.cdd: = complete_type_witness %struct_type.k.c03 [symbolic] +// CHECK:STDOUT: %require_complete.57f: = require_complete_type %Class.b1d [symbolic] +// CHECK:STDOUT: %pattern_type.a8f: type = pattern_type %Class.b1d [symbolic] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Copy.lookup_impl_witness.3ba: = lookup_impl_witness %T.578, @Copy [symbolic] +// CHECK:STDOUT: %Copy.facet.72e: %Copy.type = facet_value %T.as_type, (%Copy.lookup_impl_witness.3ba) [symbolic] +// CHECK:STDOUT: %.671: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.72e [symbolic] +// CHECK:STDOUT: %impl.elem0.56e: %.671 = impl_witness_access %Copy.lookup_impl_witness.3ba, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.fb7: = specific_impl_function %impl.elem0.56e, @Copy.Op(%Copy.facet.72e) [symbolic] +// CHECK:STDOUT: %Destroy.impl_witness.492: = impl_witness @Class.%Destroy.impl_witness_table, @Class.as.Destroy.impl(%T.as_type) [symbolic] +// CHECK:STDOUT: %Class.as.Destroy.impl.Op.type.637: type = fn_type @Class.as.Destroy.impl.Op, @Class.as.Destroy.impl(%T.as_type) [symbolic] +// CHECK:STDOUT: %Class.as.Destroy.impl.Op.598: %Class.as.Destroy.impl.Op.type.637 = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.facet.744: %Destroy.type = facet_value %Class.b1d, (%Destroy.impl_witness.492) [symbolic] +// CHECK:STDOUT: %.c08: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.744 [symbolic] +// CHECK:STDOUT: %ptr.458: type = ptr_type %Class.b1d [symbolic] +// CHECK:STDOUT: %pattern_type.20e: type = pattern_type %ptr.458 [symbolic] +// CHECK:STDOUT: %Class.as.Destroy.impl.Op.specific_fn.df2: = specific_function %Class.as.Destroy.impl.Op.598, @Class.as.Destroy.impl.Op(%T.as_type) [symbolic] +// CHECK:STDOUT: %require_complete.ec5: = require_complete_type %ptr.458 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %InitFromStructSpecific.type: type = fn_type @InitFromStructSpecific [concrete] @@ -92,6 +113,14 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %struct_type.k.0bf: type = struct_type {.k: %i32} [concrete] // CHECK:STDOUT: %complete_type.954: = complete_type_witness %struct_type.k.0bf [concrete] // CHECK:STDOUT: %pattern_type.0fa: type = pattern_type %Class.247 [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Destroy.impl_witness.ea6: = impl_witness @Class.%Destroy.impl_witness_table, @Class.as.Destroy.impl(%i32) [concrete] // CHECK:STDOUT: %Class.as.Destroy.impl.Op.type.ce6: type = fn_type @Class.as.Destroy.impl.Op, @Class.as.Destroy.impl(%i32) [concrete] // CHECK:STDOUT: %Class.as.Destroy.impl.Op.831: %Class.as.Destroy.impl.Op.type.ce6 = struct_value () [concrete] @@ -103,12 +132,16 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Destroy = %Core.Destroy +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -123,23 +156,33 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.1 (constants.%T)] +// CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.1 (constants.%T.8b3)] // CHECK:STDOUT: } // CHECK:STDOUT: %InitFromStructGeneric.decl: %InitFromStructGeneric.type = fn_decl @InitFromStructGeneric [concrete = constants.%InitFromStructGeneric] { -// CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] -// CHECK:STDOUT: %x.patt: @InitFromStructGeneric.%pattern_type.loc8 (%pattern_type.7dc) = binding_pattern x [concrete] -// CHECK:STDOUT: %x.param_patt: @InitFromStructGeneric.%pattern_type.loc8 (%pattern_type.7dc) = value_param_pattern %x.patt, call_param0 [concrete] -// CHECK:STDOUT: %return.patt: @InitFromStructGeneric.%pattern_type.loc8 (%pattern_type.7dc) = return_slot_pattern [concrete] -// CHECK:STDOUT: %return.param_patt: @InitFromStructGeneric.%pattern_type.loc8 (%pattern_type.7dc) = out_param_pattern %return.patt, call_param1 [concrete] +// CHECK:STDOUT: %T.patt: %pattern_type.ce2 = symbolic_binding_pattern T, 0 [concrete] +// CHECK:STDOUT: %x.patt: @InitFromStructGeneric.%pattern_type.loc8 (%pattern_type.f8cebc.1) = binding_pattern x [concrete] +// CHECK:STDOUT: %x.param_patt: @InitFromStructGeneric.%pattern_type.loc8 (%pattern_type.f8cebc.1) = value_param_pattern %x.patt, call_param0 [concrete] +// CHECK:STDOUT: %return.patt: @InitFromStructGeneric.%pattern_type.loc8 (%pattern_type.f8cebc.1) = return_slot_pattern [concrete] +// CHECK:STDOUT: %return.param_patt: @InitFromStructGeneric.%pattern_type.loc8 (%pattern_type.f8cebc.1) = out_param_pattern %return.patt, call_param1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc8_45: type = name_ref T, %T.loc8_26.2 [symbolic = %T.loc8_26.1 (constants.%T)] -// CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %T.loc8_26.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_26.1 (constants.%T)] -// CHECK:STDOUT: %x.param: @InitFromStructGeneric.%T.loc8_26.1 (%T) = value_param call_param0 -// CHECK:STDOUT: %T.ref.loc8_39: type = name_ref T, %T.loc8_26.2 [symbolic = %T.loc8_26.1 (constants.%T)] -// CHECK:STDOUT: %x: @InitFromStructGeneric.%T.loc8_26.1 (%T) = bind_name x, %x.param -// CHECK:STDOUT: %return.param: ref @InitFromStructGeneric.%T.loc8_26.1 (%T) = out_param call_param1 -// CHECK:STDOUT: %return: ref @InitFromStructGeneric.%T.loc8_26.1 (%T) = return_slot %return.param +// CHECK:STDOUT: %T.ref.loc8_50: %Copy.type = name_ref T, %T.loc8_26.2 [symbolic = %T.loc8_26.1 (constants.%T.578)] +// CHECK:STDOUT: %T.as_type.loc8_50: type = facet_access_type %T.ref.loc8_50 [symbolic = %T.as_type.loc8_44.1 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc8_50: type = converted %T.ref.loc8_50, %T.as_type.loc8_50 [symbolic = %T.as_type.loc8_44.1 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc8_34: type = splice_block %Copy.ref [concrete = constants.%Copy.type] { +// CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %Copy.ref: type = name_ref Copy, imports.%Core.Copy [concrete = constants.%Copy.type] +// CHECK:STDOUT: } +// CHECK:STDOUT: %T.loc8_26.2: %Copy.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_26.1 (constants.%T.578)] +// CHECK:STDOUT: %x.param: @InitFromStructGeneric.%T.as_type.loc8_44.1 (%T.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc8_44.1: type = splice_block %.loc8_44.2 [symbolic = %T.as_type.loc8_44.1 (constants.%T.as_type)] { +// CHECK:STDOUT: %T.ref.loc8_44: %Copy.type = name_ref T, %T.loc8_26.2 [symbolic = %T.loc8_26.1 (constants.%T.578)] +// CHECK:STDOUT: %T.as_type.loc8_44.2: type = facet_access_type %T.ref.loc8_44 [symbolic = %T.as_type.loc8_44.1 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc8_44.2: type = converted %T.ref.loc8_44, %T.as_type.loc8_44.2 [symbolic = %T.as_type.loc8_44.1 (constants.%T.as_type)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %x: @InitFromStructGeneric.%T.as_type.loc8_44.1 (%T.as_type) = bind_name x, %x.param +// CHECK:STDOUT: %return.param: ref @InitFromStructGeneric.%T.as_type.loc8_44.1 (%T.as_type) = out_param call_param1 +// CHECK:STDOUT: %return: ref @InitFromStructGeneric.%T.as_type.loc8_44.1 (%T.as_type) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %InitFromStructSpecific.decl: %InitFromStructSpecific.type = fn_decl @InitFromStructSpecific [concrete = constants.%InitFromStructSpecific] { // CHECK:STDOUT: %x.patt: %pattern_type.7ce = binding_pattern x [concrete] @@ -161,7 +204,7 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @Class.as.Destroy.impl(@Class.%T.loc4_13.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.8b3)] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class.fe1)] // CHECK:STDOUT: %Destroy.impl_witness: = impl_witness @Class.%Destroy.impl_witness_table, @Class.as.Destroy.impl(%T) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.d1e)] // CHECK:STDOUT: @@ -177,7 +220,7 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @Class.as.Destroy.impl.Op.%ptr (%ptr.955) = value_param call_param0 // CHECK:STDOUT: %.loc4_23.2: type = splice_block %Self.ref [symbolic = %Class (constants.%Class.fe1)] { -// CHECK:STDOUT: %.loc4_23.3: type = specific_constant constants.%Class.fe1, @Class(constants.%T) [symbolic = %Class (constants.%Class.fe1)] +// CHECK:STDOUT: %.loc4_23.3: type = specific_constant constants.%Class.fe1, @Class(constants.%T.8b3) [symbolic = %Class (constants.%Class.fe1)] // CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc4_23.3 [symbolic = %Class (constants.%Class.fe1)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @Class.as.Destroy.impl.Op.%ptr (%ptr.955) = bind_name self, %self.param @@ -190,22 +233,22 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @Class(%T.loc4_13.2: type) { -// CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.1 (constants.%T)] +// CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.1 (constants.%T.8b3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %T.loc4_13.1 [symbolic = %require_complete (constants.%require_complete.4ae)] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.loc4_13.1) [symbolic = %Class (constants.%Class.fe1)] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T.loc4_13.1 [symbolic = %Class.elem (constants.%Class.elem.e26)] -// CHECK:STDOUT: %struct_type.k: type = struct_type {.k: @Class.%T.loc4_13.1 (%T)} [symbolic = %struct_type.k (constants.%struct_type.k.b21)] +// CHECK:STDOUT: %struct_type.k: type = struct_type {.k: @Class.%T.loc4_13.1 (%T.8b3)} [symbolic = %struct_type.k (constants.%struct_type.k.b21)] // CHECK:STDOUT: %complete_type.loc6_1.2: = complete_type_witness %struct_type.k [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.b9e)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_13.2 [symbolic = %T.loc4_13.1 (constants.%T)] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_13.2 [symbolic = %T.loc4_13.1 (constants.%T.8b3)] // CHECK:STDOUT: %.loc5: @Class.%Class.elem (%Class.elem.e26) = field_decl k, element0 [concrete] // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class.fe1 [symbolic = @Class.as.Destroy.impl.%Class (constants.%Class.fe1)] // CHECK:STDOUT: impl_decl @Class.as.Destroy.impl [concrete] {} {} // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@Class.as.Destroy.impl.%Class.as.Destroy.impl.Op.decl), @Class.as.Destroy.impl [concrete] -// CHECK:STDOUT: %Destroy.impl_witness: = impl_witness %Destroy.impl_witness_table, @Class.as.Destroy.impl(constants.%T) [symbolic = @Class.as.Destroy.impl.%Destroy.impl_witness (constants.%Destroy.impl_witness.d1e)] +// CHECK:STDOUT: %Destroy.impl_witness: = impl_witness %Destroy.impl_witness_table, @Class.as.Destroy.impl(constants.%T.8b3) [symbolic = @Class.as.Destroy.impl.%Destroy.impl_witness (constants.%Destroy.impl_witness.d1e)] // CHECK:STDOUT: %complete_type.loc6_1.1: = complete_type_witness constants.%struct_type.k.b21 [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.b9e)] // CHECK:STDOUT: complete_type_witness = %complete_type.loc6_1.1 // CHECK:STDOUT: @@ -217,7 +260,7 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Class.as.Destroy.impl.Op(@Class.%T.loc4_13.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.8b3)] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class.fe1)] // CHECK:STDOUT: %ptr: type = ptr_type %Class [symbolic = %ptr (constants.%ptr.955)] // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [symbolic = %pattern_type (constants.%pattern_type.9e0)] @@ -227,55 +270,68 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: fn(%self.param: @Class.as.Destroy.impl.Op.%ptr (%ptr.955)) = "no_op"; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @InitFromStructGeneric(%T.loc8_26.2: type) { -// CHECK:STDOUT: %T.loc8_26.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_26.1 (constants.%T)] -// CHECK:STDOUT: %pattern_type.loc8: type = pattern_type %T.loc8_26.1 [symbolic = %pattern_type.loc8 (constants.%pattern_type.7dc)] +// CHECK:STDOUT: generic fn @InitFromStructGeneric(%T.loc8_26.2: %Copy.type) { +// CHECK:STDOUT: %T.loc8_26.1: %Copy.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_26.1 (constants.%T.578)] +// CHECK:STDOUT: %T.as_type.loc8_44.1: type = facet_access_type %T.loc8_26.1 [symbolic = %T.as_type.loc8_44.1 (constants.%T.as_type)] +// CHECK:STDOUT: %pattern_type.loc8: type = pattern_type %T.as_type.loc8_44.1 [symbolic = %pattern_type.loc8 (constants.%pattern_type.f8cebc.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc8: = require_complete_type %T.loc8_26.1 [symbolic = %require_complete.loc8 (constants.%require_complete.4ae)] -// CHECK:STDOUT: %Class.loc9_17.2: type = class_type @Class, @Class(%T.loc8_26.1) [symbolic = %Class.loc9_17.2 (constants.%Class.fe1)] -// CHECK:STDOUT: %require_complete.loc9_17: = require_complete_type %Class.loc9_17.2 [symbolic = %require_complete.loc9_17 (constants.%require_complete.4f8)] -// CHECK:STDOUT: %pattern_type.loc9: type = pattern_type %Class.loc9_17.2 [symbolic = %pattern_type.loc9 (constants.%pattern_type.3c1)] -// CHECK:STDOUT: %struct_type.k: type = struct_type {.k: @InitFromStructGeneric.%T.loc8_26.1 (%T)} [symbolic = %struct_type.k (constants.%struct_type.k.b21)] -// CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class.loc9_17.2, %T.loc8_26.1 [symbolic = %Class.elem (constants.%Class.elem.e26)] -// CHECK:STDOUT: %Destroy.impl_witness: = impl_witness @Class.%Destroy.impl_witness_table, @Class.as.Destroy.impl(%T.loc8_26.1) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.d1e)] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %Class.loc9_17.2, (%Destroy.impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.976)] -// CHECK:STDOUT: %.loc9_3.2: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc9_3.2 (constants.%.0e5)] -// CHECK:STDOUT: %Class.as.Destroy.impl.Op.type: type = fn_type @Class.as.Destroy.impl.Op, @Class.as.Destroy.impl(%T.loc8_26.1) [symbolic = %Class.as.Destroy.impl.Op.type (constants.%Class.as.Destroy.impl.Op.type.412)] -// CHECK:STDOUT: %Class.as.Destroy.impl.Op: @InitFromStructGeneric.%Class.as.Destroy.impl.Op.type (%Class.as.Destroy.impl.Op.type.412) = struct_value () [symbolic = %Class.as.Destroy.impl.Op (constants.%Class.as.Destroy.impl.Op.9bc)] -// CHECK:STDOUT: %Class.as.Destroy.impl.Op.specific_fn: = specific_function %Class.as.Destroy.impl.Op, @Class.as.Destroy.impl.Op(%T.loc8_26.1) [symbolic = %Class.as.Destroy.impl.Op.specific_fn (constants.%Class.as.Destroy.impl.Op.specific_fn.e70)] -// CHECK:STDOUT: %ptr: type = ptr_type %Class.loc9_17.2 [symbolic = %ptr (constants.%ptr.955)] -// CHECK:STDOUT: %require_complete.loc9_3: = require_complete_type %ptr [symbolic = %require_complete.loc9_3 (constants.%require_complete.2ae)] +// CHECK:STDOUT: %require_complete.loc8: = require_complete_type %T.as_type.loc8_44.1 [symbolic = %require_complete.loc8 (constants.%require_complete.ecc)] +// CHECK:STDOUT: %Class.loc9_17.2: type = class_type @Class, @Class(%T.as_type.loc8_44.1) [symbolic = %Class.loc9_17.2 (constants.%Class.b1d)] +// CHECK:STDOUT: %require_complete.loc9_17: = require_complete_type %Class.loc9_17.2 [symbolic = %require_complete.loc9_17 (constants.%require_complete.57f)] +// CHECK:STDOUT: %pattern_type.loc9: type = pattern_type %Class.loc9_17.2 [symbolic = %pattern_type.loc9 (constants.%pattern_type.a8f)] +// CHECK:STDOUT: %struct_type.k: type = struct_type {.k: @InitFromStructGeneric.%T.as_type.loc8_44.1 (%T.as_type)} [symbolic = %struct_type.k (constants.%struct_type.k.c03)] +// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %T.loc8_26.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.3ba)] +// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %T.as_type.loc8_44.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet.72e)] +// CHECK:STDOUT: %.loc9_27.2: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc9_27.2 (constants.%.671)] +// CHECK:STDOUT: %impl.elem0.loc9_27.2: @InitFromStructGeneric.%.loc9_27.2 (%.671) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_27.2 (constants.%impl.elem0.56e)] +// CHECK:STDOUT: %specific_impl_fn.loc9_27.2: = specific_impl_function %impl.elem0.loc9_27.2, @Copy.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc9_27.2 (constants.%specific_impl_fn.fb7)] +// CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class.loc9_17.2, %T.as_type.loc8_44.1 [symbolic = %Class.elem (constants.%Class.elem.73a)] +// CHECK:STDOUT: %Destroy.impl_witness: = impl_witness @Class.%Destroy.impl_witness_table, @Class.as.Destroy.impl(%T.as_type.loc8_44.1) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.492)] +// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %Class.loc9_17.2, (%Destroy.impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.744)] +// CHECK:STDOUT: %.loc9_3.2: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc9_3.2 (constants.%.c08)] +// CHECK:STDOUT: %Class.as.Destroy.impl.Op.type: type = fn_type @Class.as.Destroy.impl.Op, @Class.as.Destroy.impl(%T.as_type.loc8_44.1) [symbolic = %Class.as.Destroy.impl.Op.type (constants.%Class.as.Destroy.impl.Op.type.637)] +// CHECK:STDOUT: %Class.as.Destroy.impl.Op: @InitFromStructGeneric.%Class.as.Destroy.impl.Op.type (%Class.as.Destroy.impl.Op.type.637) = struct_value () [symbolic = %Class.as.Destroy.impl.Op (constants.%Class.as.Destroy.impl.Op.598)] +// CHECK:STDOUT: %Class.as.Destroy.impl.Op.specific_fn: = specific_function %Class.as.Destroy.impl.Op, @Class.as.Destroy.impl.Op(%T.as_type.loc8_44.1) [symbolic = %Class.as.Destroy.impl.Op.specific_fn (constants.%Class.as.Destroy.impl.Op.specific_fn.df2)] +// CHECK:STDOUT: %ptr: type = ptr_type %Class.loc9_17.2 [symbolic = %ptr (constants.%ptr.458)] +// CHECK:STDOUT: %require_complete.loc9_3: = require_complete_type %ptr [symbolic = %require_complete.loc9_3 (constants.%require_complete.ec5)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%x.param: @InitFromStructGeneric.%T.loc8_26.1 (%T)) -> @InitFromStructGeneric.%T.loc8_26.1 (%T) { +// CHECK:STDOUT: fn(%x.param: @InitFromStructGeneric.%T.as_type.loc8_44.1 (%T.as_type)) -> @InitFromStructGeneric.%T.as_type.loc8_44.1 (%T.as_type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %v.patt: @InitFromStructGeneric.%pattern_type.loc9 (%pattern_type.3c1) = binding_pattern v [concrete] -// CHECK:STDOUT: %v.var_patt: @InitFromStructGeneric.%pattern_type.loc9 (%pattern_type.3c1) = var_pattern %v.patt [concrete] +// CHECK:STDOUT: %v.patt: @InitFromStructGeneric.%pattern_type.loc9 (%pattern_type.a8f) = binding_pattern v [concrete] +// CHECK:STDOUT: %v.var_patt: @InitFromStructGeneric.%pattern_type.loc9 (%pattern_type.a8f) = var_pattern %v.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %v.var: ref @InitFromStructGeneric.%Class.loc9_17.2 (%Class.fe1) = var %v.var_patt -// CHECK:STDOUT: %x.ref: @InitFromStructGeneric.%T.loc8_26.1 (%T) = name_ref x, %x -// CHECK:STDOUT: %.loc9_28.1: @InitFromStructGeneric.%struct_type.k (%struct_type.k.b21) = struct_literal (%x.ref) -// CHECK:STDOUT: %.loc9_28.2: ref @InitFromStructGeneric.%T.loc8_26.1 (%T) = class_element_access %v.var, element0 -// CHECK:STDOUT: %.loc9_28.3: init @InitFromStructGeneric.%T.loc8_26.1 (%T) = initialize_from %x.ref to %.loc9_28.2 -// CHECK:STDOUT: %.loc9_28.4: init @InitFromStructGeneric.%Class.loc9_17.2 (%Class.fe1) = class_init (%.loc9_28.3), %v.var -// CHECK:STDOUT: %.loc9_3.1: init @InitFromStructGeneric.%Class.loc9_17.2 (%Class.fe1) = converted %.loc9_28.1, %.loc9_28.4 +// CHECK:STDOUT: %v.var: ref @InitFromStructGeneric.%Class.loc9_17.2 (%Class.b1d) = var %v.var_patt +// CHECK:STDOUT: %x.ref: @InitFromStructGeneric.%T.as_type.loc8_44.1 (%T.as_type) = name_ref x, %x +// CHECK:STDOUT: %.loc9_28.1: @InitFromStructGeneric.%struct_type.k (%struct_type.k.c03) = struct_literal (%x.ref) +// CHECK:STDOUT: %impl.elem0.loc9_27.1: @InitFromStructGeneric.%.loc9_27.2 (%.671) = impl_witness_access constants.%Copy.lookup_impl_witness.3ba, element0 [symbolic = %impl.elem0.loc9_27.2 (constants.%impl.elem0.56e)] +// CHECK:STDOUT: %bound_method.loc9_27.1: = bound_method %x.ref, %impl.elem0.loc9_27.1 +// CHECK:STDOUT: %specific_impl_fn.loc9_27.1: = specific_impl_function %impl.elem0.loc9_27.1, @Copy.Op(constants.%Copy.facet.72e) [symbolic = %specific_impl_fn.loc9_27.2 (constants.%specific_impl_fn.fb7)] +// CHECK:STDOUT: %bound_method.loc9_27.2: = bound_method %x.ref, %specific_impl_fn.loc9_27.1 +// CHECK:STDOUT: %.loc9_27.1: init @InitFromStructGeneric.%T.as_type.loc8_44.1 (%T.as_type) = call %bound_method.loc9_27.2(%x.ref) +// CHECK:STDOUT: %.loc9_28.2: ref @InitFromStructGeneric.%T.as_type.loc8_44.1 (%T.as_type) = class_element_access %v.var, element0 +// CHECK:STDOUT: %.loc9_28.3: init @InitFromStructGeneric.%T.as_type.loc8_44.1 (%T.as_type) = initialize_from %.loc9_27.1 to %.loc9_28.2 +// CHECK:STDOUT: %.loc9_28.4: init @InitFromStructGeneric.%Class.loc9_17.2 (%Class.b1d) = class_init (%.loc9_28.3), %v.var +// CHECK:STDOUT: %.loc9_3.1: init @InitFromStructGeneric.%Class.loc9_17.2 (%Class.b1d) = converted %.loc9_28.1, %.loc9_28.4 // CHECK:STDOUT: assign %v.var, %.loc9_3.1 -// CHECK:STDOUT: %.loc9_17: type = splice_block %Class.loc9_17.1 [symbolic = %Class.loc9_17.2 (constants.%Class.fe1)] { +// CHECK:STDOUT: %.loc9_17.1: type = splice_block %Class.loc9_17.1 [symbolic = %Class.loc9_17.2 (constants.%Class.b1d)] { // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [concrete = constants.%Class.generic] -// CHECK:STDOUT: %T.ref.loc9: type = name_ref T, %T.loc8_26.2 [symbolic = %T.loc8_26.1 (constants.%T)] -// CHECK:STDOUT: %Class.loc9_17.1: type = class_type @Class, @Class(constants.%T) [symbolic = %Class.loc9_17.2 (constants.%Class.fe1)] +// CHECK:STDOUT: %T.ref.loc9: %Copy.type = name_ref T, %T.loc8_26.2 [symbolic = %T.loc8_26.1 (constants.%T.578)] +// CHECK:STDOUT: %T.as_type.loc9: type = facet_access_type %T.ref.loc9 [symbolic = %T.as_type.loc8_44.1 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc9_17.2: type = converted %T.ref.loc9, %T.as_type.loc9 [symbolic = %T.as_type.loc8_44.1 (constants.%T.as_type)] +// CHECK:STDOUT: %Class.loc9_17.1: type = class_type @Class, @Class(constants.%T.as_type) [symbolic = %Class.loc9_17.2 (constants.%Class.b1d)] // CHECK:STDOUT: } -// CHECK:STDOUT: %v: ref @InitFromStructGeneric.%Class.loc9_17.2 (%Class.fe1) = bind_name v, %v.var -// CHECK:STDOUT: %v.ref: ref @InitFromStructGeneric.%Class.loc9_17.2 (%Class.fe1) = name_ref v, %v -// CHECK:STDOUT: %k.ref: @InitFromStructGeneric.%Class.elem (%Class.elem.e26) = name_ref k, @Class.%.loc5 [concrete = @Class.%.loc5] -// CHECK:STDOUT: %.loc10_11.1: ref @InitFromStructGeneric.%T.loc8_26.1 (%T) = class_element_access %v.ref, element0 -// CHECK:STDOUT: %.loc10_11.2: @InitFromStructGeneric.%T.loc8_26.1 (%T) = bind_value %.loc10_11.1 -// CHECK:STDOUT: %impl.elem0: @InitFromStructGeneric.%.loc9_3.2 (%.0e5) = impl_witness_access constants.%Destroy.impl_witness.d1e, element0 [symbolic = %Class.as.Destroy.impl.Op (constants.%Class.as.Destroy.impl.Op.9bc)] -// CHECK:STDOUT: %bound_method.loc9_3.1: = bound_method %v.var, %impl.elem0 -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Class.as.Destroy.impl.Op(constants.%T) [symbolic = %Class.as.Destroy.impl.Op.specific_fn (constants.%Class.as.Destroy.impl.Op.specific_fn.e70)] +// CHECK:STDOUT: %v: ref @InitFromStructGeneric.%Class.loc9_17.2 (%Class.b1d) = bind_name v, %v.var +// CHECK:STDOUT: %v.ref: ref @InitFromStructGeneric.%Class.loc9_17.2 (%Class.b1d) = name_ref v, %v +// CHECK:STDOUT: %k.ref: @InitFromStructGeneric.%Class.elem (%Class.elem.73a) = name_ref k, @Class.%.loc5 [concrete = @Class.%.loc5] +// CHECK:STDOUT: %.loc10_11.1: ref @InitFromStructGeneric.%T.as_type.loc8_44.1 (%T.as_type) = class_element_access %v.ref, element0 +// CHECK:STDOUT: %.loc10_11.2: @InitFromStructGeneric.%T.as_type.loc8_44.1 (%T.as_type) = bind_value %.loc10_11.1 +// CHECK:STDOUT: %impl.elem0.loc9_3: @InitFromStructGeneric.%.loc9_3.2 (%.c08) = impl_witness_access constants.%Destroy.impl_witness.492, element0 [symbolic = %Class.as.Destroy.impl.Op (constants.%Class.as.Destroy.impl.Op.598)] +// CHECK:STDOUT: %bound_method.loc9_3.1: = bound_method %v.var, %impl.elem0.loc9_3 +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc9_3, @Class.as.Destroy.impl.Op(constants.%T.as_type) [symbolic = %Class.as.Destroy.impl.Op.specific_fn (constants.%Class.as.Destroy.impl.Op.specific_fn.df2)] // CHECK:STDOUT: %bound_method.loc9_3.2: = bound_method %v.var, %specific_fn -// CHECK:STDOUT: %addr: @InitFromStructGeneric.%ptr (%ptr.955) = addr_of %v.var +// CHECK:STDOUT: %addr: @InitFromStructGeneric.%ptr (%ptr.458) = addr_of %v.var // CHECK:STDOUT: %Class.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc9_3.2(%addr) // CHECK:STDOUT: return %.loc10_11.2 // CHECK:STDOUT: } @@ -290,8 +346,13 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %v.var: ref %Class.247 = var %v.var_patt // CHECK:STDOUT: %x.ref: %i32 = name_ref x, %x // CHECK:STDOUT: %.loc14_30.1: %struct_type.k.0bf = struct_literal (%x.ref) +// CHECK:STDOUT: %impl.elem0: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc14_29.1: = bound_method %x.ref, %impl.elem0 +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_29.2: = bound_method %x.ref, %specific_fn +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc14_29.2(%x.ref) // CHECK:STDOUT: %.loc14_30.2: ref %i32 = class_element_access %v.var, element0 -// CHECK:STDOUT: %.loc14_30.3: init %i32 = initialize_from %x.ref to %.loc14_30.2 +// CHECK:STDOUT: %.loc14_30.3: init %i32 = initialize_from %Int.as.Copy.impl.Op.call to %.loc14_30.2 // CHECK:STDOUT: %.loc14_30.4: init %Class.247 = class_init (%.loc14_30.3), %v.var // CHECK:STDOUT: %.loc14_3: init %Class.247 = converted %.loc14_30.1, %.loc14_30.4 // CHECK:STDOUT: assign %v.var, %.loc14_3 @@ -308,43 +369,61 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %.loc15_11.2: %i32 = bind_value %.loc15_11.1 // CHECK:STDOUT: %Class.as.Destroy.impl.Op.bound: = bound_method %v.var, constants.%Class.as.Destroy.impl.Op.831 // CHECK:STDOUT: %Class.as.Destroy.impl.Op.specific_fn: = specific_function constants.%Class.as.Destroy.impl.Op.831, @Class.as.Destroy.impl.Op(constants.%i32) [concrete = constants.%Class.as.Destroy.impl.Op.specific_fn.213] -// CHECK:STDOUT: %bound_method: = bound_method %v.var, %Class.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %bound_method.loc14_3: = bound_method %v.var, %Class.as.Destroy.impl.Op.specific_fn // CHECK:STDOUT: %addr: %ptr.f7c = addr_of %v.var -// CHECK:STDOUT: %Class.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr) +// CHECK:STDOUT: %Class.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc14_3(%addr) // CHECK:STDOUT: return %.loc15_11.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(constants.%T) { -// CHECK:STDOUT: %T.loc4_13.1 => constants.%T -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%require_complete.4ae -// CHECK:STDOUT: %Class => constants.%Class.fe1 -// CHECK:STDOUT: %Class.elem => constants.%Class.elem.e26 -// CHECK:STDOUT: %struct_type.k => constants.%struct_type.k.b21 -// CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.b9e +// CHECK:STDOUT: specific @Class(constants.%T.8b3) { +// CHECK:STDOUT: %T.loc4_13.1 => constants.%T.8b3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class.as.Destroy.impl(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @Class.as.Destroy.impl(constants.%T.8b3) { +// CHECK:STDOUT: %T => constants.%T.8b3 // CHECK:STDOUT: %Class => constants.%Class.fe1 // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.d1e -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Class.as.Destroy.impl.Op.type => constants.%Class.as.Destroy.impl.Op.type.412 -// CHECK:STDOUT: %Class.as.Destroy.impl.Op => constants.%Class.as.Destroy.impl.Op.9bc // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class.as.Destroy.impl.Op(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @Class.as.Destroy.impl.Op(constants.%T.8b3) { +// CHECK:STDOUT: %T => constants.%T.8b3 // CHECK:STDOUT: %Class => constants.%Class.fe1 // CHECK:STDOUT: %ptr => constants.%ptr.955 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.9e0 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @InitFromStructGeneric(constants.%T) { -// CHECK:STDOUT: %T.loc8_26.1 => constants.%T -// CHECK:STDOUT: %pattern_type.loc8 => constants.%pattern_type.7dc +// CHECK:STDOUT: specific @InitFromStructGeneric(constants.%T.578) { +// CHECK:STDOUT: %T.loc8_26.1 => constants.%T.578 +// CHECK:STDOUT: %T.as_type.loc8_44.1 => constants.%T.as_type +// CHECK:STDOUT: %pattern_type.loc8 => constants.%pattern_type.f8cebc.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Class(constants.%T.as_type) { +// CHECK:STDOUT: %T.loc4_13.1 => constants.%T.as_type +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%require_complete.ecc +// CHECK:STDOUT: %Class => constants.%Class.b1d +// CHECK:STDOUT: %Class.elem => constants.%Class.elem.73a +// CHECK:STDOUT: %struct_type.k => constants.%struct_type.k.c03 +// CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.cdd +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Class.as.Destroy.impl(constants.%T.as_type) { +// CHECK:STDOUT: %T => constants.%T.as_type +// CHECK:STDOUT: %Class => constants.%Class.b1d +// CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.492 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Class.as.Destroy.impl.Op.type => constants.%Class.as.Destroy.impl.Op.type.637 +// CHECK:STDOUT: %Class.as.Destroy.impl.Op => constants.%Class.as.Destroy.impl.Op.598 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Class.as.Destroy.impl.Op(constants.%T.as_type) { +// CHECK:STDOUT: %T => constants.%T.as_type +// CHECK:STDOUT: %Class => constants.%Class.b1d +// CHECK:STDOUT: %ptr => constants.%ptr.458 +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.20e // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%i32) { diff --git a/toolchain/check/testdata/class/generic/member_type.carbon b/toolchain/check/testdata/class/generic/member_type.carbon index a5907a549a4b..2cf8b645524f 100644 --- a/toolchain/check/testdata/class/generic/member_type.carbon +++ b/toolchain/check/testdata/class/generic/member_type.carbon @@ -16,7 +16,7 @@ library "[[@TEST_NAME]]"; -class Outer(T:! type) { +class Outer(T:! Core.Copy) { class Inner { var n: T; } @@ -61,55 +61,72 @@ fn Test() -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self] -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] -// CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %T.578: %Copy.type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %pattern_type.ce2: type = pattern_type %Copy.type [concrete] // CHECK:STDOUT: %Outer.type: type = generic_class_type @Outer [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Outer.generic: %Outer.type = struct_value () [concrete] -// CHECK:STDOUT: %Outer.9d6: type = class_type @Outer, @Outer(%T) [symbolic] -// CHECK:STDOUT: %Inner.51b: type = class_type @Inner, @Inner(%T) [symbolic] -// CHECK:STDOUT: %require_complete.4ae: = require_complete_type %T [symbolic] -// CHECK:STDOUT: %Inner.elem.310: type = unbound_element_type %Inner.51b, %T [symbolic] +// CHECK:STDOUT: %Outer.0f8: type = class_type @Outer, @Outer(%T.578) [symbolic] +// CHECK:STDOUT: %Inner.2a5: type = class_type @Inner, @Inner(%T.578) [symbolic] +// CHECK:STDOUT: %T.as_type: type = facet_access_type %T.578 [symbolic] +// CHECK:STDOUT: %require_complete.ecc: = require_complete_type %T.as_type [symbolic] +// CHECK:STDOUT: %Inner.elem.b8f: type = unbound_element_type %Inner.2a5, %T.as_type [symbolic] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete] -// CHECK:STDOUT: %Destroy.impl_witness.9c7: = impl_witness @Inner.%Destroy.impl_witness_table, @Inner.as.Destroy.impl(%T) [symbolic] -// CHECK:STDOUT: %ptr.c82: type = ptr_type %Inner.51b [symbolic] -// CHECK:STDOUT: %pattern_type.822: type = pattern_type %ptr.c82 [symbolic] -// CHECK:STDOUT: %Inner.as.Destroy.impl.Op.type.eea: type = fn_type @Inner.as.Destroy.impl.Op, @Inner.as.Destroy.impl(%T) [symbolic] -// CHECK:STDOUT: %Inner.as.Destroy.impl.Op.310: %Inner.as.Destroy.impl.Op.type.eea = struct_value () [symbolic] -// CHECK:STDOUT: %struct_type.n.848: type = struct_type {.n: %T} [symbolic] -// CHECK:STDOUT: %complete_type.84b: = complete_type_witness %struct_type.n.848 [symbolic] -// CHECK:STDOUT: %pattern_type.7dcd0a.1: type = pattern_type %T [symbolic] -// CHECK:STDOUT: %pattern_type.253: type = pattern_type %Inner.51b [symbolic] -// CHECK:STDOUT: %Outer.F.type.2ee: type = fn_type @Outer.F, @Outer(%T) [symbolic] -// CHECK:STDOUT: %Outer.F.384: %Outer.F.type.2ee = struct_value () [symbolic] -// CHECK:STDOUT: %Destroy.impl_witness.7ee: = impl_witness @Outer.%Destroy.impl_witness_table, @Outer.as.Destroy.impl(%T) [symbolic] -// CHECK:STDOUT: %ptr.6ff: type = ptr_type %Outer.9d6 [symbolic] -// CHECK:STDOUT: %pattern_type.07e: type = pattern_type %ptr.6ff [symbolic] -// CHECK:STDOUT: %Outer.as.Destroy.impl.Op.type: type = fn_type @Outer.as.Destroy.impl.Op, @Outer.as.Destroy.impl(%T) [symbolic] +// CHECK:STDOUT: %Destroy.impl_witness.0d4: = impl_witness @Inner.%Destroy.impl_witness_table, @Inner.as.Destroy.impl(%T.578) [symbolic] +// CHECK:STDOUT: %ptr.98d: type = ptr_type %Inner.2a5 [symbolic] +// CHECK:STDOUT: %pattern_type.132: type = pattern_type %ptr.98d [symbolic] +// CHECK:STDOUT: %Inner.as.Destroy.impl.Op.type.6b3: type = fn_type @Inner.as.Destroy.impl.Op, @Inner.as.Destroy.impl(%T.578) [symbolic] +// CHECK:STDOUT: %Inner.as.Destroy.impl.Op.c12: %Inner.as.Destroy.impl.Op.type.6b3 = struct_value () [symbolic] +// CHECK:STDOUT: %struct_type.n.02b: type = struct_type {.n: %T.as_type} [symbolic] +// CHECK:STDOUT: %complete_type.786: = complete_type_witness %struct_type.n.02b [symbolic] +// CHECK:STDOUT: %pattern_type.f8cebc.1: type = pattern_type %T.as_type [symbolic] +// CHECK:STDOUT: %pattern_type.c19: type = pattern_type %Inner.2a5 [symbolic] +// CHECK:STDOUT: %Outer.F.type.bd9: type = fn_type @Outer.F, @Outer(%T.578) [symbolic] +// CHECK:STDOUT: %Outer.F.22d: %Outer.F.type.bd9 = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.impl_witness.1e4: = impl_witness @Outer.%Destroy.impl_witness_table, @Outer.as.Destroy.impl(%T.578) [symbolic] +// CHECK:STDOUT: %ptr.b2c: type = ptr_type %Outer.0f8 [symbolic] +// CHECK:STDOUT: %pattern_type.3bd: type = pattern_type %ptr.b2c [symbolic] +// CHECK:STDOUT: %Outer.as.Destroy.impl.Op.type: type = fn_type @Outer.as.Destroy.impl.Op, @Outer.as.Destroy.impl(%T.578) [symbolic] // CHECK:STDOUT: %Outer.as.Destroy.impl.Op: %Outer.as.Destroy.impl.Op.type = struct_value () [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %require_complete.561: = require_complete_type %Inner.51b [symbolic] +// CHECK:STDOUT: %require_complete.ce2: = require_complete_type %Inner.2a5 [symbolic] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Copy.lookup_impl_witness.3ba: = lookup_impl_witness %T.578, @Copy [symbolic] +// CHECK:STDOUT: %Copy.facet.72e: %Copy.type = facet_value %T.as_type, (%Copy.lookup_impl_witness.3ba) [symbolic] +// CHECK:STDOUT: %.671: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.72e [symbolic] +// CHECK:STDOUT: %impl.elem0.56e: %.671 = impl_witness_access %Copy.lookup_impl_witness.3ba, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.fb7: = specific_impl_function %impl.elem0.56e, @Copy.Op(%Copy.facet.72e) [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %Test.type: type = fn_type @Test [concrete] // CHECK:STDOUT: %Test: %Test.type = struct_value () [concrete] // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %complete_type.f8a: = complete_type_witness %i32.builtin [concrete] -// CHECK:STDOUT: %Outer.545: type = class_type @Outer, @Outer(%i32) [concrete] -// CHECK:STDOUT: %Inner.721: type = class_type @Inner, @Inner(%i32) [concrete] -// CHECK:STDOUT: %Outer.F.type.9d7: type = fn_type @Outer.F, @Outer(%i32) [concrete] -// CHECK:STDOUT: %Outer.F.c88: %Outer.F.type.9d7 = struct_value () [concrete] -// CHECK:STDOUT: %Inner.elem.6c2: type = unbound_element_type %Inner.721, %i32 [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %Outer.5dd: type = class_type @Outer, @Outer(%Copy.facet.26d) [concrete] +// CHECK:STDOUT: %Inner.3fc: type = class_type @Inner, @Inner(%Copy.facet.26d) [concrete] +// CHECK:STDOUT: %Outer.F.type.ae5: type = fn_type @Outer.F, @Outer(%Copy.facet.26d) [concrete] +// CHECK:STDOUT: %Outer.F.fb2: %Outer.F.type.ae5 = struct_value () [concrete] +// CHECK:STDOUT: %Inner.elem.45c: type = unbound_element_type %Inner.3fc, %i32 [concrete] // CHECK:STDOUT: %struct_type.n.033: type = struct_type {.n: %i32} [concrete] // CHECK:STDOUT: %complete_type.54b: = complete_type_witness %struct_type.n.033 [concrete] -// CHECK:STDOUT: %pattern_type.c22: type = pattern_type %Inner.721 [concrete] +// CHECK:STDOUT: %pattern_type.814: type = pattern_type %Inner.3fc [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] -// CHECK:STDOUT: %Outer.F.specific_fn: = specific_function %Outer.F.c88, @Outer.F(%i32) [concrete] +// CHECK:STDOUT: %Copy.impl_witness.d46: = impl_witness imports.%Copy.impl_witness_table.462 [concrete] +// CHECK:STDOUT: %Copy.facet.66a: %Copy.type = facet_value Core.IntLiteral, (%Copy.impl_witness.d46) [concrete] +// CHECK:STDOUT: %Outer.F.specific_fn: = specific_function %Outer.F.fb2, @Outer.F(%Copy.facet.26d) [concrete] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] // CHECK:STDOUT: %ImplicitAs.type.e8c: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete] @@ -126,26 +143,34 @@ fn Test() -> i32 { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.592, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] -// CHECK:STDOUT: %Destroy.impl_witness.cc9: = impl_witness @Inner.%Destroy.impl_witness_table, @Inner.as.Destroy.impl(%i32) [concrete] -// CHECK:STDOUT: %Inner.as.Destroy.impl.Op.type.8d2: type = fn_type @Inner.as.Destroy.impl.Op, @Inner.as.Destroy.impl(%i32) [concrete] -// CHECK:STDOUT: %Inner.as.Destroy.impl.Op.602: %Inner.as.Destroy.impl.Op.type.8d2 = struct_value () [concrete] -// CHECK:STDOUT: %ptr.416: type = ptr_type %Inner.721 [concrete] -// CHECK:STDOUT: %pattern_type.00b: type = pattern_type %ptr.416 [concrete] -// CHECK:STDOUT: %Inner.as.Destroy.impl.Op.specific_fn: = specific_function %Inner.as.Destroy.impl.Op.602, @Inner.as.Destroy.impl.Op(%i32) [concrete] +// CHECK:STDOUT: %Destroy.impl_witness.490: = impl_witness @Inner.%Destroy.impl_witness_table, @Inner.as.Destroy.impl(%Copy.facet.26d) [concrete] +// CHECK:STDOUT: %Inner.as.Destroy.impl.Op.type.90b: type = fn_type @Inner.as.Destroy.impl.Op, @Inner.as.Destroy.impl(%Copy.facet.26d) [concrete] +// CHECK:STDOUT: %Inner.as.Destroy.impl.Op.698: %Inner.as.Destroy.impl.Op.type.90b = struct_value () [concrete] +// CHECK:STDOUT: %ptr.efa: type = ptr_type %Inner.3fc [concrete] +// CHECK:STDOUT: %pattern_type.239: type = pattern_type %ptr.efa [concrete] +// CHECK:STDOUT: %Inner.as.Destroy.impl.Op.specific_fn: = specific_function %Inner.as.Destroy.impl.Op.698, @Inner.as.Destroy.impl.Op(%Copy.facet.26d) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.c4d = import_ref Core//prelude/parts/copy, loc28_31, unloaded +// CHECK:STDOUT: %Copy.impl_witness_table.462 = impl_witness_table (%Core.import_ref.c4d), @Core.IntLiteral.as.Copy.impl [concrete] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -157,10 +182,14 @@ fn Test() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Outer.decl: %Outer.type = class_decl @Outer [concrete = constants.%Outer.generic] { -// CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] +// CHECK:STDOUT: %T.patt: %pattern_type.ce2 = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.1 (constants.%T)] +// CHECK:STDOUT: %.loc4: type = splice_block %Copy.ref [concrete = constants.%Copy.type] { +// CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %Copy.ref: type = name_ref Copy, imports.%Core.Copy [concrete = constants.%Copy.type] +// CHECK:STDOUT: } +// CHECK:STDOUT: %T.loc4_13.2: %Copy.type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.1 (constants.%T.578)] // CHECK:STDOUT: } // CHECK:STDOUT: %Test.decl: %Test.type = fn_decl @Test [concrete = constants.%Test] { // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete] @@ -173,27 +202,27 @@ fn Test() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic impl @Inner.as.Destroy.impl(@Outer.%T.loc4_13.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %Inner: type = class_type @Inner, @Inner(%T) [symbolic = %Inner (constants.%Inner.51b)] -// CHECK:STDOUT: %Destroy.impl_witness: = impl_witness @Inner.%Destroy.impl_witness_table, @Inner.as.Destroy.impl(%T) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.9c7)] +// CHECK:STDOUT: generic impl @Inner.as.Destroy.impl(@Outer.%T.loc4_13.2: %Copy.type) { +// CHECK:STDOUT: %T: %Copy.type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.578)] +// CHECK:STDOUT: %Inner: type = class_type @Inner, @Inner(%T) [symbolic = %Inner (constants.%Inner.2a5)] +// CHECK:STDOUT: %Destroy.impl_witness: = impl_witness @Inner.%Destroy.impl_witness_table, @Inner.as.Destroy.impl(%T) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.0d4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Inner.as.Destroy.impl.Op.type: type = fn_type @Inner.as.Destroy.impl.Op, @Inner.as.Destroy.impl(%T) [symbolic = %Inner.as.Destroy.impl.Op.type (constants.%Inner.as.Destroy.impl.Op.type.eea)] -// CHECK:STDOUT: %Inner.as.Destroy.impl.Op: @Inner.as.Destroy.impl.%Inner.as.Destroy.impl.Op.type (%Inner.as.Destroy.impl.Op.type.eea) = struct_value () [symbolic = %Inner.as.Destroy.impl.Op (constants.%Inner.as.Destroy.impl.Op.310)] +// CHECK:STDOUT: %Inner.as.Destroy.impl.Op.type: type = fn_type @Inner.as.Destroy.impl.Op, @Inner.as.Destroy.impl(%T) [symbolic = %Inner.as.Destroy.impl.Op.type (constants.%Inner.as.Destroy.impl.Op.type.6b3)] +// CHECK:STDOUT: %Inner.as.Destroy.impl.Op: @Inner.as.Destroy.impl.%Inner.as.Destroy.impl.Op.type (%Inner.as.Destroy.impl.Op.type.6b3) = struct_value () [symbolic = %Inner.as.Destroy.impl.Op (constants.%Inner.as.Destroy.impl.Op.c12)] // CHECK:STDOUT: // CHECK:STDOUT: impl: @Inner.%Self.ref as constants.%Destroy.type { -// CHECK:STDOUT: %Inner.as.Destroy.impl.Op.decl: @Inner.as.Destroy.impl.%Inner.as.Destroy.impl.Op.type (%Inner.as.Destroy.impl.Op.type.eea) = fn_decl @Inner.as.Destroy.impl.Op [symbolic = @Inner.as.Destroy.impl.%Inner.as.Destroy.impl.Op (constants.%Inner.as.Destroy.impl.Op.310)] { -// CHECK:STDOUT: %self.patt: @Inner.as.Destroy.impl.Op.%pattern_type (%pattern_type.822) = binding_pattern self [concrete] -// CHECK:STDOUT: %self.param_patt: @Inner.as.Destroy.impl.Op.%pattern_type (%pattern_type.822) = value_param_pattern %self.patt, call_param0 [concrete] +// CHECK:STDOUT: %Inner.as.Destroy.impl.Op.decl: @Inner.as.Destroy.impl.%Inner.as.Destroy.impl.Op.type (%Inner.as.Destroy.impl.Op.type.6b3) = fn_decl @Inner.as.Destroy.impl.Op [symbolic = @Inner.as.Destroy.impl.%Inner.as.Destroy.impl.Op (constants.%Inner.as.Destroy.impl.Op.c12)] { +// CHECK:STDOUT: %self.patt: @Inner.as.Destroy.impl.Op.%pattern_type (%pattern_type.132) = binding_pattern self [concrete] +// CHECK:STDOUT: %self.param_patt: @Inner.as.Destroy.impl.Op.%pattern_type (%pattern_type.132) = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: %.loc5_15.1: %pattern_type.f6d = addr_pattern %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @Inner.as.Destroy.impl.Op.%ptr (%ptr.c82) = value_param call_param0 -// CHECK:STDOUT: %.loc5_15.2: type = splice_block %Self.ref [symbolic = %Inner (constants.%Inner.51b)] { -// CHECK:STDOUT: %.loc5_15.3: type = specific_constant constants.%Inner.51b, @Inner(constants.%T) [symbolic = %Inner (constants.%Inner.51b)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc5_15.3 [symbolic = %Inner (constants.%Inner.51b)] +// CHECK:STDOUT: %self.param: @Inner.as.Destroy.impl.Op.%ptr (%ptr.98d) = value_param call_param0 +// CHECK:STDOUT: %.loc5_15.2: type = splice_block %Self.ref [symbolic = %Inner (constants.%Inner.2a5)] { +// CHECK:STDOUT: %.loc5_15.3: type = specific_constant constants.%Inner.2a5, @Inner(constants.%T.578) [symbolic = %Inner (constants.%Inner.2a5)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc5_15.3 [symbolic = %Inner (constants.%Inner.2a5)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @Inner.as.Destroy.impl.Op.%ptr (%ptr.c82) = bind_name self, %self.param +// CHECK:STDOUT: %self: @Inner.as.Destroy.impl.Op.%ptr (%ptr.98d) = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -202,10 +231,10 @@ fn Test() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic impl @Outer.as.Destroy.impl(@Outer.%T.loc4_13.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %Outer: type = class_type @Outer, @Outer(%T) [symbolic = %Outer (constants.%Outer.9d6)] -// CHECK:STDOUT: %Destroy.impl_witness: = impl_witness @Outer.%Destroy.impl_witness_table, @Outer.as.Destroy.impl(%T) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.7ee)] +// CHECK:STDOUT: generic impl @Outer.as.Destroy.impl(@Outer.%T.loc4_13.2: %Copy.type) { +// CHECK:STDOUT: %T: %Copy.type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.578)] +// CHECK:STDOUT: %Outer: type = class_type @Outer, @Outer(%T) [symbolic = %Outer (constants.%Outer.0f8)] +// CHECK:STDOUT: %Destroy.impl_witness: = impl_witness @Outer.%Destroy.impl_witness_table, @Outer.as.Destroy.impl(%T) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.1e4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Outer.as.Destroy.impl.Op.type: type = fn_type @Outer.as.Destroy.impl.Op, @Outer.as.Destroy.impl(%T) [symbolic = %Outer.as.Destroy.impl.Op.type (constants.%Outer.as.Destroy.impl.Op.type)] @@ -213,16 +242,16 @@ fn Test() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: impl: @Outer.%Self.ref as constants.%Destroy.type { // CHECK:STDOUT: %Outer.as.Destroy.impl.Op.decl: @Outer.as.Destroy.impl.%Outer.as.Destroy.impl.Op.type (%Outer.as.Destroy.impl.Op.type) = fn_decl @Outer.as.Destroy.impl.Op [symbolic = @Outer.as.Destroy.impl.%Outer.as.Destroy.impl.Op (constants.%Outer.as.Destroy.impl.Op)] { -// CHECK:STDOUT: %self.patt: @Outer.as.Destroy.impl.Op.%pattern_type (%pattern_type.07e) = binding_pattern self [concrete] -// CHECK:STDOUT: %self.param_patt: @Outer.as.Destroy.impl.Op.%pattern_type (%pattern_type.07e) = value_param_pattern %self.patt, call_param0 [concrete] -// CHECK:STDOUT: %.loc4_23.1: %pattern_type.f6d = addr_pattern %self.param_patt [concrete] +// CHECK:STDOUT: %self.patt: @Outer.as.Destroy.impl.Op.%pattern_type (%pattern_type.3bd) = binding_pattern self [concrete] +// CHECK:STDOUT: %self.param_patt: @Outer.as.Destroy.impl.Op.%pattern_type (%pattern_type.3bd) = value_param_pattern %self.patt, call_param0 [concrete] +// CHECK:STDOUT: %.loc4_28.1: %pattern_type.f6d = addr_pattern %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @Outer.as.Destroy.impl.Op.%ptr (%ptr.6ff) = value_param call_param0 -// CHECK:STDOUT: %.loc4_23.2: type = splice_block %Self.ref [symbolic = %Outer (constants.%Outer.9d6)] { -// CHECK:STDOUT: %.loc4_23.3: type = specific_constant constants.%Outer.9d6, @Outer(constants.%T) [symbolic = %Outer (constants.%Outer.9d6)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc4_23.3 [symbolic = %Outer (constants.%Outer.9d6)] +// CHECK:STDOUT: %self.param: @Outer.as.Destroy.impl.Op.%ptr (%ptr.b2c) = value_param call_param0 +// CHECK:STDOUT: %.loc4_28.2: type = splice_block %Self.ref [symbolic = %Outer (constants.%Outer.0f8)] { +// CHECK:STDOUT: %.loc4_28.3: type = specific_constant constants.%Outer.0f8, @Outer(constants.%T.578) [symbolic = %Outer (constants.%Outer.0f8)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc4_28.3 [symbolic = %Outer (constants.%Outer.0f8)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @Outer.as.Destroy.impl.Op.%ptr (%ptr.6ff) = bind_name self, %self.param +// CHECK:STDOUT: %self: @Outer.as.Destroy.impl.Op.%ptr (%ptr.b2c) = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -231,132 +260,156 @@ fn Test() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Outer(%T.loc4_13.2: type) { -// CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.1 (constants.%T)] +// CHECK:STDOUT: generic class @Outer(%T.loc4_13.2: %Copy.type) { +// CHECK:STDOUT: %T.loc4_13.1: %Copy.type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.1 (constants.%T.578)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Inner: type = class_type @Inner, @Inner(%T.loc4_13.1) [symbolic = %Inner (constants.%Inner.51b)] -// CHECK:STDOUT: %Outer.F.type: type = fn_type @Outer.F, @Outer(%T.loc4_13.1) [symbolic = %Outer.F.type (constants.%Outer.F.type.2ee)] -// CHECK:STDOUT: %Outer.F: @Outer.%Outer.F.type (%Outer.F.type.2ee) = struct_value () [symbolic = %Outer.F (constants.%Outer.F.384)] +// CHECK:STDOUT: %Inner: type = class_type @Inner, @Inner(%T.loc4_13.1) [symbolic = %Inner (constants.%Inner.2a5)] +// CHECK:STDOUT: %Outer.F.type: type = fn_type @Outer.F, @Outer(%T.loc4_13.1) [symbolic = %Outer.F.type (constants.%Outer.F.type.bd9)] +// CHECK:STDOUT: %Outer.F: @Outer.%Outer.F.type (%Outer.F.type.bd9) = struct_value () [symbolic = %Outer.F (constants.%Outer.F.22d)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %Inner.decl: type = class_decl @Inner [symbolic = @Outer.%Inner (constants.%Inner.51b)] {} {} -// CHECK:STDOUT: %Outer.F.decl: @Outer.%Outer.F.type (%Outer.F.type.2ee) = fn_decl @Outer.F [symbolic = @Outer.%Outer.F (constants.%Outer.F.384)] { -// CHECK:STDOUT: %n.patt: @Outer.F.%pattern_type.loc9_8 (%pattern_type.7dcd0a.1) = binding_pattern n [concrete] -// CHECK:STDOUT: %n.param_patt: @Outer.F.%pattern_type.loc9_8 (%pattern_type.7dcd0a.1) = value_param_pattern %n.patt, call_param0 [concrete] -// CHECK:STDOUT: %return.patt: @Outer.F.%pattern_type.loc9_14 (%pattern_type.253) = return_slot_pattern [concrete] -// CHECK:STDOUT: %return.param_patt: @Outer.F.%pattern_type.loc9_14 (%pattern_type.253) = out_param_pattern %return.patt, call_param1 [concrete] +// CHECK:STDOUT: %Inner.decl: type = class_decl @Inner [symbolic = @Outer.%Inner (constants.%Inner.2a5)] {} {} +// CHECK:STDOUT: %Outer.F.decl: @Outer.%Outer.F.type (%Outer.F.type.bd9) = fn_decl @Outer.F [symbolic = @Outer.%Outer.F (constants.%Outer.F.22d)] { +// CHECK:STDOUT: %n.patt: @Outer.F.%pattern_type.loc9_8 (%pattern_type.f8cebc.1) = binding_pattern n [concrete] +// CHECK:STDOUT: %n.param_patt: @Outer.F.%pattern_type.loc9_8 (%pattern_type.f8cebc.1) = value_param_pattern %n.patt, call_param0 [concrete] +// CHECK:STDOUT: %return.patt: @Outer.F.%pattern_type.loc9_14 (%pattern_type.c19) = return_slot_pattern [concrete] +// CHECK:STDOUT: %return.param_patt: @Outer.F.%pattern_type.loc9_14 (%pattern_type.c19) = out_param_pattern %return.patt, call_param1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc9_17: type = specific_constant @Outer.%Inner.decl, @Outer(constants.%T) [symbolic = %Inner (constants.%Inner.51b)] -// CHECK:STDOUT: %Inner.ref: type = name_ref Inner, %.loc9_17 [symbolic = %Inner (constants.%Inner.51b)] -// CHECK:STDOUT: %n.param: @Outer.F.%T (%T) = value_param call_param0 -// CHECK:STDOUT: %T.ref: type = name_ref T, @Outer.%T.loc4_13.2 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %n: @Outer.F.%T (%T) = bind_name n, %n.param -// CHECK:STDOUT: %return.param: ref @Outer.F.%Inner (%Inner.51b) = out_param call_param1 -// CHECK:STDOUT: %return: ref @Outer.F.%Inner (%Inner.51b) = return_slot %return.param +// CHECK:STDOUT: %.loc9_17: type = specific_constant @Outer.%Inner.decl, @Outer(constants.%T.578) [symbolic = %Inner (constants.%Inner.2a5)] +// CHECK:STDOUT: %Inner.ref: type = name_ref Inner, %.loc9_17 [symbolic = %Inner (constants.%Inner.2a5)] +// CHECK:STDOUT: %n.param: @Outer.F.%T.as_type.loc9_11.1 (%T.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc9_11.1: type = splice_block %.loc9_11.2 [symbolic = %T.as_type.loc9_11.1 (constants.%T.as_type)] { +// CHECK:STDOUT: %T.ref: %Copy.type = name_ref T, @Outer.%T.loc4_13.2 [symbolic = %T (constants.%T.578)] +// CHECK:STDOUT: %T.as_type.loc9_11.2: type = facet_access_type %T.ref [symbolic = %T.as_type.loc9_11.1 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc9_11.2: type = converted %T.ref, %T.as_type.loc9_11.2 [symbolic = %T.as_type.loc9_11.1 (constants.%T.as_type)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %n: @Outer.F.%T.as_type.loc9_11.1 (%T.as_type) = bind_name n, %n.param +// CHECK:STDOUT: %return.param: ref @Outer.F.%Inner (%Inner.2a5) = out_param call_param1 +// CHECK:STDOUT: %return: ref @Outer.F.%Inner (%Inner.2a5) = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Outer.9d6 [symbolic = @Outer.as.Destroy.impl.%Outer (constants.%Outer.9d6)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Outer.0f8 [symbolic = @Outer.as.Destroy.impl.%Outer (constants.%Outer.0f8)] // CHECK:STDOUT: impl_decl @Outer.as.Destroy.impl [concrete] {} {} // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@Outer.as.Destroy.impl.%Outer.as.Destroy.impl.Op.decl), @Outer.as.Destroy.impl [concrete] -// CHECK:STDOUT: %Destroy.impl_witness: = impl_witness %Destroy.impl_witness_table, @Outer.as.Destroy.impl(constants.%T) [symbolic = @Outer.as.Destroy.impl.%Destroy.impl_witness (constants.%Destroy.impl_witness.7ee)] +// CHECK:STDOUT: %Destroy.impl_witness: = impl_witness %Destroy.impl_witness_table, @Outer.as.Destroy.impl(constants.%T.578) [symbolic = @Outer.as.Destroy.impl.%Destroy.impl_witness (constants.%Destroy.impl_witness.1e4)] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%Outer.9d6 +// CHECK:STDOUT: .Self = constants.%Outer.0f8 // CHECK:STDOUT: .Inner = %Inner.decl // CHECK:STDOUT: .T = // CHECK:STDOUT: .F = %Outer.F.decl // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Inner(@Outer.%T.loc4_13.2: type) { +// CHECK:STDOUT: generic class @Inner(@Outer.%T.loc4_13.2: %Copy.type) { // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic = %require_complete (constants.%require_complete.4ae)] -// CHECK:STDOUT: %Inner: type = class_type @Inner, @Inner(%T) [symbolic = %Inner (constants.%Inner.51b)] -// CHECK:STDOUT: %Inner.elem: type = unbound_element_type %Inner, %T [symbolic = %Inner.elem (constants.%Inner.elem.310)] -// CHECK:STDOUT: %struct_type.n: type = struct_type {.n: @Inner.%T (%T)} [symbolic = %struct_type.n (constants.%struct_type.n.848)] -// CHECK:STDOUT: %complete_type.loc7_3.2: = complete_type_witness %struct_type.n [symbolic = %complete_type.loc7_3.2 (constants.%complete_type.84b)] +// CHECK:STDOUT: %T: %Copy.type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.578)] +// CHECK:STDOUT: %T.as_type.loc6_12.2: type = facet_access_type %T [symbolic = %T.as_type.loc6_12.2 (constants.%T.as_type)] +// CHECK:STDOUT: %require_complete: = require_complete_type %T.as_type.loc6_12.2 [symbolic = %require_complete (constants.%require_complete.ecc)] +// CHECK:STDOUT: %Inner: type = class_type @Inner, @Inner(%T) [symbolic = %Inner (constants.%Inner.2a5)] +// CHECK:STDOUT: %Inner.elem: type = unbound_element_type %Inner, %T.as_type.loc6_12.2 [symbolic = %Inner.elem (constants.%Inner.elem.b8f)] +// CHECK:STDOUT: %struct_type.n: type = struct_type {.n: @Inner.%T.as_type.loc6_12.2 (%T.as_type)} [symbolic = %struct_type.n (constants.%struct_type.n.02b)] +// CHECK:STDOUT: %complete_type.loc7_3.2: = complete_type_witness %struct_type.n [symbolic = %complete_type.loc7_3.2 (constants.%complete_type.786)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %T.ref: type = name_ref T, @Outer.%T.loc4_13.2 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %.loc6: @Inner.%Inner.elem (%Inner.elem.310) = field_decl n, element0 [concrete] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Inner.51b [symbolic = @Inner.as.Destroy.impl.%Inner (constants.%Inner.51b)] +// CHECK:STDOUT: %T.ref: %Copy.type = name_ref T, @Outer.%T.loc4_13.2 [symbolic = %T (constants.%T.578)] +// CHECK:STDOUT: %T.as_type.loc6_12.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc6_12.2 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc6_12: type = converted %T.ref, %T.as_type.loc6_12.1 [symbolic = %T.as_type.loc6_12.2 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc6_10: @Inner.%Inner.elem (%Inner.elem.b8f) = field_decl n, element0 [concrete] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Inner.2a5 [symbolic = @Inner.as.Destroy.impl.%Inner (constants.%Inner.2a5)] // CHECK:STDOUT: impl_decl @Inner.as.Destroy.impl [concrete] {} {} // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@Inner.as.Destroy.impl.%Inner.as.Destroy.impl.Op.decl), @Inner.as.Destroy.impl [concrete] -// CHECK:STDOUT: %Destroy.impl_witness: = impl_witness %Destroy.impl_witness_table, @Inner.as.Destroy.impl(constants.%T) [symbolic = @Inner.as.Destroy.impl.%Destroy.impl_witness (constants.%Destroy.impl_witness.9c7)] -// CHECK:STDOUT: %complete_type.loc7_3.1: = complete_type_witness constants.%struct_type.n.848 [symbolic = %complete_type.loc7_3.2 (constants.%complete_type.84b)] +// CHECK:STDOUT: %Destroy.impl_witness: = impl_witness %Destroy.impl_witness_table, @Inner.as.Destroy.impl(constants.%T.578) [symbolic = @Inner.as.Destroy.impl.%Destroy.impl_witness (constants.%Destroy.impl_witness.0d4)] +// CHECK:STDOUT: %complete_type.loc7_3.1: = complete_type_witness constants.%struct_type.n.02b [symbolic = %complete_type.loc7_3.2 (constants.%complete_type.786)] // CHECK:STDOUT: complete_type_witness = %complete_type.loc7_3.1 // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%Inner.51b +// CHECK:STDOUT: .Self = constants.%Inner.2a5 // CHECK:STDOUT: .T = -// CHECK:STDOUT: .n = %.loc6 +// CHECK:STDOUT: .n = %.loc6_10 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Inner.as.Destroy.impl.Op(@Outer.%T.loc4_13.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %Inner: type = class_type @Inner, @Inner(%T) [symbolic = %Inner (constants.%Inner.51b)] -// CHECK:STDOUT: %ptr: type = ptr_type %Inner [symbolic = %ptr (constants.%ptr.c82)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [symbolic = %pattern_type (constants.%pattern_type.822)] +// CHECK:STDOUT: generic fn @Inner.as.Destroy.impl.Op(@Outer.%T.loc4_13.2: %Copy.type) { +// CHECK:STDOUT: %T: %Copy.type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.578)] +// CHECK:STDOUT: %Inner: type = class_type @Inner, @Inner(%T) [symbolic = %Inner (constants.%Inner.2a5)] +// CHECK:STDOUT: %ptr: type = ptr_type %Inner [symbolic = %ptr (constants.%ptr.98d)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [symbolic = %pattern_type (constants.%pattern_type.132)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @Inner.as.Destroy.impl.Op.%ptr (%ptr.c82)) = "no_op"; +// CHECK:STDOUT: fn(%self.param: @Inner.as.Destroy.impl.Op.%ptr (%ptr.98d)) = "no_op"; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Outer.F(@Outer.%T.loc4_13.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %pattern_type.loc9_8: type = pattern_type %T [symbolic = %pattern_type.loc9_8 (constants.%pattern_type.7dcd0a.1)] -// CHECK:STDOUT: %Inner: type = class_type @Inner, @Inner(%T) [symbolic = %Inner (constants.%Inner.51b)] -// CHECK:STDOUT: %pattern_type.loc9_14: type = pattern_type %Inner [symbolic = %pattern_type.loc9_14 (constants.%pattern_type.253)] +// CHECK:STDOUT: generic fn @Outer.F(@Outer.%T.loc4_13.2: %Copy.type) { +// CHECK:STDOUT: %T: %Copy.type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.578)] +// CHECK:STDOUT: %T.as_type.loc9_11.1: type = facet_access_type %T [symbolic = %T.as_type.loc9_11.1 (constants.%T.as_type)] +// CHECK:STDOUT: %pattern_type.loc9_8: type = pattern_type %T.as_type.loc9_11.1 [symbolic = %pattern_type.loc9_8 (constants.%pattern_type.f8cebc.1)] +// CHECK:STDOUT: %Inner: type = class_type @Inner, @Inner(%T) [symbolic = %Inner (constants.%Inner.2a5)] +// CHECK:STDOUT: %pattern_type.loc9_14: type = pattern_type %Inner [symbolic = %pattern_type.loc9_14 (constants.%pattern_type.c19)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc9_14: = require_complete_type %Inner [symbolic = %require_complete.loc9_14 (constants.%require_complete.561)] -// CHECK:STDOUT: %require_complete.loc9_9: = require_complete_type %T [symbolic = %require_complete.loc9_9 (constants.%require_complete.4ae)] -// CHECK:STDOUT: %struct_type.n: type = struct_type {.n: @Outer.F.%T (%T)} [symbolic = %struct_type.n (constants.%struct_type.n.848)] +// CHECK:STDOUT: %require_complete.loc9_14: = require_complete_type %Inner [symbolic = %require_complete.loc9_14 (constants.%require_complete.ce2)] +// CHECK:STDOUT: %require_complete.loc9_9: = require_complete_type %T.as_type.loc9_11.1 [symbolic = %require_complete.loc9_9 (constants.%require_complete.ecc)] +// CHECK:STDOUT: %struct_type.n: type = struct_type {.n: @Outer.F.%T.as_type.loc9_11.1 (%T.as_type)} [symbolic = %struct_type.n (constants.%struct_type.n.02b)] +// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %T, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.3ba)] +// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %T.as_type.loc9_11.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet.72e)] +// CHECK:STDOUT: %.loc9_38.2: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc9_38.2 (constants.%.671)] +// CHECK:STDOUT: %impl.elem0.loc9_38.2: @Outer.F.%.loc9_38.2 (%.671) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_38.2 (constants.%impl.elem0.56e)] +// CHECK:STDOUT: %specific_impl_fn.loc9_38.2: = specific_impl_function %impl.elem0.loc9_38.2, @Copy.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc9_38.2 (constants.%specific_impl_fn.fb7)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%n.param: @Outer.F.%T (%T)) -> %return.param: @Outer.F.%Inner (%Inner.51b) { +// CHECK:STDOUT: fn(%n.param: @Outer.F.%T.as_type.loc9_11.1 (%T.as_type)) -> %return.param: @Outer.F.%Inner (%Inner.2a5) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: @Outer.F.%T (%T) = name_ref n, %n -// CHECK:STDOUT: %.loc9_39.1: @Outer.F.%struct_type.n (%struct_type.n.848) = struct_literal (%n.ref) -// CHECK:STDOUT: %.loc9_39.2: ref @Outer.F.%T (%T) = class_element_access %return, element0 -// CHECK:STDOUT: %.loc9_39.3: init @Outer.F.%T (%T) = initialize_from %n.ref to %.loc9_39.2 -// CHECK:STDOUT: %.loc9_39.4: init @Outer.F.%Inner (%Inner.51b) = class_init (%.loc9_39.3), %return -// CHECK:STDOUT: %.loc9_40: init @Outer.F.%Inner (%Inner.51b) = converted %.loc9_39.1, %.loc9_39.4 +// CHECK:STDOUT: %n.ref: @Outer.F.%T.as_type.loc9_11.1 (%T.as_type) = name_ref n, %n +// CHECK:STDOUT: %.loc9_39.1: @Outer.F.%struct_type.n (%struct_type.n.02b) = struct_literal (%n.ref) +// CHECK:STDOUT: %impl.elem0.loc9_38.1: @Outer.F.%.loc9_38.2 (%.671) = impl_witness_access constants.%Copy.lookup_impl_witness.3ba, element0 [symbolic = %impl.elem0.loc9_38.2 (constants.%impl.elem0.56e)] +// CHECK:STDOUT: %bound_method.loc9_38.1: = bound_method %n.ref, %impl.elem0.loc9_38.1 +// CHECK:STDOUT: %specific_impl_fn.loc9_38.1: = specific_impl_function %impl.elem0.loc9_38.1, @Copy.Op(constants.%Copy.facet.72e) [symbolic = %specific_impl_fn.loc9_38.2 (constants.%specific_impl_fn.fb7)] +// CHECK:STDOUT: %bound_method.loc9_38.2: = bound_method %n.ref, %specific_impl_fn.loc9_38.1 +// CHECK:STDOUT: %.loc9_38.1: init @Outer.F.%T.as_type.loc9_11.1 (%T.as_type) = call %bound_method.loc9_38.2(%n.ref) +// CHECK:STDOUT: %.loc9_39.2: ref @Outer.F.%T.as_type.loc9_11.1 (%T.as_type) = class_element_access %return, element0 +// CHECK:STDOUT: %.loc9_39.3: init @Outer.F.%T.as_type.loc9_11.1 (%T.as_type) = initialize_from %.loc9_38.1 to %.loc9_39.2 +// CHECK:STDOUT: %.loc9_39.4: init @Outer.F.%Inner (%Inner.2a5) = class_init (%.loc9_39.3), %return +// CHECK:STDOUT: %.loc9_40: init @Outer.F.%Inner (%Inner.2a5) = converted %.loc9_39.1, %.loc9_39.4 // CHECK:STDOUT: return %.loc9_40 to %return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Outer.as.Destroy.impl.Op(@Outer.%T.loc4_13.2: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %Outer: type = class_type @Outer, @Outer(%T) [symbolic = %Outer (constants.%Outer.9d6)] -// CHECK:STDOUT: %ptr: type = ptr_type %Outer [symbolic = %ptr (constants.%ptr.6ff)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [symbolic = %pattern_type (constants.%pattern_type.07e)] +// CHECK:STDOUT: generic fn @Outer.as.Destroy.impl.Op(@Outer.%T.loc4_13.2: %Copy.type) { +// CHECK:STDOUT: %T: %Copy.type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.578)] +// CHECK:STDOUT: %Outer: type = class_type @Outer, @Outer(%T) [symbolic = %Outer (constants.%Outer.0f8)] +// CHECK:STDOUT: %ptr: type = ptr_type %Outer [symbolic = %ptr (constants.%ptr.b2c)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [symbolic = %pattern_type (constants.%pattern_type.3bd)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @Outer.as.Destroy.impl.Op.%ptr (%ptr.6ff)) = "no_op"; +// CHECK:STDOUT: fn(%self.param: @Outer.as.Destroy.impl.Op.%ptr (%ptr.b2c)) = "no_op"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Test() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %c.patt: %pattern_type.c22 = binding_pattern c [concrete] -// CHECK:STDOUT: %c.var_patt: %pattern_type.c22 = var_pattern %c.patt [concrete] +// CHECK:STDOUT: %c.patt: %pattern_type.814 = binding_pattern c [concrete] +// CHECK:STDOUT: %c.var_patt: %pattern_type.814 = var_pattern %c.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %c.var: ref %Inner.721 = var %c.var_patt +// CHECK:STDOUT: %c.var: ref %Inner.3fc = var %c.var_patt // CHECK:STDOUT: %Outer.ref.loc13_29: %Outer.type = name_ref Outer, file.%Outer.decl [concrete = constants.%Outer.generic] // CHECK:STDOUT: %int_32.loc13_35: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc13_35: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %Outer.loc13_38: type = class_type @Outer, @Outer(constants.%i32) [concrete = constants.%Outer.545] -// CHECK:STDOUT: %.loc13_39: %Outer.F.type.9d7 = specific_constant @Outer.%Outer.F.decl, @Outer(constants.%i32) [concrete = constants.%Outer.F.c88] -// CHECK:STDOUT: %F.ref: %Outer.F.type.9d7 = name_ref F, %.loc13_39 [concrete = constants.%Outer.F.c88] +// CHECK:STDOUT: %Copy.facet.loc13_38: %Copy.type = facet_value constants.%i32, (constants.%Copy.impl_witness.f0b) [concrete = constants.%Copy.facet.26d] +// CHECK:STDOUT: %.loc13_38: %Copy.type = converted %i32.loc13_35, %Copy.facet.loc13_38 [concrete = constants.%Copy.facet.26d] +// CHECK:STDOUT: %Outer.loc13_38: type = class_type @Outer, @Outer(constants.%Copy.facet.26d) [concrete = constants.%Outer.5dd] +// CHECK:STDOUT: %.loc13_39: %Outer.F.type.ae5 = specific_constant @Outer.%Outer.F.decl, @Outer(constants.%Copy.facet.26d) [concrete = constants.%Outer.F.fb2] +// CHECK:STDOUT: %F.ref: %Outer.F.type.ae5 = name_ref F, %.loc13_39 [concrete = constants.%Outer.F.fb2] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %Outer.F.specific_fn: = specific_function %F.ref, @Outer.F(constants.%i32) [concrete = constants.%Outer.F.specific_fn] -// CHECK:STDOUT: %.loc13_3: ref %Inner.721 = splice_block %c.var {} +// CHECK:STDOUT: %Copy.facet.loc13_43.1: %Copy.type = facet_value Core.IntLiteral, (constants.%Copy.impl_witness.d46) [concrete = constants.%Copy.facet.66a] +// CHECK:STDOUT: %.loc13_43.1: %Copy.type = converted Core.IntLiteral, %Copy.facet.loc13_43.1 [concrete = constants.%Copy.facet.66a] +// CHECK:STDOUT: %Copy.facet.loc13_43.2: %Copy.type = facet_value Core.IntLiteral, (constants.%Copy.impl_witness.d46) [concrete = constants.%Copy.facet.66a] +// CHECK:STDOUT: %.loc13_43.2: %Copy.type = converted Core.IntLiteral, %Copy.facet.loc13_43.2 [concrete = constants.%Copy.facet.66a] +// CHECK:STDOUT: %Outer.F.specific_fn: = specific_function %F.ref, @Outer.F(constants.%Copy.facet.26d) [concrete = constants.%Outer.F.specific_fn] +// CHECK:STDOUT: %.loc13_3: ref %Inner.3fc = splice_block %c.var {} // CHECK:STDOUT: %impl.elem0: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] // CHECK:STDOUT: %bound_method.loc13_42.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -364,127 +417,138 @@ fn Test() -> i32 { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc13_42.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_42.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_42.2: %i32 = converted %int_1, %.loc13_42.1 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %Outer.F.call: init %Inner.721 = call %Outer.F.specific_fn(%.loc13_42.2) to %.loc13_3 +// CHECK:STDOUT: %Outer.F.call: init %Inner.3fc = call %Outer.F.specific_fn(%.loc13_42.2) to %.loc13_3 // CHECK:STDOUT: assign %c.var, %Outer.F.call -// CHECK:STDOUT: %.loc13_20.1: type = splice_block %Inner.ref [concrete = constants.%Inner.721] { +// CHECK:STDOUT: %.loc13_20.1: type = splice_block %Inner.ref [concrete = constants.%Inner.3fc] { // CHECK:STDOUT: %Outer.ref.loc13_10: %Outer.type = name_ref Outer, file.%Outer.decl [concrete = constants.%Outer.generic] // CHECK:STDOUT: %int_32.loc13_16: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc13_16: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %Outer.loc13_19: type = class_type @Outer, @Outer(constants.%i32) [concrete = constants.%Outer.545] -// CHECK:STDOUT: %.loc13_20.2: type = specific_constant @Outer.%Inner.decl, @Outer(constants.%i32) [concrete = constants.%Inner.721] -// CHECK:STDOUT: %Inner.ref: type = name_ref Inner, %.loc13_20.2 [concrete = constants.%Inner.721] +// CHECK:STDOUT: %Copy.facet.loc13_19: %Copy.type = facet_value constants.%i32, (constants.%Copy.impl_witness.f0b) [concrete = constants.%Copy.facet.26d] +// CHECK:STDOUT: %.loc13_19: %Copy.type = converted %i32.loc13_16, %Copy.facet.loc13_19 [concrete = constants.%Copy.facet.26d] +// CHECK:STDOUT: %Outer.loc13_19: type = class_type @Outer, @Outer(constants.%Copy.facet.26d) [concrete = constants.%Outer.5dd] +// CHECK:STDOUT: %.loc13_20.2: type = specific_constant @Outer.%Inner.decl, @Outer(constants.%Copy.facet.26d) [concrete = constants.%Inner.3fc] +// CHECK:STDOUT: %Inner.ref: type = name_ref Inner, %.loc13_20.2 [concrete = constants.%Inner.3fc] // CHECK:STDOUT: } -// CHECK:STDOUT: %c: ref %Inner.721 = bind_name c, %c.var -// CHECK:STDOUT: %c.ref: ref %Inner.721 = name_ref c, %c -// CHECK:STDOUT: %n.ref: %Inner.elem.6c2 = name_ref n, @Inner.%.loc6 [concrete = @Inner.%.loc6] +// CHECK:STDOUT: %c: ref %Inner.3fc = bind_name c, %c.var +// CHECK:STDOUT: %c.ref: ref %Inner.3fc = name_ref c, %c +// CHECK:STDOUT: %n.ref: %Inner.elem.45c = name_ref n, @Inner.%.loc6_10 [concrete = @Inner.%.loc6_10] // CHECK:STDOUT: %.loc14_11.1: ref %i32 = class_element_access %c.ref, element0 // CHECK:STDOUT: %.loc14_11.2: %i32 = bind_value %.loc14_11.1 -// CHECK:STDOUT: %Inner.as.Destroy.impl.Op.bound: = bound_method %c.var, constants.%Inner.as.Destroy.impl.Op.602 -// CHECK:STDOUT: %Inner.as.Destroy.impl.Op.specific_fn: = specific_function constants.%Inner.as.Destroy.impl.Op.602, @Inner.as.Destroy.impl.Op(constants.%i32) [concrete = constants.%Inner.as.Destroy.impl.Op.specific_fn] +// CHECK:STDOUT: %Inner.as.Destroy.impl.Op.bound: = bound_method %c.var, constants.%Inner.as.Destroy.impl.Op.698 +// CHECK:STDOUT: %Inner.as.Destroy.impl.Op.specific_fn: = specific_function constants.%Inner.as.Destroy.impl.Op.698, @Inner.as.Destroy.impl.Op(constants.%Copy.facet.26d) [concrete = constants.%Inner.as.Destroy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc13_3: = bound_method %c.var, %Inner.as.Destroy.impl.Op.specific_fn -// CHECK:STDOUT: %addr: %ptr.416 = addr_of %c.var +// CHECK:STDOUT: %addr: %ptr.efa = addr_of %c.var // CHECK:STDOUT: %Inner.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc13_3(%addr) // CHECK:STDOUT: return %.loc14_11.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Outer(constants.%T) { -// CHECK:STDOUT: %T.loc4_13.1 => constants.%T +// CHECK:STDOUT: specific @Outer(constants.%T.578) { +// CHECK:STDOUT: %T.loc4_13.1 => constants.%T.578 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Inner => constants.%Inner.51b -// CHECK:STDOUT: %Outer.F.type => constants.%Outer.F.type.2ee -// CHECK:STDOUT: %Outer.F => constants.%Outer.F.384 +// CHECK:STDOUT: %Inner => constants.%Inner.2a5 +// CHECK:STDOUT: %Outer.F.type => constants.%Outer.F.type.bd9 +// CHECK:STDOUT: %Outer.F => constants.%Outer.F.22d // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Inner(constants.%T) { +// CHECK:STDOUT: specific @Inner(constants.%T.578) { // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %require_complete => constants.%require_complete.4ae -// CHECK:STDOUT: %Inner => constants.%Inner.51b -// CHECK:STDOUT: %Inner.elem => constants.%Inner.elem.310 -// CHECK:STDOUT: %struct_type.n => constants.%struct_type.n.848 -// CHECK:STDOUT: %complete_type.loc7_3.2 => constants.%complete_type.84b +// CHECK:STDOUT: %T => constants.%T.578 +// CHECK:STDOUT: %T.as_type.loc6_12.2 => constants.%T.as_type +// CHECK:STDOUT: %require_complete => constants.%require_complete.ecc +// CHECK:STDOUT: %Inner => constants.%Inner.2a5 +// CHECK:STDOUT: %Inner.elem => constants.%Inner.elem.b8f +// CHECK:STDOUT: %struct_type.n => constants.%struct_type.n.02b +// CHECK:STDOUT: %complete_type.loc7_3.2 => constants.%complete_type.786 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Inner.as.Destroy.impl(constants.%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %Inner => constants.%Inner.51b -// CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.9c7 +// CHECK:STDOUT: specific @Inner.as.Destroy.impl(constants.%T.578) { +// CHECK:STDOUT: %T => constants.%T.578 +// CHECK:STDOUT: %Inner => constants.%Inner.2a5 +// CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.0d4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Inner.as.Destroy.impl.Op(constants.%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %Inner => constants.%Inner.51b -// CHECK:STDOUT: %ptr => constants.%ptr.c82 -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.822 +// CHECK:STDOUT: specific @Inner.as.Destroy.impl.Op(constants.%T.578) { +// CHECK:STDOUT: %T => constants.%T.578 +// CHECK:STDOUT: %Inner => constants.%Inner.2a5 +// CHECK:STDOUT: %ptr => constants.%ptr.98d +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.132 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Outer.F(constants.%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %pattern_type.loc9_8 => constants.%pattern_type.7dcd0a.1 -// CHECK:STDOUT: %Inner => constants.%Inner.51b -// CHECK:STDOUT: %pattern_type.loc9_14 => constants.%pattern_type.253 +// CHECK:STDOUT: specific @Outer.F(constants.%T.578) { +// CHECK:STDOUT: %T => constants.%T.578 +// CHECK:STDOUT: %T.as_type.loc9_11.1 => constants.%T.as_type +// CHECK:STDOUT: %pattern_type.loc9_8 => constants.%pattern_type.f8cebc.1 +// CHECK:STDOUT: %Inner => constants.%Inner.2a5 +// CHECK:STDOUT: %pattern_type.loc9_14 => constants.%pattern_type.c19 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Outer.as.Destroy.impl(constants.%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %Outer => constants.%Outer.9d6 -// CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.7ee +// CHECK:STDOUT: specific @Outer.as.Destroy.impl(constants.%T.578) { +// CHECK:STDOUT: %T => constants.%T.578 +// CHECK:STDOUT: %Outer => constants.%Outer.0f8 +// CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.1e4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Outer.as.Destroy.impl.Op(constants.%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %Outer => constants.%Outer.9d6 -// CHECK:STDOUT: %ptr => constants.%ptr.6ff -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.07e +// CHECK:STDOUT: specific @Outer.as.Destroy.impl.Op(constants.%T.578) { +// CHECK:STDOUT: %T => constants.%T.578 +// CHECK:STDOUT: %Outer => constants.%Outer.0f8 +// CHECK:STDOUT: %ptr => constants.%ptr.b2c +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.3bd // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Outer(constants.%i32) { -// CHECK:STDOUT: %T.loc4_13.1 => constants.%i32 +// CHECK:STDOUT: specific @Outer(constants.%Copy.facet.26d) { +// CHECK:STDOUT: %T.loc4_13.1 => constants.%Copy.facet.26d // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Inner => constants.%Inner.721 -// CHECK:STDOUT: %Outer.F.type => constants.%Outer.F.type.9d7 -// CHECK:STDOUT: %Outer.F => constants.%Outer.F.c88 +// CHECK:STDOUT: %Inner => constants.%Inner.3fc +// CHECK:STDOUT: %Outer.F.type => constants.%Outer.F.type.ae5 +// CHECK:STDOUT: %Outer.F => constants.%Outer.F.fb2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Inner(constants.%i32) { +// CHECK:STDOUT: specific @Inner(constants.%Copy.facet.26d) { // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %T => constants.%i32 +// CHECK:STDOUT: %T => constants.%Copy.facet.26d +// CHECK:STDOUT: %T.as_type.loc6_12.2 => constants.%i32 // CHECK:STDOUT: %require_complete => constants.%complete_type.f8a -// CHECK:STDOUT: %Inner => constants.%Inner.721 -// CHECK:STDOUT: %Inner.elem => constants.%Inner.elem.6c2 +// CHECK:STDOUT: %Inner => constants.%Inner.3fc +// CHECK:STDOUT: %Inner.elem => constants.%Inner.elem.45c // CHECK:STDOUT: %struct_type.n => constants.%struct_type.n.033 // CHECK:STDOUT: %complete_type.loc7_3.2 => constants.%complete_type.54b // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Outer.F(constants.%i32) { -// CHECK:STDOUT: %T => constants.%i32 +// CHECK:STDOUT: specific @Outer.F(constants.%Copy.facet.26d) { +// CHECK:STDOUT: %T => constants.%Copy.facet.26d +// CHECK:STDOUT: %T.as_type.loc9_11.1 => constants.%i32 // CHECK:STDOUT: %pattern_type.loc9_8 => constants.%pattern_type.7ce -// CHECK:STDOUT: %Inner => constants.%Inner.721 -// CHECK:STDOUT: %pattern_type.loc9_14 => constants.%pattern_type.c22 +// CHECK:STDOUT: %Inner => constants.%Inner.3fc +// CHECK:STDOUT: %pattern_type.loc9_14 => constants.%pattern_type.814 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc9_14 => constants.%complete_type.54b // CHECK:STDOUT: %require_complete.loc9_9 => constants.%complete_type.f8a // CHECK:STDOUT: %struct_type.n => constants.%struct_type.n.033 +// CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.impl_witness.f0b +// CHECK:STDOUT: %Copy.facet => constants.%Copy.facet.26d +// CHECK:STDOUT: %.loc9_38.2 => constants.%.3c4 +// CHECK:STDOUT: %impl.elem0.loc9_38.2 => constants.%Int.as.Copy.impl.Op.87e +// CHECK:STDOUT: %specific_impl_fn.loc9_38.2 => constants.%Int.as.Copy.impl.Op.specific_fn // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Inner.as.Destroy.impl(constants.%i32) { -// CHECK:STDOUT: %T => constants.%i32 -// CHECK:STDOUT: %Inner => constants.%Inner.721 -// CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.cc9 +// CHECK:STDOUT: specific @Inner.as.Destroy.impl(constants.%Copy.facet.26d) { +// CHECK:STDOUT: %T => constants.%Copy.facet.26d +// CHECK:STDOUT: %Inner => constants.%Inner.3fc +// CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.490 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Inner.as.Destroy.impl.Op.type => constants.%Inner.as.Destroy.impl.Op.type.8d2 -// CHECK:STDOUT: %Inner.as.Destroy.impl.Op => constants.%Inner.as.Destroy.impl.Op.602 +// CHECK:STDOUT: %Inner.as.Destroy.impl.Op.type => constants.%Inner.as.Destroy.impl.Op.type.90b +// CHECK:STDOUT: %Inner.as.Destroy.impl.Op => constants.%Inner.as.Destroy.impl.Op.698 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Inner.as.Destroy.impl.Op(constants.%i32) { -// CHECK:STDOUT: %T => constants.%i32 -// CHECK:STDOUT: %Inner => constants.%Inner.721 -// CHECK:STDOUT: %ptr => constants.%ptr.416 -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.00b +// CHECK:STDOUT: specific @Inner.as.Destroy.impl.Op(constants.%Copy.facet.26d) { +// CHECK:STDOUT: %T => constants.%Copy.facet.26d +// CHECK:STDOUT: %Inner => constants.%Inner.3fc +// CHECK:STDOUT: %ptr => constants.%ptr.efa +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.239 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- interface.carbon diff --git a/toolchain/check/testdata/class/generic/stringify.carbon b/toolchain/check/testdata/class/generic/stringify.carbon index 0b4eb7784b78..75f5a7256e9d 100644 --- a/toolchain/check/testdata/class/generic/stringify.carbon +++ b/toolchain/check/testdata/class/generic/stringify.carbon @@ -576,7 +576,7 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -783,7 +783,7 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/import.carbon b/toolchain/check/testdata/class/import.carbon index 7da3d4217fb6..87f7329c578b 100644 --- a/toolchain/check/testdata/class/import.carbon +++ b/toolchain/check/testdata/class/import.carbon @@ -292,6 +292,17 @@ fn Run() { // CHECK:STDOUT: %ForwardDeclared.G: %ForwardDeclared.G.type = struct_value () [concrete] // CHECK:STDOUT: %ptr.6cf: type = ptr_type %ForwardDeclared.7b34f2.1 [concrete] // CHECK:STDOUT: %pattern_type.ebb: type = pattern_type %ptr.6cf [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.f23: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.8b3) [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.abf: %ptr.as.Copy.impl.Op.type.f23 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.815: = impl_witness imports.%Copy.impl_witness_table.a71, @ptr.as.Copy.impl(%ForwardDeclared.7b34f2.1) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.8c4: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%ForwardDeclared.7b34f2.1) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.cd7: %ptr.as.Copy.impl.Op.type.8c4 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.2e0: %Copy.type = facet_value %ptr.6cf, (%Copy.impl_witness.815) [concrete] +// CHECK:STDOUT: %.1d4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.2e0 [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.cd7, @ptr.as.Copy.impl.Op(%ForwardDeclared.7b34f2.1) [concrete] // CHECK:STDOUT: %Incomplete: type = class_type @Incomplete [concrete] // CHECK:STDOUT: %ptr.c62: type = ptr_type %Incomplete [concrete] // CHECK:STDOUT: %pattern_type.275: type = pattern_type %ptr.c62 [concrete] @@ -324,6 +335,7 @@ fn Run() { // CHECK:STDOUT: %Main.Incomplete: type = import_ref Main//a, Incomplete, loaded [concrete = constants.%Incomplete] // CHECK:STDOUT: %Core.ece: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -334,7 +346,7 @@ fn Run() { // CHECK:STDOUT: %Main.import_ref.845 = import_ref Main//a, inst63 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.4d2: %Field.elem = import_ref Main//a, loc8_8, loaded [concrete = %.d33] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.7bb: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.8a0) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.1d6)] +// CHECK:STDOUT: %Core.import_ref.7bb: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.8a0) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.1d6)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.ba4 = impl_witness_table (%Core.import_ref.7bb), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %.d33: %Field.elem = field_decl x, element0 [concrete] // CHECK:STDOUT: %Main.import_ref.8f24d3.2: = import_ref Main//a, loc16_1, loaded [concrete = constants.%complete_type.357] @@ -345,6 +357,9 @@ fn Run() { // CHECK:STDOUT: %Main.import_ref.39e731.2 = import_ref Main//a, inst113 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.42a = import_ref Main//a, loc14_21, unloaded // CHECK:STDOUT: %Main.import_ref.67a = import_ref Main//a, loc15_27, unloaded +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.de9: @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op.type (%ptr.as.Copy.impl.Op.type.f23) = import_ref Core//prelude/parts/copy, loc32_31, loaded [symbolic = @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op (constants.%ptr.as.Copy.impl.Op.abf)] +// CHECK:STDOUT: %Copy.impl_witness_table.a71 = impl_witness_table (%Core.import_ref.de9), @ptr.as.Copy.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Main.import_ref.0dc: = import_ref Main//a, loc4_13, loaded [concrete = constants.%Destroy.impl_witness.3b2] // CHECK:STDOUT: %Main.import_ref.75f: type = import_ref Main//a, loc4_13, loaded [concrete = constants.%Empty] @@ -499,7 +514,12 @@ fn Run() { // CHECK:STDOUT: %d.var: ref %ptr.6cf = var %d.var_patt // CHECK:STDOUT: %c.ref.loc16: ref %ForwardDeclared.7b34f2.1 = name_ref c, %c // CHECK:STDOUT: %addr.loc16_29: %ptr.6cf = addr_of %c.ref.loc16 -// CHECK:STDOUT: assign %d.var, %addr.loc16_29 +// CHECK:STDOUT: %impl.elem0.loc16: %.1d4 = impl_witness_access constants.%Copy.impl_witness.815, element0 [concrete = constants.%ptr.as.Copy.impl.Op.cd7] +// CHECK:STDOUT: %bound_method.loc16_29.1: = bound_method %addr.loc16_29, %impl.elem0.loc16 +// CHECK:STDOUT: %specific_fn.loc16: = specific_function %impl.elem0.loc16, @ptr.as.Copy.impl.Op(constants.%ForwardDeclared.7b34f2.1) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc16_29.2: = bound_method %addr.loc16_29, %specific_fn.loc16 +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.6cf = call %bound_method.loc16_29.2(%addr.loc16_29) +// CHECK:STDOUT: assign %d.var, %ptr.as.Copy.impl.Op.call // CHECK:STDOUT: %.loc16: type = splice_block %ptr.loc16 [concrete = constants.%ptr.6cf] { // CHECK:STDOUT: %ForwardDeclared.ref.loc16: type = name_ref ForwardDeclared, imports.%Main.ForwardDeclared [concrete = constants.%ForwardDeclared.7b34f2.1] // CHECK:STDOUT: %ptr.loc16: type = ptr_type %ForwardDeclared.ref.loc16 [concrete = constants.%ptr.6cf] @@ -522,9 +542,9 @@ fn Run() { // CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc18: init %empty_tuple.type = call %bound_method.loc18(%addr.loc18) // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc16: = bound_method %d.var, constants.%T.as.Destroy.impl.Op.bdd // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn.2: = specific_function constants.%T.as.Destroy.impl.Op.bdd, @T.as.Destroy.impl.Op(constants.%ptr.6cf) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn.6d3] -// CHECK:STDOUT: %bound_method.loc16: = bound_method %d.var, %T.as.Destroy.impl.Op.specific_fn.2 +// CHECK:STDOUT: %bound_method.loc16_3: = bound_method %d.var, %T.as.Destroy.impl.Op.specific_fn.2 // CHECK:STDOUT: %addr.loc16_3: %ptr.df0 = addr_of %d.var -// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc16: init %empty_tuple.type = call %bound_method.loc16(%addr.loc16_3) +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc16: init %empty_tuple.type = call %bound_method.loc16_3(%addr.loc16_3) // CHECK:STDOUT: %ForwardDeclared.as.Destroy.impl.Op.bound: = bound_method %c.var, constants.%ForwardDeclared.as.Destroy.impl.Op // CHECK:STDOUT: %addr.loc12: %ptr.6cf = addr_of %c.var // CHECK:STDOUT: %ForwardDeclared.as.Destroy.impl.Op.call: init %empty_tuple.type = call %ForwardDeclared.as.Destroy.impl.Op.bound(%addr.loc12) diff --git a/toolchain/check/testdata/class/import_base.carbon b/toolchain/check/testdata/class/import_base.carbon index 5ae1333683b5..9713be5acb32 100644 --- a/toolchain/check/testdata/class/import_base.carbon +++ b/toolchain/check/testdata/class/import_base.carbon @@ -265,7 +265,7 @@ fn Run() { // CHECK:STDOUT: %Main.import_ref.7e5 = import_ref Main//a, loc13_20, unloaded // CHECK:STDOUT: %Main.import_ref.a21640.2: type = import_ref Main//a, loc13_16, loaded [concrete = constants.%Base] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.7bb: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.8a0) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.1d6)] +// CHECK:STDOUT: %Core.import_ref.7bb: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.8a0) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.1d6)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.ba4 = impl_witness_table (%Core.import_ref.7bb), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %.720: %Base.elem = field_decl x, element0 [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] diff --git a/toolchain/check/testdata/class/import_indirect.carbon b/toolchain/check/testdata/class/import_indirect.carbon index a4dd6a037061..2bca41373162 100644 --- a/toolchain/check/testdata/class/import_indirect.carbon +++ b/toolchain/check/testdata/class/import_indirect.carbon @@ -172,22 +172,39 @@ var ptr: E* = &val; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete] // CHECK:STDOUT: %C.val: %C = struct_value () [concrete] // CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete] // CHECK:STDOUT: %pattern_type.44a: type = pattern_type %ptr.019 [concrete] // CHECK:STDOUT: %addr: %ptr.019 = addr_of file.%b_val.var [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.f23: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.8b3) [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.abf: %ptr.as.Copy.impl.Op.type.f23 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.a94: = impl_witness imports.%Copy.impl_witness_table.a71, @ptr.as.Copy.impl(%C) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.0f5: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%C) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.fd1: %ptr.as.Copy.impl.Op.type.0f5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.9a6: %Copy.type = facet_value %ptr.019, (%Copy.impl_witness.a94) [concrete] +// CHECK:STDOUT: %.a98: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.9a6 [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.bound: = bound_method %addr, %ptr.as.Copy.impl.Op.fd1 [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.fd1, @ptr.as.Copy.impl.Op(%C) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %addr, %ptr.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Main.C: type = import_ref Main//a, C, loaded [concrete = constants.%C] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.import_ref.8f2: = import_ref Main//a, loc4_10, loaded [concrete = constants.%complete_type] +// CHECK:STDOUT: %Main.import_ref.8f2: = import_ref Main//a, loc4_10, loaded [concrete = constants.%complete_type.357] // CHECK:STDOUT: %Main.import_ref.2c4 = import_ref Main//a, inst18 [no loc], unloaded +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.de9: @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op.type (%ptr.as.Copy.impl.Op.type.f23) = import_ref Core//prelude/parts/copy, loc32_31, loaded [symbolic = @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op (constants.%ptr.as.Copy.impl.Op.abf)] +// CHECK:STDOUT: %Copy.impl_witness_table.a71 = impl_witness_table (%Core.import_ref.de9), @ptr.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -236,7 +253,12 @@ var ptr: E* = &val; // CHECK:STDOUT: assign file.%b_val.var, %.loc8_1 // CHECK:STDOUT: %b_val.ref: ref %C = name_ref b_val, file.%b_val [concrete = file.%b_val.var] // CHECK:STDOUT: %addr: %ptr.019 = addr_of %b_val.ref [concrete = constants.%addr] -// CHECK:STDOUT: assign file.%b_ptr.var, %addr +// CHECK:STDOUT: %impl.elem0: %.a98 = impl_witness_access constants.%Copy.impl_witness.a94, element0 [concrete = constants.%ptr.as.Copy.impl.Op.fd1] +// CHECK:STDOUT: %bound_method.loc9_17.1: = bound_method %addr, %impl.elem0 [concrete = constants.%ptr.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @ptr.as.Copy.impl.Op(constants.%C) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_17.2: = bound_method %addr, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.019 = call %bound_method.loc9_17.2(%addr) [concrete = constants.%addr] +// CHECK:STDOUT: assign file.%b_ptr.var, %ptr.as.Copy.impl.Op.call // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -245,22 +267,39 @@ var ptr: E* = &val; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete] // CHECK:STDOUT: %C.val: %C = struct_value () [concrete] // CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete] // CHECK:STDOUT: %pattern_type.44a: type = pattern_type %ptr.019 [concrete] // CHECK:STDOUT: %addr: %ptr.019 = addr_of file.%c_val.var [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.f23: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.8b3) [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.abf: %ptr.as.Copy.impl.Op.type.f23 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.a94: = impl_witness imports.%Copy.impl_witness_table.a71, @ptr.as.Copy.impl(%C) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.0f5: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%C) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.fd1: %ptr.as.Copy.impl.Op.type.0f5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.9a6: %Copy.type = facet_value %ptr.019, (%Copy.impl_witness.a94) [concrete] +// CHECK:STDOUT: %.a98: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.9a6 [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.bound: = bound_method %addr, %ptr.as.Copy.impl.Op.fd1 [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.fd1, @ptr.as.Copy.impl.Op(%C) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %addr, %ptr.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Main.C: type = import_ref Main//a, C, loaded [concrete = constants.%C] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.import_ref.8f2: = import_ref Main//a, loc4_10, loaded [concrete = constants.%complete_type] +// CHECK:STDOUT: %Main.import_ref.8f2: = import_ref Main//a, loc4_10, loaded [concrete = constants.%complete_type.357] // CHECK:STDOUT: %Main.import_ref.2c4 = import_ref Main//a, inst18 [no loc], unloaded +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.de9: @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op.type (%ptr.as.Copy.impl.Op.type.f23) = import_ref Core//prelude/parts/copy, loc32_31, loaded [symbolic = @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op (constants.%ptr.as.Copy.impl.Op.abf)] +// CHECK:STDOUT: %Copy.impl_witness_table.a71 = impl_witness_table (%Core.import_ref.de9), @ptr.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -309,7 +348,12 @@ var ptr: E* = &val; // CHECK:STDOUT: assign file.%c_val.var, %.loc8_1 // CHECK:STDOUT: %c_val.ref: ref %C = name_ref c_val, file.%c_val [concrete = file.%c_val.var] // CHECK:STDOUT: %addr: %ptr.019 = addr_of %c_val.ref [concrete = constants.%addr] -// CHECK:STDOUT: assign file.%c_ptr.var, %addr +// CHECK:STDOUT: %impl.elem0: %.a98 = impl_witness_access constants.%Copy.impl_witness.a94, element0 [concrete = constants.%ptr.as.Copy.impl.Op.fd1] +// CHECK:STDOUT: %bound_method.loc9_17.1: = bound_method %addr, %impl.elem0 [concrete = constants.%ptr.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @ptr.as.Copy.impl.Op(constants.%C) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_17.2: = bound_method %addr, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.019 = call %bound_method.loc9_17.2(%addr) [concrete = constants.%addr] +// CHECK:STDOUT: assign file.%c_ptr.var, %ptr.as.Copy.impl.Op.call // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -318,12 +362,25 @@ var ptr: E* = &val; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete] // CHECK:STDOUT: %C.val: %C = struct_value () [concrete] // CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete] // CHECK:STDOUT: %pattern_type.44a: type = pattern_type %ptr.019 [concrete] // CHECK:STDOUT: %addr: %ptr.019 = addr_of file.%val.var [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.f23: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.8b3) [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.abf: %ptr.as.Copy.impl.Op.type.f23 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.a94: = impl_witness imports.%Copy.impl_witness_table.a71, @ptr.as.Copy.impl(%C) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.0f5: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%C) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.fd1: %ptr.as.Copy.impl.Op.type.0f5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.9a6: %Copy.type = facet_value %ptr.019, (%Copy.impl_witness.a94) [concrete] +// CHECK:STDOUT: %.a98: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.9a6 [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.bound: = bound_method %addr, %ptr.as.Copy.impl.Op.fd1 [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.fd1, @ptr.as.Copy.impl.Op(%C) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %addr, %ptr.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -332,11 +389,15 @@ var ptr: E* = &val; // CHECK:STDOUT: %Main.b_val = import_ref Main//b, b_val, unloaded // CHECK:STDOUT: %Main.b_ptr = import_ref Main//b, b_ptr, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.import_ref.8f2: = import_ref Main//a, loc4_10, loaded [concrete = constants.%complete_type] +// CHECK:STDOUT: %Main.import_ref.8f2: = import_ref Main//a, loc4_10, loaded [concrete = constants.%complete_type.357] // CHECK:STDOUT: %Main.import_ref.2c4 = import_ref Main//a, inst18 [no loc], unloaded +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.de9: @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op.type (%ptr.as.Copy.impl.Op.type.f23) = import_ref Core//prelude/parts/copy, loc32_31, loaded [symbolic = @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op (constants.%ptr.as.Copy.impl.Op.abf)] +// CHECK:STDOUT: %Copy.impl_witness_table.a71 = impl_witness_table (%Core.import_ref.de9), @ptr.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -385,7 +446,12 @@ var ptr: E* = &val; // CHECK:STDOUT: assign file.%val.var, %.loc7_1 // CHECK:STDOUT: %val.ref: ref %C = name_ref val, file.%val [concrete = file.%val.var] // CHECK:STDOUT: %addr: %ptr.019 = addr_of %val.ref [concrete = constants.%addr] -// CHECK:STDOUT: assign file.%ptr.var, %addr +// CHECK:STDOUT: %impl.elem0: %.a98 = impl_witness_access constants.%Copy.impl_witness.a94, element0 [concrete = constants.%ptr.as.Copy.impl.Op.fd1] +// CHECK:STDOUT: %bound_method.loc8_15.1: = bound_method %addr, %impl.elem0 [concrete = constants.%ptr.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @ptr.as.Copy.impl.Op(constants.%C) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_15.2: = bound_method %addr, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.019 = call %bound_method.loc8_15.2(%addr) [concrete = constants.%addr] +// CHECK:STDOUT: assign file.%ptr.var, %ptr.as.Copy.impl.Op.call // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -394,12 +460,25 @@ var ptr: E* = &val; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete] // CHECK:STDOUT: %C.val: %C = struct_value () [concrete] // CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete] // CHECK:STDOUT: %pattern_type.44a: type = pattern_type %ptr.019 [concrete] // CHECK:STDOUT: %addr: %ptr.019 = addr_of file.%val.var [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.f23: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.8b3) [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.abf: %ptr.as.Copy.impl.Op.type.f23 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.a94: = impl_witness imports.%Copy.impl_witness_table.a71, @ptr.as.Copy.impl(%C) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.0f5: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%C) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.fd1: %ptr.as.Copy.impl.Op.type.0f5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.9a6: %Copy.type = facet_value %ptr.019, (%Copy.impl_witness.a94) [concrete] +// CHECK:STDOUT: %.a98: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.9a6 [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.bound: = bound_method %addr, %ptr.as.Copy.impl.Op.fd1 [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.fd1, @ptr.as.Copy.impl.Op(%C) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %addr, %ptr.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -408,11 +487,15 @@ var ptr: E* = &val; // CHECK:STDOUT: %Main.b_ptr = import_ref Main//b, b_ptr, unloaded // CHECK:STDOUT: %Main.C: type = import_ref Main//a, C, loaded [concrete = constants.%C] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.import_ref.8f2: = import_ref Main//a, loc4_10, loaded [concrete = constants.%complete_type] +// CHECK:STDOUT: %Main.import_ref.8f2: = import_ref Main//a, loc4_10, loaded [concrete = constants.%complete_type.357] // CHECK:STDOUT: %Main.import_ref.2c4 = import_ref Main//a, inst18 [no loc], unloaded +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.de9: @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op.type (%ptr.as.Copy.impl.Op.type.f23) = import_ref Core//prelude/parts/copy, loc32_31, loaded [symbolic = @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op (constants.%ptr.as.Copy.impl.Op.abf)] +// CHECK:STDOUT: %Copy.impl_witness_table.a71 = impl_witness_table (%Core.import_ref.de9), @ptr.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -461,7 +544,12 @@ var ptr: E* = &val; // CHECK:STDOUT: assign file.%val.var, %.loc7_1 // CHECK:STDOUT: %val.ref: ref %C = name_ref val, file.%val [concrete = file.%val.var] // CHECK:STDOUT: %addr: %ptr.019 = addr_of %val.ref [concrete = constants.%addr] -// CHECK:STDOUT: assign file.%ptr.var, %addr +// CHECK:STDOUT: %impl.elem0: %.a98 = impl_witness_access constants.%Copy.impl_witness.a94, element0 [concrete = constants.%ptr.as.Copy.impl.Op.fd1] +// CHECK:STDOUT: %bound_method.loc8_15.1: = bound_method %addr, %impl.elem0 [concrete = constants.%ptr.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @ptr.as.Copy.impl.Op(constants.%C) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_15.2: = bound_method %addr, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.019 = call %bound_method.loc8_15.2(%addr) [concrete = constants.%addr] +// CHECK:STDOUT: assign file.%ptr.var, %ptr.as.Copy.impl.Op.call // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -470,12 +558,25 @@ var ptr: E* = &val; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete] // CHECK:STDOUT: %C.val: %C = struct_value () [concrete] // CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete] // CHECK:STDOUT: %pattern_type.44a: type = pattern_type %ptr.019 [concrete] // CHECK:STDOUT: %addr: %ptr.019 = addr_of file.%val.var [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.f23: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.8b3) [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.abf: %ptr.as.Copy.impl.Op.type.f23 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.a94: = impl_witness imports.%Copy.impl_witness_table.a71, @ptr.as.Copy.impl(%C) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.0f5: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%C) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.fd1: %ptr.as.Copy.impl.Op.type.0f5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.9a6: %Copy.type = facet_value %ptr.019, (%Copy.impl_witness.a94) [concrete] +// CHECK:STDOUT: %.a98: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.9a6 [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.bound: = bound_method %addr, %ptr.as.Copy.impl.Op.fd1 [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.fd1, @ptr.as.Copy.impl.Op(%C) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %addr, %ptr.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -486,11 +587,15 @@ var ptr: E* = &val; // CHECK:STDOUT: %Main.c_val = import_ref Main//c, c_val, unloaded // CHECK:STDOUT: %Main.c_ptr = import_ref Main//c, c_ptr, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.import_ref.8db: = import_ref Main//b, inst23 [indirect], loaded [concrete = constants.%complete_type] +// CHECK:STDOUT: %Main.import_ref.8db: = import_ref Main//b, inst23 [indirect], loaded [concrete = constants.%complete_type.357] // CHECK:STDOUT: %Main.import_ref.6a9 = import_ref Main//b, inst24 [indirect], unloaded +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.de9: @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op.type (%ptr.as.Copy.impl.Op.type.f23) = import_ref Core//prelude/parts/copy, loc32_31, loaded [symbolic = @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op (constants.%ptr.as.Copy.impl.Op.abf)] +// CHECK:STDOUT: %Copy.impl_witness_table.a71 = impl_witness_table (%Core.import_ref.de9), @ptr.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -541,7 +646,12 @@ var ptr: E* = &val; // CHECK:STDOUT: assign file.%val.var, %.loc7_1 // CHECK:STDOUT: %val.ref: ref %C = name_ref val, file.%val [concrete = file.%val.var] // CHECK:STDOUT: %addr: %ptr.019 = addr_of %val.ref [concrete = constants.%addr] -// CHECK:STDOUT: assign file.%ptr.var, %addr +// CHECK:STDOUT: %impl.elem0: %.a98 = impl_witness_access constants.%Copy.impl_witness.a94, element0 [concrete = constants.%ptr.as.Copy.impl.Op.fd1] +// CHECK:STDOUT: %bound_method.loc8_15.1: = bound_method %addr, %impl.elem0 [concrete = constants.%ptr.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @ptr.as.Copy.impl.Op(constants.%C) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_15.2: = bound_method %addr, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.019 = call %bound_method.loc8_15.2(%addr) [concrete = constants.%addr] +// CHECK:STDOUT: assign file.%ptr.var, %ptr.as.Copy.impl.Op.call // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -550,12 +660,25 @@ var ptr: E* = &val; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete] // CHECK:STDOUT: %C.val: %C = struct_value () [concrete] // CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete] // CHECK:STDOUT: %pattern_type.44a: type = pattern_type %ptr.019 [concrete] // CHECK:STDOUT: %addr: %ptr.019 = addr_of file.%val.var [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.f23: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.8b3) [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.abf: %ptr.as.Copy.impl.Op.type.f23 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.a94: = impl_witness imports.%Copy.impl_witness_table.a71, @ptr.as.Copy.impl(%C) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.0f5: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%C) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.fd1: %ptr.as.Copy.impl.Op.type.0f5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.9a6: %Copy.type = facet_value %ptr.019, (%Copy.impl_witness.a94) [concrete] +// CHECK:STDOUT: %.a98: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.9a6 [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.bound: = bound_method %addr, %ptr.as.Copy.impl.Op.fd1 [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.fd1, @ptr.as.Copy.impl.Op(%C) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %addr, %ptr.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -566,11 +689,15 @@ var ptr: E* = &val; // CHECK:STDOUT: %Main.b_val = import_ref Main//b, b_val, unloaded // CHECK:STDOUT: %Main.b_ptr = import_ref Main//b, b_ptr, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.import_ref.8db: = import_ref Main//b, inst23 [indirect], loaded [concrete = constants.%complete_type] +// CHECK:STDOUT: %Main.import_ref.8db: = import_ref Main//b, inst23 [indirect], loaded [concrete = constants.%complete_type.357] // CHECK:STDOUT: %Main.import_ref.6a9 = import_ref Main//b, inst24 [indirect], unloaded +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.de9: @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op.type (%ptr.as.Copy.impl.Op.type.f23) = import_ref Core//prelude/parts/copy, loc32_31, loaded [symbolic = @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op (constants.%ptr.as.Copy.impl.Op.abf)] +// CHECK:STDOUT: %Copy.impl_witness_table.a71 = impl_witness_table (%Core.import_ref.de9), @ptr.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -621,7 +748,12 @@ var ptr: E* = &val; // CHECK:STDOUT: assign file.%val.var, %.loc7_1 // CHECK:STDOUT: %val.ref: ref %C = name_ref val, file.%val [concrete = file.%val.var] // CHECK:STDOUT: %addr: %ptr.019 = addr_of %val.ref [concrete = constants.%addr] -// CHECK:STDOUT: assign file.%ptr.var, %addr +// CHECK:STDOUT: %impl.elem0: %.a98 = impl_witness_access constants.%Copy.impl_witness.a94, element0 [concrete = constants.%ptr.as.Copy.impl.Op.fd1] +// CHECK:STDOUT: %bound_method.loc8_15.1: = bound_method %addr, %impl.elem0 [concrete = constants.%ptr.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @ptr.as.Copy.impl.Op(constants.%C) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_15.2: = bound_method %addr, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.019 = call %bound_method.loc8_15.2(%addr) [concrete = constants.%addr] +// CHECK:STDOUT: assign file.%ptr.var, %ptr.as.Copy.impl.Op.call // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/import_struct_cyle.carbon b/toolchain/check/testdata/class/import_struct_cyle.carbon index fde677332031..4279ed57f3d4 100644 --- a/toolchain/check/testdata/class/import_struct_cyle.carbon +++ b/toolchain/check/testdata/class/import_struct_cyle.carbon @@ -129,26 +129,41 @@ fn Run() { // CHECK:STDOUT: %ptr.257: type = ptr_type %Cycle [concrete] // CHECK:STDOUT: %struct_type.b: type = struct_type {.b: %ptr.257} [concrete] // CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %struct_type.b} [concrete] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.c [concrete] -// CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.b [concrete] +// CHECK:STDOUT: %complete_type.e1c: = complete_type_witness %struct_type.c [concrete] +// CHECK:STDOUT: %pattern_type.afd: type = pattern_type %struct_type.b [concrete] // CHECK:STDOUT: %.46a: ref %ptr.257 = struct_access imports.%a.var, element0 [concrete] // CHECK:STDOUT: %Cycle.elem: type = unbound_element_type %Cycle, %struct_type.b [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.f23: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.8b3) [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.abf: %ptr.as.Copy.impl.Op.type.f23 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.6b8: = impl_witness imports.%Copy.impl_witness_table.a71, @ptr.as.Copy.impl(%Cycle) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.691: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%Cycle) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.52b: %ptr.as.Copy.impl.Op.type.691 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.ea6: %Copy.type = facet_value %ptr.257, (%Copy.impl_witness.6b8) [concrete] +// CHECK:STDOUT: %.bfa: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.ea6 [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.52b, @ptr.as.Copy.impl.Op(%Cycle) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Main.Cycle = import_ref Main//a, Cycle, unloaded // CHECK:STDOUT: %Main.a: ref %struct_type.b = import_ref Main//a, a, loaded [concrete = %a.var] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.import_ref.b93: = import_ref Main//a, loc11_1, loaded [concrete = constants.%complete_type] +// CHECK:STDOUT: %Main.import_ref.b93: = import_ref Main//a, loc11_1, loaded [concrete = constants.%complete_type.e1c] // CHECK:STDOUT: %Main.import_ref.3a6 = import_ref Main//a, inst18 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.455: %Cycle.elem = import_ref Main//a, loc10_8, loaded [concrete = %.354] -// CHECK:STDOUT: %a.patt: %pattern_type = binding_pattern a [concrete] -// CHECK:STDOUT: %a.var_patt: %pattern_type = var_pattern %a.patt [concrete] +// CHECK:STDOUT: %a.patt: %pattern_type.afd = binding_pattern a [concrete] +// CHECK:STDOUT: %a.var_patt: %pattern_type.afd = var_pattern %a.patt [concrete] // CHECK:STDOUT: %a.var: ref %struct_type.b = var %a.var_patt [concrete] // CHECK:STDOUT: %.354: %Cycle.elem = field_decl c, element0 [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.de9: @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op.type (%ptr.as.Copy.impl.Op.type.f23) = import_ref Core//prelude/parts/copy, loc32_31, loaded [symbolic = @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op (constants.%ptr.as.Copy.impl.Op.abf)] +// CHECK:STDOUT: %Copy.impl_witness_table.a71 = impl_witness_table (%Core.import_ref.de9), @ptr.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -183,7 +198,12 @@ fn Run() { // CHECK:STDOUT: %.loc7_15: ref %struct_type.b = class_element_access %.loc7_10, element0 // CHECK:STDOUT: %.loc7_17.1: ref %ptr.257 = struct_access %.loc7_15, element0 // CHECK:STDOUT: %.loc7_17.2: %ptr.257 = bind_value %.loc7_17.1 -// CHECK:STDOUT: assign %.loc7_4, %.loc7_17.2 +// CHECK:STDOUT: %impl.elem0: %.bfa = impl_witness_access constants.%Copy.impl_witness.6b8, element0 [concrete = constants.%ptr.as.Copy.impl.Op.52b] +// CHECK:STDOUT: %bound_method.loc7_17.1: = bound_method %.loc7_17.2, %impl.elem0 +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @ptr.as.Copy.impl.Op(constants.%Cycle) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc7_17.2: = bound_method %.loc7_17.2, %specific_fn +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.257 = call %bound_method.loc7_17.2(%.loc7_17.2) +// CHECK:STDOUT: assign %.loc7_4, %ptr.as.Copy.impl.Op.call // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/inheritance_access.carbon b/toolchain/check/testdata/class/inheritance_access.carbon index bf3cebb3ae70..5201240bfe90 100644 --- a/toolchain/check/testdata/class/inheritance_access.carbon +++ b/toolchain/check/testdata/class/inheritance_access.carbon @@ -238,6 +238,7 @@ class B { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %Shape.elem: type = unbound_element_type %Shape, %i32 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] @@ -251,7 +252,7 @@ class B { // CHECK:STDOUT: %complete_type.70a: = complete_type_witness %struct_type.x.y [concrete] // CHECK:STDOUT: %Circle: type = class_type @Circle [concrete] // CHECK:STDOUT: %Circle.elem: type = unbound_element_type %Circle, %Shape [concrete] -// CHECK:STDOUT: %pattern_type.ce2: type = pattern_type %Circle [concrete] +// CHECK:STDOUT: %pattern_type.ce26: type = pattern_type %Circle [concrete] // CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete] // CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [concrete] // CHECK:STDOUT: %pattern_type.511: type = pattern_type %tuple.type.d07 [concrete] @@ -264,17 +265,31 @@ class B { // CHECK:STDOUT: %Circle.as.Destroy.impl.Op: %Circle.as.Destroy.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: %struct_type.base.0ed: type = struct_type {.base: %Shape} [concrete] // CHECK:STDOUT: %complete_type.a2b: = complete_type_witness %struct_type.base.0ed [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .Destroy = %Core.Destroy +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -344,8 +359,8 @@ class B { // CHECK:STDOUT: %Shape.ref: type = name_ref Shape, file.%Shape.decl [concrete = constants.%Shape] // CHECK:STDOUT: %.loc10: %Circle.elem = base_decl %Shape.ref, element0 [concrete] // CHECK:STDOUT: %Circle.GetPosition.decl: %Circle.GetPosition.type = fn_decl @Circle.GetPosition [concrete = constants.%Circle.GetPosition] { -// CHECK:STDOUT: %self.patt: %pattern_type.ce2 = binding_pattern self [concrete] -// CHECK:STDOUT: %self.param_patt: %pattern_type.ce2 = value_param_pattern %self.patt, call_param0 [concrete] +// CHECK:STDOUT: %self.patt: %pattern_type.ce26 = binding_pattern self [concrete] +// CHECK:STDOUT: %self.param_patt: %pattern_type.ce26 = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: %return.patt: %pattern_type.511 = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.511 = out_param_pattern %return.patt, call_param1 [concrete] // CHECK:STDOUT: } { @@ -394,11 +409,21 @@ class B { // CHECK:STDOUT: %.loc13_25.3: ref %i32 = class_element_access %.loc13_25.2, element1 // CHECK:STDOUT: %.loc13_27.1: %tuple.type.d07 = tuple_literal (%.loc13_17.3, %.loc13_25.3) // CHECK:STDOUT: %.loc13_17.4: %i32 = bind_value %.loc13_17.3 +// CHECK:STDOUT: %impl.elem0.loc13_17: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc13_17.1: = bound_method %.loc13_17.4, %impl.elem0.loc13_17 +// CHECK:STDOUT: %specific_fn.loc13_17: = specific_function %impl.elem0.loc13_17, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_17.2: = bound_method %.loc13_17.4, %specific_fn.loc13_17 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc13_17: init %i32 = call %bound_method.loc13_17.2(%.loc13_17.4) // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %return, element0 -// CHECK:STDOUT: %.loc13_27.2: init %i32 = initialize_from %.loc13_17.4 to %tuple.elem0 +// CHECK:STDOUT: %.loc13_27.2: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc13_17 to %tuple.elem0 // CHECK:STDOUT: %.loc13_25.4: %i32 = bind_value %.loc13_25.3 +// CHECK:STDOUT: %impl.elem0.loc13_25: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc13_25.1: = bound_method %.loc13_25.4, %impl.elem0.loc13_25 +// CHECK:STDOUT: %specific_fn.loc13_25: = specific_function %impl.elem0.loc13_25, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_25.2: = bound_method %.loc13_25.4, %specific_fn.loc13_25 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc13_25: init %i32 = call %bound_method.loc13_25.2(%.loc13_25.4) // CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access %return, element1 -// CHECK:STDOUT: %.loc13_27.3: init %i32 = initialize_from %.loc13_25.4 to %tuple.elem1 +// CHECK:STDOUT: %.loc13_27.3: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc13_25 to %tuple.elem1 // CHECK:STDOUT: %.loc13_27.4: init %tuple.type.d07 = tuple_init (%.loc13_27.2, %.loc13_27.3) to %return // CHECK:STDOUT: %.loc13_28: init %tuple.type.d07 = converted %.loc13_27.1, %.loc13_27.4 // CHECK:STDOUT: return %.loc13_28 to %return @@ -693,7 +718,7 @@ class B { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } @@ -1498,7 +1523,7 @@ class B { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/init.carbon b/toolchain/check/testdata/class/init.carbon index 71dbd0a366e9..beddb18cf6b6 100644 --- a/toolchain/check/testdata/class/init.carbon +++ b/toolchain/check/testdata/class/init.carbon @@ -32,6 +32,7 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %Class.elem.c91: type = unbound_element_type %Class, %i32 [concrete] // CHECK:STDOUT: %ptr.e71: type = ptr_type %Class [concrete] @@ -48,6 +49,25 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: %pattern_type.761: type = pattern_type %Class [concrete] // CHECK:STDOUT: %Make.type: type = fn_type @Make [concrete] // CHECK:STDOUT: %Make: %Make.type = struct_value () [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.f23: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.8b3) [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.abf: %ptr.as.Copy.impl.Op.type.f23 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] +// CHECK:STDOUT: %Copy.impl_witness.771: = impl_witness imports.%Copy.impl_witness_table.a71, @ptr.as.Copy.impl(%Class) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.eef: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%Class) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.cd0: %ptr.as.Copy.impl.Op.type.eef = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.054: %Copy.type = facet_value %ptr.e71, (%Copy.impl_witness.771) [concrete] +// CHECK:STDOUT: %.96e: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.054 [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.cd0, @ptr.as.Copy.impl.Op(%Class) [concrete] // CHECK:STDOUT: %MakeReorder.type: type = fn_type @MakeReorder [concrete] // CHECK:STDOUT: %MakeReorder: %MakeReorder.type = struct_value () [concrete] // CHECK:STDOUT: %struct_type.next.n: type = struct_type {.next: %ptr.e71, .n: %i32} [concrete] @@ -57,11 +77,17 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .Destroy = %Core.Destroy +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.de9: @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op.type (%ptr.as.Copy.impl.Op.type.f23) = import_ref Core//prelude/parts/copy, loc32_31, loaded [symbolic = @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op (constants.%ptr.as.Copy.impl.Op.abf)] +// CHECK:STDOUT: %Copy.impl_witness_table.a71 = impl_witness_table (%Core.import_ref.de9), @ptr.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -167,10 +193,20 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n // CHECK:STDOUT: %next.ref: %ptr.e71 = name_ref next, %next // CHECK:STDOUT: %.loc21_31.1: %struct_type.n.next = struct_literal (%n.ref, %next.ref) +// CHECK:STDOUT: %impl.elem0.loc21_16: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc21_16.1: = bound_method %n.ref, %impl.elem0.loc21_16 +// CHECK:STDOUT: %specific_fn.loc21_16: = specific_function %impl.elem0.loc21_16, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc21_16.2: = bound_method %n.ref, %specific_fn.loc21_16 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc21_16.2(%n.ref) // CHECK:STDOUT: %.loc21_31.2: ref %i32 = class_element_access %return, element0 -// CHECK:STDOUT: %.loc21_31.3: init %i32 = initialize_from %n.ref to %.loc21_31.2 +// CHECK:STDOUT: %.loc21_31.3: init %i32 = initialize_from %Int.as.Copy.impl.Op.call to %.loc21_31.2 +// CHECK:STDOUT: %impl.elem0.loc21_27: %.96e = impl_witness_access constants.%Copy.impl_witness.771, element0 [concrete = constants.%ptr.as.Copy.impl.Op.cd0] +// CHECK:STDOUT: %bound_method.loc21_27.1: = bound_method %next.ref, %impl.elem0.loc21_27 +// CHECK:STDOUT: %specific_fn.loc21_27: = specific_function %impl.elem0.loc21_27, @ptr.as.Copy.impl.Op(constants.%Class) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc21_27.2: = bound_method %next.ref, %specific_fn.loc21_27 +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.e71 = call %bound_method.loc21_27.2(%next.ref) // CHECK:STDOUT: %.loc21_31.4: ref %ptr.e71 = class_element_access %return, element1 -// CHECK:STDOUT: %.loc21_31.5: init %ptr.e71 = initialize_from %next.ref to %.loc21_31.4 +// CHECK:STDOUT: %.loc21_31.5: init %ptr.e71 = initialize_from %ptr.as.Copy.impl.Op.call to %.loc21_31.4 // CHECK:STDOUT: %.loc21_31.6: init %Class = class_init (%.loc21_31.3, %.loc21_31.5), %return // CHECK:STDOUT: %.loc21_32: init %Class = converted %.loc21_31.1, %.loc21_31.6 // CHECK:STDOUT: return %.loc21_32 to %return @@ -181,10 +217,20 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: %next.ref: %ptr.e71 = name_ref next, %next // CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n // CHECK:STDOUT: %.loc25_31.1: %struct_type.next.n = struct_literal (%next.ref, %n.ref) +// CHECK:STDOUT: %impl.elem0.loc25_30: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc25_30.1: = bound_method %n.ref, %impl.elem0.loc25_30 +// CHECK:STDOUT: %specific_fn.loc25_30: = specific_function %impl.elem0.loc25_30, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc25_30.2: = bound_method %n.ref, %specific_fn.loc25_30 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc25_30.2(%n.ref) // CHECK:STDOUT: %.loc25_31.2: ref %i32 = class_element_access %return, element1 -// CHECK:STDOUT: %.loc25_31.3: init %i32 = initialize_from %n.ref to %.loc25_31.2 +// CHECK:STDOUT: %.loc25_31.3: init %i32 = initialize_from %Int.as.Copy.impl.Op.call to %.loc25_31.2 +// CHECK:STDOUT: %impl.elem0.loc25_19: %.96e = impl_witness_access constants.%Copy.impl_witness.771, element0 [concrete = constants.%ptr.as.Copy.impl.Op.cd0] +// CHECK:STDOUT: %bound_method.loc25_19.1: = bound_method %next.ref, %impl.elem0.loc25_19 +// CHECK:STDOUT: %specific_fn.loc25_19: = specific_function %impl.elem0.loc25_19, @ptr.as.Copy.impl.Op(constants.%Class) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc25_19.2: = bound_method %next.ref, %specific_fn.loc25_19 +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.e71 = call %bound_method.loc25_19.2(%next.ref) // CHECK:STDOUT: %.loc25_31.4: ref %ptr.e71 = class_element_access %return, element0 -// CHECK:STDOUT: %.loc25_31.5: init %ptr.e71 = initialize_from %next.ref to %.loc25_31.4 +// CHECK:STDOUT: %.loc25_31.5: init %ptr.e71 = initialize_from %ptr.as.Copy.impl.Op.call to %.loc25_31.4 // CHECK:STDOUT: %.loc25_31.6: init %Class = class_init (%.loc25_31.3, %.loc25_31.5), %return // CHECK:STDOUT: %.loc25_32: init %Class = converted %.loc25_31.1, %.loc25_31.6 // CHECK:STDOUT: return %.loc25_32 to %return diff --git a/toolchain/check/testdata/class/init_as.carbon b/toolchain/check/testdata/class/init_as.carbon index eb3e96e38e45..866db9466ee2 100644 --- a/toolchain/check/testdata/class/init_as.carbon +++ b/toolchain/check/testdata/class/init_as.carbon @@ -79,7 +79,7 @@ fn F() -> i32 { // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/local.carbon b/toolchain/check/testdata/class/local.carbon index 7591e95a4f3c..606c75ed1789 100644 --- a/toolchain/check/testdata/class/local.carbon +++ b/toolchain/check/testdata/class/local.carbon @@ -92,7 +92,7 @@ class A { // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/method.carbon b/toolchain/check/testdata/class/method.carbon index 23a9d5abb7f1..30a590076441 100644 --- a/toolchain/check/testdata/class/method.carbon +++ b/toolchain/check/testdata/class/method.carbon @@ -137,7 +137,7 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/nested.carbon b/toolchain/check/testdata/class/nested.carbon index f1968e212aa5..fd13f4a2ac35 100644 --- a/toolchain/check/testdata/class/nested.carbon +++ b/toolchain/check/testdata/class/nested.carbon @@ -2,7 +2,7 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/destroy.carbon +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/convert.carbon // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". // EXTRA-ARGS: --dump-sem-ir-ranges=if-present // @@ -87,17 +87,38 @@ fn F(a: Outer*) { // CHECK:STDOUT: %complete_type.e99: = complete_type_witness %struct_type.po.qo.pi [concrete] // CHECK:STDOUT: %pattern_type.e74: type = pattern_type %Outer [concrete] // CHECK:STDOUT: %pattern_type.906: type = pattern_type %Inner [concrete] +// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.f23: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.8b3) [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.abf: %ptr.as.Copy.impl.Op.type.f23 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.45b: = impl_witness imports.%Copy.impl_witness_table.a71, @ptr.as.Copy.impl(%Outer) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.a71: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%Outer) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.82d: %ptr.as.Copy.impl.Op.type.a71 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.817: %Copy.type = facet_value %ptr.5df, (%Copy.impl_witness.45b) [concrete] +// CHECK:STDOUT: %.c87: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.817 [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn.5ab: = specific_function %ptr.as.Copy.impl.Op.82d, @ptr.as.Copy.impl.Op(%Outer) [concrete] +// CHECK:STDOUT: %Copy.impl_witness.6d7: = impl_witness imports.%Copy.impl_witness_table.a71, @ptr.as.Copy.impl(%Inner) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.2a3: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%Inner) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.017: %ptr.as.Copy.impl.Op.type.2a3 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.1d3: %Copy.type = facet_value %ptr.36a, (%Copy.impl_witness.6d7) [concrete] +// CHECK:STDOUT: %.f37: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.1d3 [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn.c59: = specific_function %ptr.as.Copy.impl.Op.017, @ptr.as.Copy.impl.Op(%Inner) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Destroy = %Core.Destroy +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.de9: @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op.type (%ptr.as.Copy.impl.Op.type.f23) = import_ref Core//prelude/parts/copy, loc32_31, loaded [symbolic = @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op (constants.%ptr.as.Copy.impl.Op.abf)] +// CHECK:STDOUT: %Copy.impl_witness_table.a71 = impl_witness_table (%Core.import_ref.de9), @ptr.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -312,13 +333,23 @@ fn F(a: Outer*) { // CHECK:STDOUT: %po.ref.loc48: %Outer.elem.a16 = name_ref po, @Outer.%.loc40 [concrete = @Outer.%.loc40] // CHECK:STDOUT: %.loc48_4.2: ref %ptr.5df = class_element_access %.loc48_4.1, element0 // CHECK:STDOUT: %a.ref.loc48_11: %ptr.5df = name_ref a, %a -// CHECK:STDOUT: assign %.loc48_4.2, %a.ref.loc48_11 +// CHECK:STDOUT: %impl.elem0.loc48: %.c87 = impl_witness_access constants.%Copy.impl_witness.45b, element0 [concrete = constants.%ptr.as.Copy.impl.Op.82d] +// CHECK:STDOUT: %bound_method.loc48_11.1: = bound_method %a.ref.loc48_11, %impl.elem0.loc48 +// CHECK:STDOUT: %specific_fn.loc48: = specific_function %impl.elem0.loc48, @ptr.as.Copy.impl.Op(constants.%Outer) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn.5ab] +// CHECK:STDOUT: %bound_method.loc48_11.2: = bound_method %a.ref.loc48_11, %specific_fn.loc48 +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc48: init %ptr.5df = call %bound_method.loc48_11.2(%a.ref.loc48_11) +// CHECK:STDOUT: assign %.loc48_4.2, %ptr.as.Copy.impl.Op.call.loc48 // CHECK:STDOUT: %a.ref.loc49_3: %ptr.5df = name_ref a, %a // CHECK:STDOUT: %.loc49_4.1: ref %Outer = deref %a.ref.loc49_3 // CHECK:STDOUT: %qo.ref: %Outer.elem.a16 = name_ref qo, @Outer.%.loc41 [concrete = @Outer.%.loc41] // CHECK:STDOUT: %.loc49_4.2: ref %ptr.5df = class_element_access %.loc49_4.1, element1 // CHECK:STDOUT: %a.ref.loc49_11: %ptr.5df = name_ref a, %a -// CHECK:STDOUT: assign %.loc49_4.2, %a.ref.loc49_11 +// CHECK:STDOUT: %impl.elem0.loc49: %.c87 = impl_witness_access constants.%Copy.impl_witness.45b, element0 [concrete = constants.%ptr.as.Copy.impl.Op.82d] +// CHECK:STDOUT: %bound_method.loc49_11.1: = bound_method %a.ref.loc49_11, %impl.elem0.loc49 +// CHECK:STDOUT: %specific_fn.loc49: = specific_function %impl.elem0.loc49, @ptr.as.Copy.impl.Op(constants.%Outer) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn.5ab] +// CHECK:STDOUT: %bound_method.loc49_11.2: = bound_method %a.ref.loc49_11, %specific_fn.loc49 +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc49: init %ptr.5df = call %bound_method.loc49_11.2(%a.ref.loc49_11) +// CHECK:STDOUT: assign %.loc49_4.2, %ptr.as.Copy.impl.Op.call.loc49 // CHECK:STDOUT: %a.ref.loc50_3: %ptr.5df = name_ref a, %a // CHECK:STDOUT: %.loc50_4.1: ref %Outer = deref %a.ref.loc50_3 // CHECK:STDOUT: %pi.ref.loc50_4: %Outer.elem.fe9 = name_ref pi, @Outer.%.loc42 [concrete = @Outer.%.loc42] @@ -328,13 +359,23 @@ fn F(a: Outer*) { // CHECK:STDOUT: %pi.ref.loc50_12: %Outer.elem.fe9 = name_ref pi, @Outer.%.loc42 [concrete = @Outer.%.loc42] // CHECK:STDOUT: %.loc50_12.2: ref %ptr.36a = class_element_access %.loc50_12.1, element2 // CHECK:STDOUT: %.loc50_12.3: %ptr.36a = bind_value %.loc50_12.2 -// CHECK:STDOUT: assign %.loc50_4.2, %.loc50_12.3 +// CHECK:STDOUT: %impl.elem0.loc50: %.f37 = impl_witness_access constants.%Copy.impl_witness.6d7, element0 [concrete = constants.%ptr.as.Copy.impl.Op.017] +// CHECK:STDOUT: %bound_method.loc50_12.1: = bound_method %.loc50_12.3, %impl.elem0.loc50 +// CHECK:STDOUT: %specific_fn.loc50: = specific_function %impl.elem0.loc50, @ptr.as.Copy.impl.Op(constants.%Inner) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn.c59] +// CHECK:STDOUT: %bound_method.loc50_12.2: = bound_method %.loc50_12.3, %specific_fn.loc50 +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc50: init %ptr.36a = call %bound_method.loc50_12.2(%.loc50_12.3) +// CHECK:STDOUT: assign %.loc50_4.2, %ptr.as.Copy.impl.Op.call.loc50 // CHECK:STDOUT: %b.ref.loc51: %ptr.36a = name_ref b, %b // CHECK:STDOUT: %.loc51_4.1: ref %Inner = deref %b.ref.loc51 // CHECK:STDOUT: %po.ref.loc51: %Inner.elem.c30 = name_ref po, @Inner.%.loc24 [concrete = @Inner.%.loc24] // CHECK:STDOUT: %.loc51_4.2: ref %ptr.5df = class_element_access %.loc51_4.1, element1 // CHECK:STDOUT: %a.ref.loc51: %ptr.5df = name_ref a, %a -// CHECK:STDOUT: assign %.loc51_4.2, %a.ref.loc51 +// CHECK:STDOUT: %impl.elem0.loc51: %.c87 = impl_witness_access constants.%Copy.impl_witness.45b, element0 [concrete = constants.%ptr.as.Copy.impl.Op.82d] +// CHECK:STDOUT: %bound_method.loc51_11.1: = bound_method %a.ref.loc51, %impl.elem0.loc51 +// CHECK:STDOUT: %specific_fn.loc51: = specific_function %impl.elem0.loc51, @ptr.as.Copy.impl.Op(constants.%Outer) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn.5ab] +// CHECK:STDOUT: %bound_method.loc51_11.2: = bound_method %a.ref.loc51, %specific_fn.loc51 +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc51: init %ptr.5df = call %bound_method.loc51_11.2(%a.ref.loc51) +// CHECK:STDOUT: assign %.loc51_4.2, %ptr.as.Copy.impl.Op.call.loc51 // CHECK:STDOUT: %b.ref.loc52: %ptr.36a = name_ref b, %b // CHECK:STDOUT: %.loc52_4.1: ref %Inner = deref %b.ref.loc52 // CHECK:STDOUT: %pi.ref.loc52_4: %Inner.elem.640 = name_ref pi, @Inner.%.loc23 [concrete = @Inner.%.loc23] @@ -344,7 +385,12 @@ fn F(a: Outer*) { // CHECK:STDOUT: %pi.ref.loc52_12: %Outer.elem.fe9 = name_ref pi, @Outer.%.loc42 [concrete = @Outer.%.loc42] // CHECK:STDOUT: %.loc52_12.2: ref %ptr.36a = class_element_access %.loc52_12.1, element2 // CHECK:STDOUT: %.loc52_12.3: %ptr.36a = bind_value %.loc52_12.2 -// CHECK:STDOUT: assign %.loc52_4.2, %.loc52_12.3 +// CHECK:STDOUT: %impl.elem0.loc52: %.f37 = impl_witness_access constants.%Copy.impl_witness.6d7, element0 [concrete = constants.%ptr.as.Copy.impl.Op.017] +// CHECK:STDOUT: %bound_method.loc52_12.1: = bound_method %.loc52_12.3, %impl.elem0.loc52 +// CHECK:STDOUT: %specific_fn.loc52: = specific_function %impl.elem0.loc52, @ptr.as.Copy.impl.Op(constants.%Inner) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn.c59] +// CHECK:STDOUT: %bound_method.loc52_12.2: = bound_method %.loc52_12.3, %specific_fn.loc52 +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc52: init %ptr.36a = call %bound_method.loc52_12.2(%.loc52_12.3) +// CHECK:STDOUT: assign %.loc52_4.2, %ptr.as.Copy.impl.Op.call.loc52 // CHECK:STDOUT: %b.ref.loc53: %ptr.36a = name_ref b, %b // CHECK:STDOUT: %.loc53_4.1: ref %Inner = deref %b.ref.loc53 // CHECK:STDOUT: %qi.ref: %Inner.elem.640 = name_ref qi, @Inner.%.loc25 [concrete = @Inner.%.loc25] @@ -354,7 +400,12 @@ fn F(a: Outer*) { // CHECK:STDOUT: %pi.ref.loc53: %Outer.elem.fe9 = name_ref pi, @Outer.%.loc42 [concrete = @Outer.%.loc42] // CHECK:STDOUT: %.loc53_12.2: ref %ptr.36a = class_element_access %.loc53_12.1, element2 // CHECK:STDOUT: %.loc53_12.3: %ptr.36a = bind_value %.loc53_12.2 -// CHECK:STDOUT: assign %.loc53_4.2, %.loc53_12.3 +// CHECK:STDOUT: %impl.elem0.loc53: %.f37 = impl_witness_access constants.%Copy.impl_witness.6d7, element0 [concrete = constants.%ptr.as.Copy.impl.Op.017] +// CHECK:STDOUT: %bound_method.loc53_12.1: = bound_method %.loc53_12.3, %impl.elem0.loc53 +// CHECK:STDOUT: %specific_fn.loc53: = specific_function %impl.elem0.loc53, @ptr.as.Copy.impl.Op(constants.%Inner) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn.c59] +// CHECK:STDOUT: %bound_method.loc53_12.2: = bound_method %.loc53_12.3, %specific_fn.loc53 +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc53: init %ptr.36a = call %bound_method.loc53_12.2(%.loc53_12.3) +// CHECK:STDOUT: assign %.loc53_4.2, %ptr.as.Copy.impl.Op.call.loc53 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/raw_self.carbon b/toolchain/check/testdata/class/raw_self.carbon index 1e8da7b45c99..34fa8bf2c8ef 100644 --- a/toolchain/check/testdata/class/raw_self.carbon +++ b/toolchain/check/testdata/class/raw_self.carbon @@ -36,6 +36,7 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %Class.F.type: type = fn_type @Class.F [concrete] @@ -53,17 +54,31 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: %Class.as.Destroy.impl.Op: %Class.as.Destroy.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %i32} [concrete] // CHECK:STDOUT: %complete_type.54b: = complete_type_witness %struct_type.n [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .Destroy = %Core.Destroy +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -208,7 +223,12 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: %n.ref: %Class.elem = name_ref n, @Class.%.loc18 [concrete = @Class.%.loc18] // CHECK:STDOUT: %.loc22_10: ref %i32 = class_element_access %.loc22_4, element0 // CHECK:STDOUT: %self.ref.loc22_15: %i32 = name_ref r#self, %self.loc21_30 -// CHECK:STDOUT: assign %.loc22_10, %self.ref.loc22_15 +// CHECK:STDOUT: %impl.elem0: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc22_15.1: = bound_method %self.ref.loc22_15, %impl.elem0 +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc22_15.2: = bound_method %self.ref.loc22_15, %specific_fn +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc22_15.2(%self.ref.loc22_15) +// CHECK:STDOUT: assign %.loc22_10, %Int.as.Copy.impl.Op.call // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -220,10 +240,20 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: %.loc26_15.2: %i32 = bind_value %.loc26_15.1 // CHECK:STDOUT: %self.ref.loc26_19: %i32 = name_ref r#self, %self.loc25_24 // CHECK:STDOUT: %.loc26_25.1: %tuple.type.d07 = tuple_literal (%.loc26_15.2, %self.ref.loc26_19) +// CHECK:STDOUT: %impl.elem0.loc26_15: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc26_15.1: = bound_method %.loc26_15.2, %impl.elem0.loc26_15 +// CHECK:STDOUT: %specific_fn.loc26_15: = specific_function %impl.elem0.loc26_15, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc26_15.2: = bound_method %.loc26_15.2, %specific_fn.loc26_15 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc26_15: init %i32 = call %bound_method.loc26_15.2(%.loc26_15.2) // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %return.loc25, element0 -// CHECK:STDOUT: %.loc26_25.2: init %i32 = initialize_from %.loc26_15.2 to %tuple.elem0 +// CHECK:STDOUT: %.loc26_25.2: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc26_15 to %tuple.elem0 +// CHECK:STDOUT: %impl.elem0.loc26_19: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc26_19.1: = bound_method %self.ref.loc26_19, %impl.elem0.loc26_19 +// CHECK:STDOUT: %specific_fn.loc26_19: = specific_function %impl.elem0.loc26_19, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc26_19.2: = bound_method %self.ref.loc26_19, %specific_fn.loc26_19 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc26_19: init %i32 = call %bound_method.loc26_19.2(%self.ref.loc26_19) // CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access %return.loc25, element1 -// CHECK:STDOUT: %.loc26_25.3: init %i32 = initialize_from %self.ref.loc26_19 to %tuple.elem1 +// CHECK:STDOUT: %.loc26_25.3: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc26_19 to %tuple.elem1 // CHECK:STDOUT: %.loc26_25.4: init %tuple.type.d07 = tuple_init (%.loc26_25.2, %.loc26_25.3) to %return.loc25 // CHECK:STDOUT: %.loc26_26: init %tuple.type.d07 = converted %.loc26_25.1, %.loc26_25.4 // CHECK:STDOUT: return %.loc26_26 to %return.loc25 diff --git a/toolchain/check/testdata/class/raw_self_type.carbon b/toolchain/check/testdata/class/raw_self_type.carbon index de69e4167eca..937b226b73d6 100644 --- a/toolchain/check/testdata/class/raw_self_type.carbon +++ b/toolchain/check/testdata/class/raw_self_type.carbon @@ -43,6 +43,17 @@ fn MemberNamedSelf.F(x: Self, y: r#Self) {} // CHECK:STDOUT: %Class.as.Destroy.impl.Op: %Class.as.Destroy.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.f23: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.8b3) [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.abf: %ptr.as.Copy.impl.Op.type.f23 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.771: = impl_witness imports.%Copy.impl_witness_table.a71, @ptr.as.Copy.impl(%Class) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.eef: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%Class) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.cd0: %ptr.as.Copy.impl.Op.type.eef = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.054: %Copy.type = facet_value %ptr.e71, (%Copy.impl_witness.771) [concrete] +// CHECK:STDOUT: %.96e: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.054 [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.cd0, @ptr.as.Copy.impl.Op(%Class) [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.type.17c: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%ptr.e71) [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.d98: %T.as.Destroy.impl.Op.type.17c = struct_value () [concrete] // CHECK:STDOUT: %ptr.0dd: type = ptr_type %ptr.e71 [concrete] @@ -68,10 +79,14 @@ fn MemberNamedSelf.F(x: Self, y: r#Self) {} // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Destroy = %Core.Destroy +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.de9: @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op.type (%ptr.as.Copy.impl.Op.type.f23) = import_ref Core//prelude/parts/copy, loc32_31, loaded [symbolic = @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op (constants.%ptr.as.Copy.impl.Op.abf)] +// CHECK:STDOUT: %Copy.impl_witness_table.a71 = impl_witness_table (%Core.import_ref.de9), @ptr.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -219,7 +234,12 @@ fn MemberNamedSelf.F(x: Self, y: r#Self) {} // CHECK:STDOUT: %p.var: ref %ptr.e71 = var %p.var_patt // CHECK:STDOUT: %Self.ref.loc18_20: ref %ptr.e71 = name_ref r#Self, %Self // CHECK:STDOUT: %.loc18_20: %ptr.e71 = bind_value %Self.ref.loc18_20 -// CHECK:STDOUT: assign %p.var, %.loc18_20 +// CHECK:STDOUT: %impl.elem0: %.96e = impl_witness_access constants.%Copy.impl_witness.771, element0 [concrete = constants.%ptr.as.Copy.impl.Op.cd0] +// CHECK:STDOUT: %bound_method.loc18_20.1: = bound_method %.loc18_20, %impl.elem0 +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @ptr.as.Copy.impl.Op(constants.%Class) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc18_20.2: = bound_method %.loc18_20, %specific_fn +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.e71 = call %bound_method.loc18_20.2(%.loc18_20) +// CHECK:STDOUT: assign %p.var, %ptr.as.Copy.impl.Op.call // CHECK:STDOUT: %.loc18_16: type = splice_block %ptr.loc18 [concrete = constants.%ptr.e71] { // CHECK:STDOUT: %Self.ref.loc18_12: type = name_ref Self, constants.%Class [concrete = constants.%Class] // CHECK:STDOUT: %ptr.loc18: type = ptr_type %Self.ref.loc18_12 [concrete = constants.%ptr.e71] @@ -227,9 +247,9 @@ fn MemberNamedSelf.F(x: Self, y: r#Self) {} // CHECK:STDOUT: %p: ref %ptr.e71 = bind_name p, %p.var // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc18: = bound_method %p.var, constants.%T.as.Destroy.impl.Op.d98 // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn.1: = specific_function constants.%T.as.Destroy.impl.Op.d98, @T.as.Destroy.impl.Op(constants.%ptr.e71) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc18: = bound_method %p.var, %T.as.Destroy.impl.Op.specific_fn.1 +// CHECK:STDOUT: %bound_method.loc18_5: = bound_method %p.var, %T.as.Destroy.impl.Op.specific_fn.1 // CHECK:STDOUT: %addr.loc18: %ptr.0dd = addr_of %p.var -// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc18: init %empty_tuple.type = call %bound_method.loc18(%addr.loc18) +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc18: init %empty_tuple.type = call %bound_method.loc18_5(%addr.loc18) // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc17: = bound_method %Self.var, constants.%T.as.Destroy.impl.Op.d98 // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn.2: = specific_function constants.%T.as.Destroy.impl.Op.d98, @T.as.Destroy.impl.Op(constants.%ptr.e71) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc17: = bound_method %Self.var, %T.as.Destroy.impl.Op.specific_fn.2 diff --git a/toolchain/check/testdata/class/reorder.carbon b/toolchain/check/testdata/class/reorder.carbon index aa92679a01c2..ffdfb82b2f21 100644 --- a/toolchain/check/testdata/class/reorder.carbon +++ b/toolchain/check/testdata/class/reorder.carbon @@ -74,7 +74,7 @@ class Class { // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/reorder_qualified.carbon b/toolchain/check/testdata/class/reorder_qualified.carbon index 06d5831b2e73..c00c1eab9d76 100644 --- a/toolchain/check/testdata/class/reorder_qualified.carbon +++ b/toolchain/check/testdata/class/reorder_qualified.carbon @@ -160,7 +160,7 @@ class A { // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/scope.carbon b/toolchain/check/testdata/class/scope.carbon index dc2eb173f6f3..7d158f4f42e1 100644 --- a/toolchain/check/testdata/class/scope.carbon +++ b/toolchain/check/testdata/class/scope.carbon @@ -96,7 +96,7 @@ fn Run() { // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/self_conversion.carbon b/toolchain/check/testdata/class/self_conversion.carbon index 9eb0ca3d8f77..6280b4d14c97 100644 --- a/toolchain/check/testdata/class/self_conversion.carbon +++ b/toolchain/check/testdata/class/self_conversion.carbon @@ -102,7 +102,7 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/self_type.carbon b/toolchain/check/testdata/class/self_type.carbon index 1adfe0acf633..14feadbae7e9 100644 --- a/toolchain/check/testdata/class/self_type.carbon +++ b/toolchain/check/testdata/class/self_type.carbon @@ -50,17 +50,32 @@ fn Class.F[self: Self]() -> i32 { // CHECK:STDOUT: %Class.as.Destroy.impl.Op: %Class.as.Destroy.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: %struct_type.p: type = struct_type {.p: %ptr.e71} [concrete] // CHECK:STDOUT: %complete_type.56d: = complete_type_witness %struct_type.p [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.f23: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.8b3) [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.abf: %ptr.as.Copy.impl.Op.type.f23 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.771: = impl_witness imports.%Copy.impl_witness_table.a71, @ptr.as.Copy.impl(%Class) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.eef: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%Class) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.cd0: %ptr.as.Copy.impl.Op.type.eef = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.054: %Copy.type = facet_value %ptr.e71, (%Copy.impl_witness.771) [concrete] +// CHECK:STDOUT: %.96e: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.054 [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.cd0, @ptr.as.Copy.impl.Op(%Class) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .Destroy = %Core.Destroy +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.de9: @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op.type (%ptr.as.Copy.impl.Op.type.f23) = import_ref Core//prelude/parts/copy, loc32_31, loaded [symbolic = @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op (constants.%ptr.as.Copy.impl.Op.abf)] +// CHECK:STDOUT: %Copy.impl_witness_table.a71 = impl_witness_table (%Core.import_ref.de9), @ptr.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -170,8 +185,13 @@ fn Class.F[self: Self]() -> i32 { // CHECK:STDOUT: %s.ref.loc19_16: ref %Class = name_ref s, %s // CHECK:STDOUT: %addr: %ptr.e71 = addr_of %s.ref.loc19_16 // CHECK:STDOUT: %.loc19_17.1: %struct_type.p = struct_literal (%addr) +// CHECK:STDOUT: %impl.elem0: %.96e = impl_witness_access constants.%Copy.impl_witness.771, element0 [concrete = constants.%ptr.as.Copy.impl.Op.cd0] +// CHECK:STDOUT: %bound_method.loc19_15.1: = bound_method %addr, %impl.elem0 +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @ptr.as.Copy.impl.Op(constants.%Class) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc19_15.2: = bound_method %addr, %specific_fn +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.e71 = call %bound_method.loc19_15.2(%addr) // CHECK:STDOUT: %.loc19_17.2: ref %ptr.e71 = class_element_access %s.ref.loc19_5, element0 -// CHECK:STDOUT: %.loc19_17.3: init %ptr.e71 = initialize_from %addr to %.loc19_17.2 +// CHECK:STDOUT: %.loc19_17.3: init %ptr.e71 = initialize_from %ptr.as.Copy.impl.Op.call to %.loc19_17.2 // CHECK:STDOUT: %.loc19_17.4: init %Class = class_init (%.loc19_17.3), %s.ref.loc19_5 // CHECK:STDOUT: %.loc19_7: init %Class = converted %.loc19_17.1, %.loc19_17.4 // CHECK:STDOUT: assign %s.ref.loc19_5, %.loc19_7 diff --git a/toolchain/check/testdata/class/syntactic_merge_literal.carbon b/toolchain/check/testdata/class/syntactic_merge_literal.carbon index 3bd3098d2a71..b80b2bec790b 100644 --- a/toolchain/check/testdata/class/syntactic_merge_literal.carbon +++ b/toolchain/check/testdata/class/syntactic_merge_literal.carbon @@ -99,7 +99,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -380,7 +380,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/virtual_modifiers.carbon b/toolchain/check/testdata/class/virtual_modifiers.carbon index 0dd14f3f90ab..54cc4b098547 100644 --- a/toolchain/check/testdata/class/virtual_modifiers.carbon +++ b/toolchain/check/testdata/class/virtual_modifiers.carbon @@ -1629,6 +1629,7 @@ class T2(G2:! type) { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %Base.elem: type = unbound_element_type %Base, %i32 [concrete] // CHECK:STDOUT: %pattern_type.bcc: type = pattern_type %Base [concrete] @@ -1667,6 +1668,16 @@ class T2(G2:! type) { // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %struct_type.m2.m1.68c: type = struct_type {.m2: %i32, .m1: %i32} [concrete] // CHECK:STDOUT: %Base.vtable_ptr: ref %ptr.454 = vtable_ptr @Base.vtable [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %int_5.64b: Core.IntLiteral = int_value 5 [concrete] // CHECK:STDOUT: %struct_type.m2.m1.5f2: type = struct_type {.m2: Core.IntLiteral, .m1: Core.IntLiteral} [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.6c8: = bound_method %int_5.64b, %Core.IntLiteral.as.ImplicitAs.impl.Convert.592 [concrete] @@ -1688,14 +1699,18 @@ class T2(G2:! type) { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1796,11 +1811,21 @@ class T2(G2:! type) { // CHECK:STDOUT: %Base.vtable_ptr.loc13: ref %ptr.454 = vtable_ptr @Base.vtable [concrete = constants.%Base.vtable_ptr] // CHECK:STDOUT: %.loc13_35.3: init %ptr.454 = initialize_from %Base.vtable_ptr.loc13 to %.loc13_35.2 [concrete = constants.%Base.vtable_ptr] // CHECK:STDOUT: %.loc13_34: %i32 = bind_value %i.ref.loc13_34 +// CHECK:STDOUT: %impl.elem0.loc13_34: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc13_34.1: = bound_method %.loc13_34, %impl.elem0.loc13_34 +// CHECK:STDOUT: %specific_fn.loc13_34: = specific_function %impl.elem0.loc13_34, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_34.2: = bound_method %.loc13_34, %specific_fn.loc13_34 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc13_34: init %i32 = call %bound_method.loc13_34.2(%.loc13_34) // CHECK:STDOUT: %.loc13_35.4: ref %i32 = class_element_access %b1.var, element2 -// CHECK:STDOUT: %.loc13_35.5: init %i32 = initialize_from %.loc13_34 to %.loc13_35.4 +// CHECK:STDOUT: %.loc13_35.5: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc13_34 to %.loc13_35.4 // CHECK:STDOUT: %.loc13_25: %i32 = bind_value %i.ref.loc13_25 +// CHECK:STDOUT: %impl.elem0.loc13_25: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc13_25.1: = bound_method %.loc13_25, %impl.elem0.loc13_25 +// CHECK:STDOUT: %specific_fn.loc13_25: = specific_function %impl.elem0.loc13_25, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_25.2: = bound_method %.loc13_25, %specific_fn.loc13_25 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc13_25: init %i32 = call %bound_method.loc13_25.2(%.loc13_25) // CHECK:STDOUT: %.loc13_35.6: ref %i32 = class_element_access %b1.var, element1 -// CHECK:STDOUT: %.loc13_35.7: init %i32 = initialize_from %.loc13_25 to %.loc13_35.6 +// CHECK:STDOUT: %.loc13_35.7: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc13_25 to %.loc13_35.6 // CHECK:STDOUT: %.loc13_35.8: init %Base = class_init (%.loc13_35.3, %.loc13_35.5, %.loc13_35.7), %b1.var // CHECK:STDOUT: %.loc13_3: init %Base = converted %.loc13_35.1, %.loc13_35.8 // CHECK:STDOUT: assign %b1.var, %.loc13_3 diff --git a/toolchain/check/testdata/const/import.carbon b/toolchain/check/testdata/const/import.carbon index fe8a9041b067..8daf72e878d2 100644 --- a/toolchain/check/testdata/const/import.carbon +++ b/toolchain/check/testdata/const/import.carbon @@ -2,7 +2,7 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/none.carbon +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/convert.carbon // // AUTOUPDATE // TIP: To test this file alone, run: @@ -34,23 +34,38 @@ var a_ptr: const C* = a_ptr_ref; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.782: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.8b3) [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.58c: %ptr.as.Copy.impl.Op.type.782 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] // CHECK:STDOUT: %const: type = const_type %C [concrete] -// CHECK:STDOUT: %ptr: type = ptr_type %const [concrete] -// CHECK:STDOUT: %pattern_type.c0d: type = pattern_type %ptr [concrete] +// CHECK:STDOUT: %ptr.801: type = ptr_type %const [concrete] +// CHECK:STDOUT: %pattern_type.c0d: type = pattern_type %ptr.801 [concrete] // CHECK:STDOUT: %pattern_type.6af: type = pattern_type %const [concrete] -// CHECK:STDOUT: %addr: %ptr = addr_of imports.%a_ref.var [concrete] +// CHECK:STDOUT: %addr: %ptr.801 = addr_of imports.%a_ref.var [concrete] +// CHECK:STDOUT: %Copy.impl_witness.141: = impl_witness imports.%Copy.impl_witness_table.3e8, @ptr.as.Copy.impl(%const) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.e40: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%const) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.b8d: %ptr.as.Copy.impl.Op.type.e40 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.141: %Copy.type = facet_value %ptr.801, (%Copy.impl_witness.141) [concrete] +// CHECK:STDOUT: %.3c7: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.141 [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.bound: = bound_method %addr, %ptr.as.Copy.impl.Op.b8d [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.b8d, @ptr.as.Copy.impl.Op(%const) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %addr, %ptr.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Main.C: type = import_ref Main//implicit, C, loaded [concrete = constants.%C] // CHECK:STDOUT: %Main.a_ref: ref %const = import_ref Main//implicit, a_ref, loaded [concrete = %a_ref.var] -// CHECK:STDOUT: %Main.a_ptr_ref: ref %ptr = import_ref Main//implicit, a_ptr_ref, loaded [concrete = %a_ptr_ref.var] +// CHECK:STDOUT: %Main.a_ptr_ref: ref %ptr.801 = import_ref Main//implicit, a_ptr_ref, loaded [concrete = %a_ptr_ref.var] +// CHECK:STDOUT: %Main.import_ref.e04: @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op.type (%ptr.as.Copy.impl.Op.type.782) = import_ref Main//implicit, inst148 [indirect], loaded [symbolic = @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op (constants.%ptr.as.Copy.impl.Op.58c)] +// CHECK:STDOUT: %Copy.impl_witness_table.3e8 = impl_witness_table (%Main.import_ref.e04), @ptr.as.Copy.impl [concrete] // CHECK:STDOUT: %a_ref.patt: %pattern_type.6af = binding_pattern a_ref [concrete] // CHECK:STDOUT: %a_ref.var_patt: %pattern_type.6af = var_pattern %a_ref.patt [concrete] // CHECK:STDOUT: %a_ref.var: ref %const = var %a_ref.var_patt [concrete] // CHECK:STDOUT: %a_ptr_ref.patt: %pattern_type.c0d = binding_pattern a_ptr_ref [concrete] // CHECK:STDOUT: %a_ptr_ref.var_patt: %pattern_type.c0d = var_pattern %a_ptr_ref.patt [concrete] -// CHECK:STDOUT: %a_ptr_ref.var: ref %ptr = var %a_ptr_ref.var_patt [concrete] +// CHECK:STDOUT: %a_ptr_ref.var: ref %ptr.801 = var %a_ptr_ref.var_patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -58,34 +73,44 @@ var a_ptr: const C* = a_ptr_ref; // CHECK:STDOUT: %a.patt: %pattern_type.c0d = binding_pattern a [concrete] // CHECK:STDOUT: %a.var_patt: %pattern_type.c0d = var_pattern %a.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %a.var: ref %ptr = var %a.var_patt [concrete] -// CHECK:STDOUT: %.loc6: type = splice_block %ptr.loc6 [concrete = constants.%ptr] { +// CHECK:STDOUT: %a.var: ref %ptr.801 = var %a.var_patt [concrete] +// CHECK:STDOUT: %.loc6: type = splice_block %ptr.loc6 [concrete = constants.%ptr.801] { // CHECK:STDOUT: %C.ref.loc6: type = name_ref C, imports.%Main.C [concrete = constants.%C] // CHECK:STDOUT: %const.loc6: type = const_type %C.ref.loc6 [concrete = constants.%const] -// CHECK:STDOUT: %ptr.loc6: type = ptr_type %const.loc6 [concrete = constants.%ptr] +// CHECK:STDOUT: %ptr.loc6: type = ptr_type %const.loc6 [concrete = constants.%ptr.801] // CHECK:STDOUT: } -// CHECK:STDOUT: %a: ref %ptr = bind_name a, %a.var [concrete = %a.var] +// CHECK:STDOUT: %a: ref %ptr.801 = bind_name a, %a.var [concrete = %a.var] // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %a_ptr.patt: %pattern_type.c0d = binding_pattern a_ptr [concrete] // CHECK:STDOUT: %a_ptr.var_patt: %pattern_type.c0d = var_pattern %a_ptr.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %a_ptr.var: ref %ptr = var %a_ptr.var_patt [concrete] -// CHECK:STDOUT: %.loc7: type = splice_block %ptr.loc7 [concrete = constants.%ptr] { +// CHECK:STDOUT: %a_ptr.var: ref %ptr.801 = var %a_ptr.var_patt [concrete] +// CHECK:STDOUT: %.loc7: type = splice_block %ptr.loc7 [concrete = constants.%ptr.801] { // CHECK:STDOUT: %C.ref.loc7: type = name_ref C, imports.%Main.C [concrete = constants.%C] // CHECK:STDOUT: %const.loc7: type = const_type %C.ref.loc7 [concrete = constants.%const] -// CHECK:STDOUT: %ptr.loc7: type = ptr_type %const.loc7 [concrete = constants.%ptr] +// CHECK:STDOUT: %ptr.loc7: type = ptr_type %const.loc7 [concrete = constants.%ptr.801] // CHECK:STDOUT: } -// CHECK:STDOUT: %a_ptr: ref %ptr = bind_name a_ptr, %a_ptr.var [concrete = %a_ptr.var] +// CHECK:STDOUT: %a_ptr: ref %ptr.801 = bind_name a_ptr, %a_ptr.var [concrete = %a_ptr.var] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a_ref.ref: ref %const = name_ref a_ref, imports.%Main.a_ref [concrete = imports.%a_ref.var] -// CHECK:STDOUT: %addr: %ptr = addr_of %a_ref.ref [concrete = constants.%addr] -// CHECK:STDOUT: assign file.%a.var, %addr -// CHECK:STDOUT: %a_ptr_ref.ref: ref %ptr = name_ref a_ptr_ref, imports.%Main.a_ptr_ref [concrete = imports.%a_ptr_ref.var] -// CHECK:STDOUT: %.loc7: %ptr = bind_value %a_ptr_ref.ref -// CHECK:STDOUT: assign file.%a_ptr.var, %.loc7 +// CHECK:STDOUT: %addr: %ptr.801 = addr_of %a_ref.ref [concrete = constants.%addr] +// CHECK:STDOUT: %impl.elem0.loc6: %.3c7 = impl_witness_access constants.%Copy.impl_witness.141, element0 [concrete = constants.%ptr.as.Copy.impl.Op.b8d] +// CHECK:STDOUT: %bound_method.loc6_19.1: = bound_method %addr, %impl.elem0.loc6 [concrete = constants.%ptr.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %specific_fn.loc6: = specific_function %impl.elem0.loc6, @ptr.as.Copy.impl.Op(constants.%const) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_19.2: = bound_method %addr, %specific_fn.loc6 [concrete = constants.%bound_method] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc6: init %ptr.801 = call %bound_method.loc6_19.2(%addr) [concrete = constants.%addr] +// CHECK:STDOUT: assign file.%a.var, %ptr.as.Copy.impl.Op.call.loc6 +// CHECK:STDOUT: %a_ptr_ref.ref: ref %ptr.801 = name_ref a_ptr_ref, imports.%Main.a_ptr_ref [concrete = imports.%a_ptr_ref.var] +// CHECK:STDOUT: %.loc7: %ptr.801 = bind_value %a_ptr_ref.ref +// CHECK:STDOUT: %impl.elem0.loc7: %.3c7 = impl_witness_access constants.%Copy.impl_witness.141, element0 [concrete = constants.%ptr.as.Copy.impl.Op.b8d] +// CHECK:STDOUT: %bound_method.loc7_23.1: = bound_method %.loc7, %impl.elem0.loc7 +// CHECK:STDOUT: %specific_fn.loc7: = specific_function %impl.elem0.loc7, @ptr.as.Copy.impl.Op(constants.%const) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc7_23.2: = bound_method %.loc7, %specific_fn.loc7 +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc7: init %ptr.801 = call %bound_method.loc7_23.2(%.loc7) +// CHECK:STDOUT: assign file.%a_ptr.var, %ptr.as.Copy.impl.Op.call.loc7 // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/deduce/array.carbon b/toolchain/check/testdata/deduce/array.carbon index 3f1f6c23f1f6..64ee1ca40103 100644 --- a/toolchain/check/testdata/deduce/array.carbon +++ b/toolchain/check/testdata/deduce/array.carbon @@ -201,7 +201,7 @@ fn G() -> i32 { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -449,7 +449,7 @@ fn G() -> i32 { // CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/parts/int_literal, IntLiteral, loaded [concrete = constants.%IntLiteral] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -900,7 +900,7 @@ fn G() -> i32 { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1156,7 +1156,7 @@ fn G() -> i32 { // CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/parts/int_literal, IntLiteral, loaded [concrete = constants.%IntLiteral] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1431,7 +1431,7 @@ fn G() -> i32 { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.02e: @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert.type (%Int.as.ImplicitAs.impl.Convert.type.eb9) = import_ref Core//prelude/parts/int, loc20_44, loaded [symbolic = @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert (constants.%Int.as.ImplicitAs.impl.Convert.958)] +// CHECK:STDOUT: %Core.import_ref.02e: @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert.type (%Int.as.ImplicitAs.impl.Convert.type.eb9) = import_ref Core//prelude/parts/int, loc27_44, loaded [symbolic = @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert (constants.%Int.as.ImplicitAs.impl.Convert.958)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.13c = impl_witness_table (%Core.import_ref.02e), @Int.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/deduce/generic_type.carbon b/toolchain/check/testdata/deduce/generic_type.carbon index 870334f2f38d..90b21654d508 100644 --- a/toolchain/check/testdata/deduce/generic_type.carbon +++ b/toolchain/check/testdata/deduce/generic_type.carbon @@ -1141,7 +1141,7 @@ fn G() -> i32 { // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/deduce/tuple.carbon b/toolchain/check/testdata/deduce/tuple.carbon index 8937018079b8..56b7606cc443 100644 --- a/toolchain/check/testdata/deduce/tuple.carbon +++ b/toolchain/check/testdata/deduce/tuple.carbon @@ -358,7 +358,7 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/deduce/value_with_type_through_access.carbon b/toolchain/check/testdata/deduce/value_with_type_through_access.carbon index 63458b175d24..6c1d8d2690f6 100644 --- a/toolchain/check/testdata/deduce/value_with_type_through_access.carbon +++ b/toolchain/check/testdata/deduce/value_with_type_through_access.carbon @@ -768,6 +768,14 @@ fn G() { // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %c: %Class = bind_symbolic_name c, 0 [symbolic] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Copy.impl_witness.fde: = impl_witness imports.%Copy.impl_witness_table.095 [concrete] +// CHECK:STDOUT: %Copy.facet.0af: %Copy.type = facet_value type, (%Copy.impl_witness.fde) [concrete] +// CHECK:STDOUT: %.130: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.0af [concrete] +// CHECK:STDOUT: %type.as.Copy.impl.Op.type: type = fn_type @type.as.Copy.impl.Op [concrete] +// CHECK:STDOUT: %type.as.Copy.impl.Op: %type.as.Copy.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %type.as.Copy.impl.Op.bound: = bound_method %C, %type.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %Class.val: %Class = struct_value (%C) [concrete] // CHECK:STDOUT: %HoldsType.f95cf2.2: type = class_type @HoldsType, @HoldsType(%c) [symbolic] // CHECK:STDOUT: %HoldsType.val: %HoldsType.f95cf2.2 = struct_value () [symbolic] @@ -784,10 +792,14 @@ fn G() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Destroy = %Core.Destroy +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.7bd: %type.as.Copy.impl.Op.type = import_ref Core//prelude/parts/copy, loc36_31, loaded [concrete = constants.%type.as.Copy.impl.Op] +// CHECK:STDOUT: %Copy.impl_witness_table.095 = impl_witness_table (%Core.import_ref.7bd), @type.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -985,9 +997,12 @@ fn G() { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %.loc26_26.1: %struct_type.t = struct_literal (%C.ref) // CHECK:STDOUT: %Class.ref.loc26_31: type = name_ref Class, file.%Class.decl [concrete = constants.%Class] +// CHECK:STDOUT: %impl.elem0.loc26: %.130 = impl_witness_access constants.%Copy.impl_witness.fde, element0 [concrete = constants.%type.as.Copy.impl.Op] +// CHECK:STDOUT: %bound_method.loc26: = bound_method %C.ref, %impl.elem0.loc26 [concrete = constants.%type.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %type.as.Copy.impl.Op.call: init type = call %bound_method.loc26(%C.ref) [concrete = constants.%C] // CHECK:STDOUT: %.loc26_26.2: ref %Class = temporary_storage // CHECK:STDOUT: %.loc26_26.3: ref type = class_element_access %.loc26_26.2, element0 -// CHECK:STDOUT: %.loc26_26.4: init type = initialize_from %C.ref to %.loc26_26.3 [concrete = constants.%C] +// CHECK:STDOUT: %.loc26_26.4: init type = initialize_from %type.as.Copy.impl.Op.call to %.loc26_26.3 [concrete = constants.%C] // CHECK:STDOUT: %.loc26_26.5: init %Class = class_init (%.loc26_26.4), %.loc26_26.2 [concrete = constants.%Class.val] // CHECK:STDOUT: %.loc26_26.6: ref %Class = temporary %.loc26_26.2, %.loc26_26.5 // CHECK:STDOUT: %.loc26_28.1: ref %Class = converted %.loc26_26.1, %.loc26_26.6 @@ -1007,9 +1022,9 @@ fn G() { // CHECK:STDOUT: %.loc27_6.4: ref %HoldsType.f95cf2.2 = temporary %.loc27_6.2, %.loc27_6.3 // CHECK:STDOUT: %.loc27_8: ref %HoldsType.f95cf2.2 = converted %.loc27_6.1, %.loc27_6.4 // CHECK:STDOUT: %.loc27_26: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %impl.elem0: %.dca = impl_witness_access constants.%Destroy.impl_witness.a479d7.2, element0 [symbolic = constants.%HoldsType.as.Destroy.impl.Op.2e9888.2] -// CHECK:STDOUT: %bound_method.loc27_6.1: = bound_method %.loc27_6.4, %impl.elem0 -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @HoldsType.as.Destroy.impl.Op(constants.%c) [symbolic = constants.%HoldsType.as.Destroy.impl.Op.specific_fn] +// CHECK:STDOUT: %impl.elem0.loc27: %.dca = impl_witness_access constants.%Destroy.impl_witness.a479d7.2, element0 [symbolic = constants.%HoldsType.as.Destroy.impl.Op.2e9888.2] +// CHECK:STDOUT: %bound_method.loc27_6.1: = bound_method %.loc27_6.4, %impl.elem0.loc27 +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc27, @HoldsType.as.Destroy.impl.Op(constants.%c) [symbolic = constants.%HoldsType.as.Destroy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc27_6.2: = bound_method %.loc27_6.4, %specific_fn // CHECK:STDOUT: %addr.loc27: %ptr.deb697.2 = addr_of %.loc27_6.4 // CHECK:STDOUT: %HoldsType.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc27_6.2(%addr.loc27) @@ -1124,7 +1139,15 @@ fn G() { // CHECK:STDOUT: %C.as.Destroy.impl.Op: %C.as.Destroy.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] -// CHECK:STDOUT: %tuple.type: type = tuple_type (type) [concrete] +// CHECK:STDOUT: %tuple.type.85c: type = tuple_type (type) [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Copy.impl_witness.fde: = impl_witness imports.%Copy.impl_witness_table.095 [concrete] +// CHECK:STDOUT: %Copy.facet.0af: %Copy.type = facet_value type, (%Copy.impl_witness.fde) [concrete] +// CHECK:STDOUT: %.130: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.0af [concrete] +// CHECK:STDOUT: %type.as.Copy.impl.Op.type: type = fn_type @type.as.Copy.impl.Op [concrete] +// CHECK:STDOUT: %type.as.Copy.impl.Op: %type.as.Copy.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %type.as.Copy.impl.Op.bound: = bound_method %C, %type.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%C) [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.type.2ec: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%array_type) [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.fb7: %T.as.Destroy.impl.Op.type.2ec = struct_value () [concrete] @@ -1136,14 +1159,18 @@ fn G() { // CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.7bd: %type.as.Copy.impl.Op.type = import_ref Core//prelude/parts/copy, loc36_31, loaded [concrete = constants.%type.as.Copy.impl.Op] +// CHECK:STDOUT: %Copy.impl_witness_table.095 = impl_witness_table (%Core.import_ref.7bd), @type.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1316,13 +1343,16 @@ fn G() { // CHECK:STDOUT: %.loc24_6: %empty_struct_type = struct_literal () // CHECK:STDOUT: %HoldsType.ref: %HoldsType.type = name_ref HoldsType, file.%HoldsType.decl [concrete = constants.%HoldsType.generic] // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %.loc24_25.1: %tuple.type = tuple_literal (%C.ref) +// CHECK:STDOUT: %.loc24_25.1: %tuple.type.85c = tuple_literal (%C.ref) // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] // CHECK:STDOUT: %array_type: type = array_type %int_1, type [concrete = constants.%array_type] +// CHECK:STDOUT: %impl.elem0: %.130 = impl_witness_access constants.%Copy.impl_witness.fde, element0 [concrete = constants.%type.as.Copy.impl.Op] +// CHECK:STDOUT: %bound_method.loc24_22: = bound_method %C.ref, %impl.elem0 [concrete = constants.%type.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %type.as.Copy.impl.Op.call: init type = call %bound_method.loc24_22(%C.ref) [concrete = constants.%C] // CHECK:STDOUT: %.loc24_25.2: ref %array_type = temporary_storage // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %.loc24_25.3: ref type = array_index %.loc24_25.2, %int_0 -// CHECK:STDOUT: %.loc24_25.4: init type = initialize_from %C.ref to %.loc24_25.3 [concrete = constants.%C] +// CHECK:STDOUT: %.loc24_25.4: init type = initialize_from %type.as.Copy.impl.Op.call to %.loc24_25.3 [concrete = constants.%C] // CHECK:STDOUT: %.loc24_25.5: init %array_type = array_init (%.loc24_25.4) to %.loc24_25.2 [concrete = constants.%array] // CHECK:STDOUT: %.loc24_27.1: init %array_type = converted %.loc24_25.1, %.loc24_25.5 [concrete = constants.%array] // CHECK:STDOUT: %.loc24_27.2: ref %array_type = temporary %.loc24_25.2, %.loc24_27.1 @@ -1330,9 +1360,9 @@ fn G() { // CHECK:STDOUT: %.loc24_48: %empty_struct_type = struct_literal () // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound: = bound_method %.loc24_27.2, constants.%T.as.Destroy.impl.Op.fb7 // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: = specific_function constants.%T.as.Destroy.impl.Op.fb7, @T.as.Destroy.impl.Op(constants.%array_type) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method: = bound_method %.loc24_27.2, %T.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %bound_method.loc24_27: = bound_method %.loc24_27.2, %T.as.Destroy.impl.Op.specific_fn // CHECK:STDOUT: %addr: %ptr.ea3 = addr_of %.loc24_27.2 -// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr) +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc24_27(%addr) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/eval/aggregates.carbon b/toolchain/check/testdata/eval/aggregates.carbon index 6b80d3609b4e..f31a5d45c2a2 100644 --- a/toolchain/check/testdata/eval/aggregates.carbon +++ b/toolchain/check/testdata/eval/aggregates.carbon @@ -57,6 +57,7 @@ fn G(N:! i32) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete] // CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [concrete] @@ -83,7 +84,21 @@ fn G(N:! i32) { // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %tuple.21c: %tuple.type.d07 = tuple_value (%int_1.5d2, %int_2.ef8) [concrete] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%tuple_copy.var, element0 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.bound.514: = bound_method %int_1.5d2, %Int.as.Copy.impl.Op.87e [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.7d6: = bound_method %int_1.5d2, %Int.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access file.%tuple_copy.var, element1 [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.bound.ec1: = bound_method %int_2.ef8, %Int.as.Copy.impl.Op.87e [concrete] +// CHECK:STDOUT: %bound_method.3b8: = bound_method %int_2.ef8, %Int.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %struct_type.a.b.c: type = struct_type {.a: %i32, .b: %i32, .c: %i32} [concrete] // CHECK:STDOUT: %pattern_type.8ae: type = pattern_type %struct_type.a.b.c [concrete] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete] @@ -96,6 +111,8 @@ fn G(N:! i32) { // CHECK:STDOUT: %.91e: ref %i32 = struct_access file.%struct_copy.var, element1 [concrete] // CHECK:STDOUT: %.657: ref %i32 = struct_access file.%struct_copy.var, element0 [concrete] // CHECK:STDOUT: %.8fb: ref %i32 = struct_access file.%struct_copy.var, element2 [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.bound.011: = bound_method %int_3.822, %Int.as.Copy.impl.Op.87e [concrete] +// CHECK:STDOUT: %bound_method.7d3: = bound_method %int_3.822, %Int.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %struct.cff: %struct_type.a.b.c = struct_value (%int_1.5d2, %int_2.ef8, %int_3.822) [concrete] // CHECK:STDOUT: %array_type: type = array_type %int_1.5b8, %i32 [concrete] // CHECK:STDOUT: %pattern_type.a98: type = pattern_type %array_type [concrete] @@ -115,8 +132,10 @@ fn G(N:! i32) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -203,11 +222,21 @@ fn G(N:! i32) { // CHECK:STDOUT: %tuple.loc4: %tuple.type.d07 = tuple_value (%.loc4_35.3, %.loc4_35.5) [concrete = constants.%tuple.21c] // CHECK:STDOUT: %.loc4_37.1: %tuple.type.d07 = converted %.loc4_35.1, %tuple.loc4 [concrete = constants.%tuple.21c] // CHECK:STDOUT: %tuple.elem0.loc4_37.1: %i32 = tuple_access %.loc4_37.1, element0 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc4_37.1: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc4_37.1: = bound_method %tuple.elem0.loc4_37.1, %impl.elem0.loc4_37.1 [concrete = constants.%Int.as.Copy.impl.Op.bound.514] +// CHECK:STDOUT: %specific_fn.loc4_37.1: = specific_function %impl.elem0.loc4_37.1, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc4_37.2: = bound_method %tuple.elem0.loc4_37.1, %specific_fn.loc4_37.1 [concrete = constants.%bound_method.7d6] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc4_37.1: init %i32 = call %bound_method.loc4_37.2(%tuple.elem0.loc4_37.1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %tuple.elem0.loc4_37.2: ref %i32 = tuple_access file.%tuple_copy.var, element0 [concrete = constants.%tuple.elem0] -// CHECK:STDOUT: %.loc4_37.2: init %i32 = initialize_from %tuple.elem0.loc4_37.1 to %tuple.elem0.loc4_37.2 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc4_37.2: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc4_37.1 to %tuple.elem0.loc4_37.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %tuple.elem1.loc4_37.1: %i32 = tuple_access %.loc4_37.1, element1 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc4_37.2: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc4_37.3: = bound_method %tuple.elem1.loc4_37.1, %impl.elem0.loc4_37.2 [concrete = constants.%Int.as.Copy.impl.Op.bound.ec1] +// CHECK:STDOUT: %specific_fn.loc4_37.2: = specific_function %impl.elem0.loc4_37.2, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc4_37.4: = bound_method %tuple.elem1.loc4_37.1, %specific_fn.loc4_37.2 [concrete = constants.%bound_method.3b8] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc4_37.2: init %i32 = call %bound_method.loc4_37.4(%tuple.elem1.loc4_37.1) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %tuple.elem1.loc4_37.2: ref %i32 = tuple_access file.%tuple_copy.var, element1 [concrete = constants.%tuple.elem1] -// CHECK:STDOUT: %.loc4_37.3: init %i32 = initialize_from %tuple.elem1.loc4_37.1 to %tuple.elem1.loc4_37.2 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc4_37.3: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc4_37.2 to %tuple.elem1.loc4_37.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc4_37.4: init %tuple.type.d07 = tuple_init (%.loc4_37.2, %.loc4_37.3) to file.%tuple_copy.var [concrete = constants.%tuple.21c] // CHECK:STDOUT: %.loc4_1: init %tuple.type.d07 = converted %.loc4_37.1, %.loc4_37.4 [concrete = constants.%tuple.21c] // CHECK:STDOUT: assign file.%tuple_copy.var, %.loc4_1 @@ -246,14 +275,29 @@ fn G(N:! i32) { // CHECK:STDOUT: %struct.loc6: %struct_type.b.a.c = struct_value (%.loc6_71.3, %.loc6_71.5, %.loc6_71.7) [concrete = constants.%struct.21d] // CHECK:STDOUT: %.loc6_73.1: %struct_type.b.a.c = converted %.loc6_71.1, %struct.loc6 [concrete = constants.%struct.21d] // CHECK:STDOUT: %.loc6_73.2: %i32 = struct_access %.loc6_73.1, element1 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc6_73.1: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc6_73.1: = bound_method %.loc6_73.2, %impl.elem0.loc6_73.1 [concrete = constants.%Int.as.Copy.impl.Op.bound.514] +// CHECK:STDOUT: %specific_fn.loc6_73.1: = specific_function %impl.elem0.loc6_73.1, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_73.2: = bound_method %.loc6_73.2, %specific_fn.loc6_73.1 [concrete = constants.%bound_method.7d6] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc6_73.1: init %i32 = call %bound_method.loc6_73.2(%.loc6_73.2) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc6_73.3: ref %i32 = struct_access file.%struct_copy.var, element1 [concrete = constants.%.91e] -// CHECK:STDOUT: %.loc6_73.4: init %i32 = initialize_from %.loc6_73.2 to %.loc6_73.3 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc6_73.4: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc6_73.1 to %.loc6_73.3 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc6_73.5: %i32 = struct_access %.loc6_73.1, element0 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc6_73.2: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc6_73.3: = bound_method %.loc6_73.5, %impl.elem0.loc6_73.2 [concrete = constants.%Int.as.Copy.impl.Op.bound.ec1] +// CHECK:STDOUT: %specific_fn.loc6_73.2: = specific_function %impl.elem0.loc6_73.2, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_73.4: = bound_method %.loc6_73.5, %specific_fn.loc6_73.2 [concrete = constants.%bound_method.3b8] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc6_73.2: init %i32 = call %bound_method.loc6_73.4(%.loc6_73.5) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc6_73.6: ref %i32 = struct_access file.%struct_copy.var, element0 [concrete = constants.%.657] -// CHECK:STDOUT: %.loc6_73.7: init %i32 = initialize_from %.loc6_73.5 to %.loc6_73.6 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc6_73.7: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc6_73.2 to %.loc6_73.6 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc6_73.8: %i32 = struct_access %.loc6_73.1, element2 [concrete = constants.%int_3.822] +// CHECK:STDOUT: %impl.elem0.loc6_73.3: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc6_73.5: = bound_method %.loc6_73.8, %impl.elem0.loc6_73.3 [concrete = constants.%Int.as.Copy.impl.Op.bound.011] +// CHECK:STDOUT: %specific_fn.loc6_73.3: = specific_function %impl.elem0.loc6_73.3, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_73.6: = bound_method %.loc6_73.8, %specific_fn.loc6_73.3 [concrete = constants.%bound_method.7d3] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc6_73.3: init %i32 = call %bound_method.loc6_73.6(%.loc6_73.8) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc6_73.9: ref %i32 = struct_access file.%struct_copy.var, element2 [concrete = constants.%.8fb] -// CHECK:STDOUT: %.loc6_73.10: init %i32 = initialize_from %.loc6_73.8 to %.loc6_73.9 [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc6_73.10: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc6_73.3 to %.loc6_73.9 [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc6_73.11: init %struct_type.a.b.c = struct_init (%.loc6_73.4, %.loc6_73.7, %.loc6_73.10) to file.%struct_copy.var [concrete = constants.%struct.cff] // CHECK:STDOUT: %.loc6_1: init %struct_type.a.b.c = converted %.loc6_73.1, %.loc6_73.11 [concrete = constants.%struct.cff] // CHECK:STDOUT: assign file.%struct_copy.var, %.loc6_1 @@ -359,7 +403,7 @@ fn G(N:! i32) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -520,7 +564,7 @@ fn G(N:! i32) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core.import_ref.02e: @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert.type (%Int.as.ImplicitAs.impl.Convert.type.eb9) = import_ref Core//prelude/parts/int, loc20_44, loaded [symbolic = @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert (constants.%Int.as.ImplicitAs.impl.Convert.958)] +// CHECK:STDOUT: %Core.import_ref.02e: @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert.type (%Int.as.ImplicitAs.impl.Convert.type.eb9) = import_ref Core//prelude/parts/int, loc27_44, loaded [symbolic = @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert (constants.%Int.as.ImplicitAs.impl.Convert.958)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.13c = impl_witness_table (%Core.import_ref.02e), @Int.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/facet/access.carbon b/toolchain/check/testdata/facet/access.carbon index 6364e12190ab..9006c257388e 100644 --- a/toolchain/check/testdata/facet/access.carbon +++ b/toolchain/check/testdata/facet/access.carbon @@ -603,7 +603,7 @@ fn G(AB:! A & B where .X = () and .Y = {}) -> AB.Y { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core.import_ref.a4f: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude, loc13_42, loaded [concrete = constants.%type.as.BitAndWith.impl.Op] +// CHECK:STDOUT: %Core.import_ref.a4f: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude, loc14_42, loaded [concrete = constants.%type.as.BitAndWith.impl.Op] // CHECK:STDOUT: %BitAndWith.impl_witness_table = impl_witness_table (%Core.import_ref.a4f), @type.as.BitAndWith.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/facet/call_combined_impl_witness.carbon b/toolchain/check/testdata/facet/call_combined_impl_witness.carbon index ea2402b1b474..9631bee2712c 100644 --- a/toolchain/check/testdata/facet/call_combined_impl_witness.carbon +++ b/toolchain/check/testdata/facet/call_combined_impl_witness.carbon @@ -133,7 +133,7 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.BitAndWith: %BitAndWith.type.f2e = import_ref Core//prelude, BitAndWith, loaded [concrete = constants.%BitAndWith.generic] -// CHECK:STDOUT: %Core.import_ref.a4f: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude, loc13_42, loaded [concrete = constants.%type.as.BitAndWith.impl.Op] +// CHECK:STDOUT: %Core.import_ref.a4f: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude, loc14_42, loaded [concrete = constants.%type.as.BitAndWith.impl.Op] // CHECK:STDOUT: %BitAndWith.impl_witness_table = impl_witness_table (%Core.import_ref.a4f), @type.as.BitAndWith.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/facet/convert_facet_value_to_narrowed_facet_type.carbon b/toolchain/check/testdata/facet/convert_facet_value_to_narrowed_facet_type.carbon index 05891de198b2..2deaa9954190 100644 --- a/toolchain/check/testdata/facet/convert_facet_value_to_narrowed_facet_type.carbon +++ b/toolchain/check/testdata/facet/convert_facet_value_to_narrowed_facet_type.carbon @@ -136,7 +136,7 @@ fn CallsWithTypeExplicit(U:! type) { // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.BitAndWith: %BitAndWith.type.f2e = import_ref Core//prelude, BitAndWith, loaded [concrete = constants.%BitAndWith.generic] -// CHECK:STDOUT: %Core.import_ref.a4f: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude, loc13_42, loaded [concrete = constants.%type.as.BitAndWith.impl.Op] +// CHECK:STDOUT: %Core.import_ref.a4f: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude, loc14_42, loaded [concrete = constants.%type.as.BitAndWith.impl.Op] // CHECK:STDOUT: %BitAndWith.impl_witness_table = impl_witness_table (%Core.import_ref.a4f), @type.as.BitAndWith.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -325,7 +325,7 @@ fn CallsWithTypeExplicit(U:! type) { // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.BitAndWith: %BitAndWith.type.f2e = import_ref Core//prelude, BitAndWith, loaded [concrete = constants.%BitAndWith.generic] -// CHECK:STDOUT: %Core.import_ref.a4f: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude, loc13_42, loaded [concrete = constants.%type.as.BitAndWith.impl.Op] +// CHECK:STDOUT: %Core.import_ref.a4f: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude, loc14_42, loaded [concrete = constants.%type.as.BitAndWith.impl.Op] // CHECK:STDOUT: %BitAndWith.impl_witness_table = impl_witness_table (%Core.import_ref.a4f), @type.as.BitAndWith.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -542,7 +542,7 @@ fn CallsWithTypeExplicit(U:! type) { // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.BitAndWith: %BitAndWith.type.f2e = import_ref Core//prelude, BitAndWith, loaded [concrete = constants.%BitAndWith.generic] -// CHECK:STDOUT: %Core.import_ref.a4f: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude, loc13_42, loaded [concrete = constants.%type.as.BitAndWith.impl.Op] +// CHECK:STDOUT: %Core.import_ref.a4f: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude, loc14_42, loaded [concrete = constants.%type.as.BitAndWith.impl.Op] // CHECK:STDOUT: %BitAndWith.impl_witness_table = impl_witness_table (%Core.import_ref.a4f), @type.as.BitAndWith.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/for/actual.carbon b/toolchain/check/testdata/for/actual.carbon index 98d632f7566f..b79489b60333 100644 --- a/toolchain/check/testdata/for/actual.carbon +++ b/toolchain/check/testdata/for/actual.carbon @@ -77,27 +77,33 @@ fn Read() { // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.d62 [symbolic_self] // CHECK:STDOUT: %Iterate.lookup_impl_witness.6c6: = lookup_impl_witness %.Self.d62, @Iterate [symbolic_self] // CHECK:STDOUT: %impl.elem1.b8a: type = impl_witness_access %Iterate.lookup_impl_witness.6c6, element1 [symbolic_self] -// CHECK:STDOUT: %assoc0.724: %Iterate.assoc_type = assoc_entity element0, imports.%Core.import_ref.4f9 [concrete] -// CHECK:STDOUT: %impl.elem0.70d: type = impl_witness_access %Iterate.lookup_impl_witness.6c6, element0 [symbolic_self] -// CHECK:STDOUT: %Iterate_where.type: type = facet_type <@Iterate where %impl.elem1.b8a = %Int.49d0e6.1 and %impl.elem0.70d = %Int.49d0e6.1> [symbolic] -// CHECK:STDOUT: %require_complete.f08: = require_complete_type %Iterate_where.type [symbolic] +// CHECK:STDOUT: %assoc0.3fa: %Iterate.assoc_type = assoc_entity element0, imports.%Core.import_ref.4da [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %impl.elem0.497: %Copy.type = impl_witness_access %Iterate.lookup_impl_witness.6c6, element0 [symbolic_self] +// CHECK:STDOUT: %T.578: %Copy.type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %require_complete.b4f426.1: = require_complete_type %Int.49d0e6.1 [symbolic] +// CHECK:STDOUT: %Copy.lookup_impl_witness.ccc: = lookup_impl_witness %Int.49d0e6.1, @Copy [symbolic] +// CHECK:STDOUT: %Copy.facet.7d5: %Copy.type = facet_value %Int.49d0e6.1, (%Copy.lookup_impl_witness.ccc) [symbolic] +// CHECK:STDOUT: %Iterate_where.type: type = facet_type <@Iterate where %impl.elem1.b8a = %Int.49d0e6.1 and %impl.elem0.497 = %Copy.facet.7d5> [symbolic] +// CHECK:STDOUT: %require_complete.7fc: = require_complete_type %Iterate_where.type [symbolic] // CHECK:STDOUT: %Optional.type: type = generic_class_type @Optional [concrete] // CHECK:STDOUT: %Optional.generic: %Optional.type = struct_value () [concrete] -// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] -// CHECK:STDOUT: %Optional.None.type.ef2: type = fn_type @Optional.None, @Optional(%T.8b3) [symbolic] -// CHECK:STDOUT: %Optional.None.fd6: %Optional.None.type.ef2 = struct_value () [symbolic] -// CHECK:STDOUT: %Optional.Some.type.b2c: type = fn_type @Optional.Some, @Optional(%T.8b3) [symbolic] -// CHECK:STDOUT: %Optional.Some.d0d: %Optional.Some.type.b2c = struct_value () [symbolic] +// CHECK:STDOUT: %Optional.None.type.391: type = fn_type @Optional.None, @Optional(%T.578) [symbolic] +// CHECK:STDOUT: %Optional.None.521: %Optional.None.type.391 = struct_value () [symbolic] +// CHECK:STDOUT: %Optional.Some.type.09c: type = fn_type @Optional.Some, @Optional(%T.578) [symbolic] +// CHECK:STDOUT: %Optional.Some.05a: %Optional.Some.type.09c = struct_value () [symbolic] // CHECK:STDOUT: %Iterate.impl_witness: = impl_witness @IntRange.%Iterate.impl_witness_table, @IntRange.as.Iterate.impl(%N) [symbolic] // CHECK:STDOUT: %IntRange.as.Iterate.impl.NewCursor.type: type = fn_type @IntRange.as.Iterate.impl.NewCursor, @IntRange.as.Iterate.impl(%N) [symbolic] // CHECK:STDOUT: %IntRange.as.Iterate.impl.NewCursor: %IntRange.as.Iterate.impl.NewCursor.type = struct_value () [symbolic] // CHECK:STDOUT: %ptr.784: type = ptr_type %Int.49d0e6.1 [symbolic] // CHECK:STDOUT: %pattern_type.4dc: type = pattern_type %ptr.784 [symbolic] -// CHECK:STDOUT: %Optional.708: type = class_type @Optional, @Optional(%Int.49d0e6.1) [symbolic] -// CHECK:STDOUT: %pattern_type.4b1: type = pattern_type %Optional.708 [symbolic] +// CHECK:STDOUT: %Optional.1ca: type = class_type @Optional, @Optional(%Copy.facet.7d5) [symbolic] +// CHECK:STDOUT: %pattern_type.a74: type = pattern_type %Optional.1ca [symbolic] // CHECK:STDOUT: %IntRange.as.Iterate.impl.Next.type: type = fn_type @IntRange.as.Iterate.impl.Next, @IntRange.as.Iterate.impl(%N) [symbolic] // CHECK:STDOUT: %IntRange.as.Iterate.impl.Next: %IntRange.as.Iterate.impl.Next.type = struct_value () [symbolic] -// CHECK:STDOUT: %require_complete.b4f426.1: = require_complete_type %Int.49d0e6.1 [symbolic] // CHECK:STDOUT: %IntRange.elem.e7c: type = unbound_element_type %IntRange.349, %Int.49d0e6.1 [symbolic] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] @@ -110,11 +116,14 @@ fn Read() { // CHECK:STDOUT: %struct_type.start.end.78d: type = struct_type {.start: %Int.49d0e6.1, .end: %Int.49d0e6.1} [symbolic] // CHECK:STDOUT: %complete_type.9d5: = complete_type_witness %struct_type.start.end.78d [symbolic] // CHECK:STDOUT: %require_complete.524: = require_complete_type %IntRange.349 [symbolic] -// CHECK:STDOUT: %Optional.None.type.73a: type = fn_type @Optional.None, @Optional(%Int.49d0e6.1) [symbolic] -// CHECK:STDOUT: %Optional.None.83e: %Optional.None.type.73a = struct_value () [symbolic] -// CHECK:STDOUT: %Optional.Some.type.185: type = fn_type @Optional.Some, @Optional(%Int.49d0e6.1) [symbolic] -// CHECK:STDOUT: %Optional.Some.58a: %Optional.Some.type.185 = struct_value () [symbolic] -// CHECK:STDOUT: %require_complete.b74: = require_complete_type %Optional.708 [symbolic] +// CHECK:STDOUT: %.ba0: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.7d5 [symbolic] +// CHECK:STDOUT: %impl.elem0.13c: %.ba0 = impl_witness_access %Copy.lookup_impl_witness.ccc, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.2ab: = specific_impl_function %impl.elem0.13c, @Copy.Op(%Copy.facet.7d5) [symbolic] +// CHECK:STDOUT: %Optional.None.type.f33: type = fn_type @Optional.None, @Optional(%Copy.facet.7d5) [symbolic] +// CHECK:STDOUT: %Optional.None.059: %Optional.None.type.f33 = struct_value () [symbolic] +// CHECK:STDOUT: %Optional.Some.type.91d: type = fn_type @Optional.Some, @Optional(%Copy.facet.7d5) [symbolic] +// CHECK:STDOUT: %Optional.Some.061: %Optional.Some.type.91d = struct_value () [symbolic] +// CHECK:STDOUT: %require_complete.81c: = require_complete_type %Optional.1ca [symbolic] // CHECK:STDOUT: %require_complete.0f5: = require_complete_type %ptr.784 [symbolic] // CHECK:STDOUT: %OrderedWith.type.270: type = generic_interface_type @OrderedWith [concrete] // CHECK:STDOUT: %OrderedWith.generic: %OrderedWith.type.270 = struct_value () [concrete] @@ -146,14 +155,14 @@ fn Read() { // CHECK:STDOUT: %.c05: type = fn_type_with_self_type %Inc.Op.type, %Inc.facet [symbolic] // CHECK:STDOUT: %impl.elem0.1ab: %.c05 = impl_witness_access %Inc.lookup_impl_witness, element0 [symbolic] // CHECK:STDOUT: %specific_impl_fn.8a8: = specific_impl_function %impl.elem0.1ab, @Inc.Op(%Inc.facet) [symbolic] -// CHECK:STDOUT: %Optional.Some.specific_fn: = specific_function %Optional.Some.58a, @Optional.Some(%Int.49d0e6.1) [symbolic] +// CHECK:STDOUT: %Optional.Some.specific_fn: = specific_function %Optional.Some.061, @Optional.Some(%Copy.facet.7d5) [symbolic] // CHECK:STDOUT: %Destroy.impl_witness.b15: = impl_witness imports.%Destroy.impl_witness_table.fea, @Int.as.Destroy.impl(%N) [symbolic] // CHECK:STDOUT: %Int.as.Destroy.impl.Op.type: type = fn_type @Int.as.Destroy.impl.Op, @Int.as.Destroy.impl(%N) [symbolic] // CHECK:STDOUT: %Int.as.Destroy.impl.Op: %Int.as.Destroy.impl.Op.type = struct_value () [symbolic] // CHECK:STDOUT: %Destroy.facet.80c: %Destroy.type = facet_value %Int.49d0e6.1, (%Destroy.impl_witness.b15) [symbolic] // CHECK:STDOUT: %.11a: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.80c [symbolic] // CHECK:STDOUT: %Int.as.Destroy.impl.Op.specific_fn: = specific_function %Int.as.Destroy.impl.Op, @Int.as.Destroy.impl.Op(%N) [symbolic] -// CHECK:STDOUT: %Optional.None.specific_fn: = specific_function %Optional.None.83e, @Optional.None(%Int.49d0e6.1) [symbolic] +// CHECK:STDOUT: %Optional.None.specific_fn: = specific_function %Optional.None.059, @Optional.None(%Copy.facet.7d5) [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] @@ -184,6 +193,12 @@ fn Read() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.592, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -193,6 +208,7 @@ fn Read() { // CHECK:STDOUT: .Iterate = %Core.Iterate // CHECK:STDOUT: .Optional = %Core.Optional // CHECK:STDOUT: .Destroy = %Core.Destroy +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: .OrderedWith = %Core.OrderedWith // CHECK:STDOUT: .Inc = %Core.Inc // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs @@ -202,30 +218,33 @@ fn Read() { // CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/types/int_literal, IntLiteral, loaded [concrete = constants.%IntLiteral] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Iterate: type = import_ref Core//prelude/iterate, Iterate, loaded [concrete = constants.%Iterate.type] -// CHECK:STDOUT: %Core.import_ref.1c9: %Iterate.assoc_type = import_ref Core//prelude/iterate, loc12_18, loaded [concrete = constants.%assoc0.724] -// CHECK:STDOUT: %Core.import_ref.ed6: %Iterate.assoc_type = import_ref Core//prelude/iterate, loc13_17, loaded [concrete = constants.%assoc1.02e] -// CHECK:STDOUT: %Core.import_ref.9e6: type = import_ref Core//prelude/iterate, loc13_17, loaded [concrete = %CursorType] +// CHECK:STDOUT: %Core.import_ref.8c4: %Iterate.assoc_type = import_ref Core//prelude/iterate, loc14_18, loaded [concrete = constants.%assoc0.3fa] +// CHECK:STDOUT: %Core.import_ref.ed6: %Iterate.assoc_type = import_ref Core//prelude/iterate, loc15_17, loaded [concrete = constants.%assoc1.02e] +// CHECK:STDOUT: %Core.import_ref.9e6: type = import_ref Core//prelude/iterate, loc15_17, loaded [concrete = %CursorType] // CHECK:STDOUT: %CursorType: type = assoc_const_decl @CursorType [concrete] {} -// CHECK:STDOUT: %Core.import_ref.4f9: type = import_ref Core//prelude/iterate, loc12_18, loaded [concrete = %ElementType] -// CHECK:STDOUT: %ElementType: type = assoc_const_decl @ElementType [concrete] {} -// CHECK:STDOUT: %Core.import_ref.f49: @Optional.%Optional.None.type (%Optional.None.type.ef2) = import_ref Core//prelude/iterate, inst137 [indirect], loaded [symbolic = @Optional.%Optional.None (constants.%Optional.None.fd6)] -// CHECK:STDOUT: %Core.import_ref.1a8: @Optional.%Optional.Some.type (%Optional.Some.type.b2c) = import_ref Core//prelude/iterate, inst138 [indirect], loaded [symbolic = @Optional.%Optional.Some (constants.%Optional.Some.d0d)] +// CHECK:STDOUT: %Core.import_ref.4da: %Copy.type = import_ref Core//prelude/iterate, loc14_18, loaded [concrete = %ElementType] +// CHECK:STDOUT: %ElementType: %Copy.type = assoc_const_decl @ElementType [concrete] {} +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/types/int, loc21_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.a52: @Optional.%Optional.None.type (%Optional.None.type.391) = import_ref Core//prelude/iterate, inst146 [indirect], loaded [symbolic = @Optional.%Optional.None (constants.%Optional.None.521)] +// CHECK:STDOUT: %Core.import_ref.57f: @Optional.%Optional.Some.type (%Optional.Some.type.09c) = import_ref Core//prelude/iterate, inst147 [indirect], loaded [symbolic = @Optional.%Optional.Some (constants.%Optional.Some.05a)] // CHECK:STDOUT: %Core.Optional: %Optional.type = import_ref Core//prelude/types/optional, Optional, loaded [concrete = constants.%Optional.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/destroy, Destroy, loaded [concrete = constants.%Destroy.type] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/copy, Copy, loaded [concrete = constants.%Copy.type] // CHECK:STDOUT: %Core.OrderedWith: %OrderedWith.type.270 = import_ref Core//prelude/operators/comparison, OrderedWith, loaded [concrete = constants.%OrderedWith.generic] // CHECK:STDOUT: %Core.import_ref.1cc: @OrderedWith.%OrderedWith.assoc_type (%OrderedWith.assoc_type.03c) = import_ref Core//prelude/operators/comparison, loc26_44, loaded [symbolic = @OrderedWith.%assoc0 (constants.%assoc0.3c6)] // CHECK:STDOUT: %Core.import_ref.910: @OrderedWith.%OrderedWith.Less.type (%OrderedWith.Less.type.f19) = import_ref Core//prelude/operators/comparison, loc26_44, loaded [symbolic = @OrderedWith.%OrderedWith.Less (constants.%OrderedWith.Less.02e)] // CHECK:STDOUT: %Core.import_ref.146ebd.1 = import_ref Core//prelude/operators/comparison, loc26_44, unloaded -// CHECK:STDOUT: %Core.import_ref.dea: @Int.as.OrderedWith.impl.c2d.%Int.as.OrderedWith.impl.Less.type (%Int.as.OrderedWith.impl.Less.type.998) = import_ref Core//prelude/types/int, loc52_46, loaded [symbolic = @Int.as.OrderedWith.impl.c2d.%Int.as.OrderedWith.impl.Less (constants.%Int.as.OrderedWith.impl.Less.807)] -// CHECK:STDOUT: %Core.import_ref.ce7 = import_ref Core//prelude/types/int, loc53_58, unloaded -// CHECK:STDOUT: %Core.import_ref.fbf = import_ref Core//prelude/types/int, loc54_49, unloaded -// CHECK:STDOUT: %Core.import_ref.0c6 = import_ref Core//prelude/types/int, loc55_61, unloaded +// CHECK:STDOUT: %Core.import_ref.dea: @Int.as.OrderedWith.impl.c2d.%Int.as.OrderedWith.impl.Less.type (%Int.as.OrderedWith.impl.Less.type.998) = import_ref Core//prelude/types/int, loc59_46, loaded [symbolic = @Int.as.OrderedWith.impl.c2d.%Int.as.OrderedWith.impl.Less (constants.%Int.as.OrderedWith.impl.Less.807)] +// CHECK:STDOUT: %Core.import_ref.ce7 = import_ref Core//prelude/types/int, loc60_58, unloaded +// CHECK:STDOUT: %Core.import_ref.fbf = import_ref Core//prelude/types/int, loc61_49, unloaded +// CHECK:STDOUT: %Core.import_ref.0c6 = import_ref Core//prelude/types/int, loc62_61, unloaded // CHECK:STDOUT: %OrderedWith.impl_witness_table.d42 = impl_witness_table (%Core.import_ref.dea, %Core.import_ref.ce7, %Core.import_ref.fbf, %Core.import_ref.0c6), @Int.as.OrderedWith.impl.c2d [concrete] // CHECK:STDOUT: %Core.Inc: type = import_ref Core//prelude/operators/arithmetic, Inc, loaded [concrete = constants.%Inc.type] -// CHECK:STDOUT: %Core.import_ref.16a: @Int.as.Destroy.impl.%Int.as.Destroy.impl.Op.type (%Int.as.Destroy.impl.Op.type) = import_ref Core//prelude/types/int, loc13_29, loaded [symbolic = @Int.as.Destroy.impl.%Int.as.Destroy.impl.Op (constants.%Int.as.Destroy.impl.Op)] +// CHECK:STDOUT: %Core.import_ref.16a: @Int.as.Destroy.impl.%Int.as.Destroy.impl.Op.type (%Int.as.Destroy.impl.Op.type) = import_ref Core//prelude/types/int, loc14_29, loaded [symbolic = @Int.as.Destroy.impl.%Int.as.Destroy.impl.Op (constants.%Int.as.Destroy.impl.Op)] // CHECK:STDOUT: %Destroy.impl_witness_table.fea = impl_witness_table (%Core.import_ref.16a), @Int.as.Destroy.impl [concrete] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/types/int, loc20_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/types/int, loc27_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -273,8 +292,10 @@ fn Read() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %IntRange: type = class_type @IntRange, @IntRange(%N) [symbolic = %IntRange (constants.%IntRange.349)] // CHECK:STDOUT: %Int.loc9_54.1: type = class_type @Int, @Int(%N) [symbolic = %Int.loc9_54.1 (constants.%Int.49d0e6.1)] -// CHECK:STDOUT: %Iterate_where.type: type = facet_type <@Iterate where constants.%impl.elem1.b8a = %Int.loc9_54.1 and constants.%impl.elem0.70d = %Int.loc9_54.1> [symbolic = %Iterate_where.type (constants.%Iterate_where.type)] -// CHECK:STDOUT: %require_complete: = require_complete_type %Iterate_where.type [symbolic = %require_complete (constants.%require_complete.f08)] +// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %Int.loc9_54.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.ccc)] +// CHECK:STDOUT: %Copy.facet.loc9_85.1: %Copy.type = facet_value %Int.loc9_54.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc9_85.1 (constants.%Copy.facet.7d5)] +// CHECK:STDOUT: %Iterate_where.type: type = facet_type <@Iterate where constants.%impl.elem1.b8a = %Int.loc9_54.1 and constants.%impl.elem0.497 = %Copy.facet.loc9_85.1> [symbolic = %Iterate_where.type (constants.%Iterate_where.type)] +// CHECK:STDOUT: %require_complete: = require_complete_type %Iterate_where.type [symbolic = %require_complete (constants.%require_complete.7fc)] // CHECK:STDOUT: %Iterate.impl_witness: = impl_witness @IntRange.%Iterate.impl_witness_table, @IntRange.as.Iterate.impl(%N) [symbolic = %Iterate.impl_witness (constants.%Iterate.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -308,8 +329,8 @@ fn Read() { // CHECK:STDOUT: %self.param_patt: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_13 (%pattern_type.dcd) = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: %cursor.patt: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_25 (%pattern_type.4dc) = binding_pattern cursor [concrete] // CHECK:STDOUT: %cursor.param_patt: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_25 (%pattern_type.4dc) = value_param_pattern %cursor.patt, call_param1 [concrete] -// CHECK:STDOUT: %return.patt: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_47 (%pattern_type.4b1) = return_slot_pattern [concrete] -// CHECK:STDOUT: %return.param_patt: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_47 (%pattern_type.4b1) = out_param_pattern %return.patt, call_param2 [concrete] +// CHECK:STDOUT: %return.patt: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_47 (%pattern_type.a74) = return_slot_pattern [concrete] +// CHECK:STDOUT: %return.param_patt: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_47 (%pattern_type.a74) = out_param_pattern %return.patt, call_param2 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %Core.ref.loc11_50: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %Optional.ref.loc11: %Optional.type = name_ref Optional, imports.%Core.Optional [concrete = constants.%Optional.generic] @@ -317,7 +338,9 @@ fn Read() { // CHECK:STDOUT: %Int.ref.loc11_68: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic] // CHECK:STDOUT: %N.ref.loc11_73: Core.IntLiteral = name_ref N, @IntRange.%N.loc4_16.2 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %Int.loc11_74: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc11_43.1 (constants.%Int.49d0e6.1)] -// CHECK:STDOUT: %Optional.loc11_75.2: type = class_type @Optional, @Optional(constants.%Int.49d0e6.1) [symbolic = %Optional.loc11_75.1 (constants.%Optional.708)] +// CHECK:STDOUT: %Copy.facet.loc11_75.2: %Copy.type = facet_value constants.%Int.49d0e6.1, (constants.%Copy.lookup_impl_witness.ccc) [symbolic = %Copy.facet.loc11_75.1 (constants.%Copy.facet.7d5)] +// CHECK:STDOUT: %.loc11_75: %Copy.type = converted %Int.loc11_74, %Copy.facet.loc11_75.2 [symbolic = %Copy.facet.loc11_75.1 (constants.%Copy.facet.7d5)] +// CHECK:STDOUT: %Optional.loc11_75.2: type = class_type @Optional, @Optional(constants.%Copy.facet.7d5) [symbolic = %Optional.loc11_75.1 (constants.%Optional.1ca)] // CHECK:STDOUT: %self.param: @IntRange.as.Iterate.impl.Next.%IntRange (%IntRange.349) = value_param call_param0 // CHECK:STDOUT: %.loc11_19.1: type = splice_block %Self.ref [symbolic = %IntRange (constants.%IntRange.349)] { // CHECK:STDOUT: %.loc11_19.2: type = specific_constant constants.%IntRange.349, @IntRange(constants.%N) [symbolic = %IntRange (constants.%IntRange.349)] @@ -333,8 +356,8 @@ fn Read() { // CHECK:STDOUT: %ptr.loc11_44.2: type = ptr_type %Int.loc11_43.2 [symbolic = %ptr.loc11_44.1 (constants.%ptr.784)] // CHECK:STDOUT: } // CHECK:STDOUT: %cursor: @IntRange.as.Iterate.impl.Next.%ptr.loc11_44.1 (%ptr.784) = bind_name cursor, %cursor.param -// CHECK:STDOUT: %return.param: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.708) = out_param call_param2 -// CHECK:STDOUT: %return: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.708) = return_slot %return.param +// CHECK:STDOUT: %return.param: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.1ca) = out_param call_param2 +// CHECK:STDOUT: %return: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.1ca) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -432,24 +455,26 @@ fn Read() { // CHECK:STDOUT: %N.ref.loc9_53: Core.IntLiteral = name_ref N, @IntRange.%N.loc4_16.2 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %Int.loc9_54.2: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc9_54.1 (constants.%Int.49d0e6.1)] // CHECK:STDOUT: %.Self.ref.loc9_60: %Iterate.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.d62] -// CHECK:STDOUT: %ElementType.ref: %Iterate.assoc_type = name_ref ElementType, imports.%Core.import_ref.1c9 [concrete = constants.%assoc0.724] +// CHECK:STDOUT: %ElementType.ref: %Iterate.assoc_type = name_ref ElementType, imports.%Core.import_ref.8c4 [concrete = constants.%assoc0.3fa] // CHECK:STDOUT: %.Self.as_type.loc9_60: type = facet_access_type %.Self.ref.loc9_60 [symbolic_self = constants.%.Self.as_type] // CHECK:STDOUT: %.loc9_60: type = converted %.Self.ref.loc9_60, %.Self.as_type.loc9_60 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%Iterate.lookup_impl_witness.6c6, element0 [symbolic_self = constants.%impl.elem0.70d] +// CHECK:STDOUT: %impl.elem0: %Copy.type = impl_witness_access constants.%Iterate.lookup_impl_witness.6c6, element0 [symbolic_self = constants.%impl.elem0.497] // CHECK:STDOUT: %Core.ref.loc9_75: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %Int.ref.loc9_79: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic] // CHECK:STDOUT: %N.ref.loc9_84: Core.IntLiteral = name_ref N, @IntRange.%N.loc4_16.2 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %Int.loc9_85: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc9_54.1 (constants.%Int.49d0e6.1)] +// CHECK:STDOUT: %Copy.facet.loc9_85.2: %Copy.type = facet_value constants.%Int.49d0e6.1, (constants.%Copy.lookup_impl_witness.ccc) [symbolic = %Copy.facet.loc9_85.1 (constants.%Copy.facet.7d5)] +// CHECK:STDOUT: %.loc9_85: %Copy.type = converted %Int.loc9_85, %Copy.facet.loc9_85.2 [symbolic = %Copy.facet.loc9_85.1 (constants.%Copy.facet.7d5)] // CHECK:STDOUT: %.loc9_24: type = where_expr %.Self [symbolic = %Iterate_where.type (constants.%Iterate_where.type)] { // CHECK:STDOUT: requirement_base_facet_type constants.%Iterate.type // CHECK:STDOUT: requirement_rewrite %impl.elem1, %Int.loc9_54.2 -// CHECK:STDOUT: requirement_rewrite %impl.elem0, %Int.loc9_85 +// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc9_85 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant.loc9_87.2, %impl_witness_assoc_constant.loc9_87.1, @IntRange.as.Iterate.impl.%IntRange.as.Iterate.impl.NewCursor.decl, @IntRange.as.Iterate.impl.%IntRange.as.Iterate.impl.Next.decl), @IntRange.as.Iterate.impl [concrete] // CHECK:STDOUT: %Iterate.impl_witness: = impl_witness %Iterate.impl_witness_table, @IntRange.as.Iterate.impl(constants.%N) [symbolic = @IntRange.as.Iterate.impl.%Iterate.impl_witness (constants.%Iterate.impl_witness)] // CHECK:STDOUT: %impl_witness_assoc_constant.loc9_87.1: type = impl_witness_assoc_constant constants.%Int.49d0e6.1 [symbolic = @IntRange.as.Iterate.impl.%Int.loc9_54.1 (constants.%Int.49d0e6.1)] -// CHECK:STDOUT: %impl_witness_assoc_constant.loc9_87.2: type = impl_witness_assoc_constant constants.%Int.49d0e6.1 [symbolic = @IntRange.as.Iterate.impl.%Int.loc9_54.1 (constants.%Int.49d0e6.1)] +// CHECK:STDOUT: %impl_witness_assoc_constant.loc9_87.2: %Copy.type = impl_witness_assoc_constant constants.%Copy.facet.7d5 [symbolic = @IntRange.as.Iterate.impl.%Copy.facet.loc9_85.1 (constants.%Copy.facet.7d5)] // CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %Int.ref.loc22: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic] // CHECK:STDOUT: %N.ref.loc22: Core.IntLiteral = name_ref N, %N.loc4_16.2 [symbolic = %N.loc4_16.1 (constants.%N)] @@ -487,16 +512,31 @@ fn Read() { // CHECK:STDOUT: %require_complete.loc5_49: = require_complete_type %IntRange [symbolic = %require_complete.loc5_49 (constants.%require_complete.524)] // CHECK:STDOUT: %require_complete.loc5_16: = require_complete_type %Int.loc5_28.1 [symbolic = %require_complete.loc5_16 (constants.%require_complete.b4f426.1)] // CHECK:STDOUT: %struct_type.start.end: type = struct_type {.start: @IntRange.Make.%Int.loc5_28.1 (%Int.49d0e6.1), .end: @IntRange.Make.%Int.loc5_28.1 (%Int.49d0e6.1)} [symbolic = %struct_type.start.end (constants.%struct_type.start.end.78d)] +// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %Int.loc5_28.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.ccc)] +// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %Int.loc5_28.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet.7d5)] +// CHECK:STDOUT: %.loc6_22.2: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc6_22.2 (constants.%.ba0)] +// CHECK:STDOUT: %impl.elem0.loc6_22.2: @IntRange.Make.%.loc6_22.2 (%.ba0) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc6_22.2 (constants.%impl.elem0.13c)] +// CHECK:STDOUT: %specific_impl_fn.loc6_22.2: = specific_impl_function %impl.elem0.loc6_22.2, @Copy.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc6_22.2 (constants.%specific_impl_fn.2ab)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%start.param: @IntRange.Make.%Int.loc5_28.1 (%Int.49d0e6.1), %end.param: @IntRange.Make.%Int.loc5_28.1 (%Int.49d0e6.1)) -> %return.param: @IntRange.Make.%IntRange (%IntRange.349) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %start.ref: @IntRange.Make.%Int.loc5_28.1 (%Int.49d0e6.1) = name_ref start, %start // CHECK:STDOUT: %end.ref: @IntRange.Make.%Int.loc5_28.1 (%Int.49d0e6.1) = name_ref end, %end // CHECK:STDOUT: %.loc6_39.1: @IntRange.Make.%struct_type.start.end (%struct_type.start.end.78d) = struct_literal (%start.ref, %end.ref) +// CHECK:STDOUT: %impl.elem0.loc6_22.1: @IntRange.Make.%.loc6_22.2 (%.ba0) = impl_witness_access constants.%Copy.lookup_impl_witness.ccc, element0 [symbolic = %impl.elem0.loc6_22.2 (constants.%impl.elem0.13c)] +// CHECK:STDOUT: %bound_method.loc6_22.1: = bound_method %start.ref, %impl.elem0.loc6_22.1 +// CHECK:STDOUT: %specific_impl_fn.loc6_22.1: = specific_impl_function %impl.elem0.loc6_22.1, @Copy.Op(constants.%Copy.facet.7d5) [symbolic = %specific_impl_fn.loc6_22.2 (constants.%specific_impl_fn.2ab)] +// CHECK:STDOUT: %bound_method.loc6_22.2: = bound_method %start.ref, %specific_impl_fn.loc6_22.1 +// CHECK:STDOUT: %.loc6_22.1: init @IntRange.Make.%Int.loc5_28.1 (%Int.49d0e6.1) = call %bound_method.loc6_22.2(%start.ref) // CHECK:STDOUT: %.loc6_39.2: ref @IntRange.Make.%Int.loc5_28.1 (%Int.49d0e6.1) = class_element_access %return, element0 -// CHECK:STDOUT: %.loc6_39.3: init @IntRange.Make.%Int.loc5_28.1 (%Int.49d0e6.1) = initialize_from %start.ref to %.loc6_39.2 +// CHECK:STDOUT: %.loc6_39.3: init @IntRange.Make.%Int.loc5_28.1 (%Int.49d0e6.1) = initialize_from %.loc6_22.1 to %.loc6_39.2 +// CHECK:STDOUT: %impl.elem0.loc6_36: @IntRange.Make.%.loc6_22.2 (%.ba0) = impl_witness_access constants.%Copy.lookup_impl_witness.ccc, element0 [symbolic = %impl.elem0.loc6_22.2 (constants.%impl.elem0.13c)] +// CHECK:STDOUT: %bound_method.loc6_36.1: = bound_method %end.ref, %impl.elem0.loc6_36 +// CHECK:STDOUT: %specific_impl_fn.loc6_36: = specific_impl_function %impl.elem0.loc6_36, @Copy.Op(constants.%Copy.facet.7d5) [symbolic = %specific_impl_fn.loc6_22.2 (constants.%specific_impl_fn.2ab)] +// CHECK:STDOUT: %bound_method.loc6_36.2: = bound_method %end.ref, %specific_impl_fn.loc6_36 +// CHECK:STDOUT: %.loc6_36: init @IntRange.Make.%Int.loc5_28.1 (%Int.49d0e6.1) = call %bound_method.loc6_36.2(%end.ref) // CHECK:STDOUT: %.loc6_39.4: ref @IntRange.Make.%Int.loc5_28.1 (%Int.49d0e6.1) = class_element_access %return, element1 -// CHECK:STDOUT: %.loc6_39.5: init @IntRange.Make.%Int.loc5_28.1 (%Int.49d0e6.1) = initialize_from %end.ref to %.loc6_39.4 +// CHECK:STDOUT: %.loc6_39.5: init @IntRange.Make.%Int.loc5_28.1 (%Int.49d0e6.1) = initialize_from %.loc6_36 to %.loc6_39.4 // CHECK:STDOUT: %.loc6_39.6: init @IntRange.Make.%IntRange (%IntRange.349) = class_init (%.loc6_39.3, %.loc6_39.5), %return // CHECK:STDOUT: %.loc6_40: init @IntRange.Make.%IntRange (%IntRange.349) = converted %.loc6_39.1, %.loc6_39.6 // CHECK:STDOUT: return %.loc6_40 to %return @@ -532,15 +572,20 @@ fn Read() { // CHECK:STDOUT: %Int.loc11_43.1: type = class_type @Int, @Int(%N) [symbolic = %Int.loc11_43.1 (constants.%Int.49d0e6.1)] // CHECK:STDOUT: %ptr.loc11_44.1: type = ptr_type %Int.loc11_43.1 [symbolic = %ptr.loc11_44.1 (constants.%ptr.784)] // CHECK:STDOUT: %pattern_type.loc11_25: type = pattern_type %ptr.loc11_44.1 [symbolic = %pattern_type.loc11_25 (constants.%pattern_type.4dc)] -// CHECK:STDOUT: %Optional.loc11_75.1: type = class_type @Optional, @Optional(%Int.loc11_43.1) [symbolic = %Optional.loc11_75.1 (constants.%Optional.708)] -// CHECK:STDOUT: %pattern_type.loc11_47: type = pattern_type %Optional.loc11_75.1 [symbolic = %pattern_type.loc11_47 (constants.%pattern_type.4b1)] +// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %Int.loc11_43.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.ccc)] +// CHECK:STDOUT: %Copy.facet.loc11_75.1: %Copy.type = facet_value %Int.loc11_43.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc11_75.1 (constants.%Copy.facet.7d5)] +// CHECK:STDOUT: %Optional.loc11_75.1: type = class_type @Optional, @Optional(%Copy.facet.loc11_75.1) [symbolic = %Optional.loc11_75.1 (constants.%Optional.1ca)] +// CHECK:STDOUT: %pattern_type.loc11_47: type = pattern_type %Optional.loc11_75.1 [symbolic = %pattern_type.loc11_47 (constants.%pattern_type.a74)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc11_47: = require_complete_type %Optional.loc11_75.1 [symbolic = %require_complete.loc11_47 (constants.%require_complete.b74)] +// CHECK:STDOUT: %require_complete.loc11_47: = require_complete_type %Optional.loc11_75.1 [symbolic = %require_complete.loc11_47 (constants.%require_complete.81c)] // CHECK:STDOUT: %require_complete.loc11_17: = require_complete_type %IntRange [symbolic = %require_complete.loc11_17 (constants.%require_complete.524)] // CHECK:STDOUT: %require_complete.loc11_31: = require_complete_type %ptr.loc11_44.1 [symbolic = %require_complete.loc11_31 (constants.%require_complete.0f5)] // CHECK:STDOUT: %require_complete.loc12: = require_complete_type %Int.loc11_43.1 [symbolic = %require_complete.loc12 (constants.%require_complete.b4f426.1)] // CHECK:STDOUT: %pattern_type.loc12: type = pattern_type %Int.loc11_43.1 [symbolic = %pattern_type.loc12 (constants.%pattern_type.8963eb.1)] +// CHECK:STDOUT: %.loc12_32.4: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet.loc11_75.1 [symbolic = %.loc12_32.4 (constants.%.ba0)] +// CHECK:STDOUT: %impl.elem0.loc12_32.2: @IntRange.as.Iterate.impl.Next.%.loc12_32.4 (%.ba0) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc12_32.2 (constants.%impl.elem0.13c)] +// CHECK:STDOUT: %specific_impl_fn.loc12_32.2: = specific_impl_function %impl.elem0.loc12_32.2, @Copy.Op(%Copy.facet.loc11_75.1) [symbolic = %specific_impl_fn.loc12_32.2 (constants.%specific_impl_fn.2ab)] // CHECK:STDOUT: %IntRange.elem: type = unbound_element_type %IntRange, %Int.loc11_43.1 [symbolic = %IntRange.elem (constants.%IntRange.elem.e7c)] // CHECK:STDOUT: %OrderedWith.type.loc13_17.2: type = facet_type <@OrderedWith, @OrderedWith(%Int.loc11_43.1)> [symbolic = %OrderedWith.type.loc13_17.2 (constants.%OrderedWith.type.e9c)] // CHECK:STDOUT: %require_complete.loc13: = require_complete_type %OrderedWith.type.loc13_17.2 [symbolic = %require_complete.loc13 (constants.%require_complete.309)] @@ -558,20 +603,20 @@ fn Read() { // CHECK:STDOUT: %.loc14_9.2: type = fn_type_with_self_type constants.%Inc.Op.type, %Inc.facet [symbolic = %.loc14_9.2 (constants.%.c05)] // CHECK:STDOUT: %impl.elem0.loc14_9.2: @IntRange.as.Iterate.impl.Next.%.loc14_9.2 (%.c05) = impl_witness_access %Inc.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc14_9.2 (constants.%impl.elem0.1ab)] // CHECK:STDOUT: %specific_impl_fn.loc14_9.2: = specific_impl_function %impl.elem0.loc14_9.2, @Inc.Op(%Inc.facet) [symbolic = %specific_impl_fn.loc14_9.2 (constants.%specific_impl_fn.8a8)] -// CHECK:STDOUT: %Optional.Some.type: type = fn_type @Optional.Some, @Optional(%Int.loc11_43.1) [symbolic = %Optional.Some.type (constants.%Optional.Some.type.185)] -// CHECK:STDOUT: %Optional.Some: @IntRange.as.Iterate.impl.Next.%Optional.Some.type (%Optional.Some.type.185) = struct_value () [symbolic = %Optional.Some (constants.%Optional.Some.58a)] -// CHECK:STDOUT: %Optional.Some.specific_fn.loc15_42.2: = specific_function %Optional.Some, @Optional.Some(%Int.loc11_43.1) [symbolic = %Optional.Some.specific_fn.loc15_42.2 (constants.%Optional.Some.specific_fn)] +// CHECK:STDOUT: %Optional.Some.type: type = fn_type @Optional.Some, @Optional(%Copy.facet.loc11_75.1) [symbolic = %Optional.Some.type (constants.%Optional.Some.type.91d)] +// CHECK:STDOUT: %Optional.Some: @IntRange.as.Iterate.impl.Next.%Optional.Some.type (%Optional.Some.type.91d) = struct_value () [symbolic = %Optional.Some (constants.%Optional.Some.061)] +// CHECK:STDOUT: %Optional.Some.specific_fn.loc15_42.2: = specific_function %Optional.Some, @Optional.Some(%Copy.facet.loc11_75.1) [symbolic = %Optional.Some.specific_fn.loc15_42.2 (constants.%Optional.Some.specific_fn)] // CHECK:STDOUT: %Destroy.impl_witness: = impl_witness imports.%Destroy.impl_witness_table.fea, @Int.as.Destroy.impl(%N) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.b15)] // CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %Int.loc11_43.1, (%Destroy.impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.80c)] // CHECK:STDOUT: %.loc12_7: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc12_7 (constants.%.11a)] // CHECK:STDOUT: %Int.as.Destroy.impl.Op.type: type = fn_type @Int.as.Destroy.impl.Op, @Int.as.Destroy.impl(%N) [symbolic = %Int.as.Destroy.impl.Op.type (constants.%Int.as.Destroy.impl.Op.type)] // CHECK:STDOUT: %Int.as.Destroy.impl.Op: @IntRange.as.Iterate.impl.Next.%Int.as.Destroy.impl.Op.type (%Int.as.Destroy.impl.Op.type) = struct_value () [symbolic = %Int.as.Destroy.impl.Op (constants.%Int.as.Destroy.impl.Op)] // CHECK:STDOUT: %Int.as.Destroy.impl.Op.specific_fn: = specific_function %Int.as.Destroy.impl.Op, @Int.as.Destroy.impl.Op(%N) [symbolic = %Int.as.Destroy.impl.Op.specific_fn (constants.%Int.as.Destroy.impl.Op.specific_fn)] -// CHECK:STDOUT: %Optional.None.type: type = fn_type @Optional.None, @Optional(%Int.loc11_43.1) [symbolic = %Optional.None.type (constants.%Optional.None.type.73a)] -// CHECK:STDOUT: %Optional.None: @IntRange.as.Iterate.impl.Next.%Optional.None.type (%Optional.None.type.73a) = struct_value () [symbolic = %Optional.None (constants.%Optional.None.83e)] -// CHECK:STDOUT: %Optional.None.specific_fn.loc17_42.2: = specific_function %Optional.None, @Optional.None(%Int.loc11_43.1) [symbolic = %Optional.None.specific_fn.loc17_42.2 (constants.%Optional.None.specific_fn)] +// CHECK:STDOUT: %Optional.None.type: type = fn_type @Optional.None, @Optional(%Copy.facet.loc11_75.1) [symbolic = %Optional.None.type (constants.%Optional.None.type.f33)] +// CHECK:STDOUT: %Optional.None: @IntRange.as.Iterate.impl.Next.%Optional.None.type (%Optional.None.type.f33) = struct_value () [symbolic = %Optional.None (constants.%Optional.None.059)] +// CHECK:STDOUT: %Optional.None.specific_fn.loc17_42.2: = specific_function %Optional.None, @Optional.None(%Copy.facet.loc11_75.1) [symbolic = %Optional.None.specific_fn.loc17_42.2 (constants.%Optional.None.specific_fn)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @IntRange.as.Iterate.impl.Next.%IntRange (%IntRange.349), %cursor.param: @IntRange.as.Iterate.impl.Next.%ptr.loc11_44.1 (%ptr.784)) -> %return.param: @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.708) { +// CHECK:STDOUT: fn(%self.param: @IntRange.as.Iterate.impl.Next.%IntRange (%IntRange.349), %cursor.param: @IntRange.as.Iterate.impl.Next.%ptr.loc11_44.1 (%ptr.784)) -> %return.param: @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.1ca) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %value.patt: @IntRange.as.Iterate.impl.Next.%pattern_type.loc12 (%pattern_type.8963eb.1) = binding_pattern value [concrete] @@ -581,7 +626,12 @@ fn Read() { // CHECK:STDOUT: %cursor.ref.loc12: @IntRange.as.Iterate.impl.Next.%ptr.loc11_44.1 (%ptr.784) = name_ref cursor, %cursor // CHECK:STDOUT: %.loc12_32.1: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_43.1 (%Int.49d0e6.1) = deref %cursor.ref.loc12 // CHECK:STDOUT: %.loc12_32.2: @IntRange.as.Iterate.impl.Next.%Int.loc11_43.1 (%Int.49d0e6.1) = bind_value %.loc12_32.1 -// CHECK:STDOUT: assign %value.var, %.loc12_32.2 +// CHECK:STDOUT: %impl.elem0.loc12_32.1: @IntRange.as.Iterate.impl.Next.%.loc12_32.4 (%.ba0) = impl_witness_access constants.%Copy.lookup_impl_witness.ccc, element0 [symbolic = %impl.elem0.loc12_32.2 (constants.%impl.elem0.13c)] +// CHECK:STDOUT: %bound_method.loc12_32.1: = bound_method %.loc12_32.2, %impl.elem0.loc12_32.1 +// CHECK:STDOUT: %specific_impl_fn.loc12_32.1: = specific_impl_function %impl.elem0.loc12_32.1, @Copy.Op(constants.%Copy.facet.7d5) [symbolic = %specific_impl_fn.loc12_32.2 (constants.%specific_impl_fn.2ab)] +// CHECK:STDOUT: %bound_method.loc12_32.2: = bound_method %.loc12_32.2, %specific_impl_fn.loc12_32.1 +// CHECK:STDOUT: %.loc12_32.3: init @IntRange.as.Iterate.impl.Next.%Int.loc11_43.1 (%Int.49d0e6.1) = call %bound_method.loc12_32.2(%.loc12_32.2) +// CHECK:STDOUT: assign %value.var, %.loc12_32.3 // CHECK:STDOUT: %.loc12_28: type = splice_block %Int.loc12 [symbolic = %Int.loc11_43.1 (constants.%Int.49d0e6.1)] { // CHECK:STDOUT: %Core.ref.loc12: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %Int.ref.loc12: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic] @@ -622,14 +672,20 @@ fn Read() { // CHECK:STDOUT: %Int.ref.loc15: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic] // CHECK:STDOUT: %N.ref.loc15: Core.IntLiteral = name_ref N, @IntRange.%N.loc4_16.2 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %Int.loc15: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc11_43.1 (constants.%Int.49d0e6.1)] -// CHECK:STDOUT: %Optional.loc15: type = class_type @Optional, @Optional(constants.%Int.49d0e6.1) [symbolic = %Optional.loc11_75.1 (constants.%Optional.708)] -// CHECK:STDOUT: %.loc15_42: @IntRange.as.Iterate.impl.Next.%Optional.Some.type (%Optional.Some.type.185) = specific_constant imports.%Core.import_ref.1a8, @Optional(constants.%Int.49d0e6.1) [symbolic = %Optional.Some (constants.%Optional.Some.58a)] -// CHECK:STDOUT: %Some.ref: @IntRange.as.Iterate.impl.Next.%Optional.Some.type (%Optional.Some.type.185) = name_ref Some, %.loc15_42 [symbolic = %Optional.Some (constants.%Optional.Some.58a)] +// CHECK:STDOUT: %Copy.facet.loc15_41: %Copy.type = facet_value constants.%Int.49d0e6.1, (constants.%Copy.lookup_impl_witness.ccc) [symbolic = %Copy.facet.loc11_75.1 (constants.%Copy.facet.7d5)] +// CHECK:STDOUT: %.loc15_41: %Copy.type = converted %Int.loc15, %Copy.facet.loc15_41 [symbolic = %Copy.facet.loc11_75.1 (constants.%Copy.facet.7d5)] +// CHECK:STDOUT: %Optional.loc15: type = class_type @Optional, @Optional(constants.%Copy.facet.7d5) [symbolic = %Optional.loc11_75.1 (constants.%Optional.1ca)] +// CHECK:STDOUT: %.loc15_42: @IntRange.as.Iterate.impl.Next.%Optional.Some.type (%Optional.Some.type.91d) = specific_constant imports.%Core.import_ref.57f, @Optional(constants.%Copy.facet.7d5) [symbolic = %Optional.Some (constants.%Optional.Some.061)] +// CHECK:STDOUT: %Some.ref: @IntRange.as.Iterate.impl.Next.%Optional.Some.type (%Optional.Some.type.91d) = name_ref Some, %.loc15_42 [symbolic = %Optional.Some (constants.%Optional.Some.061)] // CHECK:STDOUT: %value.ref.loc15: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_43.1 (%Int.49d0e6.1) = name_ref value, %value -// CHECK:STDOUT: %Optional.Some.specific_fn.loc15_42.1: = specific_function %Some.ref, @Optional.Some(constants.%Int.49d0e6.1) [symbolic = %Optional.Some.specific_fn.loc15_42.2 (constants.%Optional.Some.specific_fn)] -// CHECK:STDOUT: %.loc11_47.1: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.708) = splice_block %return {} +// CHECK:STDOUT: %Copy.facet.loc15_53.1: %Copy.type = facet_value constants.%Int.49d0e6.1, (constants.%Copy.lookup_impl_witness.ccc) [symbolic = %Copy.facet.loc11_75.1 (constants.%Copy.facet.7d5)] +// CHECK:STDOUT: %.loc15_53.1: %Copy.type = converted constants.%Int.49d0e6.1, %Copy.facet.loc15_53.1 [symbolic = %Copy.facet.loc11_75.1 (constants.%Copy.facet.7d5)] +// CHECK:STDOUT: %Copy.facet.loc15_53.2: %Copy.type = facet_value constants.%Int.49d0e6.1, (constants.%Copy.lookup_impl_witness.ccc) [symbolic = %Copy.facet.loc11_75.1 (constants.%Copy.facet.7d5)] +// CHECK:STDOUT: %.loc15_53.2: %Copy.type = converted constants.%Int.49d0e6.1, %Copy.facet.loc15_53.2 [symbolic = %Copy.facet.loc11_75.1 (constants.%Copy.facet.7d5)] +// CHECK:STDOUT: %Optional.Some.specific_fn.loc15_42.1: = specific_function %Some.ref, @Optional.Some(constants.%Copy.facet.7d5) [symbolic = %Optional.Some.specific_fn.loc15_42.2 (constants.%Optional.Some.specific_fn)] +// CHECK:STDOUT: %.loc11_47.1: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.1ca) = splice_block %return {} // CHECK:STDOUT: %.loc15_48: @IntRange.as.Iterate.impl.Next.%Int.loc11_43.1 (%Int.49d0e6.1) = bind_value %value.ref.loc15 -// CHECK:STDOUT: %Optional.Some.call: init @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.708) = call %Optional.Some.specific_fn.loc15_42.1(%.loc15_48) to %.loc11_47.1 +// CHECK:STDOUT: %Optional.Some.call: init @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.1ca) = call %Optional.Some.specific_fn.loc15_42.1(%.loc15_48) to %.loc11_47.1 // CHECK:STDOUT: %impl.elem0.loc12_7.1: @IntRange.as.Iterate.impl.Next.%.loc12_7 (%.11a) = impl_witness_access constants.%Destroy.impl_witness.b15, element0 [symbolic = %Int.as.Destroy.impl.Op (constants.%Int.as.Destroy.impl.Op)] // CHECK:STDOUT: %bound_method.loc12_7.1: = bound_method %value.var, %impl.elem0.loc12_7.1 // CHECK:STDOUT: %specific_fn.loc12_7.1: = specific_function %impl.elem0.loc12_7.1, @Int.as.Destroy.impl.Op(constants.%N) [symbolic = %Int.as.Destroy.impl.Op.specific_fn (constants.%Int.as.Destroy.impl.Op.specific_fn)] @@ -645,12 +701,14 @@ fn Read() { // CHECK:STDOUT: %Int.ref.loc17: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic] // CHECK:STDOUT: %N.ref.loc17: Core.IntLiteral = name_ref N, @IntRange.%N.loc4_16.2 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %Int.loc17: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc11_43.1 (constants.%Int.49d0e6.1)] -// CHECK:STDOUT: %Optional.loc17: type = class_type @Optional, @Optional(constants.%Int.49d0e6.1) [symbolic = %Optional.loc11_75.1 (constants.%Optional.708)] -// CHECK:STDOUT: %.loc17: @IntRange.as.Iterate.impl.Next.%Optional.None.type (%Optional.None.type.73a) = specific_constant imports.%Core.import_ref.f49, @Optional(constants.%Int.49d0e6.1) [symbolic = %Optional.None (constants.%Optional.None.83e)] -// CHECK:STDOUT: %None.ref: @IntRange.as.Iterate.impl.Next.%Optional.None.type (%Optional.None.type.73a) = name_ref None, %.loc17 [symbolic = %Optional.None (constants.%Optional.None.83e)] -// CHECK:STDOUT: %Optional.None.specific_fn.loc17_42.1: = specific_function %None.ref, @Optional.None(constants.%Int.49d0e6.1) [symbolic = %Optional.None.specific_fn.loc17_42.2 (constants.%Optional.None.specific_fn)] -// CHECK:STDOUT: %.loc11_47.2: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.708) = splice_block %return {} -// CHECK:STDOUT: %Optional.None.call: init @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.708) = call %Optional.None.specific_fn.loc17_42.1() to %.loc11_47.2 +// CHECK:STDOUT: %Copy.facet.loc17: %Copy.type = facet_value constants.%Int.49d0e6.1, (constants.%Copy.lookup_impl_witness.ccc) [symbolic = %Copy.facet.loc11_75.1 (constants.%Copy.facet.7d5)] +// CHECK:STDOUT: %.loc17_41: %Copy.type = converted %Int.loc17, %Copy.facet.loc17 [symbolic = %Copy.facet.loc11_75.1 (constants.%Copy.facet.7d5)] +// CHECK:STDOUT: %Optional.loc17: type = class_type @Optional, @Optional(constants.%Copy.facet.7d5) [symbolic = %Optional.loc11_75.1 (constants.%Optional.1ca)] +// CHECK:STDOUT: %.loc17_42: @IntRange.as.Iterate.impl.Next.%Optional.None.type (%Optional.None.type.f33) = specific_constant imports.%Core.import_ref.a52, @Optional(constants.%Copy.facet.7d5) [symbolic = %Optional.None (constants.%Optional.None.059)] +// CHECK:STDOUT: %None.ref: @IntRange.as.Iterate.impl.Next.%Optional.None.type (%Optional.None.type.f33) = name_ref None, %.loc17_42 [symbolic = %Optional.None (constants.%Optional.None.059)] +// CHECK:STDOUT: %Optional.None.specific_fn.loc17_42.1: = specific_function %None.ref, @Optional.None(constants.%Copy.facet.7d5) [symbolic = %Optional.None.specific_fn.loc17_42.2 (constants.%Optional.None.specific_fn)] +// CHECK:STDOUT: %.loc11_47.2: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.1ca) = splice_block %return {} +// CHECK:STDOUT: %Optional.None.call: init @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.1ca) = call %Optional.None.specific_fn.loc17_42.1() to %.loc11_47.2 // CHECK:STDOUT: %impl.elem0.loc12_7.2: @IntRange.as.Iterate.impl.Next.%.loc12_7 (%.11a) = impl_witness_access constants.%Destroy.impl_witness.b15, element0 [symbolic = %Int.as.Destroy.impl.Op (constants.%Int.as.Destroy.impl.Op)] // CHECK:STDOUT: %bound_method.loc12_7.3: = bound_method %value.var, %impl.elem0.loc12_7.2 // CHECK:STDOUT: %specific_fn.loc12_7.2: = specific_function %impl.elem0.loc12_7.2, @Int.as.Destroy.impl.Op(constants.%N) [symbolic = %Int.as.Destroy.impl.Op.specific_fn (constants.%Int.as.Destroy.impl.Op.specific_fn)] @@ -720,8 +778,10 @@ fn Read() { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %IntRange => constants.%IntRange.349 // CHECK:STDOUT: %Int.loc9_54.1 => constants.%Int.49d0e6.1 +// CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.lookup_impl_witness.ccc +// CHECK:STDOUT: %Copy.facet.loc9_85.1 => constants.%Copy.facet.7d5 // CHECK:STDOUT: %Iterate_where.type => constants.%Iterate_where.type -// CHECK:STDOUT: %require_complete => constants.%require_complete.f08 +// CHECK:STDOUT: %require_complete => constants.%require_complete.7fc // CHECK:STDOUT: %Iterate.impl_witness => constants.%Iterate.impl_witness // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -746,8 +806,10 @@ fn Read() { // CHECK:STDOUT: %Int.loc11_43.1 => constants.%Int.49d0e6.1 // CHECK:STDOUT: %ptr.loc11_44.1 => constants.%ptr.784 // CHECK:STDOUT: %pattern_type.loc11_25 => constants.%pattern_type.4dc -// CHECK:STDOUT: %Optional.loc11_75.1 => constants.%Optional.708 -// CHECK:STDOUT: %pattern_type.loc11_47 => constants.%pattern_type.4b1 +// CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.lookup_impl_witness.ccc +// CHECK:STDOUT: %Copy.facet.loc11_75.1 => constants.%Copy.facet.7d5 +// CHECK:STDOUT: %Optional.loc11_75.1 => constants.%Optional.1ca +// CHECK:STDOUT: %pattern_type.loc11_47 => constants.%pattern_type.a74 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @IntRange.as.Destroy.impl(constants.%N) { @@ -788,6 +850,11 @@ fn Read() { // CHECK:STDOUT: %require_complete.loc5_49 => constants.%complete_type.c45 // CHECK:STDOUT: %require_complete.loc5_16 => constants.%complete_type.f8a // CHECK:STDOUT: %struct_type.start.end => constants.%struct_type.start.end.d0a +// CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.impl_witness.f0b +// CHECK:STDOUT: %Copy.facet => constants.%Copy.facet.26d +// CHECK:STDOUT: %.loc6_22.2 => constants.%.3c4 +// CHECK:STDOUT: %impl.elem0.loc6_22.2 => constants.%Int.as.Copy.impl.Op.87e +// CHECK:STDOUT: %specific_impl_fn.loc6_22.2 => constants.%Int.as.Copy.impl.Op.specific_fn // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- trivial.carbon @@ -817,6 +884,13 @@ fn Read() { // CHECK:STDOUT: %require_complete.ffde5f.1: = require_complete_type %Int.7ff11f.1 [symbolic] // CHECK:STDOUT: %IntRange.elem.ecb: type = unbound_element_type %IntRange.349, %Int.7ff11f.1 [symbolic] // CHECK:STDOUT: %require_complete.524: = require_complete_type %IntRange.349 [symbolic] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %Int.7ff11f.1, @Copy [symbolic] +// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %Int.7ff11f.1, (%Copy.lookup_impl_witness) [symbolic] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %.b47: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet [symbolic] +// CHECK:STDOUT: %impl.elem0: %.b47 = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @Copy.Op(%Copy.facet) [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %IntRange.365: type = class_type @IntRange, @IntRange(%int_32) [concrete] // CHECK:STDOUT: %IntRange.Make.type.cef: type = fn_type @IntRange.Make, @IntRange(%int_32) [concrete] @@ -879,13 +953,13 @@ fn Read() { // CHECK:STDOUT: %Main.import_ref.261 = import_ref Main//lib, loc23_18, unloaded // CHECK:STDOUT: %Main.import_ref.f1e294.2: Core.IntLiteral = import_ref Main//lib, loc4_16, loaded [symbolic = @IntRange.%N (constants.%N)] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.7bb: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.8a0) = import_ref Core//prelude/types/int, loc20_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.1d6)] +// CHECK:STDOUT: %Core.import_ref.7bb: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.8a0) = import_ref Core//prelude/types/int, loc27_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.1d6)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.ba4 = impl_witness_table (%Core.import_ref.7bb), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Main.import_ref.272: = import_ref Main//lib, loc4_39, loaded [symbolic = @IntRange.as.Destroy.impl.%Destroy.impl_witness (constants.%Destroy.impl_witness.e5b)] // CHECK:STDOUT: %Main.import_ref.f1e294.3: Core.IntLiteral = import_ref Main//lib, loc4_16, loaded [symbolic = @IntRange.%N (constants.%N)] // CHECK:STDOUT: %Main.import_ref.dae: type = import_ref Main//lib, loc4_39, loaded [symbolic = @IntRange.as.Destroy.impl.%IntRange (constants.%IntRange.349)] -// CHECK:STDOUT: %Main.import_ref.063: type = import_ref Main//lib, inst397 [no loc], loaded [concrete = constants.%Destroy.type] +// CHECK:STDOUT: %Main.import_ref.063: type = import_ref Main//lib, inst619 [no loc], loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Main.import_ref.302: @IntRange.as.Destroy.impl.%IntRange.as.Destroy.impl.Op.type (%IntRange.as.Destroy.impl.Op.type.e28) = import_ref Main//lib, loc4_39, loaded [symbolic = @IntRange.as.Destroy.impl.%IntRange.as.Destroy.impl.Op (constants.%IntRange.as.Destroy.impl.Op.a7f)] // CHECK:STDOUT: %Destroy.impl_witness_table.0cc = impl_witness_table (%Main.import_ref.302), @IntRange.as.Destroy.impl [concrete] // CHECK:STDOUT: %Main.import_ref.f1e294.4: Core.IntLiteral = import_ref Main//lib, loc4_16, loaded [symbolic = @IntRange.%N (constants.%N)] @@ -999,6 +1073,11 @@ fn Read() { // CHECK:STDOUT: %require_complete.1: = require_complete_type %IntRange [symbolic = %require_complete.1 (constants.%require_complete.524)] // CHECK:STDOUT: %require_complete.2: = require_complete_type %Int [symbolic = %require_complete.2 (constants.%require_complete.ffde5f.1)] // CHECK:STDOUT: %struct_type.start.end: type = struct_type {.start: @IntRange.Make.%Int (%Int.7ff11f.1), .end: @IntRange.Make.%Int (%Int.7ff11f.1)} [symbolic = %struct_type.start.end (constants.%struct_type.start.end.434)] +// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %Int, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness)] +// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %Int, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet)] +// CHECK:STDOUT: %.1: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.1 (constants.%.b47)] +// CHECK:STDOUT: %impl.elem0: @IntRange.Make.%.1 (%.b47) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0 (constants.%impl.elem0)] +// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @Copy.Op(%Copy.facet) [symbolic = %specific_impl_fn (constants.%specific_impl_fn)] // CHECK:STDOUT: // CHECK:STDOUT: fn; // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/for/basic.carbon b/toolchain/check/testdata/for/basic.carbon index 2da5069eb4eb..0a32d317a6cf 100644 --- a/toolchain/check/testdata/for/basic.carbon +++ b/toolchain/check/testdata/for/basic.carbon @@ -59,32 +59,35 @@ fn Run() { // CHECK:STDOUT: %TrivialRange: type = class_type @TrivialRange [concrete] // CHECK:STDOUT: %Iterate.type: type = facet_type <@Iterate> [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %T.578: %Copy.type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.fc1: = impl_witness imports.%Copy.impl_witness_table.05f [concrete] +// CHECK:STDOUT: %Copy.facet.29a: %Copy.type = facet_value %empty_tuple.type, (%Copy.impl_witness.fc1) [concrete] // CHECK:STDOUT: %Iterate.NewCursor.type: type = fn_type @Iterate.NewCursor [concrete] // CHECK:STDOUT: %Iterate.Next.type: type = fn_type @Iterate.Next [concrete] -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] -// CHECK:STDOUT: %Optional.HasValue.type.a15: type = fn_type @Optional.HasValue, @Optional(%T) [symbolic] -// CHECK:STDOUT: %Optional.HasValue.73f: %Optional.HasValue.type.a15 = struct_value () [symbolic] -// CHECK:STDOUT: %Optional.Get.type.e03: type = fn_type @Optional.Get, @Optional(%T) [symbolic] -// CHECK:STDOUT: %Optional.Get.971: %Optional.Get.type.e03 = struct_value () [symbolic] +// CHECK:STDOUT: %Optional.HasValue.type.7f4: type = fn_type @Optional.HasValue, @Optional(%T.578) [symbolic] +// CHECK:STDOUT: %Optional.HasValue.aa2: %Optional.HasValue.type.7f4 = struct_value () [symbolic] +// CHECK:STDOUT: %Optional.Get.type.fd8: type = fn_type @Optional.Get, @Optional(%T.578) [symbolic] +// CHECK:STDOUT: %Optional.Get.823: %Optional.Get.type.fd8 = struct_value () [symbolic] // CHECK:STDOUT: %Iterate.impl_witness: = impl_witness @TrivialRange.%Iterate.impl_witness_table [concrete] -// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.type.10eda3.1: type = fn_type @TrivialRange.as.Iterate.impl.NewCursor.loc6_32.1 [concrete] -// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.cc1111.1: %TrivialRange.as.Iterate.impl.NewCursor.type.10eda3.1 = struct_value () [concrete] +// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.type.2473fd.1: type = fn_type @TrivialRange.as.Iterate.impl.NewCursor.loc6_32.1 [concrete] +// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.1374e3.1: %TrivialRange.as.Iterate.impl.NewCursor.type.2473fd.1 = struct_value () [concrete] // CHECK:STDOUT: %ptr.843: type = ptr_type %empty_tuple.type [concrete] -// CHECK:STDOUT: %Optional.f9a: type = class_type @Optional, @Optional(%empty_tuple.type) [concrete] +// CHECK:STDOUT: %Optional.4ad: type = class_type @Optional, @Optional(%Copy.facet.29a) [concrete] // CHECK:STDOUT: %TrivialRange.as.Iterate.impl.Next.type: type = fn_type @TrivialRange.as.Iterate.impl.Next [concrete] // CHECK:STDOUT: %TrivialRange.as.Iterate.impl.Next: %TrivialRange.as.Iterate.impl.Next.type = struct_value () [concrete] -// CHECK:STDOUT: %Iterate.facet.d75: %Iterate.type = facet_value %TrivialRange, (%Iterate.impl_witness) [concrete] +// CHECK:STDOUT: %Iterate.facet.06c: %Iterate.type = facet_value %TrivialRange, (%Iterate.impl_witness) [concrete] // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete] -// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.type.10eda3.2: type = fn_type @TrivialRange.as.Iterate.impl.NewCursor.loc6_32.2 [concrete] -// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.cc1111.2: %TrivialRange.as.Iterate.impl.NewCursor.type.10eda3.2 = struct_value () [concrete] +// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.type.2473fd.2: type = fn_type @TrivialRange.as.Iterate.impl.NewCursor.loc6_32.2 [concrete] +// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.1374e3.2: %TrivialRange.as.Iterate.impl.NewCursor.type.2473fd.2 = struct_value () [concrete] // CHECK:STDOUT: %ptr.41d: type = ptr_type %TrivialRange [concrete] // CHECK:STDOUT: %TrivialRange.as.Destroy.impl.Op.type: type = fn_type @TrivialRange.as.Destroy.impl.Op [concrete] // CHECK:STDOUT: %TrivialRange.as.Destroy.impl.Op: %TrivialRange.as.Destroy.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %Optional.HasValue.type.b7a: type = fn_type @Optional.HasValue, @Optional(%empty_tuple.type) [concrete] -// CHECK:STDOUT: %Optional.HasValue.ada: %Optional.HasValue.type.b7a = struct_value () [concrete] -// CHECK:STDOUT: %Optional.Get.type.130: type = fn_type @Optional.Get, @Optional(%empty_tuple.type) [concrete] -// CHECK:STDOUT: %Optional.Get.6e8: %Optional.Get.type.130 = struct_value () [concrete] +// CHECK:STDOUT: %Optional.HasValue.type.9bf: type = fn_type @Optional.HasValue, @Optional(%Copy.facet.29a) [concrete] +// CHECK:STDOUT: %Optional.HasValue.28f: %Optional.HasValue.type.9bf = struct_value () [concrete] +// CHECK:STDOUT: %Optional.Get.type.aea: type = fn_type @Optional.Get, @Optional(%Copy.facet.29a) [concrete] +// CHECK:STDOUT: %Optional.Get.22d: %Optional.Get.type.aea = struct_value () [concrete] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.type.abd: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%empty_tuple.type) [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.bae: %T.as.Destroy.impl.Op.type.abd = struct_value () [concrete] @@ -93,18 +96,20 @@ fn Run() { // CHECK:STDOUT: %AfterLoop.type: type = fn_type @AfterLoop [concrete] // CHECK:STDOUT: %AfterLoop: %AfterLoop.type = struct_value () [concrete] // CHECK:STDOUT: %TrivialRange.val: %TrivialRange = struct_value () [concrete] -// CHECK:STDOUT: %.626: type = fn_type_with_self_type %Iterate.NewCursor.type, %Iterate.facet.d75 [concrete] -// CHECK:STDOUT: %.e55: type = fn_type_with_self_type %Iterate.Next.type, %Iterate.facet.d75 [concrete] -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.ada, @Optional.HasValue(%empty_tuple.type) [concrete] -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.6e8, @Optional.Get(%empty_tuple.type) [concrete] -// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.type.4fd: type = fn_type @Optional.as.Destroy.impl.Op, @Optional.as.Destroy.impl(%empty_tuple.type) [concrete] -// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.290: %Optional.as.Destroy.impl.Op.type.4fd = struct_value () [concrete] -// CHECK:STDOUT: %ptr.511: type = ptr_type %Optional.f9a [concrete] +// CHECK:STDOUT: %.a28: type = fn_type_with_self_type %Iterate.NewCursor.type, %Iterate.facet.06c [concrete] +// CHECK:STDOUT: %.e65: type = fn_type_with_self_type %Iterate.Next.type, %Iterate.facet.06c [concrete] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.28f, @Optional.HasValue(%Copy.facet.29a) [concrete] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.22d, @Optional.Get(%Copy.facet.29a) [concrete] +// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.type.635: type = fn_type @Optional.as.Destroy.impl.Op, @Optional.as.Destroy.impl(%Copy.facet.29a) [concrete] +// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.b2a: %Optional.as.Destroy.impl.Op.type.635 = struct_value () [concrete] +// CHECK:STDOUT: %ptr.bbf: type = ptr_type %Optional.4ad [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core.import_ref.cd6: @Optional.%Optional.HasValue.type (%Optional.HasValue.type.a15) = import_ref Core//prelude/parts/iterate, inst98 [indirect], loaded [symbolic = @Optional.%Optional.HasValue (constants.%Optional.HasValue.73f)] -// CHECK:STDOUT: %Core.import_ref.4fd: @Optional.%Optional.Get.type (%Optional.Get.type.e03) = import_ref Core//prelude/parts/iterate, inst99 [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.971)] +// CHECK:STDOUT: %Core.import_ref.0cc = import_ref Core//prelude/parts/copy, loc40_31, unloaded +// CHECK:STDOUT: %Copy.impl_witness_table.05f = impl_witness_table (%Core.import_ref.0cc), @empty_tuple.type.as.Copy.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.b01: @Optional.%Optional.HasValue.type (%Optional.HasValue.type.7f4) = import_ref Core//prelude/parts/iterate, inst107 [indirect], loaded [symbolic = @Optional.%Optional.HasValue (constants.%Optional.HasValue.aa2)] +// CHECK:STDOUT: %Core.import_ref.d9b: @Optional.%Optional.Get.type (%Optional.Get.type.fd8) = import_ref Core//prelude/parts/iterate, inst108 [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.823)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { @@ -118,10 +123,10 @@ fn Run() { // CHECK:STDOUT: %.loc18_18.3: init %TrivialRange = class_init (), %.loc18_18.2 [concrete = constants.%TrivialRange.val] // CHECK:STDOUT: %.loc18_18.4: ref %TrivialRange = temporary %.loc18_18.2, %.loc18_18.3 // CHECK:STDOUT: %.loc18_20.1: ref %TrivialRange = converted %.loc18_18.1, %.loc18_18.4 -// CHECK:STDOUT: %impl.elem2: %.626 = impl_witness_access constants.%Iterate.impl_witness, element2 [concrete = constants.%TrivialRange.as.Iterate.impl.NewCursor.cc1111.2] +// CHECK:STDOUT: %impl.elem2: %.a28 = impl_witness_access constants.%Iterate.impl_witness, element2 [concrete = constants.%TrivialRange.as.Iterate.impl.NewCursor.1374e3.2] // CHECK:STDOUT: %bound_method.loc18_35.1: = bound_method %.loc18_20.1, %impl.elem2 // CHECK:STDOUT: %.loc18_20.2: %TrivialRange = bind_value %.loc18_20.1 -// CHECK:STDOUT: %NewCursor.ref: %TrivialRange.as.Iterate.impl.NewCursor.type.10eda3.1 = name_ref NewCursor, @TrivialRange.as.Iterate.impl.%TrivialRange.as.Iterate.impl.NewCursor.decl.loc6_32.1 [concrete = constants.%TrivialRange.as.Iterate.impl.NewCursor.cc1111.1] +// CHECK:STDOUT: %NewCursor.ref: %TrivialRange.as.Iterate.impl.NewCursor.type.2473fd.1 = name_ref NewCursor, @TrivialRange.as.Iterate.impl.%TrivialRange.as.Iterate.impl.NewCursor.decl.loc6_32.1 [concrete = constants.%TrivialRange.as.Iterate.impl.NewCursor.1374e3.1] // CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.bound: = bound_method %.loc18_20.2, %NewCursor.ref // CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.call: init %empty_tuple.type = call %TrivialRange.as.Iterate.impl.NewCursor.bound(%.loc18_20.2) // CHECK:STDOUT: %var: ref %empty_tuple.type = var invalid @@ -130,30 +135,30 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: !for.next: // CHECK:STDOUT: %addr.loc18_35.1: %ptr.843 = addr_of %var -// CHECK:STDOUT: %impl.elem3: %.e55 = impl_witness_access constants.%Iterate.impl_witness, element3 [concrete = constants.%TrivialRange.as.Iterate.impl.Next] +// CHECK:STDOUT: %impl.elem3: %.e65 = impl_witness_access constants.%Iterate.impl_witness, element3 [concrete = constants.%TrivialRange.as.Iterate.impl.Next] // CHECK:STDOUT: %bound_method.loc18_35.2: = bound_method %.loc18_20.1, %impl.elem3 -// CHECK:STDOUT: %.loc18_35.1: ref %Optional.f9a = temporary_storage +// CHECK:STDOUT: %.loc18_35.1: ref %Optional.4ad = temporary_storage // CHECK:STDOUT: %.loc18_20.3: %TrivialRange = bind_value %.loc18_20.1 -// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.Next.call: init %Optional.f9a = call %bound_method.loc18_35.2(%.loc18_20.3, %addr.loc18_35.1) to %.loc18_35.1 -// CHECK:STDOUT: %.loc18_35.2: ref %Optional.f9a = temporary %.loc18_35.1, %TrivialRange.as.Iterate.impl.Next.call -// CHECK:STDOUT: %.loc18_35.3: %Optional.HasValue.type.b7a = specific_constant imports.%Core.import_ref.cd6, @Optional(constants.%empty_tuple.type) [concrete = constants.%Optional.HasValue.ada] -// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.b7a = name_ref HasValue, %.loc18_35.3 [concrete = constants.%Optional.HasValue.ada] +// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.Next.call: init %Optional.4ad = call %bound_method.loc18_35.2(%.loc18_20.3, %addr.loc18_35.1) to %.loc18_35.1 +// CHECK:STDOUT: %.loc18_35.2: ref %Optional.4ad = temporary %.loc18_35.1, %TrivialRange.as.Iterate.impl.Next.call +// CHECK:STDOUT: %.loc18_35.3: %Optional.HasValue.type.9bf = specific_constant imports.%Core.import_ref.b01, @Optional(constants.%Copy.facet.29a) [concrete = constants.%Optional.HasValue.28f] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.9bf = name_ref HasValue, %.loc18_35.3 [concrete = constants.%Optional.HasValue.28f] // CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc18_35.2, %HasValue.ref -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%empty_tuple.type) [concrete = constants.%Optional.HasValue.specific_fn] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%Copy.facet.29a) [concrete = constants.%Optional.HasValue.specific_fn] // CHECK:STDOUT: %bound_method.loc18_35.3: = bound_method %.loc18_35.2, %Optional.HasValue.specific_fn -// CHECK:STDOUT: %.loc18_35.4: %Optional.f9a = bind_value %.loc18_35.2 +// CHECK:STDOUT: %.loc18_35.4: %Optional.4ad = bind_value %.loc18_35.2 // CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc18_35.3(%.loc18_35.4) // CHECK:STDOUT: %.loc18_35.5: bool = value_of_initializer %Optional.HasValue.call // CHECK:STDOUT: %.loc18_35.6: bool = converted %Optional.HasValue.call, %.loc18_35.5 // CHECK:STDOUT: if %.loc18_35.6 br !for.body else br !for.done // CHECK:STDOUT: // CHECK:STDOUT: !for.body: -// CHECK:STDOUT: %.loc18_35.7: %Optional.Get.type.130 = specific_constant imports.%Core.import_ref.4fd, @Optional(constants.%empty_tuple.type) [concrete = constants.%Optional.Get.6e8] -// CHECK:STDOUT: %Get.ref: %Optional.Get.type.130 = name_ref Get, %.loc18_35.7 [concrete = constants.%Optional.Get.6e8] +// CHECK:STDOUT: %.loc18_35.7: %Optional.Get.type.aea = specific_constant imports.%Core.import_ref.d9b, @Optional(constants.%Copy.facet.29a) [concrete = constants.%Optional.Get.22d] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.aea = name_ref Get, %.loc18_35.7 [concrete = constants.%Optional.Get.22d] // CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc18_35.2, %Get.ref -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%empty_tuple.type) [concrete = constants.%Optional.Get.specific_fn] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%Copy.facet.29a) [concrete = constants.%Optional.Get.specific_fn] // CHECK:STDOUT: %bound_method.loc18_35.4: = bound_method %.loc18_35.2, %Optional.Get.specific_fn -// CHECK:STDOUT: %.loc18_35.8: %Optional.f9a = bind_value %.loc18_35.2 +// CHECK:STDOUT: %.loc18_35.8: %Optional.4ad = bind_value %.loc18_35.2 // CHECK:STDOUT: %Optional.Get.call: init %empty_tuple.type = call %bound_method.loc18_35.4(%.loc18_35.8) // CHECK:STDOUT: %.loc18_12.1: type = splice_block %.loc18_12.3 [concrete = constants.%empty_tuple.type] { // CHECK:STDOUT: %.loc18_12.2: %empty_tuple.type = tuple_literal () @@ -176,10 +181,10 @@ fn Run() { // CHECK:STDOUT: %bound_method.loc18_35.5: = bound_method %.loc18_35.10, %T.as.Destroy.impl.Op.specific_fn.1 // CHECK:STDOUT: %addr.loc18_35.2: %ptr.843 = addr_of %.loc18_35.10 // CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc18_35.1: init %empty_tuple.type = call %bound_method.loc18_35.5(%addr.loc18_35.2) -// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.bound: = bound_method %.loc18_35.2, constants.%Optional.as.Destroy.impl.Op.290 +// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.bound: = bound_method %.loc18_35.2, constants.%Optional.as.Destroy.impl.Op.b2a // CHECK:STDOUT: // CHECK:STDOUT: %bound_method.loc18_35.6: = bound_method %.loc18_35.2, %Optional.as.Destroy.impl.Op.specific_fn -// CHECK:STDOUT: %addr.loc18_35.3: %ptr.511 = addr_of %.loc18_35.2 +// CHECK:STDOUT: %addr.loc18_35.3: %ptr.bbf = addr_of %.loc18_35.2 // CHECK:STDOUT: %Optional.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc18_35.6(%addr.loc18_35.3) // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc18_35.2: = bound_method %var, constants.%T.as.Destroy.impl.Op.bae // CHECK:STDOUT: diff --git a/toolchain/check/testdata/for/pattern.carbon b/toolchain/check/testdata/for/pattern.carbon index 941cfc455b34..dc7e64c9402e 100644 --- a/toolchain/check/testdata/for/pattern.carbon +++ b/toolchain/check/testdata/for/pattern.carbon @@ -14,7 +14,7 @@ library "[[@TEST_NAME]]"; -class EmptyRange(T:! type) { +class EmptyRange(T:! Core.Copy) { fn Make() -> Self { return {}; } impl as Core.Iterate where .CursorType = {} and .ElementType = T { @@ -27,14 +27,18 @@ class EmptyRange(T:! type) { } } +class C { + impl as Core.Copy { + fn Op[self: Self]() -> Self { return {}; } + } +} + // --- value.carbon library "[[@TEST_NAME]]"; import library "empty_range"; -class C {} - fn Body(c: C); fn Run() { @@ -51,8 +55,6 @@ library "[[@TEST_NAME]]"; import library "empty_range"; -class C {} - fn Body(c: C*); fn Run() { @@ -85,8 +87,6 @@ library "[[@TEST_NAME]]"; import library "empty_range"; -class C {} - fn Body(a: C, b: C); fn Run() { @@ -104,17 +104,16 @@ library "[[@TEST_NAME]]"; import library "empty_range"; class X {} -class Y {} fn Run() { - // CHECK:STDERR: fail_bad_pattern.carbon:[[@LINE+7]]:7: error: cannot implicitly convert expression of type `Y` to `X` [ConversionFailure] - // CHECK:STDERR: for (x: X in EmptyRange(Y).Make()) { + // CHECK:STDERR: fail_bad_pattern.carbon:[[@LINE+7]]:7: error: cannot implicitly convert expression of type `C` to `X` [ConversionFailure] + // CHECK:STDERR: for (x: X in EmptyRange(C).Make()) { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_bad_pattern.carbon:[[@LINE+4]]:7: note: type `Y` does not implement interface `Core.ImplicitAs(X)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: for (x: X in EmptyRange(Y).Make()) { + // CHECK:STDERR: fail_bad_pattern.carbon:[[@LINE+4]]:7: note: type `C` does not implement interface `Core.ImplicitAs(X)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: for (x: X in EmptyRange(C).Make()) { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - for (x: X in EmptyRange(Y).Make()) { + for (x: X in EmptyRange(C).Make()) { } } @@ -122,72 +121,78 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [concrete] -// CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete] -// CHECK:STDOUT: %C.as.Destroy.impl.Op.type: type = fn_type @C.as.Destroy.impl.Op [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] -// CHECK:STDOUT: %C.as.Destroy.impl.Op: %C.as.Destroy.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete] // CHECK:STDOUT: %Body.type: type = fn_type @Body [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Body: %Body.type = struct_value () [concrete] // CHECK:STDOUT: %ptr.c28: type = ptr_type %empty_struct_type [concrete] // CHECK:STDOUT: %EmptyRange.type: type = generic_class_type @EmptyRange [concrete] // CHECK:STDOUT: %EmptyRange.generic: %EmptyRange.type = struct_value () [concrete] -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] -// CHECK:STDOUT: %EmptyRange.Make.type.bd2: type = fn_type @EmptyRange.Make, @EmptyRange(%T) [symbolic] -// CHECK:STDOUT: %EmptyRange.Make.ed1: %EmptyRange.Make.type.bd2 = struct_value () [symbolic] -// CHECK:STDOUT: %EmptyRange.cc8: type = class_type @EmptyRange, @EmptyRange(%C) [concrete] -// CHECK:STDOUT: %EmptyRange.Make.type.557: type = fn_type @EmptyRange.Make, @EmptyRange(%C) [concrete] -// CHECK:STDOUT: %EmptyRange.Make.74d: %EmptyRange.Make.type.557 = struct_value () [concrete] -// CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %EmptyRange.Make.74d, @EmptyRange.Make(%C) [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %T.049: %Copy.type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %EmptyRange.Make.type.7d6: type = fn_type @EmptyRange.Make, @EmptyRange(%T.049) [symbolic] +// CHECK:STDOUT: %EmptyRange.Make.4cc: %EmptyRange.Make.type.7d6 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.5fc: = impl_witness imports.%Copy.impl_witness_table.349 [concrete] +// CHECK:STDOUT: %Copy.facet.0cb: %Copy.type = facet_value %C, (%Copy.impl_witness.5fc) [concrete] +// CHECK:STDOUT: %EmptyRange.a62: type = class_type @EmptyRange, @EmptyRange(%Copy.facet.0cb) [concrete] +// CHECK:STDOUT: %EmptyRange.Make.type.9ed: type = fn_type @EmptyRange.Make, @EmptyRange(%Copy.facet.0cb) [concrete] +// CHECK:STDOUT: %EmptyRange.Make.a25: %EmptyRange.Make.type.9ed = struct_value () [concrete] +// CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %EmptyRange.Make.a25, @EmptyRange.Make(%Copy.facet.0cb) [concrete] // CHECK:STDOUT: %Iterate.type: type = facet_type <@Iterate> [concrete] // CHECK:STDOUT: %Iterate.NewCursor.type: type = fn_type @Iterate.NewCursor [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.edc: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%T) [symbolic] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.894: %EmptyRange.as.Iterate.impl.NewCursor.type.edc = struct_value () [symbolic] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.dc6: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%T) [symbolic] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.c1f: %EmptyRange.as.Iterate.impl.Next.type.dc6 = struct_value () [symbolic] -// CHECK:STDOUT: %Optional.HasValue.type.f81: type = fn_type @Optional.HasValue, @Optional(%T) [symbolic] -// CHECK:STDOUT: %Optional.HasValue.6fd: %Optional.HasValue.type.f81 = struct_value () [symbolic] -// CHECK:STDOUT: %Optional.Get.type.b8f: type = fn_type @Optional.Get, @Optional(%T) [symbolic] -// CHECK:STDOUT: %Optional.Get.9c8: %Optional.Get.type.b8f = struct_value () [symbolic] -// CHECK:STDOUT: %Iterate.impl_witness.c25: = impl_witness imports.%Iterate.impl_witness_table, @EmptyRange.as.Iterate.impl(%C) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.887: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%C) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.cea: %EmptyRange.as.Iterate.impl.NewCursor.type.887 = struct_value () [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.6b4: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%C) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.7c1: %EmptyRange.as.Iterate.impl.Next.type.6b4 = struct_value () [concrete] -// CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %EmptyRange.cc8, (%Iterate.impl_witness.c25) [concrete] -// CHECK:STDOUT: %.f8c: type = fn_type_with_self_type %Iterate.NewCursor.type, %Iterate.facet [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.NewCursor.cea, @EmptyRange.as.Iterate.impl.NewCursor(%C) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.be4: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%T.049) [symbolic] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.61a: %EmptyRange.as.Iterate.impl.NewCursor.type.be4 = struct_value () [symbolic] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.859: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%T.049) [symbolic] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.cc1: %EmptyRange.as.Iterate.impl.Next.type.859 = struct_value () [symbolic] +// CHECK:STDOUT: %Optional.HasValue.type.091: type = fn_type @Optional.HasValue, @Optional(%T.049) [symbolic] +// CHECK:STDOUT: %Optional.HasValue.5a0: %Optional.HasValue.type.091 = struct_value () [symbolic] +// CHECK:STDOUT: %Optional.Get.type.618: type = fn_type @Optional.Get, @Optional(%T.049) [symbolic] +// CHECK:STDOUT: %Optional.Get.9cc: %Optional.Get.type.618 = struct_value () [symbolic] +// CHECK:STDOUT: %Iterate.impl_witness.4c0: = impl_witness imports.%Iterate.impl_witness_table, @EmptyRange.as.Iterate.impl(%Copy.facet.0cb) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.47b: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%Copy.facet.0cb) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.d11: %EmptyRange.as.Iterate.impl.NewCursor.type.47b = struct_value () [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.173: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%Copy.facet.0cb) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.cad: %EmptyRange.as.Iterate.impl.Next.type.173 = struct_value () [concrete] +// CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %EmptyRange.a62, (%Iterate.impl_witness.4c0) [concrete] +// CHECK:STDOUT: %.130: type = fn_type_with_self_type %Iterate.NewCursor.type, %Iterate.facet [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.NewCursor.d11, @EmptyRange.as.Iterate.impl.NewCursor(%Copy.facet.0cb) [concrete] // CHECK:STDOUT: %Iterate.Next.type: type = fn_type @Iterate.Next [concrete] -// CHECK:STDOUT: %.84f: type = fn_type_with_self_type %Iterate.Next.type, %Iterate.facet [concrete] -// CHECK:STDOUT: %Optional.cf0: type = class_type @Optional, @Optional(%C) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.Next.7c1, @EmptyRange.as.Iterate.impl.Next(%C) [concrete] -// CHECK:STDOUT: %Optional.HasValue.type.71d: type = fn_type @Optional.HasValue, @Optional(%C) [concrete] -// CHECK:STDOUT: %Optional.HasValue.513: %Optional.HasValue.type.71d = struct_value () [concrete] -// CHECK:STDOUT: %Optional.Get.type.115: type = fn_type @Optional.Get, @Optional(%C) [concrete] -// CHECK:STDOUT: %Optional.Get.9c1: %Optional.Get.type.115 = struct_value () [concrete] -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.513, @Optional.HasValue(%C) [concrete] -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.9c1, @Optional.Get(%C) [concrete] -// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.type.45e: type = fn_type @Optional.as.Destroy.impl.Op, @Optional.as.Destroy.impl(%C) [concrete] -// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.1e3: %Optional.as.Destroy.impl.Op.type.45e = struct_value () [concrete] -// CHECK:STDOUT: %ptr.8e6: type = ptr_type %Optional.cf0 [concrete] +// CHECK:STDOUT: %.cde: type = fn_type_with_self_type %Iterate.Next.type, %Iterate.facet [concrete] +// CHECK:STDOUT: %Optional.73d: type = class_type @Optional, @Optional(%Copy.facet.0cb) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.Next.cad, @EmptyRange.as.Iterate.impl.Next(%Copy.facet.0cb) [concrete] +// CHECK:STDOUT: %Optional.HasValue.type.c31: type = fn_type @Optional.HasValue, @Optional(%Copy.facet.0cb) [concrete] +// CHECK:STDOUT: %Optional.HasValue.e8d: %Optional.HasValue.type.c31 = struct_value () [concrete] +// CHECK:STDOUT: %Optional.Get.type.a20: type = fn_type @Optional.Get, @Optional(%Copy.facet.0cb) [concrete] +// CHECK:STDOUT: %Optional.Get.c56: %Optional.Get.type.a20 = struct_value () [concrete] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.e8d, @Optional.HasValue(%Copy.facet.0cb) [concrete] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.c56, @Optional.Get(%Copy.facet.0cb) [concrete] +// CHECK:STDOUT: %C.as.Destroy.impl.Op.type: type = fn_type @C.as.Destroy.impl.Op [concrete] +// CHECK:STDOUT: %C.as.Destroy.impl.Op: %C.as.Destroy.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete] +// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.type.26d: type = fn_type @Optional.as.Destroy.impl.Op, @Optional.as.Destroy.impl(%Copy.facet.0cb) [concrete] +// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.84e: %Optional.as.Destroy.impl.Op.type.26d = struct_value () [concrete] +// CHECK:STDOUT: %ptr.3f9: type = ptr_type %Optional.73d [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.type.456: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.24b: %T.as.Destroy.impl.Op.type.456 = struct_value () [concrete] -// CHECK:STDOUT: %EmptyRange.as.Destroy.impl.Op.type.9ef: type = fn_type @EmptyRange.as.Destroy.impl.Op, @EmptyRange.as.Destroy.impl(%C) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Destroy.impl.Op.046: %EmptyRange.as.Destroy.impl.Op.type.9ef = struct_value () [concrete] -// CHECK:STDOUT: %ptr.35d: type = ptr_type %EmptyRange.cc8 [concrete] +// CHECK:STDOUT: %EmptyRange.as.Destroy.impl.Op.type.334: type = fn_type @EmptyRange.as.Destroy.impl.Op, @EmptyRange.as.Destroy.impl(%Copy.facet.0cb) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Destroy.impl.Op.61e: %EmptyRange.as.Destroy.impl.Op.type.334 = struct_value () [concrete] +// CHECK:STDOUT: %ptr.49e: type = ptr_type %EmptyRange.a62 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Main.EmptyRange: %EmptyRange.type = import_ref Main//empty_range, EmptyRange, loaded [concrete = constants.%EmptyRange.generic] -// CHECK:STDOUT: %Main.import_ref.6ea: @EmptyRange.%EmptyRange.Make.type (%EmptyRange.Make.type.bd2) = import_ref Main//empty_range, loc5_21, loaded [symbolic = @EmptyRange.%EmptyRange.Make (constants.%EmptyRange.Make.ed1)] -// CHECK:STDOUT: %Main.import_ref.6ce = import_ref Main//empty_range, loc7_68, unloaded +// CHECK:STDOUT: %Main.C: type = import_ref Main//empty_range, C, loaded [concrete = constants.%C] +// CHECK:STDOUT: %Main.import_ref.787: @EmptyRange.%EmptyRange.Make.type (%EmptyRange.Make.type.7d6) = import_ref Main//empty_range, loc5_21, loaded [symbolic = @EmptyRange.%EmptyRange.Make (constants.%EmptyRange.Make.4cc)] +// CHECK:STDOUT: %Main.import_ref.a43 = import_ref Main//empty_range, loc19_33, unloaded +// CHECK:STDOUT: %Copy.impl_witness_table.349 = impl_witness_table (%Main.import_ref.a43), @C.as.Copy.impl [concrete] +// CHECK:STDOUT: %Main.import_ref.101 = import_ref Main//empty_range, loc7_68, unloaded // CHECK:STDOUT: %Main.import_ref.999 = import_ref Main//empty_range, loc7_68, unloaded -// CHECK:STDOUT: %Main.import_ref.694: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.edc) = import_ref Main//empty_range, loc8_38, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.894)] -// CHECK:STDOUT: %Main.import_ref.9dd: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.dc6) = import_ref Main//empty_range, loc11_58, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.c1f)] -// CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%Main.import_ref.6ce, %Main.import_ref.999, %Main.import_ref.694, %Main.import_ref.9dd), @EmptyRange.as.Iterate.impl [concrete] -// CHECK:STDOUT: %Main.import_ref.7f9: @Optional.%Optional.HasValue.type (%Optional.HasValue.type.f81) = import_ref Main//empty_range, inst140 [indirect], loaded [symbolic = @Optional.%Optional.HasValue (constants.%Optional.HasValue.6fd)] -// CHECK:STDOUT: %Main.import_ref.d10: @Optional.%Optional.Get.type (%Optional.Get.type.b8f) = import_ref Main//empty_range, inst141 [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.9c8)] +// CHECK:STDOUT: %Main.import_ref.8f30: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.be4) = import_ref Main//empty_range, loc8_38, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.61a)] +// CHECK:STDOUT: %Main.import_ref.881: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.859) = import_ref Main//empty_range, loc11_58, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.cc1)] +// CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%Main.import_ref.101, %Main.import_ref.999, %Main.import_ref.8f30, %Main.import_ref.881), @EmptyRange.as.Iterate.impl [concrete] +// CHECK:STDOUT: %Main.import_ref.13f: @Optional.%Optional.HasValue.type (%Optional.HasValue.type.091) = import_ref Main//empty_range, inst151 [indirect], loaded [symbolic = @Optional.%Optional.HasValue (constants.%Optional.HasValue.5a0)] +// CHECK:STDOUT: %Main.import_ref.a3b: @Optional.%Optional.Get.type (%Optional.Get.type.618) = import_ref Main//empty_range, inst152 [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.9cc)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { @@ -196,82 +201,84 @@ fn Run() { // CHECK:STDOUT: %c.patt: %pattern_type.c48 = binding_pattern c [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %EmptyRange.ref: %EmptyRange.type = name_ref EmptyRange, imports.%Main.EmptyRange [concrete = constants.%EmptyRange.generic] -// CHECK:STDOUT: %C.ref.loc12_27: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %EmptyRange: type = class_type @EmptyRange, @EmptyRange(constants.%C) [concrete = constants.%EmptyRange.cc8] -// CHECK:STDOUT: %.loc12_29: %EmptyRange.Make.type.557 = specific_constant imports.%Main.import_ref.6ea, @EmptyRange(constants.%C) [concrete = constants.%EmptyRange.Make.74d] -// CHECK:STDOUT: %Make.ref: %EmptyRange.Make.type.557 = name_ref Make, %.loc12_29 [concrete = constants.%EmptyRange.Make.74d] -// CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %Make.ref, @EmptyRange.Make(constants.%C) [concrete = constants.%EmptyRange.Make.specific_fn] -// CHECK:STDOUT: %.loc12_35.1: ref %EmptyRange.cc8 = temporary_storage -// CHECK:STDOUT: %EmptyRange.Make.call: init %EmptyRange.cc8 = call %EmptyRange.Make.specific_fn() to %.loc12_35.1 -// CHECK:STDOUT: %.loc12_35.2: ref %EmptyRange.cc8 = temporary %.loc12_35.1, %EmptyRange.Make.call -// CHECK:STDOUT: %impl.elem2: %.f8c = impl_witness_access constants.%Iterate.impl_witness.c25, element2 [concrete = constants.%EmptyRange.as.Iterate.impl.NewCursor.cea] -// CHECK:STDOUT: %bound_method.loc12_36.1: = bound_method %.loc12_35.2, %impl.elem2 -// CHECK:STDOUT: %specific_fn.loc12_36.1: = specific_function %impl.elem2, @EmptyRange.as.Iterate.impl.NewCursor(constants.%C) [concrete = constants.%EmptyRange.as.Iterate.impl.NewCursor.specific_fn] -// CHECK:STDOUT: %bound_method.loc12_36.2: = bound_method %.loc12_35.2, %specific_fn.loc12_36.1 -// CHECK:STDOUT: %.loc12_35.3: %EmptyRange.cc8 = bind_value %.loc12_35.2 -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.call: init %empty_struct_type = call %bound_method.loc12_36.2(%.loc12_35.3) +// CHECK:STDOUT: %C.ref.loc10_27: type = name_ref C, imports.%Main.C [concrete = constants.%C] +// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value constants.%C, (constants.%Copy.impl_witness.5fc) [concrete = constants.%Copy.facet.0cb] +// CHECK:STDOUT: %.loc10_28: %Copy.type = converted %C.ref.loc10_27, %Copy.facet [concrete = constants.%Copy.facet.0cb] +// CHECK:STDOUT: %EmptyRange: type = class_type @EmptyRange, @EmptyRange(constants.%Copy.facet.0cb) [concrete = constants.%EmptyRange.a62] +// CHECK:STDOUT: %.loc10_29: %EmptyRange.Make.type.9ed = specific_constant imports.%Main.import_ref.787, @EmptyRange(constants.%Copy.facet.0cb) [concrete = constants.%EmptyRange.Make.a25] +// CHECK:STDOUT: %Make.ref: %EmptyRange.Make.type.9ed = name_ref Make, %.loc10_29 [concrete = constants.%EmptyRange.Make.a25] +// CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %Make.ref, @EmptyRange.Make(constants.%Copy.facet.0cb) [concrete = constants.%EmptyRange.Make.specific_fn] +// CHECK:STDOUT: %.loc10_35.1: ref %EmptyRange.a62 = temporary_storage +// CHECK:STDOUT: %EmptyRange.Make.call: init %EmptyRange.a62 = call %EmptyRange.Make.specific_fn() to %.loc10_35.1 +// CHECK:STDOUT: %.loc10_35.2: ref %EmptyRange.a62 = temporary %.loc10_35.1, %EmptyRange.Make.call +// CHECK:STDOUT: %impl.elem2: %.130 = impl_witness_access constants.%Iterate.impl_witness.4c0, element2 [concrete = constants.%EmptyRange.as.Iterate.impl.NewCursor.d11] +// CHECK:STDOUT: %bound_method.loc10_36.1: = bound_method %.loc10_35.2, %impl.elem2 +// CHECK:STDOUT: %specific_fn.loc10_36.1: = specific_function %impl.elem2, @EmptyRange.as.Iterate.impl.NewCursor(constants.%Copy.facet.0cb) [concrete = constants.%EmptyRange.as.Iterate.impl.NewCursor.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_36.2: = bound_method %.loc10_35.2, %specific_fn.loc10_36.1 +// CHECK:STDOUT: %.loc10_35.3: %EmptyRange.a62 = bind_value %.loc10_35.2 +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.call: init %empty_struct_type = call %bound_method.loc10_36.2(%.loc10_35.3) // CHECK:STDOUT: %var: ref %empty_struct_type = var invalid // CHECK:STDOUT: assign %var, %EmptyRange.as.Iterate.impl.NewCursor.call // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.next: -// CHECK:STDOUT: %addr.loc12_36.1: %ptr.c28 = addr_of %var -// CHECK:STDOUT: %impl.elem3: %.84f = impl_witness_access constants.%Iterate.impl_witness.c25, element3 [concrete = constants.%EmptyRange.as.Iterate.impl.Next.7c1] -// CHECK:STDOUT: %bound_method.loc12_36.3: = bound_method %.loc12_35.2, %impl.elem3 -// CHECK:STDOUT: %specific_fn.loc12_36.2: = specific_function %impl.elem3, @EmptyRange.as.Iterate.impl.Next(constants.%C) [concrete = constants.%EmptyRange.as.Iterate.impl.Next.specific_fn] -// CHECK:STDOUT: %bound_method.loc12_36.4: = bound_method %.loc12_35.2, %specific_fn.loc12_36.2 -// CHECK:STDOUT: %.loc12_36.1: ref %Optional.cf0 = temporary_storage -// CHECK:STDOUT: %.loc12_35.4: %EmptyRange.cc8 = bind_value %.loc12_35.2 -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.call: init %Optional.cf0 = call %bound_method.loc12_36.4(%.loc12_35.4, %addr.loc12_36.1) to %.loc12_36.1 -// CHECK:STDOUT: %.loc12_36.2: ref %Optional.cf0 = temporary %.loc12_36.1, %EmptyRange.as.Iterate.impl.Next.call -// CHECK:STDOUT: %.loc12_36.3: %Optional.HasValue.type.71d = specific_constant imports.%Main.import_ref.7f9, @Optional(constants.%C) [concrete = constants.%Optional.HasValue.513] -// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.71d = name_ref HasValue, %.loc12_36.3 [concrete = constants.%Optional.HasValue.513] -// CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc12_36.2, %HasValue.ref -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%C) [concrete = constants.%Optional.HasValue.specific_fn] -// CHECK:STDOUT: %bound_method.loc12_36.5: = bound_method %.loc12_36.2, %Optional.HasValue.specific_fn -// CHECK:STDOUT: %.loc12_36.4: %Optional.cf0 = bind_value %.loc12_36.2 -// CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc12_36.5(%.loc12_36.4) -// CHECK:STDOUT: %.loc12_36.5: bool = value_of_initializer %Optional.HasValue.call -// CHECK:STDOUT: %.loc12_36.6: bool = converted %Optional.HasValue.call, %.loc12_36.5 -// CHECK:STDOUT: if %.loc12_36.6 br !for.body else br !for.done +// CHECK:STDOUT: %addr.loc10_36.1: %ptr.c28 = addr_of %var +// CHECK:STDOUT: %impl.elem3: %.cde = impl_witness_access constants.%Iterate.impl_witness.4c0, element3 [concrete = constants.%EmptyRange.as.Iterate.impl.Next.cad] +// CHECK:STDOUT: %bound_method.loc10_36.3: = bound_method %.loc10_35.2, %impl.elem3 +// CHECK:STDOUT: %specific_fn.loc10_36.2: = specific_function %impl.elem3, @EmptyRange.as.Iterate.impl.Next(constants.%Copy.facet.0cb) [concrete = constants.%EmptyRange.as.Iterate.impl.Next.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_36.4: = bound_method %.loc10_35.2, %specific_fn.loc10_36.2 +// CHECK:STDOUT: %.loc10_36.1: ref %Optional.73d = temporary_storage +// CHECK:STDOUT: %.loc10_35.4: %EmptyRange.a62 = bind_value %.loc10_35.2 +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.call: init %Optional.73d = call %bound_method.loc10_36.4(%.loc10_35.4, %addr.loc10_36.1) to %.loc10_36.1 +// CHECK:STDOUT: %.loc10_36.2: ref %Optional.73d = temporary %.loc10_36.1, %EmptyRange.as.Iterate.impl.Next.call +// CHECK:STDOUT: %.loc10_36.3: %Optional.HasValue.type.c31 = specific_constant imports.%Main.import_ref.13f, @Optional(constants.%Copy.facet.0cb) [concrete = constants.%Optional.HasValue.e8d] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.c31 = name_ref HasValue, %.loc10_36.3 [concrete = constants.%Optional.HasValue.e8d] +// CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc10_36.2, %HasValue.ref +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%Copy.facet.0cb) [concrete = constants.%Optional.HasValue.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_36.5: = bound_method %.loc10_36.2, %Optional.HasValue.specific_fn +// CHECK:STDOUT: %.loc10_36.4: %Optional.73d = bind_value %.loc10_36.2 +// CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc10_36.5(%.loc10_36.4) +// CHECK:STDOUT: %.loc10_36.5: bool = value_of_initializer %Optional.HasValue.call +// CHECK:STDOUT: %.loc10_36.6: bool = converted %Optional.HasValue.call, %.loc10_36.5 +// CHECK:STDOUT: if %.loc10_36.6 br !for.body else br !for.done // CHECK:STDOUT: // CHECK:STDOUT: !for.body: -// CHECK:STDOUT: %.loc12_36.7: %Optional.Get.type.115 = specific_constant imports.%Main.import_ref.d10, @Optional(constants.%C) [concrete = constants.%Optional.Get.9c1] -// CHECK:STDOUT: %Get.ref: %Optional.Get.type.115 = name_ref Get, %.loc12_36.7 [concrete = constants.%Optional.Get.9c1] -// CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc12_36.2, %Get.ref -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%C) [concrete = constants.%Optional.Get.specific_fn] -// CHECK:STDOUT: %bound_method.loc12_36.6: = bound_method %.loc12_36.2, %Optional.Get.specific_fn -// CHECK:STDOUT: %.loc12_36.8: ref %C = temporary_storage -// CHECK:STDOUT: %.loc12_36.9: %Optional.cf0 = bind_value %.loc12_36.2 -// CHECK:STDOUT: %Optional.Get.call: init %C = call %bound_method.loc12_36.6(%.loc12_36.9) to %.loc12_36.8 -// CHECK:STDOUT: %C.ref.loc12_11: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %.loc12_36.10: ref %C = temporary %.loc12_36.8, %Optional.Get.call -// CHECK:STDOUT: %.loc12_36.11: %C = bind_value %.loc12_36.10 -// CHECK:STDOUT: %c: %C = bind_name c, %.loc12_36.11 +// CHECK:STDOUT: %.loc10_36.7: %Optional.Get.type.a20 = specific_constant imports.%Main.import_ref.a3b, @Optional(constants.%Copy.facet.0cb) [concrete = constants.%Optional.Get.c56] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.a20 = name_ref Get, %.loc10_36.7 [concrete = constants.%Optional.Get.c56] +// CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc10_36.2, %Get.ref +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%Copy.facet.0cb) [concrete = constants.%Optional.Get.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_36.6: = bound_method %.loc10_36.2, %Optional.Get.specific_fn +// CHECK:STDOUT: %.loc10_36.8: ref %C = temporary_storage +// CHECK:STDOUT: %.loc10_36.9: %Optional.73d = bind_value %.loc10_36.2 +// CHECK:STDOUT: %Optional.Get.call: init %C = call %bound_method.loc10_36.6(%.loc10_36.9) to %.loc10_36.8 +// CHECK:STDOUT: %C.ref.loc10_11: type = name_ref C, imports.%Main.C [concrete = constants.%C] +// CHECK:STDOUT: %.loc10_36.10: ref %C = temporary %.loc10_36.8, %Optional.Get.call +// CHECK:STDOUT: %.loc10_36.11: %C = bind_value %.loc10_36.10 +// CHECK:STDOUT: %c: %C = bind_name c, %.loc10_36.11 // CHECK:STDOUT: %Body.ref: %Body.type = name_ref Body, file.%Body.decl [concrete = constants.%Body] // CHECK:STDOUT: %c.ref: %C = name_ref c, %c // CHECK:STDOUT: %Body.call: init %empty_tuple.type = call %Body.ref(%c.ref) // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %C.as.Destroy.impl.Op.bound: = bound_method %.loc12_36.10, constants.%C.as.Destroy.impl.Op -// CHECK:STDOUT: %addr.loc12_36.2: %ptr.019 = addr_of %.loc12_36.10 -// CHECK:STDOUT: %C.as.Destroy.impl.Op.call: init %empty_tuple.type = call %C.as.Destroy.impl.Op.bound(%addr.loc12_36.2) -// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.bound: = bound_method %.loc12_36.2, constants.%Optional.as.Destroy.impl.Op.1e3 +// CHECK:STDOUT: %C.as.Destroy.impl.Op.bound: = bound_method %.loc10_36.10, constants.%C.as.Destroy.impl.Op +// CHECK:STDOUT: %addr.loc10_36.2: %ptr.019 = addr_of %.loc10_36.10 +// CHECK:STDOUT: %C.as.Destroy.impl.Op.call: init %empty_tuple.type = call %C.as.Destroy.impl.Op.bound(%addr.loc10_36.2) +// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.bound: = bound_method %.loc10_36.2, constants.%Optional.as.Destroy.impl.Op.84e // CHECK:STDOUT: -// CHECK:STDOUT: %bound_method.loc12_36.7: = bound_method %.loc12_36.2, %Optional.as.Destroy.impl.Op.specific_fn -// CHECK:STDOUT: %addr.loc12_36.3: %ptr.8e6 = addr_of %.loc12_36.2 -// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc12_36.7(%addr.loc12_36.3) +// CHECK:STDOUT: %bound_method.loc10_36.7: = bound_method %.loc10_36.2, %Optional.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %addr.loc10_36.3: %ptr.3f9 = addr_of %.loc10_36.2 +// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc10_36.7(%addr.loc10_36.3) // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound: = bound_method %var, constants.%T.as.Destroy.impl.Op.24b // CHECK:STDOUT: -// CHECK:STDOUT: %bound_method.loc12_36.8: = bound_method %var, %T.as.Destroy.impl.Op.specific_fn -// CHECK:STDOUT: %addr.loc12_36.4: %ptr.c28 = addr_of %var -// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc12_36.8(%addr.loc12_36.4) -// CHECK:STDOUT: %EmptyRange.as.Destroy.impl.Op.bound: = bound_method %.loc12_35.2, constants.%EmptyRange.as.Destroy.impl.Op.046 +// CHECK:STDOUT: %bound_method.loc10_36.8: = bound_method %var, %T.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %addr.loc10_36.4: %ptr.c28 = addr_of %var +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc10_36.8(%addr.loc10_36.4) +// CHECK:STDOUT: %EmptyRange.as.Destroy.impl.Op.bound: = bound_method %.loc10_35.2, constants.%EmptyRange.as.Destroy.impl.Op.61e // CHECK:STDOUT: -// CHECK:STDOUT: %bound_method.loc12_35: = bound_method %.loc12_35.2, %EmptyRange.as.Destroy.impl.Op.specific_fn -// CHECK:STDOUT: %addr.loc12_35: %ptr.35d = addr_of %.loc12_35.2 -// CHECK:STDOUT: %EmptyRange.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc12_35(%addr.loc12_35) +// CHECK:STDOUT: %bound_method.loc10_35: = bound_method %.loc10_35.2, %EmptyRange.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %addr.loc10_35: %ptr.49e = addr_of %.loc10_35.2 +// CHECK:STDOUT: %EmptyRange.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc10_35(%addr.loc10_35) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -279,72 +286,78 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [concrete] -// CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete] -// CHECK:STDOUT: %C.as.Destroy.impl.Op.type: type = fn_type @C.as.Destroy.impl.Op [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] -// CHECK:STDOUT: %C.as.Destroy.impl.Op: %C.as.Destroy.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete] // CHECK:STDOUT: %Body.type: type = fn_type @Body [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Body: %Body.type = struct_value () [concrete] // CHECK:STDOUT: %ptr.c28: type = ptr_type %empty_struct_type [concrete] // CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete] // CHECK:STDOUT: %EmptyRange.type: type = generic_class_type @EmptyRange [concrete] // CHECK:STDOUT: %EmptyRange.generic: %EmptyRange.type = struct_value () [concrete] -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] -// CHECK:STDOUT: %EmptyRange.Make.type.bd2: type = fn_type @EmptyRange.Make, @EmptyRange(%T) [symbolic] -// CHECK:STDOUT: %EmptyRange.Make.ed1: %EmptyRange.Make.type.bd2 = struct_value () [symbolic] -// CHECK:STDOUT: %EmptyRange.cc8: type = class_type @EmptyRange, @EmptyRange(%C) [concrete] -// CHECK:STDOUT: %EmptyRange.Make.type.557: type = fn_type @EmptyRange.Make, @EmptyRange(%C) [concrete] -// CHECK:STDOUT: %EmptyRange.Make.74d: %EmptyRange.Make.type.557 = struct_value () [concrete] -// CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %EmptyRange.Make.74d, @EmptyRange.Make(%C) [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %T.049: %Copy.type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %EmptyRange.Make.type.7d6: type = fn_type @EmptyRange.Make, @EmptyRange(%T.049) [symbolic] +// CHECK:STDOUT: %EmptyRange.Make.4cc: %EmptyRange.Make.type.7d6 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.5fc: = impl_witness imports.%Copy.impl_witness_table.349 [concrete] +// CHECK:STDOUT: %Copy.facet.0cb: %Copy.type = facet_value %C, (%Copy.impl_witness.5fc) [concrete] +// CHECK:STDOUT: %EmptyRange.a62: type = class_type @EmptyRange, @EmptyRange(%Copy.facet.0cb) [concrete] +// CHECK:STDOUT: %EmptyRange.Make.type.9ed: type = fn_type @EmptyRange.Make, @EmptyRange(%Copy.facet.0cb) [concrete] +// CHECK:STDOUT: %EmptyRange.Make.a25: %EmptyRange.Make.type.9ed = struct_value () [concrete] +// CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %EmptyRange.Make.a25, @EmptyRange.Make(%Copy.facet.0cb) [concrete] // CHECK:STDOUT: %Iterate.type: type = facet_type <@Iterate> [concrete] // CHECK:STDOUT: %Iterate.NewCursor.type: type = fn_type @Iterate.NewCursor [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.edc: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%T) [symbolic] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.894: %EmptyRange.as.Iterate.impl.NewCursor.type.edc = struct_value () [symbolic] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.dc6: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%T) [symbolic] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.c1f: %EmptyRange.as.Iterate.impl.Next.type.dc6 = struct_value () [symbolic] -// CHECK:STDOUT: %Optional.HasValue.type.f81: type = fn_type @Optional.HasValue, @Optional(%T) [symbolic] -// CHECK:STDOUT: %Optional.HasValue.6fd: %Optional.HasValue.type.f81 = struct_value () [symbolic] -// CHECK:STDOUT: %Optional.Get.type.b8f: type = fn_type @Optional.Get, @Optional(%T) [symbolic] -// CHECK:STDOUT: %Optional.Get.9c8: %Optional.Get.type.b8f = struct_value () [symbolic] -// CHECK:STDOUT: %Iterate.impl_witness.c25: = impl_witness imports.%Iterate.impl_witness_table, @EmptyRange.as.Iterate.impl(%C) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.887: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%C) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.cea: %EmptyRange.as.Iterate.impl.NewCursor.type.887 = struct_value () [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.6b4: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%C) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.7c1: %EmptyRange.as.Iterate.impl.Next.type.6b4 = struct_value () [concrete] -// CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %EmptyRange.cc8, (%Iterate.impl_witness.c25) [concrete] -// CHECK:STDOUT: %.f8c: type = fn_type_with_self_type %Iterate.NewCursor.type, %Iterate.facet [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.NewCursor.cea, @EmptyRange.as.Iterate.impl.NewCursor(%C) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.be4: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%T.049) [symbolic] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.61a: %EmptyRange.as.Iterate.impl.NewCursor.type.be4 = struct_value () [symbolic] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.859: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%T.049) [symbolic] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.cc1: %EmptyRange.as.Iterate.impl.Next.type.859 = struct_value () [symbolic] +// CHECK:STDOUT: %Optional.HasValue.type.091: type = fn_type @Optional.HasValue, @Optional(%T.049) [symbolic] +// CHECK:STDOUT: %Optional.HasValue.5a0: %Optional.HasValue.type.091 = struct_value () [symbolic] +// CHECK:STDOUT: %Optional.Get.type.618: type = fn_type @Optional.Get, @Optional(%T.049) [symbolic] +// CHECK:STDOUT: %Optional.Get.9cc: %Optional.Get.type.618 = struct_value () [symbolic] +// CHECK:STDOUT: %Iterate.impl_witness.4c0: = impl_witness imports.%Iterate.impl_witness_table, @EmptyRange.as.Iterate.impl(%Copy.facet.0cb) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.47b: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%Copy.facet.0cb) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.d11: %EmptyRange.as.Iterate.impl.NewCursor.type.47b = struct_value () [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.173: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%Copy.facet.0cb) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.cad: %EmptyRange.as.Iterate.impl.Next.type.173 = struct_value () [concrete] +// CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %EmptyRange.a62, (%Iterate.impl_witness.4c0) [concrete] +// CHECK:STDOUT: %.130: type = fn_type_with_self_type %Iterate.NewCursor.type, %Iterate.facet [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.NewCursor.d11, @EmptyRange.as.Iterate.impl.NewCursor(%Copy.facet.0cb) [concrete] // CHECK:STDOUT: %Iterate.Next.type: type = fn_type @Iterate.Next [concrete] -// CHECK:STDOUT: %.84f: type = fn_type_with_self_type %Iterate.Next.type, %Iterate.facet [concrete] -// CHECK:STDOUT: %Optional.cf0: type = class_type @Optional, @Optional(%C) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.Next.7c1, @EmptyRange.as.Iterate.impl.Next(%C) [concrete] -// CHECK:STDOUT: %Optional.HasValue.type.71d: type = fn_type @Optional.HasValue, @Optional(%C) [concrete] -// CHECK:STDOUT: %Optional.HasValue.513: %Optional.HasValue.type.71d = struct_value () [concrete] -// CHECK:STDOUT: %Optional.Get.type.115: type = fn_type @Optional.Get, @Optional(%C) [concrete] -// CHECK:STDOUT: %Optional.Get.9c1: %Optional.Get.type.115 = struct_value () [concrete] -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.513, @Optional.HasValue(%C) [concrete] -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.9c1, @Optional.Get(%C) [concrete] -// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.type.45e: type = fn_type @Optional.as.Destroy.impl.Op, @Optional.as.Destroy.impl(%C) [concrete] -// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.1e3: %Optional.as.Destroy.impl.Op.type.45e = struct_value () [concrete] -// CHECK:STDOUT: %ptr.8e6: type = ptr_type %Optional.cf0 [concrete] +// CHECK:STDOUT: %.cde: type = fn_type_with_self_type %Iterate.Next.type, %Iterate.facet [concrete] +// CHECK:STDOUT: %Optional.73d: type = class_type @Optional, @Optional(%Copy.facet.0cb) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.Next.cad, @EmptyRange.as.Iterate.impl.Next(%Copy.facet.0cb) [concrete] +// CHECK:STDOUT: %Optional.HasValue.type.c31: type = fn_type @Optional.HasValue, @Optional(%Copy.facet.0cb) [concrete] +// CHECK:STDOUT: %Optional.HasValue.e8d: %Optional.HasValue.type.c31 = struct_value () [concrete] +// CHECK:STDOUT: %Optional.Get.type.a20: type = fn_type @Optional.Get, @Optional(%Copy.facet.0cb) [concrete] +// CHECK:STDOUT: %Optional.Get.c56: %Optional.Get.type.a20 = struct_value () [concrete] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.e8d, @Optional.HasValue(%Copy.facet.0cb) [concrete] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.c56, @Optional.Get(%Copy.facet.0cb) [concrete] +// CHECK:STDOUT: %C.as.Destroy.impl.Op.type: type = fn_type @C.as.Destroy.impl.Op [concrete] +// CHECK:STDOUT: %C.as.Destroy.impl.Op: %C.as.Destroy.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.type.26d: type = fn_type @Optional.as.Destroy.impl.Op, @Optional.as.Destroy.impl(%Copy.facet.0cb) [concrete] +// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.84e: %Optional.as.Destroy.impl.Op.type.26d = struct_value () [concrete] +// CHECK:STDOUT: %ptr.3f9: type = ptr_type %Optional.73d [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.type.456: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.24b: %T.as.Destroy.impl.Op.type.456 = struct_value () [concrete] -// CHECK:STDOUT: %EmptyRange.as.Destroy.impl.Op.type.9ef: type = fn_type @EmptyRange.as.Destroy.impl.Op, @EmptyRange.as.Destroy.impl(%C) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Destroy.impl.Op.046: %EmptyRange.as.Destroy.impl.Op.type.9ef = struct_value () [concrete] -// CHECK:STDOUT: %ptr.35d: type = ptr_type %EmptyRange.cc8 [concrete] +// CHECK:STDOUT: %EmptyRange.as.Destroy.impl.Op.type.334: type = fn_type @EmptyRange.as.Destroy.impl.Op, @EmptyRange.as.Destroy.impl(%Copy.facet.0cb) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Destroy.impl.Op.61e: %EmptyRange.as.Destroy.impl.Op.type.334 = struct_value () [concrete] +// CHECK:STDOUT: %ptr.49e: type = ptr_type %EmptyRange.a62 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Main.EmptyRange: %EmptyRange.type = import_ref Main//empty_range, EmptyRange, loaded [concrete = constants.%EmptyRange.generic] -// CHECK:STDOUT: %Main.import_ref.6ea: @EmptyRange.%EmptyRange.Make.type (%EmptyRange.Make.type.bd2) = import_ref Main//empty_range, loc5_21, loaded [symbolic = @EmptyRange.%EmptyRange.Make (constants.%EmptyRange.Make.ed1)] -// CHECK:STDOUT: %Main.import_ref.6ce = import_ref Main//empty_range, loc7_68, unloaded +// CHECK:STDOUT: %Main.C: type = import_ref Main//empty_range, C, loaded [concrete = constants.%C] +// CHECK:STDOUT: %Main.import_ref.787: @EmptyRange.%EmptyRange.Make.type (%EmptyRange.Make.type.7d6) = import_ref Main//empty_range, loc5_21, loaded [symbolic = @EmptyRange.%EmptyRange.Make (constants.%EmptyRange.Make.4cc)] +// CHECK:STDOUT: %Main.import_ref.a43 = import_ref Main//empty_range, loc19_33, unloaded +// CHECK:STDOUT: %Copy.impl_witness_table.349 = impl_witness_table (%Main.import_ref.a43), @C.as.Copy.impl [concrete] +// CHECK:STDOUT: %Main.import_ref.101 = import_ref Main//empty_range, loc7_68, unloaded // CHECK:STDOUT: %Main.import_ref.999 = import_ref Main//empty_range, loc7_68, unloaded -// CHECK:STDOUT: %Main.import_ref.694: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.edc) = import_ref Main//empty_range, loc8_38, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.894)] -// CHECK:STDOUT: %Main.import_ref.9dd: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.dc6) = import_ref Main//empty_range, loc11_58, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.c1f)] -// CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%Main.import_ref.6ce, %Main.import_ref.999, %Main.import_ref.694, %Main.import_ref.9dd), @EmptyRange.as.Iterate.impl [concrete] -// CHECK:STDOUT: %Main.import_ref.7f9: @Optional.%Optional.HasValue.type (%Optional.HasValue.type.f81) = import_ref Main//empty_range, inst140 [indirect], loaded [symbolic = @Optional.%Optional.HasValue (constants.%Optional.HasValue.6fd)] -// CHECK:STDOUT: %Main.import_ref.d10: @Optional.%Optional.Get.type (%Optional.Get.type.b8f) = import_ref Main//empty_range, inst141 [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.9c8)] +// CHECK:STDOUT: %Main.import_ref.8f30: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.be4) = import_ref Main//empty_range, loc8_38, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.61a)] +// CHECK:STDOUT: %Main.import_ref.881: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.859) = import_ref Main//empty_range, loc11_58, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.cc1)] +// CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%Main.import_ref.101, %Main.import_ref.999, %Main.import_ref.8f30, %Main.import_ref.881), @EmptyRange.as.Iterate.impl [concrete] +// CHECK:STDOUT: %Main.import_ref.13f: @Optional.%Optional.HasValue.type (%Optional.HasValue.type.091) = import_ref Main//empty_range, inst151 [indirect], loaded [symbolic = @Optional.%Optional.HasValue (constants.%Optional.HasValue.5a0)] +// CHECK:STDOUT: %Main.import_ref.a3b: @Optional.%Optional.Get.type (%Optional.Get.type.618) = import_ref Main//empty_range, inst152 [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.9cc)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { @@ -354,83 +367,85 @@ fn Run() { // CHECK:STDOUT: %c.var_patt: %pattern_type.c48 = var_pattern %c.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %EmptyRange.ref: %EmptyRange.type = name_ref EmptyRange, imports.%Main.EmptyRange [concrete = constants.%EmptyRange.generic] -// CHECK:STDOUT: %C.ref.loc12_31: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %EmptyRange: type = class_type @EmptyRange, @EmptyRange(constants.%C) [concrete = constants.%EmptyRange.cc8] -// CHECK:STDOUT: %.loc12_33: %EmptyRange.Make.type.557 = specific_constant imports.%Main.import_ref.6ea, @EmptyRange(constants.%C) [concrete = constants.%EmptyRange.Make.74d] -// CHECK:STDOUT: %Make.ref: %EmptyRange.Make.type.557 = name_ref Make, %.loc12_33 [concrete = constants.%EmptyRange.Make.74d] -// CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %Make.ref, @EmptyRange.Make(constants.%C) [concrete = constants.%EmptyRange.Make.specific_fn] -// CHECK:STDOUT: %.loc12_39.1: ref %EmptyRange.cc8 = temporary_storage -// CHECK:STDOUT: %EmptyRange.Make.call: init %EmptyRange.cc8 = call %EmptyRange.Make.specific_fn() to %.loc12_39.1 -// CHECK:STDOUT: %.loc12_39.2: ref %EmptyRange.cc8 = temporary %.loc12_39.1, %EmptyRange.Make.call -// CHECK:STDOUT: %impl.elem2: %.f8c = impl_witness_access constants.%Iterate.impl_witness.c25, element2 [concrete = constants.%EmptyRange.as.Iterate.impl.NewCursor.cea] -// CHECK:STDOUT: %bound_method.loc12_40.1: = bound_method %.loc12_39.2, %impl.elem2 -// CHECK:STDOUT: %specific_fn.loc12_40.1: = specific_function %impl.elem2, @EmptyRange.as.Iterate.impl.NewCursor(constants.%C) [concrete = constants.%EmptyRange.as.Iterate.impl.NewCursor.specific_fn] -// CHECK:STDOUT: %bound_method.loc12_40.2: = bound_method %.loc12_39.2, %specific_fn.loc12_40.1 -// CHECK:STDOUT: %.loc12_39.3: %EmptyRange.cc8 = bind_value %.loc12_39.2 -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.call: init %empty_struct_type = call %bound_method.loc12_40.2(%.loc12_39.3) +// CHECK:STDOUT: %C.ref.loc10_31: type = name_ref C, imports.%Main.C [concrete = constants.%C] +// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value constants.%C, (constants.%Copy.impl_witness.5fc) [concrete = constants.%Copy.facet.0cb] +// CHECK:STDOUT: %.loc10_32: %Copy.type = converted %C.ref.loc10_31, %Copy.facet [concrete = constants.%Copy.facet.0cb] +// CHECK:STDOUT: %EmptyRange: type = class_type @EmptyRange, @EmptyRange(constants.%Copy.facet.0cb) [concrete = constants.%EmptyRange.a62] +// CHECK:STDOUT: %.loc10_33: %EmptyRange.Make.type.9ed = specific_constant imports.%Main.import_ref.787, @EmptyRange(constants.%Copy.facet.0cb) [concrete = constants.%EmptyRange.Make.a25] +// CHECK:STDOUT: %Make.ref: %EmptyRange.Make.type.9ed = name_ref Make, %.loc10_33 [concrete = constants.%EmptyRange.Make.a25] +// CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %Make.ref, @EmptyRange.Make(constants.%Copy.facet.0cb) [concrete = constants.%EmptyRange.Make.specific_fn] +// CHECK:STDOUT: %.loc10_39.1: ref %EmptyRange.a62 = temporary_storage +// CHECK:STDOUT: %EmptyRange.Make.call: init %EmptyRange.a62 = call %EmptyRange.Make.specific_fn() to %.loc10_39.1 +// CHECK:STDOUT: %.loc10_39.2: ref %EmptyRange.a62 = temporary %.loc10_39.1, %EmptyRange.Make.call +// CHECK:STDOUT: %impl.elem2: %.130 = impl_witness_access constants.%Iterate.impl_witness.4c0, element2 [concrete = constants.%EmptyRange.as.Iterate.impl.NewCursor.d11] +// CHECK:STDOUT: %bound_method.loc10_40.1: = bound_method %.loc10_39.2, %impl.elem2 +// CHECK:STDOUT: %specific_fn.loc10_40.1: = specific_function %impl.elem2, @EmptyRange.as.Iterate.impl.NewCursor(constants.%Copy.facet.0cb) [concrete = constants.%EmptyRange.as.Iterate.impl.NewCursor.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_40.2: = bound_method %.loc10_39.2, %specific_fn.loc10_40.1 +// CHECK:STDOUT: %.loc10_39.3: %EmptyRange.a62 = bind_value %.loc10_39.2 +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.call: init %empty_struct_type = call %bound_method.loc10_40.2(%.loc10_39.3) // CHECK:STDOUT: %var: ref %empty_struct_type = var invalid // CHECK:STDOUT: assign %var, %EmptyRange.as.Iterate.impl.NewCursor.call // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.next: -// CHECK:STDOUT: %addr.loc12_40.1: %ptr.c28 = addr_of %var -// CHECK:STDOUT: %impl.elem3: %.84f = impl_witness_access constants.%Iterate.impl_witness.c25, element3 [concrete = constants.%EmptyRange.as.Iterate.impl.Next.7c1] -// CHECK:STDOUT: %bound_method.loc12_40.3: = bound_method %.loc12_39.2, %impl.elem3 -// CHECK:STDOUT: %specific_fn.loc12_40.2: = specific_function %impl.elem3, @EmptyRange.as.Iterate.impl.Next(constants.%C) [concrete = constants.%EmptyRange.as.Iterate.impl.Next.specific_fn] -// CHECK:STDOUT: %bound_method.loc12_40.4: = bound_method %.loc12_39.2, %specific_fn.loc12_40.2 -// CHECK:STDOUT: %.loc12_40.1: ref %Optional.cf0 = temporary_storage -// CHECK:STDOUT: %.loc12_39.4: %EmptyRange.cc8 = bind_value %.loc12_39.2 -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.call: init %Optional.cf0 = call %bound_method.loc12_40.4(%.loc12_39.4, %addr.loc12_40.1) to %.loc12_40.1 -// CHECK:STDOUT: %.loc12_40.2: ref %Optional.cf0 = temporary %.loc12_40.1, %EmptyRange.as.Iterate.impl.Next.call -// CHECK:STDOUT: %.loc12_40.3: %Optional.HasValue.type.71d = specific_constant imports.%Main.import_ref.7f9, @Optional(constants.%C) [concrete = constants.%Optional.HasValue.513] -// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.71d = name_ref HasValue, %.loc12_40.3 [concrete = constants.%Optional.HasValue.513] -// CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc12_40.2, %HasValue.ref -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%C) [concrete = constants.%Optional.HasValue.specific_fn] -// CHECK:STDOUT: %bound_method.loc12_40.5: = bound_method %.loc12_40.2, %Optional.HasValue.specific_fn -// CHECK:STDOUT: %.loc12_40.4: %Optional.cf0 = bind_value %.loc12_40.2 -// CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc12_40.5(%.loc12_40.4) -// CHECK:STDOUT: %.loc12_40.5: bool = value_of_initializer %Optional.HasValue.call -// CHECK:STDOUT: %.loc12_40.6: bool = converted %Optional.HasValue.call, %.loc12_40.5 -// CHECK:STDOUT: if %.loc12_40.6 br !for.body else br !for.done +// CHECK:STDOUT: %addr.loc10_40.1: %ptr.c28 = addr_of %var +// CHECK:STDOUT: %impl.elem3: %.cde = impl_witness_access constants.%Iterate.impl_witness.4c0, element3 [concrete = constants.%EmptyRange.as.Iterate.impl.Next.cad] +// CHECK:STDOUT: %bound_method.loc10_40.3: = bound_method %.loc10_39.2, %impl.elem3 +// CHECK:STDOUT: %specific_fn.loc10_40.2: = specific_function %impl.elem3, @EmptyRange.as.Iterate.impl.Next(constants.%Copy.facet.0cb) [concrete = constants.%EmptyRange.as.Iterate.impl.Next.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_40.4: = bound_method %.loc10_39.2, %specific_fn.loc10_40.2 +// CHECK:STDOUT: %.loc10_40.1: ref %Optional.73d = temporary_storage +// CHECK:STDOUT: %.loc10_39.4: %EmptyRange.a62 = bind_value %.loc10_39.2 +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.call: init %Optional.73d = call %bound_method.loc10_40.4(%.loc10_39.4, %addr.loc10_40.1) to %.loc10_40.1 +// CHECK:STDOUT: %.loc10_40.2: ref %Optional.73d = temporary %.loc10_40.1, %EmptyRange.as.Iterate.impl.Next.call +// CHECK:STDOUT: %.loc10_40.3: %Optional.HasValue.type.c31 = specific_constant imports.%Main.import_ref.13f, @Optional(constants.%Copy.facet.0cb) [concrete = constants.%Optional.HasValue.e8d] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.c31 = name_ref HasValue, %.loc10_40.3 [concrete = constants.%Optional.HasValue.e8d] +// CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc10_40.2, %HasValue.ref +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%Copy.facet.0cb) [concrete = constants.%Optional.HasValue.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_40.5: = bound_method %.loc10_40.2, %Optional.HasValue.specific_fn +// CHECK:STDOUT: %.loc10_40.4: %Optional.73d = bind_value %.loc10_40.2 +// CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc10_40.5(%.loc10_40.4) +// CHECK:STDOUT: %.loc10_40.5: bool = value_of_initializer %Optional.HasValue.call +// CHECK:STDOUT: %.loc10_40.6: bool = converted %Optional.HasValue.call, %.loc10_40.5 +// CHECK:STDOUT: if %.loc10_40.6 br !for.body else br !for.done // CHECK:STDOUT: // CHECK:STDOUT: !for.body: // CHECK:STDOUT: %c.var: ref %C = var %c.var_patt -// CHECK:STDOUT: %.loc12_40.7: %Optional.Get.type.115 = specific_constant imports.%Main.import_ref.d10, @Optional(constants.%C) [concrete = constants.%Optional.Get.9c1] -// CHECK:STDOUT: %Get.ref: %Optional.Get.type.115 = name_ref Get, %.loc12_40.7 [concrete = constants.%Optional.Get.9c1] -// CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc12_40.2, %Get.ref -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%C) [concrete = constants.%Optional.Get.specific_fn] -// CHECK:STDOUT: %bound_method.loc12_40.6: = bound_method %.loc12_40.2, %Optional.Get.specific_fn -// CHECK:STDOUT: %.loc12_8: ref %C = splice_block %c.var {} -// CHECK:STDOUT: %.loc12_40.8: %Optional.cf0 = bind_value %.loc12_40.2 -// CHECK:STDOUT: %Optional.Get.call: init %C = call %bound_method.loc12_40.6(%.loc12_40.8) to %.loc12_8 +// CHECK:STDOUT: %.loc10_40.7: %Optional.Get.type.a20 = specific_constant imports.%Main.import_ref.a3b, @Optional(constants.%Copy.facet.0cb) [concrete = constants.%Optional.Get.c56] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.a20 = name_ref Get, %.loc10_40.7 [concrete = constants.%Optional.Get.c56] +// CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc10_40.2, %Get.ref +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%Copy.facet.0cb) [concrete = constants.%Optional.Get.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_40.6: = bound_method %.loc10_40.2, %Optional.Get.specific_fn +// CHECK:STDOUT: %.loc10_8: ref %C = splice_block %c.var {} +// CHECK:STDOUT: %.loc10_40.8: %Optional.73d = bind_value %.loc10_40.2 +// CHECK:STDOUT: %Optional.Get.call: init %C = call %bound_method.loc10_40.6(%.loc10_40.8) to %.loc10_8 // CHECK:STDOUT: assign %c.var, %Optional.Get.call -// CHECK:STDOUT: %C.ref.loc12_15: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %C.ref.loc10_15: type = name_ref C, imports.%Main.C [concrete = constants.%C] // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: %Body.ref: %Body.type = name_ref Body, file.%Body.decl [concrete = constants.%Body] // CHECK:STDOUT: %c.ref: ref %C = name_ref c, %c -// CHECK:STDOUT: %addr.loc13: %ptr.019 = addr_of %c.ref -// CHECK:STDOUT: %Body.call: init %empty_tuple.type = call %Body.ref(%addr.loc13) +// CHECK:STDOUT: %addr.loc11: %ptr.019 = addr_of %c.ref +// CHECK:STDOUT: %Body.call: init %empty_tuple.type = call %Body.ref(%addr.loc11) // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: // CHECK:STDOUT: %C.as.Destroy.impl.Op.bound: = bound_method %c.var, constants.%C.as.Destroy.impl.Op -// CHECK:STDOUT: %addr.loc12_8: %ptr.019 = addr_of %c.var -// CHECK:STDOUT: %C.as.Destroy.impl.Op.call: init %empty_tuple.type = call %C.as.Destroy.impl.Op.bound(%addr.loc12_8) -// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.bound: = bound_method %.loc12_40.2, constants.%Optional.as.Destroy.impl.Op.1e3 +// CHECK:STDOUT: %addr.loc10_8: %ptr.019 = addr_of %c.var +// CHECK:STDOUT: %C.as.Destroy.impl.Op.call: init %empty_tuple.type = call %C.as.Destroy.impl.Op.bound(%addr.loc10_8) +// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.bound: = bound_method %.loc10_40.2, constants.%Optional.as.Destroy.impl.Op.84e // CHECK:STDOUT: -// CHECK:STDOUT: %bound_method.loc12_40.7: = bound_method %.loc12_40.2, %Optional.as.Destroy.impl.Op.specific_fn -// CHECK:STDOUT: %addr.loc12_40.2: %ptr.8e6 = addr_of %.loc12_40.2 -// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc12_40.7(%addr.loc12_40.2) +// CHECK:STDOUT: %bound_method.loc10_40.7: = bound_method %.loc10_40.2, %Optional.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %addr.loc10_40.2: %ptr.3f9 = addr_of %.loc10_40.2 +// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc10_40.7(%addr.loc10_40.2) // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound: = bound_method %var, constants.%T.as.Destroy.impl.Op.24b // CHECK:STDOUT: -// CHECK:STDOUT: %bound_method.loc12_40.8: = bound_method %var, %T.as.Destroy.impl.Op.specific_fn -// CHECK:STDOUT: %addr.loc12_40.3: %ptr.c28 = addr_of %var -// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc12_40.8(%addr.loc12_40.3) -// CHECK:STDOUT: %EmptyRange.as.Destroy.impl.Op.bound: = bound_method %.loc12_39.2, constants.%EmptyRange.as.Destroy.impl.Op.046 +// CHECK:STDOUT: %bound_method.loc10_40.8: = bound_method %var, %T.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %addr.loc10_40.3: %ptr.c28 = addr_of %var +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc10_40.8(%addr.loc10_40.3) +// CHECK:STDOUT: %EmptyRange.as.Destroy.impl.Op.bound: = bound_method %.loc10_39.2, constants.%EmptyRange.as.Destroy.impl.Op.61e // CHECK:STDOUT: -// CHECK:STDOUT: %bound_method.loc12_39: = bound_method %.loc12_39.2, %EmptyRange.as.Destroy.impl.Op.specific_fn -// CHECK:STDOUT: %addr.loc12_39: %ptr.35d = addr_of %.loc12_39.2 -// CHECK:STDOUT: %EmptyRange.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc12_39(%addr.loc12_39) +// CHECK:STDOUT: %bound_method.loc10_39: = bound_method %.loc10_39.2, %EmptyRange.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %addr.loc10_39: %ptr.49e = addr_of %.loc10_39.2 +// CHECK:STDOUT: %EmptyRange.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc10_39(%addr.loc10_39) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -448,66 +463,75 @@ fn Run() { // CHECK:STDOUT: %EmptyRange.type: type = generic_class_type @EmptyRange [concrete] // CHECK:STDOUT: %EmptyRange.generic: %EmptyRange.type = struct_value () [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] -// CHECK:STDOUT: %EmptyRange.Make.type.bd2: type = fn_type @EmptyRange.Make, @EmptyRange(%T) [symbolic] -// CHECK:STDOUT: %EmptyRange.Make.ed1: %EmptyRange.Make.type.bd2 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %T.049: %Copy.type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %EmptyRange.Make.type.7d6: type = fn_type @EmptyRange.Make, @EmptyRange(%T.049) [symbolic] +// CHECK:STDOUT: %EmptyRange.Make.4cc: %EmptyRange.Make.type.7d6 = struct_value () [symbolic] // CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete] -// CHECK:STDOUT: %EmptyRange.2f3: type = class_type @EmptyRange, @EmptyRange(%tuple.type.784) [concrete] -// CHECK:STDOUT: %EmptyRange.Make.type.4fb: type = fn_type @EmptyRange.Make, @EmptyRange(%tuple.type.784) [concrete] -// CHECK:STDOUT: %EmptyRange.Make.743: %EmptyRange.Make.type.4fb = struct_value () [concrete] +// CHECK:STDOUT: %Copy.impl_witness.d73: = impl_witness imports.%Copy.impl_witness_table.71a [concrete] +// CHECK:STDOUT: %Copy.facet.c6c: %Copy.type = facet_value bool, (%Copy.impl_witness.d73) [concrete] +// CHECK:STDOUT: %Copy.impl_witness.573: = impl_witness imports.%Copy.impl_witness_table.d24, @tuple.type.as.Copy.impl(%Copy.facet.c6c, %Copy.facet.c6c) [concrete] +// CHECK:STDOUT: %Copy.facet.16a: %Copy.type = facet_value %tuple.type.784, (%Copy.impl_witness.573) [concrete] +// CHECK:STDOUT: %EmptyRange.cfc: type = class_type @EmptyRange, @EmptyRange(%Copy.facet.16a) [concrete] +// CHECK:STDOUT: %EmptyRange.Make.type.7a6: type = fn_type @EmptyRange.Make, @EmptyRange(%Copy.facet.16a) [concrete] +// CHECK:STDOUT: %EmptyRange.Make.5e1: %EmptyRange.Make.type.7a6 = struct_value () [concrete] // CHECK:STDOUT: %ptr.c28: type = ptr_type %empty_struct_type [concrete] -// CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %EmptyRange.Make.743, @EmptyRange.Make(%tuple.type.784) [concrete] +// CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %EmptyRange.Make.5e1, @EmptyRange.Make(%Copy.facet.16a) [concrete] // CHECK:STDOUT: %Iterate.type: type = facet_type <@Iterate> [concrete] // CHECK:STDOUT: %Iterate.NewCursor.type: type = fn_type @Iterate.NewCursor [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.edc: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%T) [symbolic] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.894: %EmptyRange.as.Iterate.impl.NewCursor.type.edc = struct_value () [symbolic] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.dc6: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%T) [symbolic] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.c1f: %EmptyRange.as.Iterate.impl.Next.type.dc6 = struct_value () [symbolic] -// CHECK:STDOUT: %Optional.HasValue.type.f81: type = fn_type @Optional.HasValue, @Optional(%T) [symbolic] -// CHECK:STDOUT: %Optional.HasValue.6fd: %Optional.HasValue.type.f81 = struct_value () [symbolic] -// CHECK:STDOUT: %Optional.Get.type.b8f: type = fn_type @Optional.Get, @Optional(%T) [symbolic] -// CHECK:STDOUT: %Optional.Get.9c8: %Optional.Get.type.b8f = struct_value () [symbolic] -// CHECK:STDOUT: %Iterate.impl_witness.eee: = impl_witness imports.%Iterate.impl_witness_table, @EmptyRange.as.Iterate.impl(%tuple.type.784) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.174: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%tuple.type.784) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.50d: %EmptyRange.as.Iterate.impl.NewCursor.type.174 = struct_value () [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.890: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%tuple.type.784) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.191: %EmptyRange.as.Iterate.impl.Next.type.890 = struct_value () [concrete] -// CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %EmptyRange.2f3, (%Iterate.impl_witness.eee) [concrete] -// CHECK:STDOUT: %.85a: type = fn_type_with_self_type %Iterate.NewCursor.type, %Iterate.facet [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.NewCursor.50d, @EmptyRange.as.Iterate.impl.NewCursor(%tuple.type.784) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.be4: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%T.049) [symbolic] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.61a: %EmptyRange.as.Iterate.impl.NewCursor.type.be4 = struct_value () [symbolic] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.859: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%T.049) [symbolic] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.cc1: %EmptyRange.as.Iterate.impl.Next.type.859 = struct_value () [symbolic] +// CHECK:STDOUT: %Optional.HasValue.type.091: type = fn_type @Optional.HasValue, @Optional(%T.049) [symbolic] +// CHECK:STDOUT: %Optional.HasValue.5a0: %Optional.HasValue.type.091 = struct_value () [symbolic] +// CHECK:STDOUT: %Optional.Get.type.618: type = fn_type @Optional.Get, @Optional(%T.049) [symbolic] +// CHECK:STDOUT: %Optional.Get.9cc: %Optional.Get.type.618 = struct_value () [symbolic] +// CHECK:STDOUT: %Iterate.impl_witness.9f8: = impl_witness imports.%Iterate.impl_witness_table, @EmptyRange.as.Iterate.impl(%Copy.facet.16a) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.f89: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%Copy.facet.16a) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.2f0: %EmptyRange.as.Iterate.impl.NewCursor.type.f89 = struct_value () [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.4bb: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%Copy.facet.16a) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.ef5: %EmptyRange.as.Iterate.impl.Next.type.4bb = struct_value () [concrete] +// CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %EmptyRange.cfc, (%Iterate.impl_witness.9f8) [concrete] +// CHECK:STDOUT: %.b2f: type = fn_type_with_self_type %Iterate.NewCursor.type, %Iterate.facet [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.NewCursor.2f0, @EmptyRange.as.Iterate.impl.NewCursor(%Copy.facet.16a) [concrete] // CHECK:STDOUT: %Iterate.Next.type: type = fn_type @Iterate.Next [concrete] -// CHECK:STDOUT: %.5c2: type = fn_type_with_self_type %Iterate.Next.type, %Iterate.facet [concrete] -// CHECK:STDOUT: %Optional.79e: type = class_type @Optional, @Optional(%tuple.type.784) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.Next.191, @EmptyRange.as.Iterate.impl.Next(%tuple.type.784) [concrete] -// CHECK:STDOUT: %Optional.HasValue.type.414: type = fn_type @Optional.HasValue, @Optional(%tuple.type.784) [concrete] -// CHECK:STDOUT: %Optional.HasValue.4f9: %Optional.HasValue.type.414 = struct_value () [concrete] -// CHECK:STDOUT: %Optional.Get.type.ebd: type = fn_type @Optional.Get, @Optional(%tuple.type.784) [concrete] -// CHECK:STDOUT: %Optional.Get.d99: %Optional.Get.type.ebd = struct_value () [concrete] +// CHECK:STDOUT: %.d59: type = fn_type_with_self_type %Iterate.Next.type, %Iterate.facet [concrete] +// CHECK:STDOUT: %Optional.441: type = class_type @Optional, @Optional(%Copy.facet.16a) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.Next.ef5, @EmptyRange.as.Iterate.impl.Next(%Copy.facet.16a) [concrete] +// CHECK:STDOUT: %Optional.HasValue.type.3a0: type = fn_type @Optional.HasValue, @Optional(%Copy.facet.16a) [concrete] +// CHECK:STDOUT: %Optional.HasValue.be0: %Optional.HasValue.type.3a0 = struct_value () [concrete] +// CHECK:STDOUT: %Optional.Get.type.48f: type = fn_type @Optional.Get, @Optional(%Copy.facet.16a) [concrete] +// CHECK:STDOUT: %Optional.Get.d5b: %Optional.Get.type.48f = struct_value () [concrete] // CHECK:STDOUT: %ptr.b85: type = ptr_type %tuple.type.784 [concrete] -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.4f9, @Optional.HasValue(%tuple.type.784) [concrete] -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.d99, @Optional.Get(%tuple.type.784) [concrete] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.be0, @Optional.HasValue(%Copy.facet.16a) [concrete] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.d5b, @Optional.Get(%Copy.facet.16a) [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.type.ca1: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%tuple.type.784) [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.af8: %T.as.Destroy.impl.Op.type.ca1 = struct_value () [concrete] -// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.type.7d6: type = fn_type @Optional.as.Destroy.impl.Op, @Optional.as.Destroy.impl(%tuple.type.784) [concrete] -// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.449: %Optional.as.Destroy.impl.Op.type.7d6 = struct_value () [concrete] -// CHECK:STDOUT: %ptr.07d: type = ptr_type %Optional.79e [concrete] +// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.type.aac: type = fn_type @Optional.as.Destroy.impl.Op, @Optional.as.Destroy.impl(%Copy.facet.16a) [concrete] +// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.1f8: %Optional.as.Destroy.impl.Op.type.aac = struct_value () [concrete] +// CHECK:STDOUT: %ptr.bed: type = ptr_type %Optional.441 [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.type.456: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.24b: %T.as.Destroy.impl.Op.type.456 = struct_value () [concrete] -// CHECK:STDOUT: %EmptyRange.as.Destroy.impl.Op.type.4be: type = fn_type @EmptyRange.as.Destroy.impl.Op, @EmptyRange.as.Destroy.impl(%tuple.type.784) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Destroy.impl.Op.f20: %EmptyRange.as.Destroy.impl.Op.type.4be = struct_value () [concrete] -// CHECK:STDOUT: %ptr.5cf: type = ptr_type %EmptyRange.2f3 [concrete] +// CHECK:STDOUT: %EmptyRange.as.Destroy.impl.Op.type.f19: type = fn_type @EmptyRange.as.Destroy.impl.Op, @EmptyRange.as.Destroy.impl(%Copy.facet.16a) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Destroy.impl.Op.ecb: %EmptyRange.as.Destroy.impl.Op.type.f19 = struct_value () [concrete] +// CHECK:STDOUT: %ptr.df3: type = ptr_type %EmptyRange.cfc [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Main.EmptyRange: %EmptyRange.type = import_ref Main//empty_range, EmptyRange, loaded [concrete = constants.%EmptyRange.generic] -// CHECK:STDOUT: %Main.import_ref.6ea: @EmptyRange.%EmptyRange.Make.type (%EmptyRange.Make.type.bd2) = import_ref Main//empty_range, loc5_21, loaded [symbolic = @EmptyRange.%EmptyRange.Make (constants.%EmptyRange.Make.ed1)] -// CHECK:STDOUT: %Main.import_ref.6ce = import_ref Main//empty_range, loc7_68, unloaded +// CHECK:STDOUT: %Main.import_ref.787: @EmptyRange.%EmptyRange.Make.type (%EmptyRange.Make.type.7d6) = import_ref Main//empty_range, loc5_21, loaded [symbolic = @EmptyRange.%EmptyRange.Make (constants.%EmptyRange.Make.4cc)] +// CHECK:STDOUT: %Core.import_ref.570 = import_ref Core//prelude/parts/copy, loc44_31, unloaded +// CHECK:STDOUT: %Copy.impl_witness_table.d24 = impl_witness_table (%Core.import_ref.570), @tuple.type.as.Copy.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.a7d = import_ref Core//prelude/parts/copy, loc16_31, unloaded +// CHECK:STDOUT: %Copy.impl_witness_table.71a = impl_witness_table (%Core.import_ref.a7d), @bool.as.Copy.impl [concrete] +// CHECK:STDOUT: %Main.import_ref.101 = import_ref Main//empty_range, loc7_68, unloaded // CHECK:STDOUT: %Main.import_ref.999 = import_ref Main//empty_range, loc7_68, unloaded -// CHECK:STDOUT: %Main.import_ref.694: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.edc) = import_ref Main//empty_range, loc8_38, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.894)] -// CHECK:STDOUT: %Main.import_ref.9dd: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.dc6) = import_ref Main//empty_range, loc11_58, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.c1f)] -// CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%Main.import_ref.6ce, %Main.import_ref.999, %Main.import_ref.694, %Main.import_ref.9dd), @EmptyRange.as.Iterate.impl [concrete] -// CHECK:STDOUT: %Main.import_ref.7f9: @Optional.%Optional.HasValue.type (%Optional.HasValue.type.f81) = import_ref Main//empty_range, inst140 [indirect], loaded [symbolic = @Optional.%Optional.HasValue (constants.%Optional.HasValue.6fd)] -// CHECK:STDOUT: %Main.import_ref.d10: @Optional.%Optional.Get.type (%Optional.Get.type.b8f) = import_ref Main//empty_range, inst141 [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.9c8)] +// CHECK:STDOUT: %Main.import_ref.8f30: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.be4) = import_ref Main//empty_range, loc8_38, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.61a)] +// CHECK:STDOUT: %Main.import_ref.881: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.859) = import_ref Main//empty_range, loc11_58, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.cc1)] +// CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%Main.import_ref.101, %Main.import_ref.999, %Main.import_ref.8f30, %Main.import_ref.881), @EmptyRange.as.Iterate.impl [concrete] +// CHECK:STDOUT: %Main.import_ref.13f: @Optional.%Optional.HasValue.type (%Optional.HasValue.type.091) = import_ref Main//empty_range, inst151 [indirect], loaded [symbolic = @Optional.%Optional.HasValue (constants.%Optional.HasValue.5a0)] +// CHECK:STDOUT: %Main.import_ref.a3b: @Optional.%Optional.Get.type (%Optional.Get.type.618) = import_ref Main//empty_range, inst152 [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.9cc)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { @@ -525,19 +549,24 @@ fn Run() { // CHECK:STDOUT: %.loc10_53.2: type = converted %Bool.call.loc10_42, %.loc10_53.1 [concrete = bool] // CHECK:STDOUT: %.loc10_53.3: type = value_of_initializer %Bool.call.loc10_48 [concrete = bool] // CHECK:STDOUT: %.loc10_53.4: type = converted %Bool.call.loc10_48, %.loc10_53.3 [concrete = bool] -// CHECK:STDOUT: %.loc10_53.5: type = converted %.loc10_52, constants.%tuple.type.784 [concrete = constants.%tuple.type.784] -// CHECK:STDOUT: %EmptyRange: type = class_type @EmptyRange, @EmptyRange(constants.%tuple.type.784) [concrete = constants.%EmptyRange.2f3] -// CHECK:STDOUT: %.loc10_54: %EmptyRange.Make.type.4fb = specific_constant imports.%Main.import_ref.6ea, @EmptyRange(constants.%tuple.type.784) [concrete = constants.%EmptyRange.Make.743] -// CHECK:STDOUT: %Make.ref: %EmptyRange.Make.type.4fb = name_ref Make, %.loc10_54 [concrete = constants.%EmptyRange.Make.743] -// CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %Make.ref, @EmptyRange.Make(constants.%tuple.type.784) [concrete = constants.%EmptyRange.Make.specific_fn] -// CHECK:STDOUT: %.loc10_60.1: ref %EmptyRange.2f3 = temporary_storage -// CHECK:STDOUT: %EmptyRange.Make.call: init %EmptyRange.2f3 = call %EmptyRange.Make.specific_fn() to %.loc10_60.1 -// CHECK:STDOUT: %.loc10_60.2: ref %EmptyRange.2f3 = temporary %.loc10_60.1, %EmptyRange.Make.call -// CHECK:STDOUT: %impl.elem2: %.85a = impl_witness_access constants.%Iterate.impl_witness.eee, element2 [concrete = constants.%EmptyRange.as.Iterate.impl.NewCursor.50d] +// CHECK:STDOUT: %Copy.facet.loc10_53.1: %Copy.type = facet_value bool, (constants.%Copy.impl_witness.d73) [concrete = constants.%Copy.facet.c6c] +// CHECK:STDOUT: %.loc10_53.5: %Copy.type = converted bool, %Copy.facet.loc10_53.1 [concrete = constants.%Copy.facet.c6c] +// CHECK:STDOUT: %Copy.facet.loc10_53.2: %Copy.type = facet_value bool, (constants.%Copy.impl_witness.d73) [concrete = constants.%Copy.facet.c6c] +// CHECK:STDOUT: %.loc10_53.6: %Copy.type = converted bool, %Copy.facet.loc10_53.2 [concrete = constants.%Copy.facet.c6c] +// CHECK:STDOUT: %Copy.facet.loc10_53.3: %Copy.type = facet_value constants.%tuple.type.784, (constants.%Copy.impl_witness.573) [concrete = constants.%Copy.facet.16a] +// CHECK:STDOUT: %.loc10_53.7: %Copy.type = converted %.loc10_52, %Copy.facet.loc10_53.3 [concrete = constants.%Copy.facet.16a] +// CHECK:STDOUT: %EmptyRange: type = class_type @EmptyRange, @EmptyRange(constants.%Copy.facet.16a) [concrete = constants.%EmptyRange.cfc] +// CHECK:STDOUT: %.loc10_54: %EmptyRange.Make.type.7a6 = specific_constant imports.%Main.import_ref.787, @EmptyRange(constants.%Copy.facet.16a) [concrete = constants.%EmptyRange.Make.5e1] +// CHECK:STDOUT: %Make.ref: %EmptyRange.Make.type.7a6 = name_ref Make, %.loc10_54 [concrete = constants.%EmptyRange.Make.5e1] +// CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %Make.ref, @EmptyRange.Make(constants.%Copy.facet.16a) [concrete = constants.%EmptyRange.Make.specific_fn] +// CHECK:STDOUT: %.loc10_60.1: ref %EmptyRange.cfc = temporary_storage +// CHECK:STDOUT: %EmptyRange.Make.call: init %EmptyRange.cfc = call %EmptyRange.Make.specific_fn() to %.loc10_60.1 +// CHECK:STDOUT: %.loc10_60.2: ref %EmptyRange.cfc = temporary %.loc10_60.1, %EmptyRange.Make.call +// CHECK:STDOUT: %impl.elem2: %.b2f = impl_witness_access constants.%Iterate.impl_witness.9f8, element2 [concrete = constants.%EmptyRange.as.Iterate.impl.NewCursor.2f0] // CHECK:STDOUT: %bound_method.loc10_61.1: = bound_method %.loc10_60.2, %impl.elem2 -// CHECK:STDOUT: %specific_fn.loc10_61.1: = specific_function %impl.elem2, @EmptyRange.as.Iterate.impl.NewCursor(constants.%tuple.type.784) [concrete = constants.%EmptyRange.as.Iterate.impl.NewCursor.specific_fn] +// CHECK:STDOUT: %specific_fn.loc10_61.1: = specific_function %impl.elem2, @EmptyRange.as.Iterate.impl.NewCursor(constants.%Copy.facet.16a) [concrete = constants.%EmptyRange.as.Iterate.impl.NewCursor.specific_fn] // CHECK:STDOUT: %bound_method.loc10_61.2: = bound_method %.loc10_60.2, %specific_fn.loc10_61.1 -// CHECK:STDOUT: %.loc10_60.3: %EmptyRange.2f3 = bind_value %.loc10_60.2 +// CHECK:STDOUT: %.loc10_60.3: %EmptyRange.cfc = bind_value %.loc10_60.2 // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.call: init %empty_struct_type = call %bound_method.loc10_61.2(%.loc10_60.3) // CHECK:STDOUT: %var: ref %empty_struct_type = var invalid // CHECK:STDOUT: assign %var, %EmptyRange.as.Iterate.impl.NewCursor.call @@ -545,33 +574,33 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: !for.next: // CHECK:STDOUT: %addr.loc10_61.1: %ptr.c28 = addr_of %var -// CHECK:STDOUT: %impl.elem3: %.5c2 = impl_witness_access constants.%Iterate.impl_witness.eee, element3 [concrete = constants.%EmptyRange.as.Iterate.impl.Next.191] +// CHECK:STDOUT: %impl.elem3: %.d59 = impl_witness_access constants.%Iterate.impl_witness.9f8, element3 [concrete = constants.%EmptyRange.as.Iterate.impl.Next.ef5] // CHECK:STDOUT: %bound_method.loc10_61.3: = bound_method %.loc10_60.2, %impl.elem3 -// CHECK:STDOUT: %specific_fn.loc10_61.2: = specific_function %impl.elem3, @EmptyRange.as.Iterate.impl.Next(constants.%tuple.type.784) [concrete = constants.%EmptyRange.as.Iterate.impl.Next.specific_fn] +// CHECK:STDOUT: %specific_fn.loc10_61.2: = specific_function %impl.elem3, @EmptyRange.as.Iterate.impl.Next(constants.%Copy.facet.16a) [concrete = constants.%EmptyRange.as.Iterate.impl.Next.specific_fn] // CHECK:STDOUT: %bound_method.loc10_61.4: = bound_method %.loc10_60.2, %specific_fn.loc10_61.2 -// CHECK:STDOUT: %.loc10_61.1: ref %Optional.79e = temporary_storage -// CHECK:STDOUT: %.loc10_60.4: %EmptyRange.2f3 = bind_value %.loc10_60.2 -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.call: init %Optional.79e = call %bound_method.loc10_61.4(%.loc10_60.4, %addr.loc10_61.1) to %.loc10_61.1 -// CHECK:STDOUT: %.loc10_61.2: ref %Optional.79e = temporary %.loc10_61.1, %EmptyRange.as.Iterate.impl.Next.call -// CHECK:STDOUT: %.loc10_61.3: %Optional.HasValue.type.414 = specific_constant imports.%Main.import_ref.7f9, @Optional(constants.%tuple.type.784) [concrete = constants.%Optional.HasValue.4f9] -// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.414 = name_ref HasValue, %.loc10_61.3 [concrete = constants.%Optional.HasValue.4f9] +// CHECK:STDOUT: %.loc10_61.1: ref %Optional.441 = temporary_storage +// CHECK:STDOUT: %.loc10_60.4: %EmptyRange.cfc = bind_value %.loc10_60.2 +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.call: init %Optional.441 = call %bound_method.loc10_61.4(%.loc10_60.4, %addr.loc10_61.1) to %.loc10_61.1 +// CHECK:STDOUT: %.loc10_61.2: ref %Optional.441 = temporary %.loc10_61.1, %EmptyRange.as.Iterate.impl.Next.call +// CHECK:STDOUT: %.loc10_61.3: %Optional.HasValue.type.3a0 = specific_constant imports.%Main.import_ref.13f, @Optional(constants.%Copy.facet.16a) [concrete = constants.%Optional.HasValue.be0] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.3a0 = name_ref HasValue, %.loc10_61.3 [concrete = constants.%Optional.HasValue.be0] // CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc10_61.2, %HasValue.ref -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%tuple.type.784) [concrete = constants.%Optional.HasValue.specific_fn] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%Copy.facet.16a) [concrete = constants.%Optional.HasValue.specific_fn] // CHECK:STDOUT: %bound_method.loc10_61.5: = bound_method %.loc10_61.2, %Optional.HasValue.specific_fn -// CHECK:STDOUT: %.loc10_61.4: %Optional.79e = bind_value %.loc10_61.2 +// CHECK:STDOUT: %.loc10_61.4: %Optional.441 = bind_value %.loc10_61.2 // CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc10_61.5(%.loc10_61.4) // CHECK:STDOUT: %.loc10_61.5: bool = value_of_initializer %Optional.HasValue.call // CHECK:STDOUT: %.loc10_61.6: bool = converted %Optional.HasValue.call, %.loc10_61.5 // CHECK:STDOUT: if %.loc10_61.6 br !for.body else br !for.done // CHECK:STDOUT: // CHECK:STDOUT: !for.body: -// CHECK:STDOUT: %.loc10_61.7: %Optional.Get.type.ebd = specific_constant imports.%Main.import_ref.d10, @Optional(constants.%tuple.type.784) [concrete = constants.%Optional.Get.d99] -// CHECK:STDOUT: %Get.ref: %Optional.Get.type.ebd = name_ref Get, %.loc10_61.7 [concrete = constants.%Optional.Get.d99] +// CHECK:STDOUT: %.loc10_61.7: %Optional.Get.type.48f = specific_constant imports.%Main.import_ref.a3b, @Optional(constants.%Copy.facet.16a) [concrete = constants.%Optional.Get.d5b] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.48f = name_ref Get, %.loc10_61.7 [concrete = constants.%Optional.Get.d5b] // CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc10_61.2, %Get.ref -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%tuple.type.784) [concrete = constants.%Optional.Get.specific_fn] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%Copy.facet.16a) [concrete = constants.%Optional.Get.specific_fn] // CHECK:STDOUT: %bound_method.loc10_61.6: = bound_method %.loc10_61.2, %Optional.Get.specific_fn // CHECK:STDOUT: %.loc10_61.8: ref %tuple.type.784 = temporary_storage -// CHECK:STDOUT: %.loc10_61.9: %Optional.79e = bind_value %.loc10_61.2 +// CHECK:STDOUT: %.loc10_61.9: %Optional.441 = bind_value %.loc10_61.2 // CHECK:STDOUT: %Optional.Get.call: init %tuple.type.784 = call %bound_method.loc10_61.6(%.loc10_61.9) to %.loc10_61.8 // CHECK:STDOUT: %.loc10_61.10: ref %tuple.type.784 = temporary %.loc10_61.8, %Optional.Get.call // CHECK:STDOUT: %tuple.elem0: ref bool = tuple_access %.loc10_61.10, element0 @@ -602,20 +631,20 @@ fn Run() { // CHECK:STDOUT: %bound_method.loc10_61.7: = bound_method %.loc10_61.10, %T.as.Destroy.impl.Op.specific_fn.1 // CHECK:STDOUT: %addr.loc10_61.2: %ptr.b85 = addr_of %.loc10_61.10 // CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc10_61.1: init %empty_tuple.type = call %bound_method.loc10_61.7(%addr.loc10_61.2) -// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.bound: = bound_method %.loc10_61.2, constants.%Optional.as.Destroy.impl.Op.449 +// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.bound: = bound_method %.loc10_61.2, constants.%Optional.as.Destroy.impl.Op.1f8 // CHECK:STDOUT: // CHECK:STDOUT: %bound_method.loc10_61.8: = bound_method %.loc10_61.2, %Optional.as.Destroy.impl.Op.specific_fn -// CHECK:STDOUT: %addr.loc10_61.3: %ptr.07d = addr_of %.loc10_61.2 +// CHECK:STDOUT: %addr.loc10_61.3: %ptr.bed = addr_of %.loc10_61.2 // CHECK:STDOUT: %Optional.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc10_61.8(%addr.loc10_61.3) // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc10_61.2: = bound_method %var, constants.%T.as.Destroy.impl.Op.24b // CHECK:STDOUT: // CHECK:STDOUT: %bound_method.loc10_61.9: = bound_method %var, %T.as.Destroy.impl.Op.specific_fn.2 // CHECK:STDOUT: %addr.loc10_61.4: %ptr.c28 = addr_of %var // CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc10_61.2: init %empty_tuple.type = call %bound_method.loc10_61.9(%addr.loc10_61.4) -// CHECK:STDOUT: %EmptyRange.as.Destroy.impl.Op.bound: = bound_method %.loc10_60.2, constants.%EmptyRange.as.Destroy.impl.Op.f20 +// CHECK:STDOUT: %EmptyRange.as.Destroy.impl.Op.bound: = bound_method %.loc10_60.2, constants.%EmptyRange.as.Destroy.impl.Op.ecb // CHECK:STDOUT: // CHECK:STDOUT: %bound_method.loc10_60: = bound_method %.loc10_60.2, %EmptyRange.as.Destroy.impl.Op.specific_fn -// CHECK:STDOUT: %addr.loc10_60: %ptr.5cf = addr_of %.loc10_60.2 +// CHECK:STDOUT: %addr.loc10_60: %ptr.df3 = addr_of %.loc10_60.2 // CHECK:STDOUT: %EmptyRange.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc10_60(%addr.loc10_60) // CHECK:STDOUT: // CHECK:STDOUT: } @@ -624,75 +653,85 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete] // CHECK:STDOUT: %Body.type: type = fn_type @Body [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Body: %Body.type = struct_value () [concrete] // CHECK:STDOUT: %ptr.c28: type = ptr_type %empty_struct_type [concrete] // CHECK:STDOUT: %tuple.type.56b: type = tuple_type (%C, %C) [concrete] // CHECK:STDOUT: %pattern_type.99e: type = pattern_type %tuple.type.56b [concrete] // CHECK:STDOUT: %EmptyRange.type: type = generic_class_type @EmptyRange [concrete] // CHECK:STDOUT: %EmptyRange.generic: %EmptyRange.type = struct_value () [concrete] -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] -// CHECK:STDOUT: %EmptyRange.Make.type.bd2: type = fn_type @EmptyRange.Make, @EmptyRange(%T) [symbolic] -// CHECK:STDOUT: %EmptyRange.Make.ed1: %EmptyRange.Make.type.bd2 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %T.049: %Copy.type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %EmptyRange.Make.type.7d6: type = fn_type @EmptyRange.Make, @EmptyRange(%T.049) [symbolic] +// CHECK:STDOUT: %EmptyRange.Make.4cc: %EmptyRange.Make.type.7d6 = struct_value () [symbolic] // CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete] -// CHECK:STDOUT: %EmptyRange.90a: type = class_type @EmptyRange, @EmptyRange(%tuple.type.56b) [concrete] -// CHECK:STDOUT: %EmptyRange.Make.type.829: type = fn_type @EmptyRange.Make, @EmptyRange(%tuple.type.56b) [concrete] -// CHECK:STDOUT: %EmptyRange.Make.d4f: %EmptyRange.Make.type.829 = struct_value () [concrete] -// CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %EmptyRange.Make.d4f, @EmptyRange.Make(%tuple.type.56b) [concrete] +// CHECK:STDOUT: %Copy.impl_witness.5fc: = impl_witness imports.%Copy.impl_witness_table.349 [concrete] +// CHECK:STDOUT: %Copy.facet.0cb: %Copy.type = facet_value %C, (%Copy.impl_witness.5fc) [concrete] +// CHECK:STDOUT: %Copy.impl_witness.cda: = impl_witness imports.%Copy.impl_witness_table.d24, @tuple.type.as.Copy.impl(%Copy.facet.0cb, %Copy.facet.0cb) [concrete] +// CHECK:STDOUT: %Copy.facet.84f: %Copy.type = facet_value %tuple.type.56b, (%Copy.impl_witness.cda) [concrete] +// CHECK:STDOUT: %EmptyRange.b93: type = class_type @EmptyRange, @EmptyRange(%Copy.facet.84f) [concrete] +// CHECK:STDOUT: %EmptyRange.Make.type.880: type = fn_type @EmptyRange.Make, @EmptyRange(%Copy.facet.84f) [concrete] +// CHECK:STDOUT: %EmptyRange.Make.85f: %EmptyRange.Make.type.880 = struct_value () [concrete] +// CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %EmptyRange.Make.85f, @EmptyRange.Make(%Copy.facet.84f) [concrete] // CHECK:STDOUT: %Iterate.type: type = facet_type <@Iterate> [concrete] // CHECK:STDOUT: %Iterate.NewCursor.type: type = fn_type @Iterate.NewCursor [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.edc: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%T) [symbolic] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.894: %EmptyRange.as.Iterate.impl.NewCursor.type.edc = struct_value () [symbolic] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.dc6: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%T) [symbolic] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.c1f: %EmptyRange.as.Iterate.impl.Next.type.dc6 = struct_value () [symbolic] -// CHECK:STDOUT: %Optional.HasValue.type.f81: type = fn_type @Optional.HasValue, @Optional(%T) [symbolic] -// CHECK:STDOUT: %Optional.HasValue.6fd: %Optional.HasValue.type.f81 = struct_value () [symbolic] -// CHECK:STDOUT: %Optional.Get.type.b8f: type = fn_type @Optional.Get, @Optional(%T) [symbolic] -// CHECK:STDOUT: %Optional.Get.9c8: %Optional.Get.type.b8f = struct_value () [symbolic] -// CHECK:STDOUT: %Iterate.impl_witness.a53: = impl_witness imports.%Iterate.impl_witness_table, @EmptyRange.as.Iterate.impl(%tuple.type.56b) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.72d: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%tuple.type.56b) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.390: %EmptyRange.as.Iterate.impl.NewCursor.type.72d = struct_value () [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.6b8: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%tuple.type.56b) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.385: %EmptyRange.as.Iterate.impl.Next.type.6b8 = struct_value () [concrete] -// CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %EmptyRange.90a, (%Iterate.impl_witness.a53) [concrete] -// CHECK:STDOUT: %.ec0: type = fn_type_with_self_type %Iterate.NewCursor.type, %Iterate.facet [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.NewCursor.390, @EmptyRange.as.Iterate.impl.NewCursor(%tuple.type.56b) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.be4: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%T.049) [symbolic] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.61a: %EmptyRange.as.Iterate.impl.NewCursor.type.be4 = struct_value () [symbolic] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.859: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%T.049) [symbolic] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.cc1: %EmptyRange.as.Iterate.impl.Next.type.859 = struct_value () [symbolic] +// CHECK:STDOUT: %Optional.HasValue.type.091: type = fn_type @Optional.HasValue, @Optional(%T.049) [symbolic] +// CHECK:STDOUT: %Optional.HasValue.5a0: %Optional.HasValue.type.091 = struct_value () [symbolic] +// CHECK:STDOUT: %Optional.Get.type.618: type = fn_type @Optional.Get, @Optional(%T.049) [symbolic] +// CHECK:STDOUT: %Optional.Get.9cc: %Optional.Get.type.618 = struct_value () [symbolic] +// CHECK:STDOUT: %Iterate.impl_witness.1c3: = impl_witness imports.%Iterate.impl_witness_table, @EmptyRange.as.Iterate.impl(%Copy.facet.84f) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.adf: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%Copy.facet.84f) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.c8f: %EmptyRange.as.Iterate.impl.NewCursor.type.adf = struct_value () [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.f5b: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%Copy.facet.84f) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.bcf: %EmptyRange.as.Iterate.impl.Next.type.f5b = struct_value () [concrete] +// CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %EmptyRange.b93, (%Iterate.impl_witness.1c3) [concrete] +// CHECK:STDOUT: %.a9f: type = fn_type_with_self_type %Iterate.NewCursor.type, %Iterate.facet [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.NewCursor.c8f, @EmptyRange.as.Iterate.impl.NewCursor(%Copy.facet.84f) [concrete] // CHECK:STDOUT: %Iterate.Next.type: type = fn_type @Iterate.Next [concrete] -// CHECK:STDOUT: %.2ad: type = fn_type_with_self_type %Iterate.Next.type, %Iterate.facet [concrete] -// CHECK:STDOUT: %Optional.657: type = class_type @Optional, @Optional(%tuple.type.56b) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.Next.385, @EmptyRange.as.Iterate.impl.Next(%tuple.type.56b) [concrete] -// CHECK:STDOUT: %Optional.HasValue.type.2f1: type = fn_type @Optional.HasValue, @Optional(%tuple.type.56b) [concrete] -// CHECK:STDOUT: %Optional.HasValue.bef: %Optional.HasValue.type.2f1 = struct_value () [concrete] -// CHECK:STDOUT: %Optional.Get.type.4a4: type = fn_type @Optional.Get, @Optional(%tuple.type.56b) [concrete] -// CHECK:STDOUT: %Optional.Get.8a7: %Optional.Get.type.4a4 = struct_value () [concrete] -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.bef, @Optional.HasValue(%tuple.type.56b) [concrete] -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.8a7, @Optional.Get(%tuple.type.56b) [concrete] +// CHECK:STDOUT: %.813: type = fn_type_with_self_type %Iterate.Next.type, %Iterate.facet [concrete] +// CHECK:STDOUT: %Optional.07d: type = class_type @Optional, @Optional(%Copy.facet.84f) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.Next.bcf, @EmptyRange.as.Iterate.impl.Next(%Copy.facet.84f) [concrete] +// CHECK:STDOUT: %Optional.HasValue.type.8d2: type = fn_type @Optional.HasValue, @Optional(%Copy.facet.84f) [concrete] +// CHECK:STDOUT: %Optional.HasValue.d61: %Optional.HasValue.type.8d2 = struct_value () [concrete] +// CHECK:STDOUT: %Optional.Get.type.4f2: type = fn_type @Optional.Get, @Optional(%Copy.facet.84f) [concrete] +// CHECK:STDOUT: %Optional.Get.ded: %Optional.Get.type.4f2 = struct_value () [concrete] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.d61, @Optional.HasValue(%Copy.facet.84f) [concrete] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.ded, @Optional.Get(%Copy.facet.84f) [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.type.ee9: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%tuple.type.56b) [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.de5: %T.as.Destroy.impl.Op.type.ee9 = struct_value () [concrete] // CHECK:STDOUT: %ptr.9f0: type = ptr_type %tuple.type.56b [concrete] -// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.type.a8c: type = fn_type @Optional.as.Destroy.impl.Op, @Optional.as.Destroy.impl(%tuple.type.56b) [concrete] -// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.23b: %Optional.as.Destroy.impl.Op.type.a8c = struct_value () [concrete] -// CHECK:STDOUT: %ptr.036: type = ptr_type %Optional.657 [concrete] +// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.type.8ba: type = fn_type @Optional.as.Destroy.impl.Op, @Optional.as.Destroy.impl(%Copy.facet.84f) [concrete] +// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.78b: %Optional.as.Destroy.impl.Op.type.8ba = struct_value () [concrete] +// CHECK:STDOUT: %ptr.d6a: type = ptr_type %Optional.07d [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.type.456: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.24b: %T.as.Destroy.impl.Op.type.456 = struct_value () [concrete] -// CHECK:STDOUT: %EmptyRange.as.Destroy.impl.Op.type.89c: type = fn_type @EmptyRange.as.Destroy.impl.Op, @EmptyRange.as.Destroy.impl(%tuple.type.56b) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Destroy.impl.Op.67e: %EmptyRange.as.Destroy.impl.Op.type.89c = struct_value () [concrete] -// CHECK:STDOUT: %ptr.f9b: type = ptr_type %EmptyRange.90a [concrete] +// CHECK:STDOUT: %EmptyRange.as.Destroy.impl.Op.type.31a: type = fn_type @EmptyRange.as.Destroy.impl.Op, @EmptyRange.as.Destroy.impl(%Copy.facet.84f) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Destroy.impl.Op.c9d: %EmptyRange.as.Destroy.impl.Op.type.31a = struct_value () [concrete] +// CHECK:STDOUT: %ptr.894: type = ptr_type %EmptyRange.b93 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Main.EmptyRange: %EmptyRange.type = import_ref Main//empty_range, EmptyRange, loaded [concrete = constants.%EmptyRange.generic] -// CHECK:STDOUT: %Main.import_ref.6ea: @EmptyRange.%EmptyRange.Make.type (%EmptyRange.Make.type.bd2) = import_ref Main//empty_range, loc5_21, loaded [symbolic = @EmptyRange.%EmptyRange.Make (constants.%EmptyRange.Make.ed1)] -// CHECK:STDOUT: %Main.import_ref.6ce = import_ref Main//empty_range, loc7_68, unloaded +// CHECK:STDOUT: %Main.C: type = import_ref Main//empty_range, C, loaded [concrete = constants.%C] +// CHECK:STDOUT: %Main.import_ref.787: @EmptyRange.%EmptyRange.Make.type (%EmptyRange.Make.type.7d6) = import_ref Main//empty_range, loc5_21, loaded [symbolic = @EmptyRange.%EmptyRange.Make (constants.%EmptyRange.Make.4cc)] +// CHECK:STDOUT: %Core.import_ref.570 = import_ref Core//prelude/parts/copy, loc44_31, unloaded +// CHECK:STDOUT: %Copy.impl_witness_table.d24 = impl_witness_table (%Core.import_ref.570), @tuple.type.as.Copy.impl [concrete] +// CHECK:STDOUT: %Main.import_ref.a43 = import_ref Main//empty_range, loc19_33, unloaded +// CHECK:STDOUT: %Copy.impl_witness_table.349 = impl_witness_table (%Main.import_ref.a43), @C.as.Copy.impl [concrete] +// CHECK:STDOUT: %Main.import_ref.101 = import_ref Main//empty_range, loc7_68, unloaded // CHECK:STDOUT: %Main.import_ref.999 = import_ref Main//empty_range, loc7_68, unloaded -// CHECK:STDOUT: %Main.import_ref.694: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.edc) = import_ref Main//empty_range, loc8_38, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.894)] -// CHECK:STDOUT: %Main.import_ref.9dd: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.dc6) = import_ref Main//empty_range, loc11_58, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.c1f)] -// CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%Main.import_ref.6ce, %Main.import_ref.999, %Main.import_ref.694, %Main.import_ref.9dd), @EmptyRange.as.Iterate.impl [concrete] -// CHECK:STDOUT: %Main.import_ref.7f9: @Optional.%Optional.HasValue.type (%Optional.HasValue.type.f81) = import_ref Main//empty_range, inst140 [indirect], loaded [symbolic = @Optional.%Optional.HasValue (constants.%Optional.HasValue.6fd)] -// CHECK:STDOUT: %Main.import_ref.d10: @Optional.%Optional.Get.type (%Optional.Get.type.b8f) = import_ref Main//empty_range, inst141 [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.9c8)] +// CHECK:STDOUT: %Main.import_ref.8f30: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.be4) = import_ref Main//empty_range, loc8_38, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.61a)] +// CHECK:STDOUT: %Main.import_ref.881: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.859) = import_ref Main//empty_range, loc11_58, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.cc1)] +// CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%Main.import_ref.101, %Main.import_ref.999, %Main.import_ref.8f30, %Main.import_ref.881), @EmptyRange.as.Iterate.impl [concrete] +// CHECK:STDOUT: %Main.import_ref.13f: @Optional.%Optional.HasValue.type (%Optional.HasValue.type.091) = import_ref Main//empty_range, inst151 [indirect], loaded [symbolic = @Optional.%Optional.HasValue (constants.%Optional.HasValue.5a0)] +// CHECK:STDOUT: %Main.import_ref.a3b: @Optional.%Optional.Get.type (%Optional.Get.type.618) = import_ref Main//empty_range, inst152 [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.9cc)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { @@ -700,69 +739,74 @@ fn Run() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %a.patt: %pattern_type.c48 = binding_pattern a [concrete] // CHECK:STDOUT: %b.patt: %pattern_type.c48 = binding_pattern b [concrete] -// CHECK:STDOUT: %.loc12_19: %pattern_type.99e = tuple_pattern (%a.patt, %b.patt) [concrete] +// CHECK:STDOUT: %.loc10_19: %pattern_type.99e = tuple_pattern (%a.patt, %b.patt) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %EmptyRange.ref: %EmptyRange.type = name_ref EmptyRange, imports.%Main.EmptyRange [concrete = constants.%EmptyRange.generic] -// CHECK:STDOUT: %C.ref.loc12_36: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %C.ref.loc12_39: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %.loc12_40: %tuple.type.24b = tuple_literal (%C.ref.loc12_36, %C.ref.loc12_39) -// CHECK:STDOUT: %.loc12_41: type = converted %.loc12_40, constants.%tuple.type.56b [concrete = constants.%tuple.type.56b] -// CHECK:STDOUT: %EmptyRange: type = class_type @EmptyRange, @EmptyRange(constants.%tuple.type.56b) [concrete = constants.%EmptyRange.90a] -// CHECK:STDOUT: %.loc12_42: %EmptyRange.Make.type.829 = specific_constant imports.%Main.import_ref.6ea, @EmptyRange(constants.%tuple.type.56b) [concrete = constants.%EmptyRange.Make.d4f] -// CHECK:STDOUT: %Make.ref: %EmptyRange.Make.type.829 = name_ref Make, %.loc12_42 [concrete = constants.%EmptyRange.Make.d4f] -// CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %Make.ref, @EmptyRange.Make(constants.%tuple.type.56b) [concrete = constants.%EmptyRange.Make.specific_fn] -// CHECK:STDOUT: %.loc12_48.1: ref %EmptyRange.90a = temporary_storage -// CHECK:STDOUT: %EmptyRange.Make.call: init %EmptyRange.90a = call %EmptyRange.Make.specific_fn() to %.loc12_48.1 -// CHECK:STDOUT: %.loc12_48.2: ref %EmptyRange.90a = temporary %.loc12_48.1, %EmptyRange.Make.call -// CHECK:STDOUT: %impl.elem2: %.ec0 = impl_witness_access constants.%Iterate.impl_witness.a53, element2 [concrete = constants.%EmptyRange.as.Iterate.impl.NewCursor.390] -// CHECK:STDOUT: %bound_method.loc12_49.1: = bound_method %.loc12_48.2, %impl.elem2 -// CHECK:STDOUT: %specific_fn.loc12_49.1: = specific_function %impl.elem2, @EmptyRange.as.Iterate.impl.NewCursor(constants.%tuple.type.56b) [concrete = constants.%EmptyRange.as.Iterate.impl.NewCursor.specific_fn] -// CHECK:STDOUT: %bound_method.loc12_49.2: = bound_method %.loc12_48.2, %specific_fn.loc12_49.1 -// CHECK:STDOUT: %.loc12_48.3: %EmptyRange.90a = bind_value %.loc12_48.2 -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.call: init %empty_struct_type = call %bound_method.loc12_49.2(%.loc12_48.3) +// CHECK:STDOUT: %C.ref.loc10_36: type = name_ref C, imports.%Main.C [concrete = constants.%C] +// CHECK:STDOUT: %C.ref.loc10_39: type = name_ref C, imports.%Main.C [concrete = constants.%C] +// CHECK:STDOUT: %.loc10_40: %tuple.type.24b = tuple_literal (%C.ref.loc10_36, %C.ref.loc10_39) +// CHECK:STDOUT: %Copy.facet.loc10_41.1: %Copy.type = facet_value constants.%C, (constants.%Copy.impl_witness.5fc) [concrete = constants.%Copy.facet.0cb] +// CHECK:STDOUT: %.loc10_41.1: %Copy.type = converted constants.%C, %Copy.facet.loc10_41.1 [concrete = constants.%Copy.facet.0cb] +// CHECK:STDOUT: %Copy.facet.loc10_41.2: %Copy.type = facet_value constants.%C, (constants.%Copy.impl_witness.5fc) [concrete = constants.%Copy.facet.0cb] +// CHECK:STDOUT: %.loc10_41.2: %Copy.type = converted constants.%C, %Copy.facet.loc10_41.2 [concrete = constants.%Copy.facet.0cb] +// CHECK:STDOUT: %Copy.facet.loc10_41.3: %Copy.type = facet_value constants.%tuple.type.56b, (constants.%Copy.impl_witness.cda) [concrete = constants.%Copy.facet.84f] +// CHECK:STDOUT: %.loc10_41.3: %Copy.type = converted %.loc10_40, %Copy.facet.loc10_41.3 [concrete = constants.%Copy.facet.84f] +// CHECK:STDOUT: %EmptyRange: type = class_type @EmptyRange, @EmptyRange(constants.%Copy.facet.84f) [concrete = constants.%EmptyRange.b93] +// CHECK:STDOUT: %.loc10_42: %EmptyRange.Make.type.880 = specific_constant imports.%Main.import_ref.787, @EmptyRange(constants.%Copy.facet.84f) [concrete = constants.%EmptyRange.Make.85f] +// CHECK:STDOUT: %Make.ref: %EmptyRange.Make.type.880 = name_ref Make, %.loc10_42 [concrete = constants.%EmptyRange.Make.85f] +// CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %Make.ref, @EmptyRange.Make(constants.%Copy.facet.84f) [concrete = constants.%EmptyRange.Make.specific_fn] +// CHECK:STDOUT: %.loc10_48.1: ref %EmptyRange.b93 = temporary_storage +// CHECK:STDOUT: %EmptyRange.Make.call: init %EmptyRange.b93 = call %EmptyRange.Make.specific_fn() to %.loc10_48.1 +// CHECK:STDOUT: %.loc10_48.2: ref %EmptyRange.b93 = temporary %.loc10_48.1, %EmptyRange.Make.call +// CHECK:STDOUT: %impl.elem2: %.a9f = impl_witness_access constants.%Iterate.impl_witness.1c3, element2 [concrete = constants.%EmptyRange.as.Iterate.impl.NewCursor.c8f] +// CHECK:STDOUT: %bound_method.loc10_49.1: = bound_method %.loc10_48.2, %impl.elem2 +// CHECK:STDOUT: %specific_fn.loc10_49.1: = specific_function %impl.elem2, @EmptyRange.as.Iterate.impl.NewCursor(constants.%Copy.facet.84f) [concrete = constants.%EmptyRange.as.Iterate.impl.NewCursor.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_49.2: = bound_method %.loc10_48.2, %specific_fn.loc10_49.1 +// CHECK:STDOUT: %.loc10_48.3: %EmptyRange.b93 = bind_value %.loc10_48.2 +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.call: init %empty_struct_type = call %bound_method.loc10_49.2(%.loc10_48.3) // CHECK:STDOUT: %var: ref %empty_struct_type = var invalid // CHECK:STDOUT: assign %var, %EmptyRange.as.Iterate.impl.NewCursor.call // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.next: -// CHECK:STDOUT: %addr.loc12_49.1: %ptr.c28 = addr_of %var -// CHECK:STDOUT: %impl.elem3: %.2ad = impl_witness_access constants.%Iterate.impl_witness.a53, element3 [concrete = constants.%EmptyRange.as.Iterate.impl.Next.385] -// CHECK:STDOUT: %bound_method.loc12_49.3: = bound_method %.loc12_48.2, %impl.elem3 -// CHECK:STDOUT: %specific_fn.loc12_49.2: = specific_function %impl.elem3, @EmptyRange.as.Iterate.impl.Next(constants.%tuple.type.56b) [concrete = constants.%EmptyRange.as.Iterate.impl.Next.specific_fn] -// CHECK:STDOUT: %bound_method.loc12_49.4: = bound_method %.loc12_48.2, %specific_fn.loc12_49.2 -// CHECK:STDOUT: %.loc12_49.1: ref %Optional.657 = temporary_storage -// CHECK:STDOUT: %.loc12_48.4: %EmptyRange.90a = bind_value %.loc12_48.2 -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.call: init %Optional.657 = call %bound_method.loc12_49.4(%.loc12_48.4, %addr.loc12_49.1) to %.loc12_49.1 -// CHECK:STDOUT: %.loc12_49.2: ref %Optional.657 = temporary %.loc12_49.1, %EmptyRange.as.Iterate.impl.Next.call -// CHECK:STDOUT: %.loc12_49.3: %Optional.HasValue.type.2f1 = specific_constant imports.%Main.import_ref.7f9, @Optional(constants.%tuple.type.56b) [concrete = constants.%Optional.HasValue.bef] -// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.2f1 = name_ref HasValue, %.loc12_49.3 [concrete = constants.%Optional.HasValue.bef] -// CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc12_49.2, %HasValue.ref -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%tuple.type.56b) [concrete = constants.%Optional.HasValue.specific_fn] -// CHECK:STDOUT: %bound_method.loc12_49.5: = bound_method %.loc12_49.2, %Optional.HasValue.specific_fn -// CHECK:STDOUT: %.loc12_49.4: %Optional.657 = bind_value %.loc12_49.2 -// CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc12_49.5(%.loc12_49.4) -// CHECK:STDOUT: %.loc12_49.5: bool = value_of_initializer %Optional.HasValue.call -// CHECK:STDOUT: %.loc12_49.6: bool = converted %Optional.HasValue.call, %.loc12_49.5 -// CHECK:STDOUT: if %.loc12_49.6 br !for.body else br !for.done +// CHECK:STDOUT: %addr.loc10_49.1: %ptr.c28 = addr_of %var +// CHECK:STDOUT: %impl.elem3: %.813 = impl_witness_access constants.%Iterate.impl_witness.1c3, element3 [concrete = constants.%EmptyRange.as.Iterate.impl.Next.bcf] +// CHECK:STDOUT: %bound_method.loc10_49.3: = bound_method %.loc10_48.2, %impl.elem3 +// CHECK:STDOUT: %specific_fn.loc10_49.2: = specific_function %impl.elem3, @EmptyRange.as.Iterate.impl.Next(constants.%Copy.facet.84f) [concrete = constants.%EmptyRange.as.Iterate.impl.Next.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_49.4: = bound_method %.loc10_48.2, %specific_fn.loc10_49.2 +// CHECK:STDOUT: %.loc10_49.1: ref %Optional.07d = temporary_storage +// CHECK:STDOUT: %.loc10_48.4: %EmptyRange.b93 = bind_value %.loc10_48.2 +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.call: init %Optional.07d = call %bound_method.loc10_49.4(%.loc10_48.4, %addr.loc10_49.1) to %.loc10_49.1 +// CHECK:STDOUT: %.loc10_49.2: ref %Optional.07d = temporary %.loc10_49.1, %EmptyRange.as.Iterate.impl.Next.call +// CHECK:STDOUT: %.loc10_49.3: %Optional.HasValue.type.8d2 = specific_constant imports.%Main.import_ref.13f, @Optional(constants.%Copy.facet.84f) [concrete = constants.%Optional.HasValue.d61] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.8d2 = name_ref HasValue, %.loc10_49.3 [concrete = constants.%Optional.HasValue.d61] +// CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc10_49.2, %HasValue.ref +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%Copy.facet.84f) [concrete = constants.%Optional.HasValue.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_49.5: = bound_method %.loc10_49.2, %Optional.HasValue.specific_fn +// CHECK:STDOUT: %.loc10_49.4: %Optional.07d = bind_value %.loc10_49.2 +// CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc10_49.5(%.loc10_49.4) +// CHECK:STDOUT: %.loc10_49.5: bool = value_of_initializer %Optional.HasValue.call +// CHECK:STDOUT: %.loc10_49.6: bool = converted %Optional.HasValue.call, %.loc10_49.5 +// CHECK:STDOUT: if %.loc10_49.6 br !for.body else br !for.done // CHECK:STDOUT: // CHECK:STDOUT: !for.body: -// CHECK:STDOUT: %.loc12_49.7: %Optional.Get.type.4a4 = specific_constant imports.%Main.import_ref.d10, @Optional(constants.%tuple.type.56b) [concrete = constants.%Optional.Get.8a7] -// CHECK:STDOUT: %Get.ref: %Optional.Get.type.4a4 = name_ref Get, %.loc12_49.7 [concrete = constants.%Optional.Get.8a7] -// CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc12_49.2, %Get.ref -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%tuple.type.56b) [concrete = constants.%Optional.Get.specific_fn] -// CHECK:STDOUT: %bound_method.loc12_49.6: = bound_method %.loc12_49.2, %Optional.Get.specific_fn -// CHECK:STDOUT: %.loc12_49.8: ref %tuple.type.56b = temporary_storage -// CHECK:STDOUT: %.loc12_49.9: %Optional.657 = bind_value %.loc12_49.2 -// CHECK:STDOUT: %Optional.Get.call: init %tuple.type.56b = call %bound_method.loc12_49.6(%.loc12_49.9) to %.loc12_49.8 -// CHECK:STDOUT: %.loc12_49.10: ref %tuple.type.56b = temporary %.loc12_49.8, %Optional.Get.call -// CHECK:STDOUT: %tuple.elem0: ref %C = tuple_access %.loc12_49.10, element0 -// CHECK:STDOUT: %tuple.elem1: ref %C = tuple_access %.loc12_49.10, element1 -// CHECK:STDOUT: %C.ref.loc12_12: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %.loc12_49.11: %C = bind_value %tuple.elem0 -// CHECK:STDOUT: %a: %C = bind_name a, %.loc12_49.11 -// CHECK:STDOUT: %C.ref.loc12_18: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %.loc12_49.12: %C = bind_value %tuple.elem1 -// CHECK:STDOUT: %b: %C = bind_name b, %.loc12_49.12 +// CHECK:STDOUT: %.loc10_49.7: %Optional.Get.type.4f2 = specific_constant imports.%Main.import_ref.a3b, @Optional(constants.%Copy.facet.84f) [concrete = constants.%Optional.Get.ded] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.4f2 = name_ref Get, %.loc10_49.7 [concrete = constants.%Optional.Get.ded] +// CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc10_49.2, %Get.ref +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%Copy.facet.84f) [concrete = constants.%Optional.Get.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_49.6: = bound_method %.loc10_49.2, %Optional.Get.specific_fn +// CHECK:STDOUT: %.loc10_49.8: ref %tuple.type.56b = temporary_storage +// CHECK:STDOUT: %.loc10_49.9: %Optional.07d = bind_value %.loc10_49.2 +// CHECK:STDOUT: %Optional.Get.call: init %tuple.type.56b = call %bound_method.loc10_49.6(%.loc10_49.9) to %.loc10_49.8 +// CHECK:STDOUT: %.loc10_49.10: ref %tuple.type.56b = temporary %.loc10_49.8, %Optional.Get.call +// CHECK:STDOUT: %tuple.elem0: ref %C = tuple_access %.loc10_49.10, element0 +// CHECK:STDOUT: %tuple.elem1: ref %C = tuple_access %.loc10_49.10, element1 +// CHECK:STDOUT: %C.ref.loc10_12: type = name_ref C, imports.%Main.C [concrete = constants.%C] +// CHECK:STDOUT: %.loc10_49.11: %C = bind_value %tuple.elem0 +// CHECK:STDOUT: %a: %C = bind_name a, %.loc10_49.11 +// CHECK:STDOUT: %C.ref.loc10_18: type = name_ref C, imports.%Main.C [concrete = constants.%C] +// CHECK:STDOUT: %.loc10_49.12: %C = bind_value %tuple.elem1 +// CHECK:STDOUT: %b: %C = bind_name b, %.loc10_49.12 // CHECK:STDOUT: %Body.ref: %Body.type = name_ref Body, file.%Body.decl [concrete = constants.%Body] // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b @@ -770,26 +814,26 @@ fn Run() { // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc12_49.1: = bound_method %.loc12_49.10, constants.%T.as.Destroy.impl.Op.de5 +// CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc10_49.1: = bound_method %.loc10_49.10, constants.%T.as.Destroy.impl.Op.de5 // CHECK:STDOUT: -// CHECK:STDOUT: %bound_method.loc12_49.7: = bound_method %.loc12_49.10, %T.as.Destroy.impl.Op.specific_fn.1 -// CHECK:STDOUT: %addr.loc12_49.2: %ptr.9f0 = addr_of %.loc12_49.10 -// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc12_49.1: init %empty_tuple.type = call %bound_method.loc12_49.7(%addr.loc12_49.2) -// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.bound: = bound_method %.loc12_49.2, constants.%Optional.as.Destroy.impl.Op.23b +// CHECK:STDOUT: %bound_method.loc10_49.7: = bound_method %.loc10_49.10, %T.as.Destroy.impl.Op.specific_fn.1 +// CHECK:STDOUT: %addr.loc10_49.2: %ptr.9f0 = addr_of %.loc10_49.10 +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc10_49.1: init %empty_tuple.type = call %bound_method.loc10_49.7(%addr.loc10_49.2) +// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.bound: = bound_method %.loc10_49.2, constants.%Optional.as.Destroy.impl.Op.78b // CHECK:STDOUT: -// CHECK:STDOUT: %bound_method.loc12_49.8: = bound_method %.loc12_49.2, %Optional.as.Destroy.impl.Op.specific_fn -// CHECK:STDOUT: %addr.loc12_49.3: %ptr.036 = addr_of %.loc12_49.2 -// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc12_49.8(%addr.loc12_49.3) -// CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc12_49.2: = bound_method %var, constants.%T.as.Destroy.impl.Op.24b +// CHECK:STDOUT: %bound_method.loc10_49.8: = bound_method %.loc10_49.2, %Optional.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %addr.loc10_49.3: %ptr.d6a = addr_of %.loc10_49.2 +// CHECK:STDOUT: %Optional.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc10_49.8(%addr.loc10_49.3) +// CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc10_49.2: = bound_method %var, constants.%T.as.Destroy.impl.Op.24b // CHECK:STDOUT: -// CHECK:STDOUT: %bound_method.loc12_49.9: = bound_method %var, %T.as.Destroy.impl.Op.specific_fn.2 -// CHECK:STDOUT: %addr.loc12_49.4: %ptr.c28 = addr_of %var -// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc12_49.2: init %empty_tuple.type = call %bound_method.loc12_49.9(%addr.loc12_49.4) -// CHECK:STDOUT: %EmptyRange.as.Destroy.impl.Op.bound: = bound_method %.loc12_48.2, constants.%EmptyRange.as.Destroy.impl.Op.67e +// CHECK:STDOUT: %bound_method.loc10_49.9: = bound_method %var, %T.as.Destroy.impl.Op.specific_fn.2 +// CHECK:STDOUT: %addr.loc10_49.4: %ptr.c28 = addr_of %var +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc10_49.2: init %empty_tuple.type = call %bound_method.loc10_49.9(%addr.loc10_49.4) +// CHECK:STDOUT: %EmptyRange.as.Destroy.impl.Op.bound: = bound_method %.loc10_48.2, constants.%EmptyRange.as.Destroy.impl.Op.c9d // CHECK:STDOUT: -// CHECK:STDOUT: %bound_method.loc12_48: = bound_method %.loc12_48.2, %EmptyRange.as.Destroy.impl.Op.specific_fn -// CHECK:STDOUT: %addr.loc12_48: %ptr.f9b = addr_of %.loc12_48.2 -// CHECK:STDOUT: %EmptyRange.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc12_48(%addr.loc12_48) +// CHECK:STDOUT: %bound_method.loc10_48: = bound_method %.loc10_48.2, %EmptyRange.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %addr.loc10_48: %ptr.894 = addr_of %.loc10_48.2 +// CHECK:STDOUT: %EmptyRange.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc10_48(%addr.loc10_48) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/builtin/call.carbon b/toolchain/check/testdata/function/builtin/call.carbon index 897fa3fe4b58..27fcb5ec9c8b 100644 --- a/toolchain/check/testdata/function/builtin/call.carbon +++ b/toolchain/check/testdata/function/builtin/call.carbon @@ -81,9 +81,9 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] -// CHECK:STDOUT: %Core.import_ref.02e: @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert.type (%Int.as.ImplicitAs.impl.Convert.type.eb9) = import_ref Core//prelude/parts/int, loc20_44, loaded [symbolic = @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert (constants.%Int.as.ImplicitAs.impl.Convert.958)] +// CHECK:STDOUT: %Core.import_ref.02e: @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert.type (%Int.as.ImplicitAs.impl.Convert.type.eb9) = import_ref Core//prelude/parts/int, loc27_44, loaded [symbolic = @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert (constants.%Int.as.ImplicitAs.impl.Convert.958)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.13c = impl_witness_table (%Core.import_ref.02e), @Int.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/builtin/method.carbon b/toolchain/check/testdata/function/builtin/method.carbon index 0fb90c5b7e62..f65097777108 100644 --- a/toolchain/check/testdata/function/builtin/method.carbon +++ b/toolchain/check/testdata/function/builtin/method.carbon @@ -106,12 +106,12 @@ var arr: array(i32, (1 as i32).(I.F)(2)); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//prelude/parts/as, As, loaded [concrete = constants.%As.generic] -// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/parts/int, loc25_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] +// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/parts/int, loc32_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] // CHECK:STDOUT: %As.impl_witness_table.3fe = impl_witness_table (%Core.import_ref.52c), @Core.IntLiteral.as.As.impl [concrete] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] -// CHECK:STDOUT: %Core.import_ref.02e: @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert.type (%Int.as.ImplicitAs.impl.Convert.type.eb9) = import_ref Core//prelude/parts/int, loc20_44, loaded [symbolic = @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert (constants.%Int.as.ImplicitAs.impl.Convert.958)] +// CHECK:STDOUT: %Core.import_ref.02e: @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert.type (%Int.as.ImplicitAs.impl.Convert.type.eb9) = import_ref Core//prelude/parts/int, loc27_44, loaded [symbolic = @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert (constants.%Int.as.ImplicitAs.impl.Convert.958)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.13c = impl_witness_table (%Core.import_ref.02e), @Int.as.ImplicitAs.impl [concrete] // 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 798e9dd3df63..19f71b8d1982 100644 --- a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon +++ b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon @@ -78,7 +78,7 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Float: %Float.type = import_ref Core//prelude/parts/float, Float, loaded [concrete = constants.%Float.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.175: @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type (%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type.261) = import_ref Core//prelude/parts/float, loc15_41, loaded [symbolic = @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert (constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.4dd)] +// CHECK:STDOUT: %Core.import_ref.175: @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type (%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type.261) = import_ref Core//prelude/parts/float, loc20_41, loaded [symbolic = @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert (constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.4dd)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.cc3 = impl_witness_table (%Core.import_ref.175), @Core.FloatLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] diff --git a/toolchain/check/testdata/function/call/i32.carbon b/toolchain/check/testdata/function/call/i32.carbon index 0c5b38a65cc8..408be2a65632 100644 --- a/toolchain/check/testdata/function/call/i32.carbon +++ b/toolchain/check/testdata/function/call/i32.carbon @@ -67,7 +67,7 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/more_param_ir.carbon b/toolchain/check/testdata/function/call/more_param_ir.carbon index 7f66d67e1c70..ec58637d39df 100644 --- a/toolchain/check/testdata/function/call/more_param_ir.carbon +++ b/toolchain/check/testdata/function/call/more_param_ir.carbon @@ -77,7 +77,7 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/params_one.carbon b/toolchain/check/testdata/function/call/params_one.carbon index 679f08d167d3..fc6a9a2f4832 100644 --- a/toolchain/check/testdata/function/call/params_one.carbon +++ b/toolchain/check/testdata/function/call/params_one.carbon @@ -59,7 +59,7 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/call/params_one_comma.carbon b/toolchain/check/testdata/function/call/params_one_comma.carbon index 46a84cbbe97d..562516df6f43 100644 --- a/toolchain/check/testdata/function/call/params_one_comma.carbon +++ b/toolchain/check/testdata/function/call/params_one_comma.carbon @@ -60,7 +60,7 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/call/params_two.carbon b/toolchain/check/testdata/function/call/params_two.carbon index ca5c9b2aa0de..f2f979a3cc1b 100644 --- a/toolchain/check/testdata/function/call/params_two.carbon +++ b/toolchain/check/testdata/function/call/params_two.carbon @@ -63,7 +63,7 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/call/params_two_comma.carbon b/toolchain/check/testdata/function/call/params_two_comma.carbon index 3beeb8207ce1..04c861f3c516 100644 --- a/toolchain/check/testdata/function/call/params_two_comma.carbon +++ b/toolchain/check/testdata/function/call/params_two_comma.carbon @@ -64,7 +64,7 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/call/prefer_unqualified_lookup.carbon b/toolchain/check/testdata/function/call/prefer_unqualified_lookup.carbon index 98f781a277c3..807b0e7f4b85 100644 --- a/toolchain/check/testdata/function/call/prefer_unqualified_lookup.carbon +++ b/toolchain/check/testdata/function/call/prefer_unqualified_lookup.carbon @@ -92,7 +92,7 @@ fn Class(F:! type).Inner.G() -> i32 { return F(); } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/declaration/import.carbon b/toolchain/check/testdata/function/declaration/import.carbon index bb113633ca07..bf6aa4dac7ac 100644 --- a/toolchain/check/testdata/function/declaration/import.carbon +++ b/toolchain/check/testdata/function/declaration/import.carbon @@ -520,7 +520,7 @@ import library "extern_api"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -701,7 +701,7 @@ import library "extern_api"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -912,7 +912,7 @@ import library "extern_api"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.7bb: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.8a0) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.1d6)] +// CHECK:STDOUT: %Core.import_ref.7bb: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.8a0) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.1d6)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.ba4 = impl_witness_table (%Core.import_ref.7bb), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1127,7 +1127,7 @@ import library "extern_api"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1312,7 +1312,7 @@ import library "extern_api"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/definition/import.carbon b/toolchain/check/testdata/function/definition/import.carbon index bc48df743211..9f8ac8660aee 100644 --- a/toolchain/check/testdata/function/definition/import.carbon +++ b/toolchain/check/testdata/function/definition/import.carbon @@ -299,7 +299,7 @@ fn D() {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/generic/deduce.carbon b/toolchain/check/testdata/function/generic/deduce.carbon index 61d298534666..ad19568baf70 100644 --- a/toolchain/check/testdata/function/generic/deduce.carbon +++ b/toolchain/check/testdata/function/generic/deduce.carbon @@ -887,7 +887,7 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1021,7 +1021,7 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/generic/deduce_nested_facet_value.carbon b/toolchain/check/testdata/function/generic/deduce_nested_facet_value.carbon index 0aaa04b10568..553108e2515d 100644 --- a/toolchain/check/testdata/function/generic/deduce_nested_facet_value.carbon +++ b/toolchain/check/testdata/function/generic/deduce_nested_facet_value.carbon @@ -106,7 +106,7 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.BitAndWith: %BitAndWith.type.f2e = import_ref Core//prelude, BitAndWith, loaded [concrete = constants.%BitAndWith.generic] -// CHECK:STDOUT: %Core.import_ref.a4f: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude, loc13_42, loaded [concrete = constants.%type.as.BitAndWith.impl.Op] +// CHECK:STDOUT: %Core.import_ref.a4f: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude, loc14_42, loaded [concrete = constants.%type.as.BitAndWith.impl.Op] // CHECK:STDOUT: %BitAndWith.impl_witness_table = impl_witness_table (%Core.import_ref.a4f), @type.as.BitAndWith.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/generic/param_in_type.carbon b/toolchain/check/testdata/function/generic/param_in_type.carbon index 02326d1ac5e9..25b94bee35c7 100644 --- a/toolchain/check/testdata/function/generic/param_in_type.carbon +++ b/toolchain/check/testdata/function/generic/param_in_type.carbon @@ -57,7 +57,7 @@ fn F(N:! i32, a: array(i32, N)*); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.02e: @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert.type (%Int.as.ImplicitAs.impl.Convert.type.eb9) = import_ref Core//prelude/parts/int, loc20_44, loaded [symbolic = @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert (constants.%Int.as.ImplicitAs.impl.Convert.958)] +// CHECK:STDOUT: %Core.import_ref.02e: @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert.type (%Int.as.ImplicitAs.impl.Convert.type.eb9) = import_ref Core//prelude/parts/int, loc27_44, loaded [symbolic = @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert (constants.%Int.as.ImplicitAs.impl.Convert.958)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.13c = impl_witness_table (%Core.import_ref.02e), @Int.as.ImplicitAs.impl [concrete] // 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 3ede094db9f0..d7f1855493c1 100644 --- a/toolchain/check/testdata/function/generic/resolve_used.carbon +++ b/toolchain/check/testdata/function/generic/resolve_used.carbon @@ -21,7 +21,7 @@ fn ErrorIfNIsZero(N:! Core.IntLiteral()) { // ensuring we produce an error when doing so. Notionally this error is // produced as a result of instantiating the `Core.Int` template, although // that's not how we currently model `Core.Int`. - // CHECK:STDERR: min_prelude/parts/int.carbon:10:9: error: integer type width of 0 is not positive [IntWidthNotPositive] + // CHECK:STDERR: min_prelude/parts/int.carbon:11:9: error: integer type width of 0 is not positive [IntWidthNotPositive] // CHECK:STDERR: adapt MakeInt(N); // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: fail_todo_call_monomorphization_error.carbon:[[@LINE+3]]:10: note: in `i0` used here [ResolvingSpecificHere] @@ -93,7 +93,7 @@ fn CallNegative() { // CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/parts/int_literal, IntLiteral, loaded [concrete = constants.%IntLiteral] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] -// CHECK:STDOUT: %Core.import_ref.16a: @Int.as.Destroy.impl.%Int.as.Destroy.impl.Op.type (%Int.as.Destroy.impl.Op.type.a60) = import_ref Core//prelude/parts/int, loc9_29, loaded [symbolic = @Int.as.Destroy.impl.%Int.as.Destroy.impl.Op (constants.%Int.as.Destroy.impl.Op.340)] +// CHECK:STDOUT: %Core.import_ref.16a: @Int.as.Destroy.impl.%Int.as.Destroy.impl.Op.type (%Int.as.Destroy.impl.Op.type.a60) = import_ref Core//prelude/parts/int, loc10_29, loaded [symbolic = @Int.as.Destroy.impl.%Int.as.Destroy.impl.Op (constants.%Int.as.Destroy.impl.Op.340)] // CHECK:STDOUT: %Destroy.impl_witness_table.fea = impl_witness_table (%Core.import_ref.16a), @Int.as.Destroy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/generic/undefined.carbon b/toolchain/check/testdata/function/generic/undefined.carbon index ae84921d4f4d..33c21018c932 100644 --- a/toolchain/check/testdata/function/generic/undefined.carbon +++ b/toolchain/check/testdata/function/generic/undefined.carbon @@ -104,7 +104,7 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//prelude/parts/as, As, loaded [concrete = constants.%As.generic] -// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/parts/int, loc25_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] +// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/parts/int, loc32_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] // CHECK:STDOUT: %As.impl_witness_table.3fe = impl_witness_table (%Core.import_ref.52c), @Core.IntLiteral.as.As.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -238,7 +238,7 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//prelude/parts/as, As, loaded [concrete = constants.%As.generic] -// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/parts/int, loc25_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] +// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/parts/int, loc32_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] // CHECK:STDOUT: %As.impl_witness_table.3fe = impl_witness_table (%Core.import_ref.52c), @Core.IntLiteral.as.As.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -385,7 +385,7 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//prelude/parts/as, As, loaded [concrete = constants.%As.generic] -// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/parts/int, loc25_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] +// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/parts/int, loc32_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] // CHECK:STDOUT: %As.impl_witness_table.3fe = impl_witness_table (%Core.import_ref.52c), @Core.IntLiteral.as.As.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/generic/call_basic_depth.carbon b/toolchain/check/testdata/generic/call_basic_depth.carbon index 088adb50ea51..211aefdc54af 100644 --- a/toolchain/check/testdata/generic/call_basic_depth.carbon +++ b/toolchain/check/testdata/generic/call_basic_depth.carbon @@ -122,7 +122,7 @@ fn M() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/generic/dependent_param.carbon b/toolchain/check/testdata/generic/dependent_param.carbon index debc60dd2470..9872edfe8bbc 100644 --- a/toolchain/check/testdata/generic/dependent_param.carbon +++ b/toolchain/check/testdata/generic/dependent_param.carbon @@ -100,7 +100,7 @@ var n: i32 = Outer(i32).Inner(42).Get(); // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/generic/local.carbon b/toolchain/check/testdata/generic/local.carbon index 20fa68c77848..c2d7ecd1860e 100644 --- a/toolchain/check/testdata/generic/local.carbon +++ b/toolchain/check/testdata/generic/local.carbon @@ -120,7 +120,7 @@ class C(C:! type) { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/if_expr/basic.carbon b/toolchain/check/testdata/if_expr/basic.carbon index 2e88c09bcd62..30206fc2cead 100644 --- a/toolchain/check/testdata/if_expr/basic.carbon +++ b/toolchain/check/testdata/if_expr/basic.carbon @@ -72,7 +72,7 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = constants.%Bool] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/if_expr/constant_condition.carbon b/toolchain/check/testdata/if_expr/constant_condition.carbon index 6a0b9a1c1545..58e6216f1b69 100644 --- a/toolchain/check/testdata/if_expr/constant_condition.carbon +++ b/toolchain/check/testdata/if_expr/constant_condition.carbon @@ -80,6 +80,17 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %Constant: %Constant.type = struct_value () [concrete] // CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [concrete] // CHECK:STDOUT: %pattern_type.fe8: type = pattern_type %ptr.235 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.f23: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.8b3) [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.abf: %ptr.as.Copy.impl.Op.type.f23 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.19c: = impl_witness imports.%Copy.impl_witness_table.a71, @ptr.as.Copy.impl(%i32) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.3ea: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%i32) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.2f4: %ptr.as.Copy.impl.Op.type.3ea = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.bab: %Copy.type = facet_value %ptr.235, (%Copy.impl_witness.19c) [concrete] +// CHECK:STDOUT: %.284: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.bab [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.2f4, @ptr.as.Copy.impl.Op(%i32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.type.f2e: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%ptr.235) [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.fad: %T.as.Destroy.impl.Op.type.f2e = struct_value () [concrete] @@ -96,14 +107,18 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.de9: @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op.type (%ptr.as.Copy.impl.Op.type.f23) = import_ref Core//prelude/parts/copy, loc32_31, loaded [symbolic = @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op (constants.%ptr.as.Copy.impl.Op.abf)] +// CHECK:STDOUT: %Copy.impl_witness_table.a71 = impl_witness_table (%Core.import_ref.de9), @ptr.as.Copy.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -260,10 +275,10 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %v.var: ref %i32 = var %v.var_patt // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] -// CHECK:STDOUT: %bound_method.loc27_3.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.a02] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc27_3.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method.b59] +// CHECK:STDOUT: %impl.elem0.loc27: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] +// CHECK:STDOUT: %bound_method.loc27_3.1: = bound_method %int_1, %impl.elem0.loc27 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.a02] +// CHECK:STDOUT: %specific_fn.loc27: = specific_function %impl.elem0.loc27, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc27_3.2: = bound_method %int_1, %specific_fn.loc27 [concrete = constants.%bound_method.b59] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc27_3.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc27_3: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.5d2] // CHECK:STDOUT: assign %v.var, %.loc27_3 @@ -297,7 +312,12 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %w.var: ref %ptr.235 = var %w.var_patt // CHECK:STDOUT: %v.ref: ref %i32 = name_ref v, %v // CHECK:STDOUT: %addr.loc28_40: %ptr.235 = addr_of %v.ref -// CHECK:STDOUT: assign %w.var, %addr.loc28_40 +// CHECK:STDOUT: %impl.elem0.loc28: %.284 = impl_witness_access constants.%Copy.impl_witness.19c, element0 [concrete = constants.%ptr.as.Copy.impl.Op.2f4] +// CHECK:STDOUT: %bound_method.loc28_40.1: = bound_method %addr.loc28_40, %impl.elem0.loc28 +// CHECK:STDOUT: %specific_fn.loc28: = specific_function %impl.elem0.loc28, @ptr.as.Copy.impl.Op(constants.%i32) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc28_40.2: = bound_method %addr.loc28_40, %specific_fn.loc28 +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.235 = call %bound_method.loc28_40.2(%addr.loc28_40) +// CHECK:STDOUT: assign %w.var, %ptr.as.Copy.impl.Op.call // CHECK:STDOUT: br !.loc28_13 // CHECK:STDOUT: // CHECK:STDOUT: !.loc28_13: @@ -327,9 +347,9 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %.loc29_10.2: %i32 = bind_value %.loc29_10.1 // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound: = bound_method %w.var, constants.%T.as.Destroy.impl.Op.fad // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: = specific_function constants.%T.as.Destroy.impl.Op.fad, @T.as.Destroy.impl.Op(constants.%ptr.235) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc28: = bound_method %w.var, %T.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %bound_method.loc28_3: = bound_method %w.var, %T.as.Destroy.impl.Op.specific_fn // CHECK:STDOUT: %addr.loc28_3: %ptr.5d5 = addr_of %w.var -// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc28(%addr.loc28_3) +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc28_3(%addr.loc28_3) // CHECK:STDOUT: %Int.as.Destroy.impl.Op.bound: = bound_method %v.var, constants.%Int.as.Destroy.impl.Op.054 // CHECK:STDOUT: %Int.as.Destroy.impl.Op.specific_fn: = specific_function constants.%Int.as.Destroy.impl.Op.054, @Int.as.Destroy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Destroy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc27_3.3: = bound_method %v.var, %Int.as.Destroy.impl.Op.specific_fn @@ -346,10 +366,10 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %v.var: ref %i32 = var %v.var_patt // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] -// CHECK:STDOUT: %bound_method.loc33_3.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.a02] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc33_3.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method.b59] +// CHECK:STDOUT: %impl.elem0.loc33: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] +// CHECK:STDOUT: %bound_method.loc33_3.1: = bound_method %int_1, %impl.elem0.loc33 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.a02] +// CHECK:STDOUT: %specific_fn.loc33: = specific_function %impl.elem0.loc33, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc33_3.2: = bound_method %int_1, %specific_fn.loc33 [concrete = constants.%bound_method.b59] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc33_3.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc33_3: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.5d2] // CHECK:STDOUT: assign %v.var, %.loc33_3 @@ -381,7 +401,12 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %w.var: ref %ptr.235 = var %w.var_patt // CHECK:STDOUT: %v.ref: ref %i32 = name_ref v, %v // CHECK:STDOUT: %addr.loc34_38: %ptr.235 = addr_of %v.ref -// CHECK:STDOUT: assign %w.var, %addr.loc34_38 +// CHECK:STDOUT: %impl.elem0.loc34: %.284 = impl_witness_access constants.%Copy.impl_witness.19c, element0 [concrete = constants.%ptr.as.Copy.impl.Op.2f4] +// CHECK:STDOUT: %bound_method.loc34_38.1: = bound_method %addr.loc34_38, %impl.elem0.loc34 +// CHECK:STDOUT: %specific_fn.loc34: = specific_function %impl.elem0.loc34, @ptr.as.Copy.impl.Op(constants.%i32) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc34_38.2: = bound_method %addr.loc34_38, %specific_fn.loc34 +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.235 = call %bound_method.loc34_38.2(%addr.loc34_38) +// CHECK:STDOUT: assign %w.var, %ptr.as.Copy.impl.Op.call // CHECK:STDOUT: br !.loc34_13 // CHECK:STDOUT: // CHECK:STDOUT: !.loc34_13: @@ -410,9 +435,9 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %.loc35_10.2: %i32 = bind_value %.loc35_10.1 // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound: = bound_method %w.var, constants.%T.as.Destroy.impl.Op.fad // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: = specific_function constants.%T.as.Destroy.impl.Op.fad, @T.as.Destroy.impl.Op(constants.%ptr.235) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc34: = bound_method %w.var, %T.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %bound_method.loc34_3: = bound_method %w.var, %T.as.Destroy.impl.Op.specific_fn // CHECK:STDOUT: %addr.loc34_3: %ptr.5d5 = addr_of %w.var -// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc34(%addr.loc34_3) +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc34_3(%addr.loc34_3) // CHECK:STDOUT: %Int.as.Destroy.impl.Op.bound: = bound_method %v.var, constants.%Int.as.Destroy.impl.Op.054 // CHECK:STDOUT: %Int.as.Destroy.impl.Op.specific_fn: = specific_function constants.%Int.as.Destroy.impl.Op.054, @Int.as.Destroy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Destroy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc33_3.3: = bound_method %v.var, %Int.as.Destroy.impl.Op.specific_fn diff --git a/toolchain/check/testdata/if_expr/control_flow.carbon b/toolchain/check/testdata/if_expr/control_flow.carbon index 0be45bf3de80..4f2babae5704 100644 --- a/toolchain/check/testdata/if_expr/control_flow.carbon +++ b/toolchain/check/testdata/if_expr/control_flow.carbon @@ -69,7 +69,7 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = constants.%Bool] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/if_expr/nested.carbon b/toolchain/check/testdata/if_expr/nested.carbon index 6d0884ddb13d..abc1cdf04be8 100644 --- a/toolchain/check/testdata/if_expr/nested.carbon +++ b/toolchain/check/testdata/if_expr/nested.carbon @@ -71,7 +71,7 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = constants.%Bool] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/if_expr/struct.carbon b/toolchain/check/testdata/if_expr/struct.carbon index fd508dce6f60..1f56379d2bb5 100644 --- a/toolchain/check/testdata/if_expr/struct.carbon +++ b/toolchain/check/testdata/if_expr/struct.carbon @@ -78,7 +78,7 @@ fn F(cond: bool) { // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = constants.%Bool] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/assoc_const_self.carbon b/toolchain/check/testdata/impl/assoc_const_self.carbon index 3be4f3ca7d4b..dded4d0b1b47 100644 --- a/toolchain/check/testdata/impl/assoc_const_self.carbon +++ b/toolchain/check/testdata/impl/assoc_const_self.carbon @@ -158,7 +158,7 @@ fn CallF() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/extend_impl_generic.carbon b/toolchain/check/testdata/impl/extend_impl_generic.carbon index 57af5e158cc0..88152f1078d3 100644 --- a/toolchain/check/testdata/impl/extend_impl_generic.carbon +++ b/toolchain/check/testdata/impl/extend_impl_generic.carbon @@ -56,22 +56,23 @@ class X(U:! type) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self] -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] // CHECK:STDOUT: %HasF.type.fe3: type = generic_interface_type @HasF [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %HasF.generic: %HasF.type.fe3 = struct_value () [concrete] -// CHECK:STDOUT: %HasF.type.cc6: type = facet_type <@HasF, @HasF(%T)> [symbolic] +// CHECK:STDOUT: %HasF.type.cc6: type = facet_type <@HasF, @HasF(%T.8b3)> [symbolic] // CHECK:STDOUT: %Self.759: %HasF.type.cc6 = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %pattern_type.7dcd0a.1: type = pattern_type %T [symbolic] -// CHECK:STDOUT: %HasF.F.type.46c: type = fn_type @HasF.F, @HasF(%T) [symbolic] +// CHECK:STDOUT: %pattern_type.7dcd0a.1: type = pattern_type %T.8b3 [symbolic] +// CHECK:STDOUT: %HasF.F.type.46c: type = fn_type @HasF.F, @HasF(%T.8b3) [symbolic] // CHECK:STDOUT: %HasF.F.823: %HasF.F.type.46c = struct_value () [symbolic] -// CHECK:STDOUT: %HasF.assoc_type.dd8: type = assoc_entity_type @HasF, @HasF(%T) [symbolic] +// CHECK:STDOUT: %HasF.assoc_type.dd8: type = assoc_entity_type @HasF, @HasF(%T.8b3) [symbolic] // CHECK:STDOUT: %assoc0.d31: %HasF.assoc_type.dd8 = assoc_entity element0, @HasF.%HasF.F.decl [symbolic] // CHECK:STDOUT: %Param: type = class_type @Param [concrete] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %Param.elem: type = unbound_element_type %Param, %i32 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] @@ -126,6 +127,16 @@ class X(U:! type) { // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %.d6f: type = fn_type_with_self_type %HasF.F.type.7f1, %HasF.facet [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Int.as.Destroy.impl.Op.type.11b: type = fn_type @Int.as.Destroy.impl.Op, @Int.as.Destroy.impl(%int_32) [concrete] // CHECK:STDOUT: %Int.as.Destroy.impl.Op.054: %Int.as.Destroy.impl.Op.type.11b = struct_value () [concrete] // CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [concrete] @@ -137,14 +148,18 @@ class X(U:! type) { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -160,7 +175,7 @@ class X(U:! type) { // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %T.loc4_16.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_16.1 (constants.%T)] +// CHECK:STDOUT: %T.loc4_16.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_16.1 (constants.%T.8b3)] // CHECK:STDOUT: } // CHECK:STDOUT: %Param.decl: type = class_decl @Param [concrete = constants.%Param] {} {} // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {} @@ -175,7 +190,7 @@ class X(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @HasF(%T.loc4_16.2: type) { -// CHECK:STDOUT: %T.loc4_16.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_16.1 (constants.%T)] +// CHECK:STDOUT: %T.loc4_16.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_16.1 (constants.%T.8b3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF, @HasF(%T.loc4_16.1)> [symbolic = %HasF.type (constants.%HasF.type.cc6)] @@ -191,9 +206,9 @@ class X(U:! type) { // CHECK:STDOUT: %return.patt: @HasF.F.%pattern_type (%pattern_type.7dcd0a.1) = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: @HasF.F.%pattern_type (%pattern_type.7dcd0a.1) = out_param_pattern %return.patt, call_param0 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: type = name_ref T, @HasF.%T.loc4_16.2 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %return.param: ref @HasF.F.%T (%T) = out_param call_param0 -// CHECK:STDOUT: %return: ref @HasF.F.%T (%T) = return_slot %return.param +// CHECK:STDOUT: %T.ref: type = name_ref T, @HasF.%T.loc4_16.2 [symbolic = %T (constants.%T.8b3)] +// CHECK:STDOUT: %return.param: ref @HasF.F.%T (%T.8b3) = out_param call_param0 +// CHECK:STDOUT: %return: ref @HasF.F.%T (%T.8b3) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0.loc5_14.1: @HasF.%HasF.assoc_type (%HasF.assoc_type.dd8) = assoc_entity element0, %HasF.F.decl [symbolic = %assoc0.loc5_14.2 (constants.%assoc0.d31)] // CHECK:STDOUT: @@ -295,10 +310,10 @@ class X(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @HasF.F(@HasF.%T.loc4_16.2: type, @HasF.%Self.1: @HasF.%HasF.type (%HasF.type.cc6)) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.8b3)] // CHECK:STDOUT: %pattern_type: type = pattern_type %T [symbolic = %pattern_type (constants.%pattern_type.7dcd0a.1)] // CHECK:STDOUT: -// CHECK:STDOUT: fn() -> @HasF.F.%T (%T); +// CHECK:STDOUT: fn() -> @HasF.F.%T (%T.8b3); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Param.as.Destroy.impl.Op(%self.param: %ptr.756) = "no_op"; @@ -350,14 +365,19 @@ class X(U:! type) { // CHECK:STDOUT: %c.ref: %C = name_ref c, %c // CHECK:STDOUT: %.loc22_17: %HasF.assoc_type.257 = specific_constant @HasF.%assoc0.loc5_14.1, @HasF(constants.%Param) [concrete = constants.%assoc0.afb] // CHECK:STDOUT: %F.ref.loc22: %HasF.assoc_type.257 = name_ref F, %.loc22_17 [concrete = constants.%assoc0.afb] -// CHECK:STDOUT: %impl.elem0.loc22: %.d6f = impl_witness_access constants.%HasF.impl_witness, element0 [concrete = constants.%C.as.HasF.impl.F] +// CHECK:STDOUT: %impl.elem0.loc22_17: %.d6f = impl_witness_access constants.%HasF.impl_witness, element0 [concrete = constants.%C.as.HasF.impl.F] // CHECK:STDOUT: %.loc22_20.1: ref %Param = temporary_storage -// CHECK:STDOUT: %C.as.HasF.impl.F.call.loc22: init %Param = call %impl.elem0.loc22() to %.loc22_20.1 +// CHECK:STDOUT: %C.as.HasF.impl.F.call.loc22: init %Param = call %impl.elem0.loc22_17() to %.loc22_20.1 // CHECK:STDOUT: %.loc22_20.2: ref %Param = temporary %.loc22_20.1, %C.as.HasF.impl.F.call.loc22 // CHECK:STDOUT: %x.ref.loc22: %Param.elem = name_ref x, @Param.%.loc9 [concrete = @Param.%.loc9] // CHECK:STDOUT: %.loc22_21.1: ref %i32 = class_element_access %.loc22_20.2, element0 // CHECK:STDOUT: %.loc22_21.2: %i32 = bind_value %.loc22_21.1 -// CHECK:STDOUT: assign %b.var, %.loc22_21.2 +// CHECK:STDOUT: %impl.elem0.loc22_21: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc22_21.1: = bound_method %.loc22_21.2, %impl.elem0.loc22_21 +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc22_21, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc22_21.2: = bound_method %.loc22_21.2, %specific_fn +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc22_21.2(%.loc22_21.2) +// CHECK:STDOUT: assign %b.var, %Int.as.Copy.impl.Op.call // CHECK:STDOUT: %.loc22_10: type = splice_block %i32.loc22 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] @@ -368,21 +388,21 @@ class X(U:! type) { // CHECK:STDOUT: %Param.as.Destroy.impl.Op.call.loc22: init %empty_tuple.type = call %Param.as.Destroy.impl.Op.bound.loc22(%addr.loc22_20) // CHECK:STDOUT: %Int.as.Destroy.impl.Op.bound: = bound_method %b.var, constants.%Int.as.Destroy.impl.Op.054 // CHECK:STDOUT: %Int.as.Destroy.impl.Op.specific_fn: = specific_function constants.%Int.as.Destroy.impl.Op.054, @Int.as.Destroy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Destroy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method: = bound_method %b.var, %Int.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %bound_method.loc22_3: = bound_method %b.var, %Int.as.Destroy.impl.Op.specific_fn // CHECK:STDOUT: %addr.loc22_3: %ptr.235 = addr_of %b.var -// CHECK:STDOUT: %Int.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr.loc22_3) +// CHECK:STDOUT: %Int.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc22_3(%addr.loc22_3) // CHECK:STDOUT: %Param.as.Destroy.impl.Op.bound.loc21: = bound_method %.loc21_20.2, constants.%Param.as.Destroy.impl.Op // CHECK:STDOUT: %addr.loc21: %ptr.756 = addr_of %.loc21_20.2 // CHECK:STDOUT: %Param.as.Destroy.impl.Op.call.loc21: init %empty_tuple.type = call %Param.as.Destroy.impl.Op.bound.loc21(%addr.loc21) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @HasF(constants.%T) { -// CHECK:STDOUT: %T.loc4_16.1 => constants.%T +// CHECK:STDOUT: specific @HasF(constants.%T.8b3) { +// CHECK:STDOUT: %T.loc4_16.1 => constants.%T.8b3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @HasF.F(constants.%T, constants.%Self.759) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @HasF.F(constants.%T.8b3, constants.%Self.759) { +// CHECK:STDOUT: %T => constants.%T.8b3 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dcd0a.1 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/forward_decls.carbon b/toolchain/check/testdata/impl/forward_decls.carbon index dd510cb6f10f..549fb30086e2 100644 --- a/toolchain/check/testdata/impl/forward_decls.carbon +++ b/toolchain/check/testdata/impl/forward_decls.carbon @@ -433,7 +433,7 @@ interface I { // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.BitAndWith: %BitAndWith.type.f2e = import_ref Core//prelude, BitAndWith, loaded [concrete = constants.%BitAndWith.generic] -// CHECK:STDOUT: %Core.import_ref.a4f: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude, loc13_42, loaded [concrete = constants.%type.as.BitAndWith.impl.Op] +// CHECK:STDOUT: %Core.import_ref.a4f: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude, loc14_42, loaded [concrete = constants.%type.as.BitAndWith.impl.Op] // CHECK:STDOUT: %BitAndWith.impl_witness_table = impl_witness_table (%Core.import_ref.a4f), @type.as.BitAndWith.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1670,7 +1670,7 @@ interface I { // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.BitAndWith: %BitAndWith.type.f2e = import_ref Core//prelude, BitAndWith, loaded [concrete = constants.%BitAndWith.generic] -// CHECK:STDOUT: %Core.import_ref.a4f: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude, loc13_42, loaded [concrete = constants.%type.as.BitAndWith.impl.Op] +// CHECK:STDOUT: %Core.import_ref.a4f: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude, loc14_42, loaded [concrete = constants.%type.as.BitAndWith.impl.Op] // CHECK:STDOUT: %BitAndWith.impl_witness_table = impl_witness_table (%Core.import_ref.a4f), @type.as.BitAndWith.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/impl_assoc_const_with_prelude.carbon b/toolchain/check/testdata/impl/impl_assoc_const_with_prelude.carbon index 06cb3a8a1288..f1db346f5edf 100644 --- a/toolchain/check/testdata/impl/impl_assoc_const_with_prelude.carbon +++ b/toolchain/check/testdata/impl/impl_assoc_const_with_prelude.carbon @@ -119,7 +119,7 @@ impl () as I where .X = {.a = true, .b = (1, 2)} and .X = {.a = false, .b = (3, // CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/types/int, loc20_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/types/int, loc27_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.SubWith: %SubWith.type.378 = import_ref Core//prelude/operators/arithmetic, SubWith, loaded [concrete = constants.%SubWith.generic] // CHECK:STDOUT: %Core.import_ref.abd97d.1 = import_ref Core//prelude/operators/arithmetic, loc115_57, unloaded @@ -320,7 +320,7 @@ impl () as I where .X = {.a = true, .b = (1, 2)} and .X = {.a = false, .b = (3, // CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/types/int, loc20_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/types/int, loc27_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/impl_thunk.carbon b/toolchain/check/testdata/impl/impl_thunk.carbon index 77c9ae9318cb..c3d865ba6717 100644 --- a/toolchain/check/testdata/impl/impl_thunk.carbon +++ b/toolchain/check/testdata/impl/impl_thunk.carbon @@ -103,10 +103,13 @@ interface X { impl A as X { //@dump-sem-ir-begin - // CHECK:STDERR: fail_inheritance_value_conversion_copy_return.carbon:[[@LINE+7]]:3: error: cannot copy value of type `A` [CopyOfUncopyableType] + // CHECK:STDERR: fail_inheritance_value_conversion_copy_return.carbon:[[@LINE+10]]:3: error: cannot copy value of type `A` [CopyOfUncopyableType] // CHECK:STDERR: fn F() -> B; // CHECK:STDERR: ^~~~~~~~~~~~ - // CHECK:STDERR: fail_inheritance_value_conversion_copy_return.carbon:[[@LINE-8]]:3: note: while building thunk to match the signature of this function [ThunkSignature] + // CHECK:STDERR: fail_inheritance_value_conversion_copy_return.carbon:[[@LINE+7]]:3: note: type `A` does not implement interface `Core.Copy` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fn F() -> B; + // CHECK:STDERR: ^~~~~~~~~~~~ + // CHECK:STDERR: fail_inheritance_value_conversion_copy_return.carbon:[[@LINE-11]]:3: note: while building thunk to match the signature of this function [ThunkSignature] // CHECK:STDERR: fn F() -> Self; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -622,9 +625,9 @@ impl () as I({}) { // CHECK:STDOUT: %B.as.Destroy.impl.Op.type: type = fn_type @B.as.Destroy.impl.Op [concrete] // CHECK:STDOUT: %B.as.Destroy.impl.Op: %B.as.Destroy.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.049: type = pattern_type %B [concrete] -// CHECK:STDOUT: %A.as.X.impl.F.type.d90acb.1: type = fn_type @A.as.X.impl.F.loc20_14.1 [concrete] +// CHECK:STDOUT: %A.as.X.impl.F.type.d90acb.1: type = fn_type @A.as.X.impl.F.loc23_14.1 [concrete] // CHECK:STDOUT: %A.as.X.impl.F.4a6dbe.1: %A.as.X.impl.F.type.d90acb.1 = struct_value () [concrete] -// CHECK:STDOUT: %A.as.X.impl.F.type.d90acb.2: type = fn_type @A.as.X.impl.F.loc20_14.2 [concrete] +// CHECK:STDOUT: %A.as.X.impl.F.type.d90acb.2: type = fn_type @A.as.X.impl.F.loc23_14.2 [concrete] // CHECK:STDOUT: %A.as.X.impl.F.4a6dbe.2: %A.as.X.impl.F.type.d90acb.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -632,7 +635,7 @@ impl () as I({}) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @A.as.X.impl: %A.ref as %X.ref { -// CHECK:STDOUT: %A.as.X.impl.F.decl.loc20_14.1: %A.as.X.impl.F.type.d90acb.1 = fn_decl @A.as.X.impl.F.loc20_14.1 [concrete = constants.%A.as.X.impl.F.4a6dbe.1] { +// CHECK:STDOUT: %A.as.X.impl.F.decl.loc23_14.1: %A.as.X.impl.F.type.d90acb.1 = fn_decl @A.as.X.impl.F.loc23_14.1 [concrete = constants.%A.as.X.impl.F.4a6dbe.1] { // CHECK:STDOUT: %return.patt: %pattern_type.049 = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.049 = out_param_pattern %return.patt, call_param0 [concrete] // CHECK:STDOUT: } { @@ -640,7 +643,7 @@ impl () as I({}) { // CHECK:STDOUT: %return.param: ref %B = out_param call_param0 // CHECK:STDOUT: %return: ref %B = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %A.as.X.impl.F.decl.loc20_14.2: %A.as.X.impl.F.type.d90acb.2 = fn_decl @A.as.X.impl.F.loc20_14.2 [concrete = constants.%A.as.X.impl.F.4a6dbe.2] { +// CHECK:STDOUT: %A.as.X.impl.F.decl.loc23_14.2: %A.as.X.impl.F.type.d90acb.2 = fn_decl @A.as.X.impl.F.loc23_14.2 [concrete = constants.%A.as.X.impl.F.4a6dbe.2] { // CHECK:STDOUT: // CHECK:STDOUT: } { // CHECK:STDOUT: @@ -648,24 +651,24 @@ impl () as I({}) { // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .B = -// CHECK:STDOUT: .F = %A.as.X.impl.F.decl.loc20_14.1 +// CHECK:STDOUT: .F = %A.as.X.impl.F.decl.loc23_14.1 // CHECK:STDOUT: witness = file.%X.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @A.as.X.impl.F.loc20_14.1() -> %return.param: %B; +// CHECK:STDOUT: fn @A.as.X.impl.F.loc23_14.1() -> %return.param: %B; // CHECK:STDOUT: -// CHECK:STDOUT: fn @A.as.X.impl.F.loc20_14.2() -> %return.param: %A [thunk @A.as.X.impl.%A.as.X.impl.F.decl.loc20_14.1] { +// CHECK:STDOUT: fn @A.as.X.impl.F.loc23_14.2() -> %return.param: %A [thunk @A.as.X.impl.%A.as.X.impl.F.decl.loc23_14.1] { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %A.as.X.impl.F.type.d90acb.1 = name_ref F, @A.as.X.impl.%A.as.X.impl.F.decl.loc20_14.1 [concrete = constants.%A.as.X.impl.F.4a6dbe.1] +// CHECK:STDOUT: %F.ref: %A.as.X.impl.F.type.d90acb.1 = name_ref F, @A.as.X.impl.%A.as.X.impl.F.decl.loc23_14.1 [concrete = constants.%A.as.X.impl.F.4a6dbe.1] // CHECK:STDOUT: -// CHECK:STDOUT: %.loc20_14.1: ref %B = temporary_storage -// CHECK:STDOUT: %A.as.X.impl.F.call: init %B = call %F.ref() to %.loc20_14.1 -// CHECK:STDOUT: %.loc20_14.2: ref %B = temporary %.loc20_14.1, %A.as.X.impl.F.call -// CHECK:STDOUT: %.loc20_14.3: ref %A = class_element_access %.loc20_14.2, element0 -// CHECK:STDOUT: %.loc20_14.4: ref %A = converted %A.as.X.impl.F.call, %.loc20_14.3 -// CHECK:STDOUT: %.loc20_14.5: %A = bind_value %.loc20_14.4 -// CHECK:STDOUT: %B.as.Destroy.impl.Op.bound: = bound_method %.loc20_14.2, constants.%B.as.Destroy.impl.Op -// CHECK:STDOUT: %addr: %ptr.e79 = addr_of %.loc20_14.2 +// CHECK:STDOUT: %.loc23_14.1: ref %B = temporary_storage +// CHECK:STDOUT: %A.as.X.impl.F.call: init %B = call %F.ref() to %.loc23_14.1 +// CHECK:STDOUT: %.loc23_14.2: ref %B = temporary %.loc23_14.1, %A.as.X.impl.F.call +// CHECK:STDOUT: %.loc23_14.3: ref %A = class_element_access %.loc23_14.2, element0 +// CHECK:STDOUT: %.loc23_14.4: ref %A = converted %A.as.X.impl.F.call, %.loc23_14.3 +// CHECK:STDOUT: %.loc23_14.5: %A = bind_value %.loc23_14.4 +// CHECK:STDOUT: %B.as.Destroy.impl.Op.bound: = bound_method %.loc23_14.2, constants.%B.as.Destroy.impl.Op +// CHECK:STDOUT: %addr: %ptr.e79 = addr_of %.loc23_14.2 // CHECK:STDOUT: %B.as.Destroy.impl.Op.call: init %empty_tuple.type = call %B.as.Destroy.impl.Op.bound(%addr) // CHECK:STDOUT: return to %return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/lookup/canonical_query_self.carbon b/toolchain/check/testdata/impl/lookup/canonical_query_self.carbon index 74a4464c2098..6be0343c0acc 100644 --- a/toolchain/check/testdata/impl/lookup/canonical_query_self.carbon +++ b/toolchain/check/testdata/impl/lookup/canonical_query_self.carbon @@ -128,7 +128,7 @@ fn G() { // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.BitAndWith: %BitAndWith.type.f2e = import_ref Core//prelude, BitAndWith, loaded [concrete = constants.%BitAndWith.generic] -// CHECK:STDOUT: %Core.import_ref.a4f: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude, loc13_42, loaded [concrete = constants.%type.as.BitAndWith.impl.Op] +// CHECK:STDOUT: %Core.import_ref.a4f: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude, loc14_42, loaded [concrete = constants.%type.as.BitAndWith.impl.Op] // CHECK:STDOUT: %BitAndWith.impl_witness_table = impl_witness_table (%Core.import_ref.a4f), @type.as.BitAndWith.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/lookup/lookup_interface_with_enclosing_generic_inside_rewrite_constraint.carbon b/toolchain/check/testdata/impl/lookup/lookup_interface_with_enclosing_generic_inside_rewrite_constraint.carbon index 8964d7c695df..d8eea7983db2 100644 --- a/toolchain/check/testdata/impl/lookup/lookup_interface_with_enclosing_generic_inside_rewrite_constraint.carbon +++ b/toolchain/check/testdata/impl/lookup/lookup_interface_with_enclosing_generic_inside_rewrite_constraint.carbon @@ -543,7 +543,7 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.BitAndWith: %BitAndWith.type.f2e = import_ref Core//prelude, BitAndWith, loaded [concrete = constants.%BitAndWith.generic] -// CHECK:STDOUT: %Core.import_ref.a4f: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude, loc13_42, loaded [concrete = constants.%type.as.BitAndWith.impl.Op] +// CHECK:STDOUT: %Core.import_ref.a4f: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude, loc14_42, loaded [concrete = constants.%type.as.BitAndWith.impl.Op] // CHECK:STDOUT: %BitAndWith.impl_witness_table = impl_witness_table (%Core.import_ref.a4f), @type.as.BitAndWith.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/use_assoc_const.carbon b/toolchain/check/testdata/impl/use_assoc_const.carbon index 6e368311882c..3193cab59efd 100644 --- a/toolchain/check/testdata/impl/use_assoc_const.carbon +++ b/toolchain/check/testdata/impl/use_assoc_const.carbon @@ -378,11 +378,11 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Negate: type = import_ref Core//prelude/parts/int_literal, Negate, loaded [concrete = constants.%Negate.type] -// CHECK:STDOUT: %Core.import_ref.5f5 = import_ref Core//prelude/parts/int, loc35_43, unloaded -// CHECK:STDOUT: %Core.import_ref.c4a: @Int.as.Negate.impl.%Int.as.Negate.impl.Op.type (%Int.as.Negate.impl.Op.type.2d0) = import_ref Core//prelude/parts/int, loc36_31, loaded [symbolic = @Int.as.Negate.impl.%Int.as.Negate.impl.Op (constants.%Int.as.Negate.impl.Op.e54)] +// CHECK:STDOUT: %Core.import_ref.5f5 = import_ref Core//prelude/parts/int, loc42_43, unloaded +// CHECK:STDOUT: %Core.import_ref.c4a: @Int.as.Negate.impl.%Int.as.Negate.impl.Op.type (%Int.as.Negate.impl.Op.type.2d0) = import_ref Core//prelude/parts/int, loc43_31, loaded [symbolic = @Int.as.Negate.impl.%Int.as.Negate.impl.Op (constants.%Int.as.Negate.impl.Op.e54)] // CHECK:STDOUT: %Negate.impl_witness_table = impl_witness_table (%Core.import_ref.5f5, %Core.import_ref.c4a), @Int.as.Negate.impl [concrete] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } @@ -755,11 +755,11 @@ fn F() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Negate: type = import_ref Core//prelude/parts/int_literal, Negate, loaded [concrete = constants.%Negate.type] -// CHECK:STDOUT: %Core.import_ref.5f5 = import_ref Core//prelude/parts/int, loc35_43, unloaded -// CHECK:STDOUT: %Core.import_ref.c4a: @Int.as.Negate.impl.%Int.as.Negate.impl.Op.type (%Int.as.Negate.impl.Op.type.2d0) = import_ref Core//prelude/parts/int, loc36_31, loaded [symbolic = @Int.as.Negate.impl.%Int.as.Negate.impl.Op (constants.%Int.as.Negate.impl.Op.e54)] +// CHECK:STDOUT: %Core.import_ref.5f5 = import_ref Core//prelude/parts/int, loc42_43, unloaded +// CHECK:STDOUT: %Core.import_ref.c4a: @Int.as.Negate.impl.%Int.as.Negate.impl.Op.type (%Int.as.Negate.impl.Op.type.2d0) = import_ref Core//prelude/parts/int, loc43_31, loaded [symbolic = @Int.as.Negate.impl.%Int.as.Negate.impl.Op (constants.%Int.as.Negate.impl.Op.e54)] // CHECK:STDOUT: %Negate.impl_witness_table = impl_witness_table (%Core.import_ref.5f5, %Core.import_ref.c4a), @Int.as.Negate.impl [concrete] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1087,11 +1087,11 @@ fn F() { // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.Negate: type = import_ref Core//prelude/parts/int_literal, Negate, loaded [concrete = constants.%Negate.type] -// CHECK:STDOUT: %Core.import_ref.5f5 = import_ref Core//prelude/parts/int, loc35_43, unloaded -// CHECK:STDOUT: %Core.import_ref.c4a: @Int.as.Negate.impl.%Int.as.Negate.impl.Op.type (%Int.as.Negate.impl.Op.type.2d0) = import_ref Core//prelude/parts/int, loc36_31, loaded [symbolic = @Int.as.Negate.impl.%Int.as.Negate.impl.Op (constants.%Int.as.Negate.impl.Op.e54)] +// CHECK:STDOUT: %Core.import_ref.5f5 = import_ref Core//prelude/parts/int, loc42_43, unloaded +// CHECK:STDOUT: %Core.import_ref.c4a: @Int.as.Negate.impl.%Int.as.Negate.impl.Op.type (%Int.as.Negate.impl.Op.type.2d0) = import_ref Core//prelude/parts/int, loc43_31, loaded [symbolic = @Int.as.Negate.impl.%Int.as.Negate.impl.Op (constants.%Int.as.Negate.impl.Op.e54)] // CHECK:STDOUT: %Negate.impl_witness_table = impl_witness_table (%Core.import_ref.5f5, %Core.import_ref.c4a), @Int.as.Negate.impl [concrete] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2218,7 +2218,7 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3667,9 +3667,18 @@ fn F() { // CHECK:STDOUT: %bound_method.a75: = bound_method %int_2.ef8, %Int.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %true: bool = bool_literal true [concrete] // CHECK:STDOUT: %false: bool = bool_literal false [concrete] -// CHECK:STDOUT: %tuple.type: type = tuple_type (bool, bool) [concrete] +// CHECK:STDOUT: %tuple.type.784: type = tuple_type (bool, bool) [concrete] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Copy.impl_witness.09f: = impl_witness imports.%Copy.impl_witness_table.47e [concrete] +// CHECK:STDOUT: %Copy.facet.dcd: %Copy.type = facet_value bool, (%Copy.impl_witness.09f) [concrete] +// CHECK:STDOUT: %.235: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.dcd [concrete] +// CHECK:STDOUT: %bool.as.Copy.impl.Op.type: type = fn_type @bool.as.Copy.impl.Op [concrete] +// CHECK:STDOUT: %bool.as.Copy.impl.Op: %bool.as.Copy.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %bool.as.Copy.impl.Op.bound.12b: = bound_method %true, %bool.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete] +// CHECK:STDOUT: %bool.as.Copy.impl.Op.bound.082: = bound_method %false, %bool.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %array: %array_type.c9b = tuple_value (%true, %false) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3678,16 +3687,20 @@ fn F() { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .Bool = %Core.Bool // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = constants.%Bool] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] -// CHECK:STDOUT: %Core.import_ref.02e: @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert.type (%Int.as.ImplicitAs.impl.Convert.type.eb9) = import_ref Core//prelude/parts/int, loc20_44, loaded [symbolic = @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert (constants.%Int.as.ImplicitAs.impl.Convert.958)] +// CHECK:STDOUT: %Core.import_ref.02e: @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert.type (%Int.as.ImplicitAs.impl.Convert.type.eb9) = import_ref Core//prelude/parts/int, loc27_44, loaded [symbolic = @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert (constants.%Int.as.ImplicitAs.impl.Convert.958)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.13c = impl_witness_table (%Core.import_ref.02e), @Int.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.297: %bool.as.Copy.impl.Op.type = import_ref Core//prelude/parts/copy, loc16_31, loaded [concrete = constants.%bool.as.Copy.impl.Op] +// CHECK:STDOUT: %Copy.impl_witness_table.47e = impl_witness_table (%Core.import_ref.297), @bool.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -3815,13 +3828,19 @@ fn F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %true: bool = bool_literal true [concrete = constants.%true] // CHECK:STDOUT: %false: bool = bool_literal false [concrete = constants.%false] -// CHECK:STDOUT: %.loc9_61.1: %tuple.type = tuple_literal (%true, %false) +// CHECK:STDOUT: %.loc9_61.1: %tuple.type.784 = tuple_literal (%true, %false) +// CHECK:STDOUT: %impl.elem0.loc9_50: %.235 = impl_witness_access constants.%Copy.impl_witness.09f, element0 [concrete = constants.%bool.as.Copy.impl.Op] +// CHECK:STDOUT: %bound_method.loc9_50: = bound_method %true, %impl.elem0.loc9_50 [concrete = constants.%bool.as.Copy.impl.Op.bound.12b] +// CHECK:STDOUT: %bool.as.Copy.impl.Op.call.loc9_50: init bool = call %bound_method.loc9_50(%true) [concrete = constants.%true] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc9_61.2: ref bool = array_index %return, %int_0 -// CHECK:STDOUT: %.loc9_61.3: init bool = initialize_from %true to %.loc9_61.2 [concrete = constants.%true] +// CHECK:STDOUT: %.loc9_61.3: init bool = initialize_from %bool.as.Copy.impl.Op.call.loc9_50 to %.loc9_61.2 [concrete = constants.%true] +// CHECK:STDOUT: %impl.elem0.loc9_56: %.235 = impl_witness_access constants.%Copy.impl_witness.09f, element0 [concrete = constants.%bool.as.Copy.impl.Op] +// CHECK:STDOUT: %bound_method.loc9_56: = bound_method %false, %impl.elem0.loc9_56 [concrete = constants.%bool.as.Copy.impl.Op.bound.082] +// CHECK:STDOUT: %bool.as.Copy.impl.Op.call.loc9_56: init bool = call %bound_method.loc9_56(%false) [concrete = constants.%false] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] // CHECK:STDOUT: %.loc9_61.4: ref bool = array_index %return, %int_1 -// CHECK:STDOUT: %.loc9_61.5: init bool = initialize_from %false to %.loc9_61.4 [concrete = constants.%false] +// CHECK:STDOUT: %.loc9_61.5: init bool = initialize_from %bool.as.Copy.impl.Op.call.loc9_56 to %.loc9_61.4 [concrete = constants.%false] // CHECK:STDOUT: %.loc9_61.6: init %array_type.c9b = array_init (%.loc9_61.3, %.loc9_61.5) to %return [concrete = constants.%array] // CHECK:STDOUT: %.loc9_62: init %array_type.c9b = converted %.loc9_61.1, %.loc9_61.6 [concrete = constants.%array] // CHECK:STDOUT: return %.loc9_62 to %return diff --git a/toolchain/check/testdata/index/array_element_access.carbon b/toolchain/check/testdata/index/array_element_access.carbon index fdf1412743a3..2c16487f2a52 100644 --- a/toolchain/check/testdata/index/array_element_access.carbon +++ b/toolchain/check/testdata/index/array_element_access.carbon @@ -23,13 +23,14 @@ var d: i32 = a[b]; // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %array_type: type = array_type %int_2, %i32 [concrete] // CHECK:STDOUT: %pattern_type.ae7: type = pattern_type %array_type [concrete] // CHECK:STDOUT: %int_12.6a3: Core.IntLiteral = int_value 12 [concrete] // CHECK:STDOUT: %int_24.e3c: Core.IntLiteral = int_value 24 [concrete] -// CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete] +// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] @@ -59,19 +60,33 @@ var d: i32 = a[b]; // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.7cb: = bound_method %int_0.5c6, %Core.IntLiteral.as.ImplicitAs.impl.Convert.592 [concrete] // CHECK:STDOUT: %bound_method.698: = bound_method %int_0.5c6, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -131,7 +146,7 @@ var d: i32 = a[b]; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [concrete = constants.%int_12.6a3] // CHECK:STDOUT: %int_24: Core.IntLiteral = int_value 24 [concrete = constants.%int_24.e3c] -// CHECK:STDOUT: %.loc15_31.1: %tuple.type = tuple_literal (%int_12, %int_24) +// CHECK:STDOUT: %.loc15_31.1: %tuple.type.f94 = tuple_literal (%int_12, %int_24) // CHECK:STDOUT: %impl.elem0.loc15_31.1: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] // CHECK:STDOUT: %bound_method.loc15_31.1: = bound_method %int_12, %impl.elem0.loc15_31.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.0b4] // CHECK:STDOUT: %specific_fn.loc15_31.1: = specific_function %impl.elem0.loc15_31.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -165,16 +180,21 @@ var d: i32 = a[b]; // CHECK:STDOUT: %int_0.loc17: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc17: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] -// CHECK:STDOUT: %bound_method.loc17_16.1: = bound_method %int_0.loc17, %impl.elem0.loc17 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.7cb] -// CHECK:STDOUT: %specific_fn.loc17: = specific_function %impl.elem0.loc17, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc17_16.2: = bound_method %int_0.loc17, %specific_fn.loc17 [concrete = constants.%bound_method.698] +// CHECK:STDOUT: %impl.elem0.loc17_16: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] +// CHECK:STDOUT: %bound_method.loc17_16.1: = bound_method %int_0.loc17, %impl.elem0.loc17_16 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.7cb] +// CHECK:STDOUT: %specific_fn.loc17_16: = specific_function %impl.elem0.loc17_16, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc17_16.2: = bound_method %int_0.loc17, %specific_fn.loc17_16 [concrete = constants.%bound_method.698] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc17: init %i32 = call %bound_method.loc17_16.2(%int_0.loc17) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc17_16.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc17 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc17_16.2: %i32 = converted %int_0.loc17, %.loc17_16.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc17_17.1: ref %i32 = array_index %a.ref.loc17, %.loc17_16.2 // CHECK:STDOUT: %.loc17_17.2: %i32 = bind_value %.loc17_17.1 -// CHECK:STDOUT: assign file.%c.var, %.loc17_17.2 +// CHECK:STDOUT: %impl.elem0.loc17_17: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc17_17.1: = bound_method %.loc17_17.2, %impl.elem0.loc17_17 +// CHECK:STDOUT: %specific_fn.loc17_17: = specific_function %impl.elem0.loc17_17, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc17_17.2: = bound_method %.loc17_17.2, %specific_fn.loc17_17 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc17: init %i32 = call %bound_method.loc17_17.2(%.loc17_17.2) +// CHECK:STDOUT: assign file.%c.var, %Int.as.Copy.impl.Op.call.loc17 // CHECK:STDOUT: %a.ref.loc18: ref %array_type = name_ref a, file.%a [concrete = file.%a.var] // CHECK:STDOUT: %b.ref: ref %i32 = name_ref b, file.%b [concrete = file.%b.var] // CHECK:STDOUT: %int_32.loc18: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] @@ -182,7 +202,12 @@ var d: i32 = a[b]; // CHECK:STDOUT: %.loc18_16: %i32 = bind_value %b.ref // CHECK:STDOUT: %.loc18_17.1: ref %i32 = array_index %a.ref.loc18, %.loc18_16 // CHECK:STDOUT: %.loc18_17.2: %i32 = bind_value %.loc18_17.1 -// CHECK:STDOUT: assign file.%d.var, %.loc18_17.2 +// CHECK:STDOUT: %impl.elem0.loc18: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc18_17.1: = bound_method %.loc18_17.2, %impl.elem0.loc18 +// CHECK:STDOUT: %specific_fn.loc18: = specific_function %impl.elem0.loc18, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc18_17.2: = bound_method %.loc18_17.2, %specific_fn.loc18 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc18: init %i32 = call %bound_method.loc18_17.2(%.loc18_17.2) +// CHECK:STDOUT: assign file.%d.var, %Int.as.Copy.impl.Op.call.loc18 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/index/expr_category.carbon b/toolchain/check/testdata/index/expr_category.carbon index 18985ff3f9ba..6e26d5b41ad4 100644 --- a/toolchain/check/testdata/index/expr_category.carbon +++ b/toolchain/check/testdata/index/expr_category.carbon @@ -50,7 +50,7 @@ fn ValueBinding(b: array(i32, 3)) { // CHECK:STDOUT: %ptr.f01: type = ptr_type %array_type [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] -// CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [concrete] +// CHECK:STDOUT: %tuple.type.37f: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [concrete] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] @@ -80,6 +80,17 @@ fn ValueBinding(b: array(i32, 3)) { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.7cb: = bound_method %int_0.5c6, %Core.IntLiteral.as.ImplicitAs.impl.Convert.592 [concrete] // CHECK:STDOUT: %bound_method.698: = bound_method %int_0.5c6, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.f23: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.8b3) [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.abf: %ptr.as.Copy.impl.Op.type.f23 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.19c: = impl_witness imports.%Copy.impl_witness_table.a71, @ptr.as.Copy.impl(%i32) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.3ea: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%i32) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.2f4: %ptr.as.Copy.impl.Op.type.3ea = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.bab: %Copy.type = facet_value %ptr.235, (%Copy.impl_witness.19c) [concrete] +// CHECK:STDOUT: %.284: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.bab [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.2f4, @ptr.as.Copy.impl.Op(%i32) [concrete] // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.121: = bound_method %int_4.0c1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.592 [concrete] // CHECK:STDOUT: %bound_method.564: = bound_method %int_4.0c1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] @@ -100,14 +111,18 @@ fn ValueBinding(b: array(i32, 3)) { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.de9: @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op.type (%ptr.as.Copy.impl.Op.type.f23) = import_ref Core//prelude/parts/copy, loc32_31, loaded [symbolic = @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op (constants.%ptr.as.Copy.impl.Op.abf)] +// CHECK:STDOUT: %Copy.impl_witness_table.a71 = impl_witness_table (%Core.import_ref.de9), @ptr.as.Copy.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -170,7 +185,7 @@ fn ValueBinding(b: array(i32, 3)) { // CHECK:STDOUT: %int_1.loc18_27: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %int_2.loc18_30: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %int_3.loc18_33: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] -// CHECK:STDOUT: %.loc18_34.1: %tuple.type = tuple_literal (%int_1.loc18_27, %int_2.loc18_30, %int_3.loc18_33) +// CHECK:STDOUT: %.loc18_34.1: %tuple.type.37f = tuple_literal (%int_1.loc18_27, %int_2.loc18_30, %int_3.loc18_33) // CHECK:STDOUT: %impl.elem0.loc18_34.1: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] // CHECK:STDOUT: %bound_method.loc18_34.1: = bound_method %int_1.loc18_27, %impl.elem0.loc18_34.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.a02] // CHECK:STDOUT: %specific_fn.loc18_34.1: = specific_function %impl.elem0.loc18_34.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -217,16 +232,21 @@ fn ValueBinding(b: array(i32, 3)) { // CHECK:STDOUT: %int_0.loc21: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %int_32.loc21_22: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc21_22: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc21: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] -// CHECK:STDOUT: %bound_method.loc21_21.1: = bound_method %int_0.loc21, %impl.elem0.loc21 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.7cb] -// CHECK:STDOUT: %specific_fn.loc21: = specific_function %impl.elem0.loc21, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc21_21.2: = bound_method %int_0.loc21, %specific_fn.loc21 [concrete = constants.%bound_method.698] +// CHECK:STDOUT: %impl.elem0.loc21_21: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] +// CHECK:STDOUT: %bound_method.loc21_21.1: = bound_method %int_0.loc21, %impl.elem0.loc21_21 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.7cb] +// CHECK:STDOUT: %specific_fn.loc21_21: = specific_function %impl.elem0.loc21_21, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc21_21.2: = bound_method %int_0.loc21, %specific_fn.loc21_21 [concrete = constants.%bound_method.698] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21: init %i32 = call %bound_method.loc21_21.2(%int_0.loc21) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc21_21.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc21_21.2: %i32 = converted %int_0.loc21, %.loc21_21.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc21_22: ref %i32 = array_index %a.ref.loc21, %.loc21_21.2 // CHECK:STDOUT: %addr.loc21_18: %ptr.235 = addr_of %.loc21_22 -// CHECK:STDOUT: assign %pa.var, %addr.loc21_18 +// CHECK:STDOUT: %impl.elem0.loc21_18: %.284 = impl_witness_access constants.%Copy.impl_witness.19c, element0 [concrete = constants.%ptr.as.Copy.impl.Op.2f4] +// CHECK:STDOUT: %bound_method.loc21_18.1: = bound_method %addr.loc21_18, %impl.elem0.loc21_18 +// CHECK:STDOUT: %specific_fn.loc21_18: = specific_function %impl.elem0.loc21_18, @ptr.as.Copy.impl.Op(constants.%i32) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc21_18.2: = bound_method %addr.loc21_18, %specific_fn.loc21_18 +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.235 = call %bound_method.loc21_18.2(%addr.loc21_18) +// CHECK:STDOUT: assign %pa.var, %ptr.as.Copy.impl.Op.call // CHECK:STDOUT: %.loc21_14: type = splice_block %ptr [concrete = constants.%ptr.235] { // CHECK:STDOUT: %int_32.loc21_11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc21_11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] @@ -276,7 +296,7 @@ fn ValueBinding(b: array(i32, 3)) { // CHECK:STDOUT: %int_1.loc26_27: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %int_2.loc26_30: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %int_3.loc26_33: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] -// CHECK:STDOUT: %.loc26_34.1: %tuple.type = tuple_literal (%int_1.loc26_27, %int_2.loc26_30, %int_3.loc26_33) +// CHECK:STDOUT: %.loc26_34.1: %tuple.type.37f = tuple_literal (%int_1.loc26_27, %int_2.loc26_30, %int_3.loc26_33) // CHECK:STDOUT: %impl.elem0.loc26_34.1: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] // CHECK:STDOUT: %bound_method.loc26_34.1: = bound_method %int_1.loc26_27, %impl.elem0.loc26_34.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.a02] // CHECK:STDOUT: %specific_fn.loc26_34.1: = specific_function %impl.elem0.loc26_34.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] diff --git a/toolchain/check/testdata/index/fail_array_large_index.carbon b/toolchain/check/testdata/index/fail_array_large_index.carbon index b70b7bb4d813..6901c19e0e0c 100644 --- a/toolchain/check/testdata/index/fail_array_large_index.carbon +++ b/toolchain/check/testdata/index/fail_array_large_index.carbon @@ -32,12 +32,13 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %array_type: type = array_type %int_1.5b8, %i32 [concrete] // CHECK:STDOUT: %pattern_type.a98: type = pattern_type %array_type [concrete] // CHECK:STDOUT: %int_12.6a3: Core.IntLiteral = int_value 12 [concrete] -// CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral) [concrete] +// CHECK:STDOUT: %tuple.type.985: type = tuple_type (Core.IntLiteral) [concrete] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] @@ -60,6 +61,16 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.a02: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.592 [concrete] // CHECK:STDOUT: %bound_method.b59: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %int_2147483647.d89: Core.IntLiteral = int_value 2147483647 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.479: = bound_method %int_2147483647.d89, %Core.IntLiteral.as.ImplicitAs.impl.Convert.592 [concrete] // CHECK:STDOUT: %bound_method.875: = bound_method %int_2147483647.d89, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] @@ -70,13 +81,17 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -124,7 +139,7 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [concrete = constants.%int_12.6a3] -// CHECK:STDOUT: %.loc15_28.1: %tuple.type = tuple_literal (%int_12) +// CHECK:STDOUT: %.loc15_28.1: %tuple.type.985 = tuple_literal (%int_12) // CHECK:STDOUT: %impl.elem0.loc15: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] // CHECK:STDOUT: %bound_method.loc15_28.1: = bound_method %int_12, %impl.elem0.loc15 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.0b4] // CHECK:STDOUT: %specific_fn.loc15: = specific_function %impl.elem0.loc15, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -141,30 +156,40 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc21: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] -// CHECK:STDOUT: %bound_method.loc21_16.1: = bound_method %int_1, %impl.elem0.loc21 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.a02] -// CHECK:STDOUT: %specific_fn.loc21: = specific_function %impl.elem0.loc21, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc21_16.2: = bound_method %int_1, %specific_fn.loc21 [concrete = constants.%bound_method.b59] +// CHECK:STDOUT: %impl.elem0.loc21_16: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] +// CHECK:STDOUT: %bound_method.loc21_16.1: = bound_method %int_1, %impl.elem0.loc21_16 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.a02] +// CHECK:STDOUT: %specific_fn.loc21_16: = specific_function %impl.elem0.loc21_16, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc21_16.2: = bound_method %int_1, %specific_fn.loc21_16 [concrete = constants.%bound_method.b59] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21: init %i32 = call %bound_method.loc21_16.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc21_16.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc21_16.2: %i32 = converted %int_1, %.loc21_16.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc21_17.1: ref %i32 = array_index %a.ref.loc21, %.loc21_16.2 [concrete = ] // CHECK:STDOUT: %.loc21_17.2: %i32 = bind_value %.loc21_17.1 [concrete = ] -// CHECK:STDOUT: assign file.%b.var, %.loc21_17.2 +// CHECK:STDOUT: %impl.elem0.loc21_17: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc21_17.1: = bound_method %.loc21_17.2, %impl.elem0.loc21_17 [concrete = ] +// CHECK:STDOUT: %specific_fn.loc21_17: = specific_function %impl.elem0.loc21_17, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc21_17.2: = bound_method %.loc21_17.2, %specific_fn.loc21_17 [concrete = ] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc21: init %i32 = call %bound_method.loc21_17.2(%.loc21_17.2) [concrete = ] +// CHECK:STDOUT: assign file.%b.var, %Int.as.Copy.impl.Op.call.loc21 // CHECK:STDOUT: %a.ref.loc27: ref %array_type = name_ref a, file.%a [concrete = file.%a.var] // CHECK:STDOUT: %int_2147483647: Core.IntLiteral = int_value 2147483647 [concrete = constants.%int_2147483647.d89] // CHECK:STDOUT: %int_32.loc27: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc27: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc27: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] -// CHECK:STDOUT: %bound_method.loc27_16.1: = bound_method %int_2147483647, %impl.elem0.loc27 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.479] -// CHECK:STDOUT: %specific_fn.loc27: = specific_function %impl.elem0.loc27, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc27_16.2: = bound_method %int_2147483647, %specific_fn.loc27 [concrete = constants.%bound_method.875] +// CHECK:STDOUT: %impl.elem0.loc27_16: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] +// CHECK:STDOUT: %bound_method.loc27_16.1: = bound_method %int_2147483647, %impl.elem0.loc27_16 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.479] +// CHECK:STDOUT: %specific_fn.loc27_16: = specific_function %impl.elem0.loc27_16, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc27_16.2: = bound_method %int_2147483647, %specific_fn.loc27_16 [concrete = constants.%bound_method.875] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc27: init %i32 = call %bound_method.loc27_16.2(%int_2147483647) [concrete = constants.%int_2147483647.a74] // CHECK:STDOUT: %.loc27_16.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc27 [concrete = constants.%int_2147483647.a74] // CHECK:STDOUT: %.loc27_16.2: %i32 = converted %int_2147483647, %.loc27_16.1 [concrete = constants.%int_2147483647.a74] // CHECK:STDOUT: %.loc27_27.1: ref %i32 = array_index %a.ref.loc27, %.loc27_16.2 [concrete = ] // CHECK:STDOUT: %.loc27_27.2: %i32 = bind_value %.loc27_27.1 [concrete = ] -// CHECK:STDOUT: assign file.%c.var, %.loc27_27.2 +// CHECK:STDOUT: %impl.elem0.loc27_27: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc27_27.1: = bound_method %.loc27_27.2, %impl.elem0.loc27_27 [concrete = ] +// CHECK:STDOUT: %specific_fn.loc27_27: = specific_function %impl.elem0.loc27_27, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc27_27.2: = bound_method %.loc27_27.2, %specific_fn.loc27_27 [concrete = ] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc27: init %i32 = call %bound_method.loc27_27.2(%.loc27_27.2) [concrete = ] +// CHECK:STDOUT: assign file.%c.var, %Int.as.Copy.impl.Op.call.loc27 // CHECK:STDOUT: return // 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 b8496ffde3a7..9c5e3354b209 100644 --- a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon +++ b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon @@ -28,12 +28,13 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %array_type: type = array_type %int_1, %i32 [concrete] // CHECK:STDOUT: %pattern_type.a98: type = pattern_type %array_type [concrete] // CHECK:STDOUT: %int_12.6a3: Core.IntLiteral = int_value 12 [concrete] -// CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral) [concrete] +// CHECK:STDOUT: %tuple.type.985: type = tuple_type (Core.IntLiteral) [concrete] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] @@ -54,19 +55,33 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_12.1e1) [concrete] // CHECK:STDOUT: %float: Core.FloatLiteral = float_literal_value 26e-1 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -103,11 +118,11 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [concrete = constants.%int_12.6a3] -// CHECK:STDOUT: %.loc15_28.1: %tuple.type = tuple_literal (%int_12) -// CHECK:STDOUT: %impl.elem0: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] -// CHECK:STDOUT: %bound_method.loc15_28.1: = bound_method %int_12, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc15_28.2: = bound_method %int_12, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %.loc15_28.1: %tuple.type.985 = tuple_literal (%int_12) +// CHECK:STDOUT: %impl.elem0.loc15: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] +// CHECK:STDOUT: %bound_method.loc15_28.1: = bound_method %int_12, %impl.elem0.loc15 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc15: = specific_function %impl.elem0.loc15, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc15_28.2: = bound_method %int_12, %specific_fn.loc15 [concrete = constants.%bound_method] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc15_28.2(%int_12) [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %.loc15_28.2: init %i32 = converted %int_12, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] @@ -123,7 +138,12 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: %.loc23_16: %i32 = converted %float, [concrete = ] // CHECK:STDOUT: %.loc23_19.1: ref %i32 = array_index %a.ref, [concrete = ] // CHECK:STDOUT: %.loc23_19.2: %i32 = bind_value %.loc23_19.1 [concrete = ] -// CHECK:STDOUT: assign file.%b.var, %.loc23_19.2 +// CHECK:STDOUT: %impl.elem0.loc23: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc23_19.1: = bound_method %.loc23_19.2, %impl.elem0.loc23 [concrete = ] +// CHECK:STDOUT: %specific_fn.loc23: = specific_function %impl.elem0.loc23, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc23_19.2: = bound_method %.loc23_19.2, %specific_fn.loc23 [concrete = ] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc23_19.2(%.loc23_19.2) [concrete = ] +// CHECK:STDOUT: assign file.%b.var, %Int.as.Copy.impl.Op.call // CHECK:STDOUT: return // 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 466104274b0e..451ea29c6e32 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 @@ -25,12 +25,13 @@ var b: i32 = a[1]; // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %array_type: type = array_type %int_1.5b8, %i32 [concrete] // CHECK:STDOUT: %pattern_type.a98: type = pattern_type %array_type [concrete] // CHECK:STDOUT: %int_12.6a3: Core.IntLiteral = int_value 12 [concrete] -// CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral) [concrete] +// CHECK:STDOUT: %tuple.type.985: type = tuple_type (Core.IntLiteral) [concrete] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] @@ -53,19 +54,33 @@ var b: i32 = a[1]; // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.a02: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.592 [concrete] // CHECK:STDOUT: %bound_method.b59: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -102,7 +117,7 @@ var b: i32 = a[1]; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [concrete = constants.%int_12.6a3] -// CHECK:STDOUT: %.loc15_28.1: %tuple.type = tuple_literal (%int_12) +// CHECK:STDOUT: %.loc15_28.1: %tuple.type.985 = tuple_literal (%int_12) // CHECK:STDOUT: %impl.elem0.loc15: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] // CHECK:STDOUT: %bound_method.loc15_28.1: = bound_method %int_12, %impl.elem0.loc15 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.0b4] // CHECK:STDOUT: %specific_fn.loc15: = specific_function %impl.elem0.loc15, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -119,16 +134,21 @@ var b: i32 = a[1]; // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc20: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] -// CHECK:STDOUT: %bound_method.loc20_16.1: = bound_method %int_1, %impl.elem0.loc20 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.a02] -// CHECK:STDOUT: %specific_fn.loc20: = specific_function %impl.elem0.loc20, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc20_16.2: = bound_method %int_1, %specific_fn.loc20 [concrete = constants.%bound_method.b59] +// CHECK:STDOUT: %impl.elem0.loc20_16: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] +// CHECK:STDOUT: %bound_method.loc20_16.1: = bound_method %int_1, %impl.elem0.loc20_16 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.a02] +// CHECK:STDOUT: %specific_fn.loc20_16: = specific_function %impl.elem0.loc20_16, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc20_16.2: = bound_method %int_1, %specific_fn.loc20_16 [concrete = constants.%bound_method.b59] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc20: init %i32 = call %bound_method.loc20_16.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc20_16.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc20 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc20_16.2: %i32 = converted %int_1, %.loc20_16.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc20_17.1: ref %i32 = array_index %a.ref, %.loc20_16.2 [concrete = ] // CHECK:STDOUT: %.loc20_17.2: %i32 = bind_value %.loc20_17.1 [concrete = ] -// CHECK:STDOUT: assign file.%b.var, %.loc20_17.2 +// CHECK:STDOUT: %impl.elem0.loc20_17: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc20_17.1: = bound_method %.loc20_17.2, %impl.elem0.loc20_17 [concrete = ] +// CHECK:STDOUT: %specific_fn.loc20_17: = specific_function %impl.elem0.loc20_17, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc20_17.2: = bound_method %.loc20_17.2, %specific_fn.loc20_17 [concrete = ] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc20_17.2(%.loc20_17.2) [concrete = ] +// CHECK:STDOUT: assign file.%b.var, %Int.as.Copy.impl.Op.call // CHECK:STDOUT: return // 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 23c462258b5e..70c727b1a3b4 100644 --- a/toolchain/check/testdata/index/fail_expr_category.carbon +++ b/toolchain/check/testdata/index/fail_expr_category.carbon @@ -76,6 +76,17 @@ fn G(b: array(i32, 3)) { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.592, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method.698: = bound_method %int_0.5c6, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.f23: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.8b3) [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.abf: %ptr.as.Copy.impl.Op.type.f23 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.19c: = impl_witness imports.%Copy.impl_witness_table.a71, @ptr.as.Copy.impl(%i32) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.3ea: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%i32) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.2f4: %ptr.as.Copy.impl.Op.type.3ea = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.bab: %Copy.type = facet_value %ptr.235, (%Copy.impl_witness.19c) [concrete] +// CHECK:STDOUT: %.284: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.bab [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.2f4, @ptr.as.Copy.impl.Op(%i32) [concrete] // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.121: = bound_method %int_4.0c1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.592 [concrete] // CHECK:STDOUT: %bound_method.564: = bound_method %int_4.0c1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] @@ -94,14 +105,18 @@ fn G(b: array(i32, 3)) { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.de9: @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op.type (%ptr.as.Copy.impl.Op.type.f23) = import_ref Core//prelude/parts/copy, loc32_31, loaded [symbolic = @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op (constants.%ptr.as.Copy.impl.Op.abf)] +// CHECK:STDOUT: %Copy.impl_witness_table.a71 = impl_witness_table (%Core.import_ref.de9), @ptr.as.Copy.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -151,10 +166,10 @@ fn G(b: array(i32, 3)) { // CHECK:STDOUT: %int_0.loc23: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %int_32.loc23_22: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc23_22: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc23: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] -// CHECK:STDOUT: %bound_method.loc23_21.1: = bound_method %int_0.loc23, %impl.elem0.loc23 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.7cb] -// CHECK:STDOUT: %specific_fn.loc23: = specific_function %impl.elem0.loc23, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc23_21.2: = bound_method %int_0.loc23, %specific_fn.loc23 [concrete = constants.%bound_method.698] +// CHECK:STDOUT: %impl.elem0.loc23_21: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] +// CHECK:STDOUT: %bound_method.loc23_21.1: = bound_method %int_0.loc23, %impl.elem0.loc23_21 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.7cb] +// CHECK:STDOUT: %specific_fn.loc23_21: = specific_function %impl.elem0.loc23_21, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc23_21.2: = bound_method %int_0.loc23, %specific_fn.loc23_21 [concrete = constants.%bound_method.698] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc23: init %i32 = call %bound_method.loc23_21.2(%int_0.loc23) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc23_21.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc23 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc23_21.2: %i32 = converted %int_0.loc23, %.loc23_21.1 [concrete = constants.%int_0.6a9] @@ -162,7 +177,12 @@ fn G(b: array(i32, 3)) { // CHECK:STDOUT: %.loc23_22.2: ref %i32 = array_index %.loc23_22.1, %.loc23_21.2 // CHECK:STDOUT: %.loc23_22.3: %i32 = bind_value %.loc23_22.2 // CHECK:STDOUT: %addr.loc23_18: %ptr.235 = addr_of [concrete = ] -// CHECK:STDOUT: assign %pb.var, %addr.loc23_18 +// CHECK:STDOUT: %impl.elem0.loc23_18: %.284 = impl_witness_access constants.%Copy.impl_witness.19c, element0 [concrete = constants.%ptr.as.Copy.impl.Op.2f4] +// CHECK:STDOUT: %bound_method.loc23_18.1: = bound_method %addr.loc23_18, %impl.elem0.loc23_18 [concrete = ] +// CHECK:STDOUT: %specific_fn.loc23_18: = specific_function %impl.elem0.loc23_18, @ptr.as.Copy.impl.Op(constants.%i32) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc23_18.2: = bound_method %addr.loc23_18, %specific_fn.loc23_18 [concrete = ] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc23: init %ptr.235 = call %bound_method.loc23_18.2(%addr.loc23_18) [concrete = ] +// CHECK:STDOUT: assign %pb.var, %ptr.as.Copy.impl.Op.call.loc23 // CHECK:STDOUT: %.loc23_14: type = splice_block %ptr.loc23 [concrete = constants.%ptr.235] { // CHECK:STDOUT: %int_32.loc23_11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc23_11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] @@ -203,17 +223,22 @@ fn G(b: array(i32, 3)) { // CHECK:STDOUT: %.loc36_21.2: ref %array_type = temporary %.loc36_21.1, %F.call.loc36 // CHECK:STDOUT: %int_32.loc36_24: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc36_24: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc36: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] -// CHECK:STDOUT: %bound_method.loc36_23.1: = bound_method %int_0.loc36, %impl.elem0.loc36 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.7cb] -// CHECK:STDOUT: %specific_fn.loc36: = specific_function %impl.elem0.loc36, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc36_23.2: = bound_method %int_0.loc36, %specific_fn.loc36 [concrete = constants.%bound_method.698] +// CHECK:STDOUT: %impl.elem0.loc36_23: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] +// CHECK:STDOUT: %bound_method.loc36_23.1: = bound_method %int_0.loc36, %impl.elem0.loc36_23 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.7cb] +// CHECK:STDOUT: %specific_fn.loc36_23: = specific_function %impl.elem0.loc36_23, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc36_23.2: = bound_method %int_0.loc36, %specific_fn.loc36_23 [concrete = constants.%bound_method.698] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc36: init %i32 = call %bound_method.loc36_23.2(%int_0.loc36) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc36_23.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc36 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc36_23.2: %i32 = converted %int_0.loc36, %.loc36_23.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc36_24.1: ref %i32 = array_index %.loc36_21.2, %.loc36_23.2 // CHECK:STDOUT: %.loc36_24.2: %i32 = bind_value %.loc36_24.1 // CHECK:STDOUT: %addr.loc36_18: %ptr.235 = addr_of [concrete = ] -// CHECK:STDOUT: assign %pf.var, %addr.loc36_18 +// CHECK:STDOUT: %impl.elem0.loc36_18: %.284 = impl_witness_access constants.%Copy.impl_witness.19c, element0 [concrete = constants.%ptr.as.Copy.impl.Op.2f4] +// CHECK:STDOUT: %bound_method.loc36_18.1: = bound_method %addr.loc36_18, %impl.elem0.loc36_18 [concrete = ] +// CHECK:STDOUT: %specific_fn.loc36_18: = specific_function %impl.elem0.loc36_18, @ptr.as.Copy.impl.Op(constants.%i32) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc36_18.2: = bound_method %addr.loc36_18, %specific_fn.loc36_18 [concrete = ] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc36: init %ptr.235 = call %bound_method.loc36_18.2(%addr.loc36_18) [concrete = ] +// CHECK:STDOUT: assign %pf.var, %ptr.as.Copy.impl.Op.call.loc36 // CHECK:STDOUT: %.loc36_14: type = splice_block %ptr.loc36 [concrete = constants.%ptr.235] { // CHECK:STDOUT: %int_32.loc36_11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc36_11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] diff --git a/toolchain/check/testdata/index/fail_negative_indexing.carbon b/toolchain/check/testdata/index/fail_negative_indexing.carbon index 46ce0a21f08b..7648fafd7520 100644 --- a/toolchain/check/testdata/index/fail_negative_indexing.carbon +++ b/toolchain/check/testdata/index/fail_negative_indexing.carbon @@ -26,12 +26,13 @@ var d: i32 = c[-10]; // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %array_type: type = array_type %int_2, %i32 [concrete] // CHECK:STDOUT: %pattern_type.ae7: type = pattern_type %array_type [concrete] // CHECK:STDOUT: %int_42.20e: Core.IntLiteral = int_value 42 [concrete] -// CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete] +// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] @@ -65,6 +66,16 @@ var d: i32 = c[-10]; // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.32f: = bound_method %int_-10.06d, %Core.IntLiteral.as.ImplicitAs.impl.Convert.592 [concrete] // CHECK:STDOUT: %bound_method.a78: = bound_method %int_-10.06d, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_-10.c17: %i32 = int_value -10 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -72,17 +83,21 @@ var d: i32 = c[-10]; // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs // CHECK:STDOUT: .Negate = %Core.Negate +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.Negate: type = import_ref Core//prelude/parts/int_literal, Negate, loaded [concrete = constants.%Negate.type] // CHECK:STDOUT: %Core.import_ref.abd = import_ref Core//prelude/parts/int_literal, loc13_50, unloaded // CHECK:STDOUT: %Core.import_ref.037: %Core.IntLiteral.as.Negate.impl.Op.type = import_ref Core//prelude/parts/int_literal, loc14_31, loaded [concrete = constants.%Core.IntLiteral.as.Negate.impl.Op] // CHECK:STDOUT: %Negate.impl_witness_table = impl_witness_table (%Core.import_ref.abd, %Core.import_ref.037), @Core.IntLiteral.as.Negate.impl [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -120,7 +135,7 @@ var d: i32 = c[-10]; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_42.loc15_25: Core.IntLiteral = int_value 42 [concrete = constants.%int_42.20e] // CHECK:STDOUT: %int_42.loc15_29: Core.IntLiteral = int_value 42 [concrete = constants.%int_42.20e] -// CHECK:STDOUT: %.loc15_31.1: %tuple.type = tuple_literal (%int_42.loc15_25, %int_42.loc15_29) +// CHECK:STDOUT: %.loc15_31.1: %tuple.type.f94 = tuple_literal (%int_42.loc15_25, %int_42.loc15_29) // CHECK:STDOUT: %impl.elem0.loc15_31.1: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] // CHECK:STDOUT: %bound_method.loc15_31.1: = bound_method %int_42.loc15_25, %impl.elem0.loc15_31.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.c18] // CHECK:STDOUT: %specific_fn.loc15_31.1: = specific_function %impl.elem0.loc15_31.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -149,10 +164,10 @@ var d: i32 = c[-10]; // CHECK:STDOUT: %Core.IntLiteral.as.Negate.impl.Op.call: init Core.IntLiteral = call %bound_method.loc20_16.1(%int_10) [concrete = constants.%int_-10.06d] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc20: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] -// CHECK:STDOUT: %bound_method.loc20_16.2: = bound_method %Core.IntLiteral.as.Negate.impl.Op.call, %impl.elem0.loc20 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.32f] -// CHECK:STDOUT: %specific_fn.loc20: = specific_function %impl.elem0.loc20, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc20_16.3: = bound_method %Core.IntLiteral.as.Negate.impl.Op.call, %specific_fn.loc20 [concrete = constants.%bound_method.a78] +// CHECK:STDOUT: %impl.elem0.loc20_16: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] +// CHECK:STDOUT: %bound_method.loc20_16.2: = bound_method %Core.IntLiteral.as.Negate.impl.Op.call, %impl.elem0.loc20_16 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.32f] +// CHECK:STDOUT: %specific_fn.loc20_16: = specific_function %impl.elem0.loc20_16, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc20_16.3: = bound_method %Core.IntLiteral.as.Negate.impl.Op.call, %specific_fn.loc20_16 [concrete = constants.%bound_method.a78] // CHECK:STDOUT: %.loc20_16.1: Core.IntLiteral = value_of_initializer %Core.IntLiteral.as.Negate.impl.Op.call [concrete = constants.%int_-10.06d] // CHECK:STDOUT: %.loc20_16.2: Core.IntLiteral = converted %Core.IntLiteral.as.Negate.impl.Op.call, %.loc20_16.1 [concrete = constants.%int_-10.06d] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc20: init %i32 = call %bound_method.loc20_16.3(%.loc20_16.2) [concrete = constants.%int_-10.c17] @@ -160,7 +175,12 @@ var d: i32 = c[-10]; // CHECK:STDOUT: %.loc20_16.4: %i32 = converted %Core.IntLiteral.as.Negate.impl.Op.call, %.loc20_16.3 [concrete = constants.%int_-10.c17] // CHECK:STDOUT: %.loc20_19.1: ref %i32 = array_index %c.ref, %.loc20_16.4 [concrete = ] // CHECK:STDOUT: %.loc20_19.2: %i32 = bind_value %.loc20_19.1 [concrete = ] -// CHECK:STDOUT: assign file.%d.var, %.loc20_19.2 +// CHECK:STDOUT: %impl.elem0.loc20_19: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc20_19.1: = bound_method %.loc20_19.2, %impl.elem0.loc20_19 [concrete = ] +// CHECK:STDOUT: %specific_fn.loc20_19: = specific_function %impl.elem0.loc20_19, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc20_19.2: = bound_method %.loc20_19.2, %specific_fn.loc20_19 [concrete = ] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc20_19.2(%.loc20_19.2) [concrete = ] +// CHECK:STDOUT: assign file.%d.var, %Int.as.Copy.impl.Op.call // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/compound_member_access.carbon b/toolchain/check/testdata/interface/compound_member_access.carbon index 0e9023527bed..b5787945ad33 100644 --- a/toolchain/check/testdata/interface/compound_member_access.carbon +++ b/toolchain/check/testdata/interface/compound_member_access.carbon @@ -76,17 +76,15 @@ interface L1 { } // Simple member access. -fn Simple4(T:! L1, x: T) { +fn Simple4(T:! L1, x: T, p: T*) { x.R1(); - var xcopy: T = x; - xcopy.S1(); + p->S1(); } // This should be equivalent to `Simple4` above, but using compound member access. -fn Compound4(V:! L1, y: V) { +fn Compound4(V:! L1, y: V, p: V*) { y.(L1.R1)(); - var ycopy: V = y; - ycopy.(L1.S1)(); + p->(L1.S1)(); } // --- fail_interface_instance_caller_not.carbon @@ -660,15 +658,15 @@ fn Works() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %L1.type: type = facet_type <@L1> [concrete] -// CHECK:STDOUT: %Self.112: %L1.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %Self.as_type.351: type = facet_access_type %Self.112 [symbolic] -// CHECK:STDOUT: %pattern_type.cb4262.1: type = pattern_type %Self.as_type.351 [symbolic] +// CHECK:STDOUT: %Self: %L1.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic] +// CHECK:STDOUT: %pattern_type.cb4262.1: type = pattern_type %Self.as_type [symbolic] // CHECK:STDOUT: %L1.R1.type: type = fn_type @L1.R1 [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %L1.R1: %L1.R1.type = struct_value () [concrete] // CHECK:STDOUT: %L1.assoc_type: type = assoc_entity_type @L1 [concrete] -// CHECK:STDOUT: %assoc0.8b4: %L1.assoc_type = assoc_entity element0, @L1.%L1.R1.decl [concrete] -// CHECK:STDOUT: %ptr.87f2ee.1: type = ptr_type %Self.as_type.351 [symbolic] +// CHECK:STDOUT: %assoc0: %L1.assoc_type = assoc_entity element0, @L1.%L1.R1.decl [concrete] +// CHECK:STDOUT: %ptr.87f2ee.1: type = ptr_type %Self.as_type [symbolic] // CHECK:STDOUT: %pattern_type.c0652c.1: type = pattern_type %ptr.87f2ee.1 [symbolic] // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete] // CHECK:STDOUT: %L1.S1.type: type = fn_type @L1.S1 [concrete] @@ -676,37 +674,33 @@ fn Works() { // CHECK:STDOUT: %assoc1: %L1.assoc_type = assoc_entity element1, @L1.%L1.S1.decl [concrete] // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self] -// CHECK:STDOUT: %T.112: %L1.type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T: %L1.type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.1cf: type = pattern_type %L1.type [concrete] -// CHECK:STDOUT: %T.as_type: type = facet_access_type %T.112 [symbolic] +// CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic] // CHECK:STDOUT: %pattern_type.cb4262.2: type = pattern_type %T.as_type [symbolic] +// CHECK:STDOUT: %ptr.87f2ee.2: type = ptr_type %T.as_type [symbolic] +// CHECK:STDOUT: %pattern_type.c0652c.2: type = pattern_type %ptr.87f2ee.2 [symbolic] // CHECK:STDOUT: %Simple4.type: type = fn_type @Simple4 [concrete] // CHECK:STDOUT: %Simple4: %Simple4.type = struct_value () [concrete] // CHECK:STDOUT: %require_complete.a52deb.1: = require_complete_type %T.as_type [symbolic] -// CHECK:STDOUT: %L1.lookup_impl_witness.d9f5df.1: = lookup_impl_witness %T.112, @L1 [symbolic] +// CHECK:STDOUT: %require_complete.5158e1.1: = require_complete_type %ptr.87f2ee.2 [symbolic] +// CHECK:STDOUT: %L1.lookup_impl_witness.d9f5df.1: = lookup_impl_witness %T, @L1 [symbolic] // CHECK:STDOUT: %L1.facet.1cc812.1: %L1.type = facet_value %T.as_type, (%L1.lookup_impl_witness.d9f5df.1) [symbolic] // CHECK:STDOUT: %.cad400.1: type = fn_type_with_self_type %L1.R1.type, %L1.facet.1cc812.1 [symbolic] // CHECK:STDOUT: %impl.elem0.c5e026.1: %.cad400.1 = impl_witness_access %L1.lookup_impl_witness.d9f5df.1, element0 [symbolic] // CHECK:STDOUT: %specific_impl_fn.5f85c4.1: = specific_impl_function %impl.elem0.c5e026.1, @L1.R1(%L1.facet.1cc812.1) [symbolic] // CHECK:STDOUT: %.9b5ba3.1: type = fn_type_with_self_type %L1.S1.type, %L1.facet.1cc812.1 [symbolic] // CHECK:STDOUT: %impl.elem1.d07d0e.1: %.9b5ba3.1 = impl_witness_access %L1.lookup_impl_witness.d9f5df.1, element1 [symbolic] -// CHECK:STDOUT: %ptr.87f2ee.2: type = ptr_type %T.as_type [symbolic] -// CHECK:STDOUT: %pattern_type.c0652c.2: type = pattern_type %ptr.87f2ee.2 [symbolic] // CHECK:STDOUT: %specific_impl_fn.2473a0.1: = specific_impl_function %impl.elem1.d07d0e.1, @L1.S1(%L1.facet.1cc812.1) [symbolic] -// CHECK:STDOUT: %require_complete.5158e1.1: = require_complete_type %ptr.87f2ee.2 [symbolic] -// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.c7977f.1: = lookup_impl_witness %T.112, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.facet.f26842.1: %Destroy.type = facet_value %T.as_type, (%Destroy.lookup_impl_witness.c7977f.1) [symbolic] -// CHECK:STDOUT: %.acaa49.1: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.f26842.1 [symbolic] -// CHECK:STDOUT: %impl.elem0.b71e6c.1: %.acaa49.1 = impl_witness_access %Destroy.lookup_impl_witness.c7977f.1, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.21ccd1.1: = specific_impl_function %impl.elem0.b71e6c.1, @Destroy.Op(%Destroy.facet.f26842.1) [symbolic] // CHECK:STDOUT: %V: %L1.type = bind_symbolic_name V, 0 [symbolic] // CHECK:STDOUT: %V.as_type: type = facet_access_type %V [symbolic] // CHECK:STDOUT: %pattern_type.cb4262.3: type = pattern_type %V.as_type [symbolic] +// CHECK:STDOUT: %ptr.87f2ee.3: type = ptr_type %V.as_type [symbolic] +// CHECK:STDOUT: %pattern_type.c0652c.3: type = pattern_type %ptr.87f2ee.3 [symbolic] // CHECK:STDOUT: %Compound4.type: type = fn_type @Compound4 [concrete] // CHECK:STDOUT: %Compound4: %Compound4.type = struct_value () [concrete] // CHECK:STDOUT: %require_complete.a52deb.2: = require_complete_type %V.as_type [symbolic] +// CHECK:STDOUT: %require_complete.5158e1.2: = require_complete_type %ptr.87f2ee.3 [symbolic] // CHECK:STDOUT: %L1.lookup_impl_witness.d9f5df.2: = lookup_impl_witness %V, @L1 [symbolic] // CHECK:STDOUT: %L1.facet.1cc812.2: %L1.type = facet_value %V.as_type, (%L1.lookup_impl_witness.d9f5df.2) [symbolic] // CHECK:STDOUT: %.cad400.2: type = fn_type_with_self_type %L1.R1.type, %L1.facet.1cc812.2 [symbolic] @@ -714,24 +708,14 @@ fn Works() { // CHECK:STDOUT: %specific_impl_fn.5f85c4.2: = specific_impl_function %impl.elem0.c5e026.2, @L1.R1(%L1.facet.1cc812.2) [symbolic] // CHECK:STDOUT: %.9b5ba3.2: type = fn_type_with_self_type %L1.S1.type, %L1.facet.1cc812.2 [symbolic] // CHECK:STDOUT: %impl.elem1.d07d0e.2: %.9b5ba3.2 = impl_witness_access %L1.lookup_impl_witness.d9f5df.2, element1 [symbolic] -// CHECK:STDOUT: %ptr.87f2ee.3: type = ptr_type %V.as_type [symbolic] -// CHECK:STDOUT: %pattern_type.c0652c.3: type = pattern_type %ptr.87f2ee.3 [symbolic] // CHECK:STDOUT: %specific_impl_fn.2473a0.2: = specific_impl_function %impl.elem1.d07d0e.2, @L1.S1(%L1.facet.1cc812.2) [symbolic] -// CHECK:STDOUT: %require_complete.5158e1.2: = require_complete_type %ptr.87f2ee.3 [symbolic] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.c7977f.2: = lookup_impl_witness %V, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.facet.f26842.2: %Destroy.type = facet_value %V.as_type, (%Destroy.lookup_impl_witness.c7977f.2) [symbolic] -// CHECK:STDOUT: %.acaa49.2: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.f26842.2 [symbolic] -// CHECK:STDOUT: %impl.elem0.b71e6c.2: %.acaa49.2 = impl_witness_access %Destroy.lookup_impl_witness.c7977f.2, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.21ccd1.2: = specific_impl_function %impl.elem0.b71e6c.2, @Destroy.Op(%Destroy.facet.f26842.2) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { -// CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -745,57 +729,77 @@ fn Works() { // CHECK:STDOUT: %L1.decl: type = interface_decl @L1 [concrete = constants.%L1.type] {} {} // CHECK:STDOUT: %Simple4.decl: %Simple4.type = fn_decl @Simple4 [concrete = constants.%Simple4] { // CHECK:STDOUT: %T.patt: %pattern_type.1cf = symbolic_binding_pattern T, 0 [concrete] -// CHECK:STDOUT: %x.patt: @Simple4.%pattern_type (%pattern_type.cb4262.2) = binding_pattern x [concrete] -// CHECK:STDOUT: %x.param_patt: @Simple4.%pattern_type (%pattern_type.cb4262.2) = value_param_pattern %x.patt, call_param0 [concrete] +// CHECK:STDOUT: %x.patt: @Simple4.%pattern_type.loc9_20 (%pattern_type.cb4262.2) = binding_pattern x [concrete] +// CHECK:STDOUT: %x.param_patt: @Simple4.%pattern_type.loc9_20 (%pattern_type.cb4262.2) = value_param_pattern %x.patt, call_param0 [concrete] +// CHECK:STDOUT: %p.patt: @Simple4.%pattern_type.loc9_26 (%pattern_type.c0652c.2) = binding_pattern p [concrete] +// CHECK:STDOUT: %p.param_patt: @Simple4.%pattern_type.loc9_26 (%pattern_type.c0652c.2) = value_param_pattern %p.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc9_16: type = splice_block %L1.ref [concrete = constants.%L1.type] { // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %L1.ref: type = name_ref L1, file.%L1.decl [concrete = constants.%L1.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %T.loc9_12.2: %L1.type = bind_symbolic_name T, 0 [symbolic = %T.loc9_12.1 (constants.%T.112)] +// CHECK:STDOUT: %T.loc9_12.2: %L1.type = bind_symbolic_name T, 0 [symbolic = %T.loc9_12.1 (constants.%T)] // CHECK:STDOUT: %x.param: @Simple4.%T.as_type.loc9_23.1 (%T.as_type) = value_param call_param0 // CHECK:STDOUT: %.loc9_23.1: type = splice_block %.loc9_23.2 [symbolic = %T.as_type.loc9_23.1 (constants.%T.as_type)] { -// CHECK:STDOUT: %T.ref.loc9: %L1.type = name_ref T, %T.loc9_12.2 [symbolic = %T.loc9_12.1 (constants.%T.112)] -// CHECK:STDOUT: %T.as_type.loc9_23.2: type = facet_access_type %T.ref.loc9 [symbolic = %T.as_type.loc9_23.1 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc9_23.2: type = converted %T.ref.loc9, %T.as_type.loc9_23.2 [symbolic = %T.as_type.loc9_23.1 (constants.%T.as_type)] +// CHECK:STDOUT: %T.ref.loc9_23: %L1.type = name_ref T, %T.loc9_12.2 [symbolic = %T.loc9_12.1 (constants.%T)] +// CHECK:STDOUT: %T.as_type.loc9_23.2: type = facet_access_type %T.ref.loc9_23 [symbolic = %T.as_type.loc9_23.1 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc9_23.2: type = converted %T.ref.loc9_23, %T.as_type.loc9_23.2 [symbolic = %T.as_type.loc9_23.1 (constants.%T.as_type)] // CHECK:STDOUT: } // CHECK:STDOUT: %x: @Simple4.%T.as_type.loc9_23.1 (%T.as_type) = bind_name x, %x.param +// CHECK:STDOUT: %p.param: @Simple4.%ptr.loc9_30.1 (%ptr.87f2ee.2) = value_param call_param1 +// CHECK:STDOUT: %.loc9_30.1: type = splice_block %ptr.loc9_30.2 [symbolic = %ptr.loc9_30.1 (constants.%ptr.87f2ee.2)] { +// CHECK:STDOUT: %T.ref.loc9_29: %L1.type = name_ref T, %T.loc9_12.2 [symbolic = %T.loc9_12.1 (constants.%T)] +// CHECK:STDOUT: %T.as_type.loc9_30: type = facet_access_type %T.ref.loc9_29 [symbolic = %T.as_type.loc9_23.1 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc9_30.2: type = converted %T.ref.loc9_29, %T.as_type.loc9_30 [symbolic = %T.as_type.loc9_23.1 (constants.%T.as_type)] +// CHECK:STDOUT: %ptr.loc9_30.2: type = ptr_type %.loc9_30.2 [symbolic = %ptr.loc9_30.1 (constants.%ptr.87f2ee.2)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %p: @Simple4.%ptr.loc9_30.1 (%ptr.87f2ee.2) = bind_name p, %p.param // CHECK:STDOUT: } // CHECK:STDOUT: %Compound4.decl: %Compound4.type = fn_decl @Compound4 [concrete = constants.%Compound4] { // CHECK:STDOUT: %V.patt: %pattern_type.1cf = symbolic_binding_pattern V, 0 [concrete] -// CHECK:STDOUT: %y.patt: @Compound4.%pattern_type (%pattern_type.cb4262.3) = binding_pattern y [concrete] -// CHECK:STDOUT: %y.param_patt: @Compound4.%pattern_type (%pattern_type.cb4262.3) = value_param_pattern %y.patt, call_param0 [concrete] +// CHECK:STDOUT: %y.patt: @Compound4.%pattern_type.loc15_22 (%pattern_type.cb4262.3) = binding_pattern y [concrete] +// CHECK:STDOUT: %y.param_patt: @Compound4.%pattern_type.loc15_22 (%pattern_type.cb4262.3) = value_param_pattern %y.patt, call_param0 [concrete] +// CHECK:STDOUT: %p.patt: @Compound4.%pattern_type.loc15_28 (%pattern_type.c0652c.3) = binding_pattern p [concrete] +// CHECK:STDOUT: %p.param_patt: @Compound4.%pattern_type.loc15_28 (%pattern_type.c0652c.3) = value_param_pattern %p.patt, call_param1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc16_18: type = splice_block %L1.ref.loc16 [concrete = constants.%L1.type] { +// CHECK:STDOUT: %.loc15_18: type = splice_block %L1.ref.loc15 [concrete = constants.%L1.type] { // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %L1.ref.loc16: type = name_ref L1, file.%L1.decl [concrete = constants.%L1.type] +// CHECK:STDOUT: %L1.ref.loc15: type = name_ref L1, file.%L1.decl [concrete = constants.%L1.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %V.loc16_14.2: %L1.type = bind_symbolic_name V, 0 [symbolic = %V.loc16_14.1 (constants.%V)] -// CHECK:STDOUT: %y.param: @Compound4.%V.as_type.loc16_25.1 (%V.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc16_25.1: type = splice_block %.loc16_25.2 [symbolic = %V.as_type.loc16_25.1 (constants.%V.as_type)] { -// CHECK:STDOUT: %V.ref.loc16: %L1.type = name_ref V, %V.loc16_14.2 [symbolic = %V.loc16_14.1 (constants.%V)] -// CHECK:STDOUT: %V.as_type.loc16_25.2: type = facet_access_type %V.ref.loc16 [symbolic = %V.as_type.loc16_25.1 (constants.%V.as_type)] -// CHECK:STDOUT: %.loc16_25.2: type = converted %V.ref.loc16, %V.as_type.loc16_25.2 [symbolic = %V.as_type.loc16_25.1 (constants.%V.as_type)] +// CHECK:STDOUT: %V.loc15_14.2: %L1.type = bind_symbolic_name V, 0 [symbolic = %V.loc15_14.1 (constants.%V)] +// CHECK:STDOUT: %y.param: @Compound4.%V.as_type.loc15_25.1 (%V.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc15_25.1: type = splice_block %.loc15_25.2 [symbolic = %V.as_type.loc15_25.1 (constants.%V.as_type)] { +// CHECK:STDOUT: %V.ref.loc15_25: %L1.type = name_ref V, %V.loc15_14.2 [symbolic = %V.loc15_14.1 (constants.%V)] +// CHECK:STDOUT: %V.as_type.loc15_25.2: type = facet_access_type %V.ref.loc15_25 [symbolic = %V.as_type.loc15_25.1 (constants.%V.as_type)] +// CHECK:STDOUT: %.loc15_25.2: type = converted %V.ref.loc15_25, %V.as_type.loc15_25.2 [symbolic = %V.as_type.loc15_25.1 (constants.%V.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %y: @Compound4.%V.as_type.loc16_25.1 (%V.as_type) = bind_name y, %y.param +// CHECK:STDOUT: %y: @Compound4.%V.as_type.loc15_25.1 (%V.as_type) = bind_name y, %y.param +// CHECK:STDOUT: %p.param: @Compound4.%ptr.loc15_32.1 (%ptr.87f2ee.3) = value_param call_param1 +// CHECK:STDOUT: %.loc15_32.1: type = splice_block %ptr.loc15_32.2 [symbolic = %ptr.loc15_32.1 (constants.%ptr.87f2ee.3)] { +// CHECK:STDOUT: %V.ref.loc15_31: %L1.type = name_ref V, %V.loc15_14.2 [symbolic = %V.loc15_14.1 (constants.%V)] +// CHECK:STDOUT: %V.as_type.loc15_32: type = facet_access_type %V.ref.loc15_31 [symbolic = %V.as_type.loc15_25.1 (constants.%V.as_type)] +// CHECK:STDOUT: %.loc15_32.2: type = converted %V.ref.loc15_31, %V.as_type.loc15_32 [symbolic = %V.as_type.loc15_25.1 (constants.%V.as_type)] +// CHECK:STDOUT: %ptr.loc15_32.2: type = ptr_type %.loc15_32.2 [symbolic = %ptr.loc15_32.1 (constants.%ptr.87f2ee.3)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %p: @Compound4.%ptr.loc15_32.1 (%ptr.87f2ee.3) = bind_name p, %p.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @L1 { -// CHECK:STDOUT: %Self: %L1.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.112] +// CHECK:STDOUT: %Self: %L1.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] // CHECK:STDOUT: %L1.R1.decl: %L1.R1.type = fn_decl @L1.R1 [concrete = constants.%L1.R1] { // CHECK:STDOUT: %self.patt: @L1.R1.%pattern_type (%pattern_type.cb4262.1) = binding_pattern self [concrete] // CHECK:STDOUT: %self.param_patt: @L1.R1.%pattern_type (%pattern_type.cb4262.1) = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @L1.R1.%Self.as_type.loc4_15.1 (%Self.as_type.351) = value_param call_param0 -// CHECK:STDOUT: %.loc4_15.1: type = splice_block %.loc4_15.2 [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type.351)] { -// CHECK:STDOUT: %Self.ref: %L1.type = name_ref Self, @L1.%Self [symbolic = %Self (constants.%Self.112)] -// CHECK:STDOUT: %Self.as_type.loc4_15.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type.351)] -// CHECK:STDOUT: %.loc4_15.2: type = converted %Self.ref, %Self.as_type.loc4_15.2 [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type.351)] +// CHECK:STDOUT: %self.param: @L1.R1.%Self.as_type.loc4_15.1 (%Self.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc4_15.1: type = splice_block %.loc4_15.2 [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %Self.ref: %L1.type = name_ref Self, @L1.%Self [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc4_15.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc4_15.2: type = converted %Self.ref, %Self.as_type.loc4_15.2 [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @L1.R1.%Self.as_type.loc4_15.1 (%Self.as_type.351) = bind_name self, %self.param +// CHECK:STDOUT: %self: @L1.R1.%Self.as_type.loc4_15.1 (%Self.as_type) = bind_name self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %assoc0: %L1.assoc_type = assoc_entity element0, %L1.R1.decl [concrete = constants.%assoc0.8b4] +// CHECK:STDOUT: %assoc0: %L1.assoc_type = assoc_entity element0, %L1.R1.decl [concrete = constants.%assoc0] // CHECK:STDOUT: %L1.S1.decl: %L1.S1.type = fn_decl @L1.S1 [concrete = constants.%L1.S1] { // CHECK:STDOUT: %self.patt: @L1.S1.%pattern_type (%pattern_type.c0652c.1) = binding_pattern self [concrete] // CHECK:STDOUT: %self.param_patt: @L1.S1.%pattern_type (%pattern_type.c0652c.1) = value_param_pattern %self.patt, call_param0 [concrete] @@ -803,9 +807,9 @@ fn Works() { // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @L1.S1.%ptr.loc5_24.1 (%ptr.87f2ee.1) = value_param call_param0 // CHECK:STDOUT: %.loc5_24.1: type = splice_block %ptr.loc5_24.2 [symbolic = %ptr.loc5_24.1 (constants.%ptr.87f2ee.1)] { -// CHECK:STDOUT: %Self.ref: %L1.type = name_ref Self, @L1.%Self [symbolic = %Self (constants.%Self.112)] -// CHECK:STDOUT: %Self.as_type.loc5_24.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_24.1 (constants.%Self.as_type.351)] -// CHECK:STDOUT: %.loc5_24.2: type = converted %Self.ref, %Self.as_type.loc5_24.2 [symbolic = %Self.as_type.loc5_24.1 (constants.%Self.as_type.351)] +// CHECK:STDOUT: %Self.ref: %L1.type = name_ref Self, @L1.%Self [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc5_24.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_24.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_24.2: type = converted %Self.ref, %Self.as_type.loc5_24.2 [symbolic = %Self.as_type.loc5_24.1 (constants.%Self.as_type)] // CHECK:STDOUT: %ptr.loc5_24.2: type = ptr_type %.loc5_24.2 [symbolic = %ptr.loc5_24.1 (constants.%ptr.87f2ee.1)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @L1.S1.%ptr.loc5_24.1 (%ptr.87f2ee.1) = bind_name self, %self.param @@ -820,16 +824,16 @@ fn Works() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @L1.R1(@L1.%Self: %L1.type) { -// CHECK:STDOUT: %Self: %L1.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.112)] -// CHECK:STDOUT: %Self.as_type.loc4_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type.351)] +// CHECK:STDOUT: %Self: %L1.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc4_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type)] // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc4_15.1 [symbolic = %pattern_type (constants.%pattern_type.cb4262.1)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @L1.R1.%Self.as_type.loc4_15.1 (%Self.as_type.351)); +// CHECK:STDOUT: fn(%self.param: @L1.R1.%Self.as_type.loc4_15.1 (%Self.as_type)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @L1.S1(@L1.%Self: %L1.type) { -// CHECK:STDOUT: %Self: %L1.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.112)] -// CHECK:STDOUT: %Self.as_type.loc5_24.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_24.1 (constants.%Self.as_type.351)] +// CHECK:STDOUT: %Self: %L1.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc5_24.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_24.1 (constants.%Self.as_type)] // CHECK:STDOUT: %ptr.loc5_24.1: type = ptr_type %Self.as_type.loc5_24.1 [symbolic = %ptr.loc5_24.1 (constants.%ptr.87f2ee.1)] // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.loc5_24.1 [symbolic = %pattern_type (constants.%pattern_type.c0652c.1)] // CHECK:STDOUT: @@ -837,158 +841,112 @@ fn Works() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Simple4(%T.loc9_12.2: %L1.type) { -// CHECK:STDOUT: %T.loc9_12.1: %L1.type = bind_symbolic_name T, 0 [symbolic = %T.loc9_12.1 (constants.%T.112)] +// CHECK:STDOUT: %T.loc9_12.1: %L1.type = bind_symbolic_name T, 0 [symbolic = %T.loc9_12.1 (constants.%T)] // CHECK:STDOUT: %T.as_type.loc9_23.1: type = facet_access_type %T.loc9_12.1 [symbolic = %T.as_type.loc9_23.1 (constants.%T.as_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %T.as_type.loc9_23.1 [symbolic = %pattern_type (constants.%pattern_type.cb4262.2)] +// CHECK:STDOUT: %pattern_type.loc9_20: type = pattern_type %T.as_type.loc9_23.1 [symbolic = %pattern_type.loc9_20 (constants.%pattern_type.cb4262.2)] +// CHECK:STDOUT: %ptr.loc9_30.1: type = ptr_type %T.as_type.loc9_23.1 [symbolic = %ptr.loc9_30.1 (constants.%ptr.87f2ee.2)] +// CHECK:STDOUT: %pattern_type.loc9_26: type = pattern_type %ptr.loc9_30.1 [symbolic = %pattern_type.loc9_26 (constants.%pattern_type.c0652c.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc9: = require_complete_type %T.as_type.loc9_23.1 [symbolic = %require_complete.loc9 (constants.%require_complete.a52deb.1)] +// CHECK:STDOUT: %require_complete.loc9_21: = require_complete_type %T.as_type.loc9_23.1 [symbolic = %require_complete.loc9_21 (constants.%require_complete.a52deb.1)] +// CHECK:STDOUT: %require_complete.loc9_27: = require_complete_type %ptr.loc9_30.1 [symbolic = %require_complete.loc9_27 (constants.%require_complete.5158e1.1)] // CHECK:STDOUT: %L1.lookup_impl_witness: = lookup_impl_witness %T.loc9_12.1, @L1 [symbolic = %L1.lookup_impl_witness (constants.%L1.lookup_impl_witness.d9f5df.1)] // CHECK:STDOUT: %L1.facet: %L1.type = facet_value %T.as_type.loc9_23.1, (%L1.lookup_impl_witness) [symbolic = %L1.facet (constants.%L1.facet.1cc812.1)] // CHECK:STDOUT: %.loc10_4.2: type = fn_type_with_self_type constants.%L1.R1.type, %L1.facet [symbolic = %.loc10_4.2 (constants.%.cad400.1)] // CHECK:STDOUT: %impl.elem0.loc10_4.2: @Simple4.%.loc10_4.2 (%.cad400.1) = impl_witness_access %L1.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_4.2 (constants.%impl.elem0.c5e026.1)] // CHECK:STDOUT: %specific_impl_fn.loc10_4.2: = specific_impl_function %impl.elem0.loc10_4.2, @L1.R1(%L1.facet) [symbolic = %specific_impl_fn.loc10_4.2 (constants.%specific_impl_fn.5f85c4.1)] -// CHECK:STDOUT: %.loc12_8.2: type = fn_type_with_self_type constants.%L1.S1.type, %L1.facet [symbolic = %.loc12_8.2 (constants.%.9b5ba3.1)] -// CHECK:STDOUT: %impl.elem1.loc12_8.2: @Simple4.%.loc12_8.2 (%.9b5ba3.1) = impl_witness_access %L1.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc12_8.2 (constants.%impl.elem1.d07d0e.1)] -// CHECK:STDOUT: %specific_impl_fn.loc12_8.2: = specific_impl_function %impl.elem1.loc12_8.2, @L1.S1(%L1.facet) [symbolic = %specific_impl_fn.loc12_8.2 (constants.%specific_impl_fn.2473a0.1)] -// CHECK:STDOUT: %ptr: type = ptr_type %T.as_type.loc9_23.1 [symbolic = %ptr (constants.%ptr.87f2ee.2)] -// CHECK:STDOUT: %require_complete.loc12: = require_complete_type %ptr [symbolic = %require_complete.loc12 (constants.%require_complete.5158e1.1)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %T.loc9_12.1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.c7977f.1)] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %T.as_type.loc9_23.1, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.f26842.1)] -// CHECK:STDOUT: %.loc11_3.3: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc11_3.3 (constants.%.acaa49.1)] -// CHECK:STDOUT: %impl.elem0.loc11_3.2: @Simple4.%.loc11_3.3 (%.acaa49.1) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc11_3.2 (constants.%impl.elem0.b71e6c.1)] -// CHECK:STDOUT: %specific_impl_fn.loc11_3.2: = specific_impl_function %impl.elem0.loc11_3.2, @Destroy.Op(%Destroy.facet) [symbolic = %specific_impl_fn.loc11_3.2 (constants.%specific_impl_fn.21ccd1.1)] +// CHECK:STDOUT: %.loc11_4.3: type = fn_type_with_self_type constants.%L1.S1.type, %L1.facet [symbolic = %.loc11_4.3 (constants.%.9b5ba3.1)] +// CHECK:STDOUT: %impl.elem1.loc11_4.2: @Simple4.%.loc11_4.3 (%.9b5ba3.1) = impl_witness_access %L1.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc11_4.2 (constants.%impl.elem1.d07d0e.1)] +// CHECK:STDOUT: %specific_impl_fn.loc11_4.2: = specific_impl_function %impl.elem1.loc11_4.2, @L1.S1(%L1.facet) [symbolic = %specific_impl_fn.loc11_4.2 (constants.%specific_impl_fn.2473a0.1)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%x.param: @Simple4.%T.as_type.loc9_23.1 (%T.as_type)) { +// CHECK:STDOUT: fn(%x.param: @Simple4.%T.as_type.loc9_23.1 (%T.as_type), %p.param: @Simple4.%ptr.loc9_30.1 (%ptr.87f2ee.2)) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %x.ref.loc10: @Simple4.%T.as_type.loc9_23.1 (%T.as_type) = name_ref x, %x -// CHECK:STDOUT: %R1.ref: %L1.assoc_type = name_ref R1, @L1.%assoc0 [concrete = constants.%assoc0.8b4] -// CHECK:STDOUT: %T.as_type.loc10: type = facet_access_type constants.%T.112 [symbolic = %T.as_type.loc9_23.1 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc10_4.1: type = converted constants.%T.112, %T.as_type.loc10 [symbolic = %T.as_type.loc9_23.1 (constants.%T.as_type)] +// CHECK:STDOUT: %x.ref: @Simple4.%T.as_type.loc9_23.1 (%T.as_type) = name_ref x, %x +// CHECK:STDOUT: %R1.ref: %L1.assoc_type = name_ref R1, @L1.%assoc0 [concrete = constants.%assoc0] +// CHECK:STDOUT: %T.as_type.loc10: type = facet_access_type constants.%T [symbolic = %T.as_type.loc9_23.1 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc10_4.1: type = converted constants.%T, %T.as_type.loc10 [symbolic = %T.as_type.loc9_23.1 (constants.%T.as_type)] // CHECK:STDOUT: %impl.elem0.loc10_4.1: @Simple4.%.loc10_4.2 (%.cad400.1) = impl_witness_access constants.%L1.lookup_impl_witness.d9f5df.1, element0 [symbolic = %impl.elem0.loc10_4.2 (constants.%impl.elem0.c5e026.1)] -// CHECK:STDOUT: %bound_method.loc10_4: = bound_method %x.ref.loc10, %impl.elem0.loc10_4.1 +// CHECK:STDOUT: %bound_method.loc10_4: = bound_method %x.ref, %impl.elem0.loc10_4.1 // CHECK:STDOUT: %specific_impl_fn.loc10_4.1: = specific_impl_function %impl.elem0.loc10_4.1, @L1.R1(constants.%L1.facet.1cc812.1) [symbolic = %specific_impl_fn.loc10_4.2 (constants.%specific_impl_fn.5f85c4.1)] -// CHECK:STDOUT: %bound_method.loc10_8: = bound_method %x.ref.loc10, %specific_impl_fn.loc10_4.1 -// CHECK:STDOUT: %.loc10_8: init %empty_tuple.type = call %bound_method.loc10_8(%x.ref.loc10) -// CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %xcopy.patt: @Simple4.%pattern_type (%pattern_type.cb4262.2) = binding_pattern xcopy [concrete] -// CHECK:STDOUT: %xcopy.var_patt: @Simple4.%pattern_type (%pattern_type.cb4262.2) = var_pattern %xcopy.patt [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: %xcopy.var: ref @Simple4.%T.as_type.loc9_23.1 (%T.as_type) = var %xcopy.var_patt -// CHECK:STDOUT: %x.ref.loc11: @Simple4.%T.as_type.loc9_23.1 (%T.as_type) = name_ref x, %x -// CHECK:STDOUT: assign %xcopy.var, %x.ref.loc11 -// CHECK:STDOUT: %.loc11_14.1: type = splice_block %.loc11_14.2 [symbolic = %T.as_type.loc9_23.1 (constants.%T.as_type)] { -// CHECK:STDOUT: %T.ref.loc11: %L1.type = name_ref T, %T.loc9_12.2 [symbolic = %T.loc9_12.1 (constants.%T.112)] -// CHECK:STDOUT: %T.as_type.loc11_14: type = facet_access_type %T.ref.loc11 [symbolic = %T.as_type.loc9_23.1 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc11_14.2: type = converted %T.ref.loc11, %T.as_type.loc11_14 [symbolic = %T.as_type.loc9_23.1 (constants.%T.as_type)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %xcopy: ref @Simple4.%T.as_type.loc9_23.1 (%T.as_type) = bind_name xcopy, %xcopy.var -// CHECK:STDOUT: %xcopy.ref: ref @Simple4.%T.as_type.loc9_23.1 (%T.as_type) = name_ref xcopy, %xcopy +// CHECK:STDOUT: %bound_method.loc10_8: = bound_method %x.ref, %specific_impl_fn.loc10_4.1 +// CHECK:STDOUT: %.loc10_8: init %empty_tuple.type = call %bound_method.loc10_8(%x.ref) +// CHECK:STDOUT: %p.ref: @Simple4.%ptr.loc9_30.1 (%ptr.87f2ee.2) = name_ref p, %p +// CHECK:STDOUT: %.loc11_4.1: ref @Simple4.%T.as_type.loc9_23.1 (%T.as_type) = deref %p.ref // CHECK:STDOUT: %S1.ref: %L1.assoc_type = name_ref S1, @L1.%assoc1 [concrete = constants.%assoc1] -// CHECK:STDOUT: %T.as_type.loc12: type = facet_access_type constants.%T.112 [symbolic = %T.as_type.loc9_23.1 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc12_8.1: type = converted constants.%T.112, %T.as_type.loc12 [symbolic = %T.as_type.loc9_23.1 (constants.%T.as_type)] -// CHECK:STDOUT: %impl.elem1.loc12_8.1: @Simple4.%.loc12_8.2 (%.9b5ba3.1) = impl_witness_access constants.%L1.lookup_impl_witness.d9f5df.1, element1 [symbolic = %impl.elem1.loc12_8.2 (constants.%impl.elem1.d07d0e.1)] -// CHECK:STDOUT: %bound_method.loc12_8: = bound_method %xcopy.ref, %impl.elem1.loc12_8.1 -// CHECK:STDOUT: %specific_impl_fn.loc12_8.1: = specific_impl_function %impl.elem1.loc12_8.1, @L1.S1(constants.%L1.facet.1cc812.1) [symbolic = %specific_impl_fn.loc12_8.2 (constants.%specific_impl_fn.2473a0.1)] -// CHECK:STDOUT: %bound_method.loc12_12: = bound_method %xcopy.ref, %specific_impl_fn.loc12_8.1 -// CHECK:STDOUT: %addr.loc12: @Simple4.%ptr (%ptr.87f2ee.2) = addr_of %xcopy.ref -// CHECK:STDOUT: %.loc12_12: init %empty_tuple.type = call %bound_method.loc12_12(%addr.loc12) -// CHECK:STDOUT: %T.as_type.loc11_3: type = facet_access_type constants.%T.112 [symbolic = %T.as_type.loc9_23.1 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc11_3.1: type = converted constants.%T.112, %T.as_type.loc11_3 [symbolic = %T.as_type.loc9_23.1 (constants.%T.as_type)] -// CHECK:STDOUT: %impl.elem0.loc11_3.1: @Simple4.%.loc11_3.3 (%.acaa49.1) = impl_witness_access constants.%Destroy.lookup_impl_witness.c7977f.1, element0 [symbolic = %impl.elem0.loc11_3.2 (constants.%impl.elem0.b71e6c.1)] -// CHECK:STDOUT: %bound_method.loc11_3.1: = bound_method %xcopy.var, %impl.elem0.loc11_3.1 -// CHECK:STDOUT: %specific_impl_fn.loc11_3.1: = specific_impl_function %impl.elem0.loc11_3.1, @Destroy.Op(constants.%Destroy.facet.f26842.1) [symbolic = %specific_impl_fn.loc11_3.2 (constants.%specific_impl_fn.21ccd1.1)] -// CHECK:STDOUT: %bound_method.loc11_3.2: = bound_method %xcopy.var, %specific_impl_fn.loc11_3.1 -// CHECK:STDOUT: %addr.loc11: @Simple4.%ptr (%ptr.87f2ee.2) = addr_of %xcopy.var -// CHECK:STDOUT: %.loc11_3.2: init %empty_tuple.type = call %bound_method.loc11_3.2(%addr.loc11) +// CHECK:STDOUT: %T.as_type.loc11: type = facet_access_type constants.%T [symbolic = %T.as_type.loc9_23.1 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc11_4.2: type = converted constants.%T, %T.as_type.loc11 [symbolic = %T.as_type.loc9_23.1 (constants.%T.as_type)] +// CHECK:STDOUT: %impl.elem1.loc11_4.1: @Simple4.%.loc11_4.3 (%.9b5ba3.1) = impl_witness_access constants.%L1.lookup_impl_witness.d9f5df.1, element1 [symbolic = %impl.elem1.loc11_4.2 (constants.%impl.elem1.d07d0e.1)] +// CHECK:STDOUT: %bound_method.loc11_4: = bound_method %.loc11_4.1, %impl.elem1.loc11_4.1 +// CHECK:STDOUT: %specific_impl_fn.loc11_4.1: = specific_impl_function %impl.elem1.loc11_4.1, @L1.S1(constants.%L1.facet.1cc812.1) [symbolic = %specific_impl_fn.loc11_4.2 (constants.%specific_impl_fn.2473a0.1)] +// CHECK:STDOUT: %bound_method.loc11_9: = bound_method %.loc11_4.1, %specific_impl_fn.loc11_4.1 +// CHECK:STDOUT: %addr: @Simple4.%ptr.loc9_30.1 (%ptr.87f2ee.2) = addr_of %.loc11_4.1 +// CHECK:STDOUT: %.loc11_9: init %empty_tuple.type = call %bound_method.loc11_9(%addr) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Compound4(%V.loc16_14.2: %L1.type) { -// CHECK:STDOUT: %V.loc16_14.1: %L1.type = bind_symbolic_name V, 0 [symbolic = %V.loc16_14.1 (constants.%V)] -// CHECK:STDOUT: %V.as_type.loc16_25.1: type = facet_access_type %V.loc16_14.1 [symbolic = %V.as_type.loc16_25.1 (constants.%V.as_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %V.as_type.loc16_25.1 [symbolic = %pattern_type (constants.%pattern_type.cb4262.3)] +// CHECK:STDOUT: generic fn @Compound4(%V.loc15_14.2: %L1.type) { +// CHECK:STDOUT: %V.loc15_14.1: %L1.type = bind_symbolic_name V, 0 [symbolic = %V.loc15_14.1 (constants.%V)] +// CHECK:STDOUT: %V.as_type.loc15_25.1: type = facet_access_type %V.loc15_14.1 [symbolic = %V.as_type.loc15_25.1 (constants.%V.as_type)] +// CHECK:STDOUT: %pattern_type.loc15_22: type = pattern_type %V.as_type.loc15_25.1 [symbolic = %pattern_type.loc15_22 (constants.%pattern_type.cb4262.3)] +// CHECK:STDOUT: %ptr.loc15_32.1: type = ptr_type %V.as_type.loc15_25.1 [symbolic = %ptr.loc15_32.1 (constants.%ptr.87f2ee.3)] +// CHECK:STDOUT: %pattern_type.loc15_28: type = pattern_type %ptr.loc15_32.1 [symbolic = %pattern_type.loc15_28 (constants.%pattern_type.c0652c.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc16: = require_complete_type %V.as_type.loc16_25.1 [symbolic = %require_complete.loc16 (constants.%require_complete.a52deb.2)] -// CHECK:STDOUT: %L1.lookup_impl_witness: = lookup_impl_witness %V.loc16_14.1, @L1 [symbolic = %L1.lookup_impl_witness (constants.%L1.lookup_impl_witness.d9f5df.2)] -// CHECK:STDOUT: %L1.facet: %L1.type = facet_value %V.as_type.loc16_25.1, (%L1.lookup_impl_witness) [symbolic = %L1.facet (constants.%L1.facet.1cc812.2)] -// CHECK:STDOUT: %.loc17_4: type = fn_type_with_self_type constants.%L1.R1.type, %L1.facet [symbolic = %.loc17_4 (constants.%.cad400.2)] -// CHECK:STDOUT: %impl.elem0.loc17_4.2: @Compound4.%.loc17_4 (%.cad400.2) = impl_witness_access %L1.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc17_4.2 (constants.%impl.elem0.c5e026.2)] -// CHECK:STDOUT: %specific_impl_fn.loc17_4.2: = specific_impl_function %impl.elem0.loc17_4.2, @L1.R1(%L1.facet) [symbolic = %specific_impl_fn.loc17_4.2 (constants.%specific_impl_fn.5f85c4.2)] -// CHECK:STDOUT: %.loc19_8: type = fn_type_with_self_type constants.%L1.S1.type, %L1.facet [symbolic = %.loc19_8 (constants.%.9b5ba3.2)] -// CHECK:STDOUT: %impl.elem1.loc19_8.2: @Compound4.%.loc19_8 (%.9b5ba3.2) = impl_witness_access %L1.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc19_8.2 (constants.%impl.elem1.d07d0e.2)] -// CHECK:STDOUT: %specific_impl_fn.loc19_8.2: = specific_impl_function %impl.elem1.loc19_8.2, @L1.S1(%L1.facet) [symbolic = %specific_impl_fn.loc19_8.2 (constants.%specific_impl_fn.2473a0.2)] -// CHECK:STDOUT: %ptr: type = ptr_type %V.as_type.loc16_25.1 [symbolic = %ptr (constants.%ptr.87f2ee.3)] -// CHECK:STDOUT: %require_complete.loc19: = require_complete_type %ptr [symbolic = %require_complete.loc19 (constants.%require_complete.5158e1.2)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %V.loc16_14.1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.c7977f.2)] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %V.as_type.loc16_25.1, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.f26842.2)] -// CHECK:STDOUT: %.loc18_3.3: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc18_3.3 (constants.%.acaa49.2)] -// CHECK:STDOUT: %impl.elem0.loc18_3.2: @Compound4.%.loc18_3.3 (%.acaa49.2) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc18_3.2 (constants.%impl.elem0.b71e6c.2)] -// CHECK:STDOUT: %specific_impl_fn.loc18_3.2: = specific_impl_function %impl.elem0.loc18_3.2, @Destroy.Op(%Destroy.facet) [symbolic = %specific_impl_fn.loc18_3.2 (constants.%specific_impl_fn.21ccd1.2)] +// CHECK:STDOUT: %require_complete.loc15_23: = require_complete_type %V.as_type.loc15_25.1 [symbolic = %require_complete.loc15_23 (constants.%require_complete.a52deb.2)] +// CHECK:STDOUT: %require_complete.loc15_29: = require_complete_type %ptr.loc15_32.1 [symbolic = %require_complete.loc15_29 (constants.%require_complete.5158e1.2)] +// CHECK:STDOUT: %L1.lookup_impl_witness: = lookup_impl_witness %V.loc15_14.1, @L1 [symbolic = %L1.lookup_impl_witness (constants.%L1.lookup_impl_witness.d9f5df.2)] +// CHECK:STDOUT: %L1.facet: %L1.type = facet_value %V.as_type.loc15_25.1, (%L1.lookup_impl_witness) [symbolic = %L1.facet (constants.%L1.facet.1cc812.2)] +// CHECK:STDOUT: %.loc16_4: type = fn_type_with_self_type constants.%L1.R1.type, %L1.facet [symbolic = %.loc16_4 (constants.%.cad400.2)] +// CHECK:STDOUT: %impl.elem0.loc16_4.2: @Compound4.%.loc16_4 (%.cad400.2) = impl_witness_access %L1.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc16_4.2 (constants.%impl.elem0.c5e026.2)] +// CHECK:STDOUT: %specific_impl_fn.loc16_4.2: = specific_impl_function %impl.elem0.loc16_4.2, @L1.R1(%L1.facet) [symbolic = %specific_impl_fn.loc16_4.2 (constants.%specific_impl_fn.5f85c4.2)] +// CHECK:STDOUT: %.loc17_4.2: type = fn_type_with_self_type constants.%L1.S1.type, %L1.facet [symbolic = %.loc17_4.2 (constants.%.9b5ba3.2)] +// CHECK:STDOUT: %impl.elem1.loc17_4.2: @Compound4.%.loc17_4.2 (%.9b5ba3.2) = impl_witness_access %L1.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc17_4.2 (constants.%impl.elem1.d07d0e.2)] +// CHECK:STDOUT: %specific_impl_fn.loc17_4.2: = specific_impl_function %impl.elem1.loc17_4.2, @L1.S1(%L1.facet) [symbolic = %specific_impl_fn.loc17_4.2 (constants.%specific_impl_fn.2473a0.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%y.param: @Compound4.%V.as_type.loc16_25.1 (%V.as_type)) { +// CHECK:STDOUT: fn(%y.param: @Compound4.%V.as_type.loc15_25.1 (%V.as_type), %p.param: @Compound4.%ptr.loc15_32.1 (%ptr.87f2ee.3)) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %y.ref.loc17: @Compound4.%V.as_type.loc16_25.1 (%V.as_type) = name_ref y, %y +// CHECK:STDOUT: %y.ref: @Compound4.%V.as_type.loc15_25.1 (%V.as_type) = name_ref y, %y +// CHECK:STDOUT: %L1.ref.loc16: type = name_ref L1, file.%L1.decl [concrete = constants.%L1.type] +// CHECK:STDOUT: %R1.ref: %L1.assoc_type = name_ref R1, @L1.%assoc0 [concrete = constants.%assoc0] +// CHECK:STDOUT: %impl.elem0.loc16_4.1: @Compound4.%.loc16_4 (%.cad400.2) = impl_witness_access constants.%L1.lookup_impl_witness.d9f5df.2, element0 [symbolic = %impl.elem0.loc16_4.2 (constants.%impl.elem0.c5e026.2)] +// CHECK:STDOUT: %bound_method.loc16_4: = bound_method %y.ref, %impl.elem0.loc16_4.1 +// CHECK:STDOUT: %specific_impl_fn.loc16_4.1: = specific_impl_function %impl.elem0.loc16_4.1, @L1.R1(constants.%L1.facet.1cc812.2) [symbolic = %specific_impl_fn.loc16_4.2 (constants.%specific_impl_fn.5f85c4.2)] +// CHECK:STDOUT: %bound_method.loc16_13: = bound_method %y.ref, %specific_impl_fn.loc16_4.1 +// CHECK:STDOUT: %.loc16_13: init %empty_tuple.type = call %bound_method.loc16_13(%y.ref) +// CHECK:STDOUT: %p.ref: @Compound4.%ptr.loc15_32.1 (%ptr.87f2ee.3) = name_ref p, %p // CHECK:STDOUT: %L1.ref.loc17: type = name_ref L1, file.%L1.decl [concrete = constants.%L1.type] -// CHECK:STDOUT: %R1.ref: %L1.assoc_type = name_ref R1, @L1.%assoc0 [concrete = constants.%assoc0.8b4] -// CHECK:STDOUT: %impl.elem0.loc17_4.1: @Compound4.%.loc17_4 (%.cad400.2) = impl_witness_access constants.%L1.lookup_impl_witness.d9f5df.2, element0 [symbolic = %impl.elem0.loc17_4.2 (constants.%impl.elem0.c5e026.2)] -// CHECK:STDOUT: %bound_method.loc17_4: = bound_method %y.ref.loc17, %impl.elem0.loc17_4.1 -// CHECK:STDOUT: %specific_impl_fn.loc17_4.1: = specific_impl_function %impl.elem0.loc17_4.1, @L1.R1(constants.%L1.facet.1cc812.2) [symbolic = %specific_impl_fn.loc17_4.2 (constants.%specific_impl_fn.5f85c4.2)] -// CHECK:STDOUT: %bound_method.loc17_13: = bound_method %y.ref.loc17, %specific_impl_fn.loc17_4.1 -// CHECK:STDOUT: %.loc17_13: init %empty_tuple.type = call %bound_method.loc17_13(%y.ref.loc17) -// CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %ycopy.patt: @Compound4.%pattern_type (%pattern_type.cb4262.3) = binding_pattern ycopy [concrete] -// CHECK:STDOUT: %ycopy.var_patt: @Compound4.%pattern_type (%pattern_type.cb4262.3) = var_pattern %ycopy.patt [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: %ycopy.var: ref @Compound4.%V.as_type.loc16_25.1 (%V.as_type) = var %ycopy.var_patt -// CHECK:STDOUT: %y.ref.loc18: @Compound4.%V.as_type.loc16_25.1 (%V.as_type) = name_ref y, %y -// CHECK:STDOUT: assign %ycopy.var, %y.ref.loc18 -// CHECK:STDOUT: %.loc18_14.1: type = splice_block %.loc18_14.2 [symbolic = %V.as_type.loc16_25.1 (constants.%V.as_type)] { -// CHECK:STDOUT: %V.ref.loc18: %L1.type = name_ref V, %V.loc16_14.2 [symbolic = %V.loc16_14.1 (constants.%V)] -// CHECK:STDOUT: %V.as_type.loc18_14: type = facet_access_type %V.ref.loc18 [symbolic = %V.as_type.loc16_25.1 (constants.%V.as_type)] -// CHECK:STDOUT: %.loc18_14.2: type = converted %V.ref.loc18, %V.as_type.loc18_14 [symbolic = %V.as_type.loc16_25.1 (constants.%V.as_type)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %ycopy: ref @Compound4.%V.as_type.loc16_25.1 (%V.as_type) = bind_name ycopy, %ycopy.var -// CHECK:STDOUT: %ycopy.ref: ref @Compound4.%V.as_type.loc16_25.1 (%V.as_type) = name_ref ycopy, %ycopy -// CHECK:STDOUT: %L1.ref.loc19: type = name_ref L1, file.%L1.decl [concrete = constants.%L1.type] // CHECK:STDOUT: %S1.ref: %L1.assoc_type = name_ref S1, @L1.%assoc1 [concrete = constants.%assoc1] -// CHECK:STDOUT: %impl.elem1.loc19_8.1: @Compound4.%.loc19_8 (%.9b5ba3.2) = impl_witness_access constants.%L1.lookup_impl_witness.d9f5df.2, element1 [symbolic = %impl.elem1.loc19_8.2 (constants.%impl.elem1.d07d0e.2)] -// CHECK:STDOUT: %bound_method.loc19_8: = bound_method %ycopy.ref, %impl.elem1.loc19_8.1 -// CHECK:STDOUT: %specific_impl_fn.loc19_8.1: = specific_impl_function %impl.elem1.loc19_8.1, @L1.S1(constants.%L1.facet.1cc812.2) [symbolic = %specific_impl_fn.loc19_8.2 (constants.%specific_impl_fn.2473a0.2)] -// CHECK:STDOUT: %bound_method.loc19_17: = bound_method %ycopy.ref, %specific_impl_fn.loc19_8.1 -// CHECK:STDOUT: %addr.loc19: @Compound4.%ptr (%ptr.87f2ee.3) = addr_of %ycopy.ref -// CHECK:STDOUT: %.loc19_17: init %empty_tuple.type = call %bound_method.loc19_17(%addr.loc19) -// CHECK:STDOUT: %V.as_type.loc18_3: type = facet_access_type constants.%V [symbolic = %V.as_type.loc16_25.1 (constants.%V.as_type)] -// CHECK:STDOUT: %.loc18_3.1: type = converted constants.%V, %V.as_type.loc18_3 [symbolic = %V.as_type.loc16_25.1 (constants.%V.as_type)] -// CHECK:STDOUT: %impl.elem0.loc18_3.1: @Compound4.%.loc18_3.3 (%.acaa49.2) = impl_witness_access constants.%Destroy.lookup_impl_witness.c7977f.2, element0 [symbolic = %impl.elem0.loc18_3.2 (constants.%impl.elem0.b71e6c.2)] -// CHECK:STDOUT: %bound_method.loc18_3.1: = bound_method %ycopy.var, %impl.elem0.loc18_3.1 -// CHECK:STDOUT: %specific_impl_fn.loc18_3.1: = specific_impl_function %impl.elem0.loc18_3.1, @Destroy.Op(constants.%Destroy.facet.f26842.2) [symbolic = %specific_impl_fn.loc18_3.2 (constants.%specific_impl_fn.21ccd1.2)] -// CHECK:STDOUT: %bound_method.loc18_3.2: = bound_method %ycopy.var, %specific_impl_fn.loc18_3.1 -// CHECK:STDOUT: %addr.loc18: @Compound4.%ptr (%ptr.87f2ee.3) = addr_of %ycopy.var -// CHECK:STDOUT: %.loc18_3.2: init %empty_tuple.type = call %bound_method.loc18_3.2(%addr.loc18) +// CHECK:STDOUT: %.loc17_4.1: ref @Compound4.%V.as_type.loc15_25.1 (%V.as_type) = deref %p.ref +// CHECK:STDOUT: %impl.elem1.loc17_4.1: @Compound4.%.loc17_4.2 (%.9b5ba3.2) = impl_witness_access constants.%L1.lookup_impl_witness.d9f5df.2, element1 [symbolic = %impl.elem1.loc17_4.2 (constants.%impl.elem1.d07d0e.2)] +// CHECK:STDOUT: %bound_method.loc17_4: = bound_method %.loc17_4.1, %impl.elem1.loc17_4.1 +// CHECK:STDOUT: %specific_impl_fn.loc17_4.1: = specific_impl_function %impl.elem1.loc17_4.1, @L1.S1(constants.%L1.facet.1cc812.2) [symbolic = %specific_impl_fn.loc17_4.2 (constants.%specific_impl_fn.2473a0.2)] +// CHECK:STDOUT: %bound_method.loc17_14: = bound_method %.loc17_4.1, %specific_impl_fn.loc17_4.1 +// CHECK:STDOUT: %addr: @Compound4.%ptr.loc15_32.1 (%ptr.87f2ee.3) = addr_of %.loc17_4.1 +// CHECK:STDOUT: %.loc17_14: init %empty_tuple.type = call %bound_method.loc17_14(%addr) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @L1.R1(constants.%Self.112) { -// CHECK:STDOUT: %Self => constants.%Self.112 -// CHECK:STDOUT: %Self.as_type.loc4_15.1 => constants.%Self.as_type.351 +// CHECK:STDOUT: specific @L1.R1(constants.%Self) { +// CHECK:STDOUT: %Self => constants.%Self +// CHECK:STDOUT: %Self.as_type.loc4_15.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.cb4262.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @L1.S1(constants.%Self.112) { -// CHECK:STDOUT: %Self => constants.%Self.112 -// CHECK:STDOUT: %Self.as_type.loc5_24.1 => constants.%Self.as_type.351 +// CHECK:STDOUT: specific @L1.S1(constants.%Self) { +// CHECK:STDOUT: %Self => constants.%Self +// CHECK:STDOUT: %Self.as_type.loc5_24.1 => constants.%Self.as_type // CHECK:STDOUT: %ptr.loc5_24.1 => constants.%ptr.87f2ee.1 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c0652c.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Simple4(constants.%T.112) { -// CHECK:STDOUT: %T.loc9_12.1 => constants.%T.112 +// CHECK:STDOUT: specific @Simple4(constants.%T) { +// CHECK:STDOUT: %T.loc9_12.1 => constants.%T // CHECK:STDOUT: %T.as_type.loc9_23.1 => constants.%T.as_type -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.cb4262.2 +// CHECK:STDOUT: %pattern_type.loc9_20 => constants.%pattern_type.cb4262.2 +// CHECK:STDOUT: %ptr.loc9_30.1 => constants.%ptr.87f2ee.2 +// CHECK:STDOUT: %pattern_type.loc9_26 => constants.%pattern_type.c0652c.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @L1.R1(constants.%L1.facet.1cc812.1) { @@ -1005,9 +963,11 @@ fn Works() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Compound4(constants.%V) { -// CHECK:STDOUT: %V.loc16_14.1 => constants.%V -// CHECK:STDOUT: %V.as_type.loc16_25.1 => constants.%V.as_type -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.cb4262.3 +// CHECK:STDOUT: %V.loc15_14.1 => constants.%V +// CHECK:STDOUT: %V.as_type.loc15_25.1 => constants.%V.as_type +// CHECK:STDOUT: %pattern_type.loc15_22 => constants.%pattern_type.cb4262.3 +// CHECK:STDOUT: %ptr.loc15_32.1 => constants.%ptr.87f2ee.3 +// CHECK:STDOUT: %pattern_type.loc15_28 => constants.%pattern_type.c0652c.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @L1.R1(constants.%L1.facet.1cc812.2) { @@ -1292,7 +1252,7 @@ fn Works() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.BitAndWith: %BitAndWith.type.f2e = import_ref Core//prelude, BitAndWith, loaded [concrete = constants.%BitAndWith.generic] -// CHECK:STDOUT: %Core.import_ref.a4f: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude, loc13_42, loaded [concrete = constants.%type.as.BitAndWith.impl.Op] +// CHECK:STDOUT: %Core.import_ref.a4f: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude, loc14_42, loaded [concrete = constants.%type.as.BitAndWith.impl.Op] // CHECK:STDOUT: %BitAndWith.impl_witness_table = impl_witness_table (%Core.import_ref.a4f), @type.as.BitAndWith.impl [concrete] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: } @@ -1499,7 +1459,7 @@ fn Works() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.BitAndWith: %BitAndWith.type.f2e = import_ref Core//prelude, BitAndWith, loaded [concrete = constants.%BitAndWith.generic] -// CHECK:STDOUT: %Core.import_ref.a4f: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude, loc13_42, loaded [concrete = constants.%type.as.BitAndWith.impl.Op] +// CHECK:STDOUT: %Core.import_ref.a4f: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude, loc14_42, loaded [concrete = constants.%type.as.BitAndWith.impl.Op] // CHECK:STDOUT: %BitAndWith.impl_witness_table = impl_witness_table (%Core.import_ref.a4f), @type.as.BitAndWith.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon b/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon index 9c338ad36610..2677af824b01 100644 --- a/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon +++ b/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon @@ -67,7 +67,7 @@ interface I { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/generic_method.carbon b/toolchain/check/testdata/interface/generic_method.carbon index e8fc60819330..256d2a67711e 100644 --- a/toolchain/check/testdata/interface/generic_method.carbon +++ b/toolchain/check/testdata/interface/generic_method.carbon @@ -18,7 +18,7 @@ library "[[@TEST_NAME]]"; // T has index 0, Self has index 1, U has index 2. interface A(T:! type) { - fn F(U:! type, u: U) -> (T, Self, U); + fn F(U:! type, u: U*) -> (T, Self, U*); } class X {} @@ -28,17 +28,19 @@ class Z {} impl Y as A(X) { // Here, U has index 0. The specific used for A.F needs to renumber its U from // index 2 to index 0. - fn F(U:! type, u: U) -> (X, Y, U) { + fn F(U:! type, u: U*) -> (X, Y, U*) { return ({}, {}, u); } } fn Call() { - (Y as A(X)).F(Z, {}); + var u: Z; + (Y as A(X)).F(Z, &u); } fn CallGeneric(T:! A(X)) { - T.F(Z, {}); + var u: Z; + T.F(Z, &u); } fn CallIndirect() { @@ -94,11 +96,12 @@ fn CallIndirect() { // CHECK:STDOUT: %A.type.806: type = facet_type <@A, @A(%T.8b3)> [symbolic] // CHECK:STDOUT: %Self.b74: %A.type.806 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %U.2cb: type = bind_symbolic_name U, 2 [symbolic] -// CHECK:STDOUT: %pattern_type.20f: type = pattern_type %U.2cb [symbolic] +// CHECK:STDOUT: %ptr.204: type = ptr_type %U.2cb [symbolic] +// CHECK:STDOUT: %pattern_type.eee: type = pattern_type %ptr.204 [symbolic] // CHECK:STDOUT: %tuple.type.4c5: type = tuple_type (type, %A.type.806, type) [symbolic] // CHECK:STDOUT: %Self.as_type.327: type = facet_access_type %Self.b74 [symbolic] -// CHECK:STDOUT: %tuple.type.6ec: type = tuple_type (%T.8b3, %Self.as_type.327, %U.2cb) [symbolic] -// CHECK:STDOUT: %pattern_type.e2e: type = pattern_type %tuple.type.6ec [symbolic] +// CHECK:STDOUT: %tuple.type.5a8: type = tuple_type (%T.8b3, %Self.as_type.327, %ptr.204) [symbolic] +// CHECK:STDOUT: %pattern_type.0eb: type = pattern_type %tuple.type.5a8 [symbolic] // CHECK:STDOUT: %A.F.type.17a: type = fn_type @A.F, @A(%T.8b3) [symbolic] // CHECK:STDOUT: %A.F.0d8: %A.F.type.17a = struct_value () [symbolic] // CHECK:STDOUT: %A.assoc_type.ed3: type = assoc_entity_type @A, @A(%T.8b3) [symbolic] @@ -134,71 +137,91 @@ fn CallIndirect() { // CHECK:STDOUT: %assoc0.5f6: %A.assoc_type.296 = assoc_entity element0, @A.%A.F.decl [concrete] // CHECK:STDOUT: %A.impl_witness: = impl_witness file.%A.impl_witness_table [concrete] // CHECK:STDOUT: %U.8b3: type = bind_symbolic_name U, 0 [symbolic] -// CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %U.8b3 [symbolic] +// CHECK:STDOUT: %ptr.79f131.1: type = ptr_type %U.8b3 [symbolic] +// CHECK:STDOUT: %pattern_type.afe393.1: type = pattern_type %ptr.79f131.1 [symbolic] // CHECK:STDOUT: %tuple.type.ff9: type = tuple_type (type, type, type) [concrete] -// CHECK:STDOUT: %tuple.type.765: type = tuple_type (%X, %Y, %U.8b3) [symbolic] -// CHECK:STDOUT: %pattern_type.340: type = pattern_type %tuple.type.765 [symbolic] +// CHECK:STDOUT: %tuple.type.c14: type = tuple_type (%X, %Y, %ptr.79f131.1) [symbolic] +// CHECK:STDOUT: %pattern_type.ac9: type = pattern_type %tuple.type.c14 [symbolic] // CHECK:STDOUT: %Y.as.A.impl.F.type: type = fn_type @Y.as.A.impl.F [concrete] // CHECK:STDOUT: %Y.as.A.impl.F: %Y.as.A.impl.F.type = struct_value () [concrete] // CHECK:STDOUT: %A.facet.f2b: %A.type.515 = facet_value %Y, (%A.impl_witness) [concrete] // CHECK:STDOUT: %tuple.type.281: type = tuple_type (type, %A.type.515, type) [concrete] -// CHECK:STDOUT: %require_complete.816: = require_complete_type %tuple.type.765 [symbolic] -// CHECK:STDOUT: %require_complete.4ae: = require_complete_type %U.8b3 [symbolic] -// CHECK:STDOUT: %tuple.type.a41: type = tuple_type (%empty_struct_type, %empty_struct_type, %U.8b3) [symbolic] +// CHECK:STDOUT: %require_complete.86f: = require_complete_type %tuple.type.c14 [symbolic] +// CHECK:STDOUT: %require_complete.6e5e64.1: = require_complete_type %ptr.79f131.1 [symbolic] +// CHECK:STDOUT: %tuple.type.e44: type = tuple_type (%empty_struct_type, %empty_struct_type, %ptr.79f131.1) [symbolic] // CHECK:STDOUT: %X.val: %X = struct_value () [concrete] // CHECK:STDOUT: %Y.val: %Y = struct_value () [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.f23dbd.1: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.8b3) [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.abf12b.1: %ptr.as.Copy.impl.Op.type.f23dbd.1 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.lookup_impl_witness.cb2: = lookup_impl_witness %ptr.79f131.1, @Copy [symbolic] +// CHECK:STDOUT: %Copy.facet.def: %Copy.type = facet_value %ptr.79f131.1, (%Copy.lookup_impl_witness.cb2) [symbolic] +// CHECK:STDOUT: %.fe5: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.def [symbolic] +// CHECK:STDOUT: %impl.elem0.429: %.fe5 = impl_witness_access %Copy.lookup_impl_witness.cb2, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.d8a: = specific_impl_function %impl.elem0.429, @Copy.Op(%Copy.facet.def) [symbolic] // CHECK:STDOUT: %Call.type: type = fn_type @Call [concrete] // CHECK:STDOUT: %Call: %Call.type = struct_value () [concrete] -// CHECK:STDOUT: %.7c0: type = fn_type_with_self_type %A.F.type.13d, %A.facet.f2b [concrete] // CHECK:STDOUT: %pattern_type.8f9: type = pattern_type %Z [concrete] -// CHECK:STDOUT: %tuple.type.f6b: type = tuple_type (%X, %Y, %Z) [concrete] -// CHECK:STDOUT: %pattern_type.ef1: type = pattern_type %tuple.type.f6b [concrete] +// CHECK:STDOUT: %.7c0: type = fn_type_with_self_type %A.F.type.13d, %A.facet.f2b [concrete] +// CHECK:STDOUT: %tuple.type.092: type = tuple_type (%X, %Y, %ptr.fb6) [concrete] +// CHECK:STDOUT: %pattern_type.48d: type = pattern_type %tuple.type.092 [concrete] // CHECK:STDOUT: %Y.as.A.impl.F.specific_fn: = specific_function %Y.as.A.impl.F, @Y.as.A.impl.F(%Z) [concrete] -// CHECK:STDOUT: %Z.val: %Z = struct_value () [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.type.305: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%T.8b3) [symbolic] // CHECK:STDOUT: %T.as.Destroy.impl.Op.e3a: %T.as.Destroy.impl.Op.type.305 = struct_value () [symbolic] -// CHECK:STDOUT: %Destroy.impl_witness.324: = impl_witness imports.%Destroy.impl_witness_table, @T.as.Destroy.impl(%tuple.type.f6b) [concrete] -// CHECK:STDOUT: %T.as.Destroy.impl.Op.type.6ad: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%tuple.type.f6b) [concrete] -// CHECK:STDOUT: %T.as.Destroy.impl.Op.47b: %T.as.Destroy.impl.Op.type.6ad = struct_value () [concrete] -// CHECK:STDOUT: %ptr.959: type = ptr_type %tuple.type.f6b [concrete] -// CHECK:STDOUT: %complete_type.456: = complete_type_witness %ptr.959 [concrete] -// CHECK:STDOUT: %Destroy.facet.0e8: %Destroy.type = facet_value %tuple.type.f6b, (%Destroy.impl_witness.324) [concrete] -// CHECK:STDOUT: %.c95: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.0e8 [concrete] -// CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: = specific_function %T.as.Destroy.impl.Op.47b, @T.as.Destroy.impl.Op(%tuple.type.f6b) [concrete] +// CHECK:STDOUT: %Destroy.impl_witness.d7d: = impl_witness imports.%Destroy.impl_witness_table, @T.as.Destroy.impl(%tuple.type.092) [concrete] +// CHECK:STDOUT: %T.as.Destroy.impl.Op.type.dde: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%tuple.type.092) [concrete] +// CHECK:STDOUT: %T.as.Destroy.impl.Op.64e: %T.as.Destroy.impl.Op.type.dde = struct_value () [concrete] +// CHECK:STDOUT: %ptr.5df: type = ptr_type %tuple.type.092 [concrete] +// CHECK:STDOUT: %complete_type.aab: = complete_type_witness %ptr.5df [concrete] +// CHECK:STDOUT: %Destroy.facet.ed1: %Destroy.type = facet_value %tuple.type.092, (%Destroy.impl_witness.d7d) [concrete] +// CHECK:STDOUT: %.928: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.ed1 [concrete] +// CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: = specific_function %T.as.Destroy.impl.Op.64e, @T.as.Destroy.impl.Op(%tuple.type.092) [concrete] // CHECK:STDOUT: %T.3b6: %A.type.515 = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.05f: type = pattern_type %A.type.515 [concrete] // CHECK:STDOUT: %CallGeneric.type: type = fn_type @CallGeneric [concrete] // CHECK:STDOUT: %CallGeneric: %CallGeneric.type = struct_value () [concrete] -// CHECK:STDOUT: %T.as_type: type = facet_access_type %T.3b6 [symbolic] +// CHECK:STDOUT: %T.as_type.fc2: type = facet_access_type %T.3b6 [symbolic] // CHECK:STDOUT: %A.lookup_impl_witness: = lookup_impl_witness %T.3b6, @A, @A(%X) [symbolic] -// CHECK:STDOUT: %A.facet.97b: %A.type.515 = facet_value %T.as_type, (%A.lookup_impl_witness) [symbolic] +// CHECK:STDOUT: %A.facet.97b: %A.type.515 = facet_value %T.as_type.fc2, (%A.lookup_impl_witness) [symbolic] // CHECK:STDOUT: %.7c8: type = fn_type_with_self_type %A.F.type.13d, %A.facet.97b [symbolic] // CHECK:STDOUT: %impl.elem0.eda: %.7c8 = impl_witness_access %A.lookup_impl_witness, element0 [symbolic] -// CHECK:STDOUT: %tuple.type.379: type = tuple_type (%X, %T.as_type, %Z) [symbolic] -// CHECK:STDOUT: %pattern_type.fcb: type = pattern_type %tuple.type.379 [symbolic] +// CHECK:STDOUT: %tuple.type.fd8: type = tuple_type (%X, %T.as_type.fc2, %ptr.fb6) [symbolic] +// CHECK:STDOUT: %pattern_type.1d1: type = pattern_type %tuple.type.fd8 [symbolic] // CHECK:STDOUT: %specific_impl_fn.9ce: = specific_impl_function %impl.elem0.eda, @A.F(%X, %A.facet.97b, %Z) [symbolic] -// CHECK:STDOUT: %require_complete.d0c: = require_complete_type %tuple.type.379 [symbolic] -// CHECK:STDOUT: %ptr.e41: type = ptr_type %tuple.type.379 [symbolic] -// CHECK:STDOUT: %require_complete.1f9: = require_complete_type %ptr.e41 [symbolic] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %tuple.type.379, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.facet.a89: %Destroy.type = facet_value %tuple.type.379, (%Destroy.lookup_impl_witness) [symbolic] -// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.a89 [symbolic] -// CHECK:STDOUT: %impl.elem0.80a: %.a0b = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.515: = specific_impl_function %impl.elem0.80a, @Destroy.Op(%Destroy.facet.a89) [symbolic] +// CHECK:STDOUT: %require_complete.f71: = require_complete_type %tuple.type.fd8 [symbolic] +// CHECK:STDOUT: %ptr.1b6: type = ptr_type %tuple.type.fd8 [symbolic] +// CHECK:STDOUT: %require_complete.cda: = require_complete_type %ptr.1b6 [symbolic] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %tuple.type.fd8, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.facet.709: %Destroy.type = facet_value %tuple.type.fd8, (%Destroy.lookup_impl_witness) [symbolic] +// CHECK:STDOUT: %.768: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.709 [symbolic] +// CHECK:STDOUT: %impl.elem0.c2c: %.768 = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.5e2: = specific_impl_function %impl.elem0.c2c, @Destroy.Op(%Destroy.facet.709) [symbolic] // CHECK:STDOUT: %CallIndirect.type: type = fn_type @CallIndirect [concrete] // CHECK:STDOUT: %CallIndirect: %CallIndirect.type = struct_value () [concrete] // CHECK:STDOUT: %CallGeneric.specific_fn: = specific_function %CallGeneric, @CallGeneric(%A.facet.f2b) [concrete] -// CHECK:STDOUT: %complete_type.a64: = complete_type_witness %tuple.type.f6b [concrete] -// CHECK:STDOUT: %tuple.type.9c8: type = tuple_type (%empty_struct_type, %empty_struct_type, %Z) [concrete] +// CHECK:STDOUT: %complete_type.05d: = complete_type_witness %tuple.type.092 [concrete] +// CHECK:STDOUT: %complete_type.d3e: = complete_type_witness %ptr.fb6 [concrete] +// CHECK:STDOUT: %tuple.type.953: type = tuple_type (%empty_struct_type, %empty_struct_type, %ptr.fb6) [concrete] +// CHECK:STDOUT: %Copy.impl_witness.f8c: = impl_witness imports.%Copy.impl_witness_table.a71, @ptr.as.Copy.impl(%Z) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.0d9: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%Z) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.ac3: %ptr.as.Copy.impl.Op.type.0d9 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.27d: %Copy.type = facet_value %ptr.fb6, (%Copy.impl_witness.f8c) [concrete] +// CHECK:STDOUT: %.67f: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.27d [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.ac3, @ptr.as.Copy.impl.Op(%Z) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Destroy = %Core.Destroy +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.de9: @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op.type (%ptr.as.Copy.impl.Op.type.f23dbd.1) = import_ref Core//prelude/parts/copy, loc32_31, loaded [symbolic = @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op (constants.%ptr.as.Copy.impl.Op.abf12b.1)] +// CHECK:STDOUT: %Copy.impl_witness_table.a71 = impl_witness_table (%Core.import_ref.de9), @ptr.as.Copy.impl [concrete] // CHECK:STDOUT: %Core.import_ref.efe: @T.as.Destroy.impl.%T.as.Destroy.impl.Op.type (%T.as.Destroy.impl.Op.type.305) = import_ref Core//prelude/parts/destroy, loc8_29, loaded [symbolic = @T.as.Destroy.impl.%T.as.Destroy.impl.Op (constants.%T.as.Destroy.impl.Op.e3a)] // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (%Core.import_ref.efe), @T.as.Destroy.impl [concrete] // CHECK:STDOUT: } @@ -236,13 +259,13 @@ fn CallIndirect() { // CHECK:STDOUT: %CallGeneric.decl: %CallGeneric.type = fn_decl @CallGeneric [concrete = constants.%CallGeneric] { // CHECK:STDOUT: %T.patt: %pattern_type.05f = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc25: type = splice_block %A.type [concrete = constants.%A.type.515] { +// CHECK:STDOUT: %.loc26: type = splice_block %A.type [concrete = constants.%A.type.515] { // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %A.ref: %A.type.495 = name_ref A, file.%A.decl [concrete = constants.%A.generic] // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %A.type: type = facet_type <@A, @A(constants.%X)> [concrete = constants.%A.type.515] // CHECK:STDOUT: } -// CHECK:STDOUT: %T.loc25_16.2: %A.type.515 = bind_symbolic_name T, 0 [symbolic = %T.loc25_16.1 (constants.%T.3b6)] +// CHECK:STDOUT: %T.loc26_16.2: %A.type.515 = bind_symbolic_name T, 0 [symbolic = %T.loc26_16.1 (constants.%T.3b6)] // CHECK:STDOUT: } // CHECK:STDOUT: %CallIndirect.decl: %CallIndirect.type = fn_decl @CallIndirect [concrete = constants.%CallIndirect] {} {} // CHECK:STDOUT: } @@ -256,39 +279,43 @@ fn CallIndirect() { // CHECK:STDOUT: %A.F.type: type = fn_type @A.F, @A(%T.loc5_13.1) [symbolic = %A.F.type (constants.%A.F.type.17a)] // CHECK:STDOUT: %A.F: @A.%A.F.type (%A.F.type.17a) = struct_value () [symbolic = %A.F (constants.%A.F.0d8)] // CHECK:STDOUT: %A.assoc_type: type = assoc_entity_type @A, @A(%T.loc5_13.1) [symbolic = %A.assoc_type (constants.%A.assoc_type.ed3)] -// CHECK:STDOUT: %assoc0.loc6_39.2: @A.%A.assoc_type (%A.assoc_type.ed3) = assoc_entity element0, %A.F.decl [symbolic = %assoc0.loc6_39.2 (constants.%assoc0.fcb)] +// CHECK:STDOUT: %assoc0.loc6_41.2: @A.%A.assoc_type (%A.assoc_type.ed3) = assoc_entity element0, %A.F.decl [symbolic = %assoc0.loc6_41.2 (constants.%assoc0.fcb)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: %Self.1: @A.%A.type (%A.type.806) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.b74)] // CHECK:STDOUT: %A.F.decl: @A.%A.F.type (%A.F.type.17a) = fn_decl @A.F [symbolic = @A.%A.F (constants.%A.F.0d8)] { // CHECK:STDOUT: %U.patt: %pattern_type.98f = symbolic_binding_pattern U, 2 [concrete] -// CHECK:STDOUT: %u.patt: @A.F.%pattern_type.loc6_18 (%pattern_type.20f) = binding_pattern u [concrete] -// CHECK:STDOUT: %u.param_patt: @A.F.%pattern_type.loc6_18 (%pattern_type.20f) = value_param_pattern %u.patt, call_param0 [concrete] -// CHECK:STDOUT: %return.patt: @A.F.%pattern_type.loc6_24 (%pattern_type.e2e) = return_slot_pattern [concrete] -// CHECK:STDOUT: %return.param_patt: @A.F.%pattern_type.loc6_24 (%pattern_type.e2e) = out_param_pattern %return.patt, call_param1 [concrete] +// CHECK:STDOUT: %u.patt: @A.F.%pattern_type.loc6_18 (%pattern_type.eee) = binding_pattern u [concrete] +// CHECK:STDOUT: %u.param_patt: @A.F.%pattern_type.loc6_18 (%pattern_type.eee) = value_param_pattern %u.patt, call_param0 [concrete] +// CHECK:STDOUT: %return.patt: @A.F.%pattern_type.loc6_25 (%pattern_type.0eb) = return_slot_pattern [concrete] +// CHECK:STDOUT: %return.param_patt: @A.F.%pattern_type.loc6_25 (%pattern_type.0eb) = out_param_pattern %return.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref: type = name_ref T, @A.%T.loc5_13.2 [symbolic = %T (constants.%T.8b3)] -// CHECK:STDOUT: %.loc6_31: @A.F.%A.type (%A.type.806) = specific_constant @A.%Self.1, @A(constants.%T.8b3) [symbolic = %Self (constants.%Self.b74)] -// CHECK:STDOUT: %Self.ref: @A.F.%A.type (%A.type.806) = name_ref Self, %.loc6_31 [symbolic = %Self (constants.%Self.b74)] -// CHECK:STDOUT: %U.ref.loc6_37: type = name_ref U, %U.loc6_8.2 [symbolic = %U.loc6_8.1 (constants.%U.2cb)] -// CHECK:STDOUT: %.loc6_38.1: @A.F.%tuple.type.loc6_38.1 (%tuple.type.4c5) = tuple_literal (%T.ref, %Self.ref, %U.ref.loc6_37) -// CHECK:STDOUT: %Self.as_type.loc6_38.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc6_38.1 (constants.%Self.as_type.327)] -// CHECK:STDOUT: %.loc6_38.2: type = converted %Self.ref, %Self.as_type.loc6_38.2 [symbolic = %Self.as_type.loc6_38.1 (constants.%Self.as_type.327)] -// CHECK:STDOUT: %.loc6_38.3: type = converted %.loc6_38.1, constants.%tuple.type.6ec [symbolic = %tuple.type.loc6_38.2 (constants.%tuple.type.6ec)] +// CHECK:STDOUT: %.loc6_32: @A.F.%A.type (%A.type.806) = specific_constant @A.%Self.1, @A(constants.%T.8b3) [symbolic = %Self (constants.%Self.b74)] +// CHECK:STDOUT: %Self.ref: @A.F.%A.type (%A.type.806) = name_ref Self, %.loc6_32 [symbolic = %Self (constants.%Self.b74)] +// CHECK:STDOUT: %U.ref.loc6_38: type = name_ref U, %U.loc6_8.2 [symbolic = %U.loc6_8.1 (constants.%U.2cb)] +// CHECK:STDOUT: %ptr.loc6_39: type = ptr_type %U.ref.loc6_38 [symbolic = %ptr.loc6_22.1 (constants.%ptr.204)] +// CHECK:STDOUT: %.loc6_40.1: @A.F.%tuple.type.loc6_40.1 (%tuple.type.4c5) = tuple_literal (%T.ref, %Self.ref, %ptr.loc6_39) +// CHECK:STDOUT: %Self.as_type.loc6_40.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc6_40.1 (constants.%Self.as_type.327)] +// CHECK:STDOUT: %.loc6_40.2: type = converted %Self.ref, %Self.as_type.loc6_40.2 [symbolic = %Self.as_type.loc6_40.1 (constants.%Self.as_type.327)] +// CHECK:STDOUT: %.loc6_40.3: type = converted %.loc6_40.1, constants.%tuple.type.5a8 [symbolic = %tuple.type.loc6_40.2 (constants.%tuple.type.5a8)] // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %U.loc6_8.2: type = bind_symbolic_name U, 2 [symbolic = %U.loc6_8.1 (constants.%U.2cb)] -// CHECK:STDOUT: %u.param: @A.F.%U.loc6_8.1 (%U.2cb) = value_param call_param0 -// CHECK:STDOUT: %U.ref.loc6_21: type = name_ref U, %U.loc6_8.2 [symbolic = %U.loc6_8.1 (constants.%U.2cb)] -// CHECK:STDOUT: %u: @A.F.%U.loc6_8.1 (%U.2cb) = bind_name u, %u.param -// CHECK:STDOUT: %return.param: ref @A.F.%tuple.type.loc6_38.2 (%tuple.type.6ec) = out_param call_param1 -// CHECK:STDOUT: %return: ref @A.F.%tuple.type.loc6_38.2 (%tuple.type.6ec) = return_slot %return.param +// CHECK:STDOUT: %u.param: @A.F.%ptr.loc6_22.1 (%ptr.204) = value_param call_param0 +// CHECK:STDOUT: %.loc6_22: type = splice_block %ptr.loc6_22.2 [symbolic = %ptr.loc6_22.1 (constants.%ptr.204)] { +// CHECK:STDOUT: %U.ref.loc6_21: type = name_ref U, %U.loc6_8.2 [symbolic = %U.loc6_8.1 (constants.%U.2cb)] +// CHECK:STDOUT: %ptr.loc6_22.2: type = ptr_type %U.ref.loc6_21 [symbolic = %ptr.loc6_22.1 (constants.%ptr.204)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %u: @A.F.%ptr.loc6_22.1 (%ptr.204) = bind_name u, %u.param +// CHECK:STDOUT: %return.param: ref @A.F.%tuple.type.loc6_40.2 (%tuple.type.5a8) = out_param call_param1 +// CHECK:STDOUT: %return: ref @A.F.%tuple.type.loc6_40.2 (%tuple.type.5a8) = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %assoc0.loc6_39.1: @A.%A.assoc_type (%A.assoc_type.ed3) = assoc_entity element0, %A.F.decl [symbolic = %assoc0.loc6_39.2 (constants.%assoc0.fcb)] +// CHECK:STDOUT: %assoc0.loc6_41.1: @A.%A.assoc_type (%A.assoc_type.ed3) = assoc_entity element0, %A.F.decl [symbolic = %assoc0.loc6_41.2 (constants.%assoc0.fcb)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self.1 // CHECK:STDOUT: .T = -// CHECK:STDOUT: .F = %assoc0.loc6_39.1 +// CHECK:STDOUT: .F = %assoc0.loc6_41.1 // CHECK:STDOUT: witness = (%A.F.decl) // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -344,23 +371,27 @@ fn CallIndirect() { // CHECK:STDOUT: impl @Y.as.A.impl: %Y.ref as %A.type { // CHECK:STDOUT: %Y.as.A.impl.F.decl: %Y.as.A.impl.F.type = fn_decl @Y.as.A.impl.F [concrete = constants.%Y.as.A.impl.F] { // CHECK:STDOUT: %U.patt: %pattern_type.98f = symbolic_binding_pattern U, 0 [concrete] -// CHECK:STDOUT: %u.patt: @Y.as.A.impl.F.%pattern_type.loc16_18 (%pattern_type.7dc) = binding_pattern u [concrete] -// CHECK:STDOUT: %u.param_patt: @Y.as.A.impl.F.%pattern_type.loc16_18 (%pattern_type.7dc) = value_param_pattern %u.patt, call_param0 [concrete] -// CHECK:STDOUT: %return.patt: @Y.as.A.impl.F.%pattern_type.loc16_24 (%pattern_type.340) = return_slot_pattern [concrete] -// CHECK:STDOUT: %return.param_patt: @Y.as.A.impl.F.%pattern_type.loc16_24 (%pattern_type.340) = out_param_pattern %return.patt, call_param1 [concrete] +// CHECK:STDOUT: %u.patt: @Y.as.A.impl.F.%pattern_type.loc16_18 (%pattern_type.afe393.1) = binding_pattern u [concrete] +// CHECK:STDOUT: %u.param_patt: @Y.as.A.impl.F.%pattern_type.loc16_18 (%pattern_type.afe393.1) = value_param_pattern %u.patt, call_param0 [concrete] +// CHECK:STDOUT: %return.patt: @Y.as.A.impl.F.%pattern_type.loc16_25 (%pattern_type.ac9) = return_slot_pattern [concrete] +// CHECK:STDOUT: %return.param_patt: @Y.as.A.impl.F.%pattern_type.loc16_25 (%pattern_type.ac9) = out_param_pattern %return.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %Y.ref: type = name_ref Y, file.%Y.decl [concrete = constants.%Y] -// CHECK:STDOUT: %U.ref.loc16_34: type = name_ref U, %U.loc16_8.2 [symbolic = %U.loc16_8.1 (constants.%U.8b3)] -// CHECK:STDOUT: %.loc16_35.1: %tuple.type.ff9 = tuple_literal (%X.ref, %Y.ref, %U.ref.loc16_34) -// CHECK:STDOUT: %.loc16_35.2: type = converted %.loc16_35.1, constants.%tuple.type.765 [symbolic = %tuple.type.loc16 (constants.%tuple.type.765)] +// CHECK:STDOUT: %U.ref.loc16_35: type = name_ref U, %U.loc16_8.2 [symbolic = %U.loc16_8.1 (constants.%U.8b3)] +// CHECK:STDOUT: %ptr.loc16_36: type = ptr_type %U.ref.loc16_35 [symbolic = %ptr.loc16_22.1 (constants.%ptr.79f131.1)] +// CHECK:STDOUT: %.loc16_37.1: %tuple.type.ff9 = tuple_literal (%X.ref, %Y.ref, %ptr.loc16_36) +// CHECK:STDOUT: %.loc16_37.2: type = converted %.loc16_37.1, constants.%tuple.type.c14 [symbolic = %tuple.type.loc16 (constants.%tuple.type.c14)] // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %U.loc16_8.2: type = bind_symbolic_name U, 0 [symbolic = %U.loc16_8.1 (constants.%U.8b3)] -// CHECK:STDOUT: %u.param: @Y.as.A.impl.F.%U.loc16_8.1 (%U.8b3) = value_param call_param0 -// CHECK:STDOUT: %U.ref.loc16_21: type = name_ref U, %U.loc16_8.2 [symbolic = %U.loc16_8.1 (constants.%U.8b3)] -// CHECK:STDOUT: %u: @Y.as.A.impl.F.%U.loc16_8.1 (%U.8b3) = bind_name u, %u.param -// CHECK:STDOUT: %return.param: ref @Y.as.A.impl.F.%tuple.type.loc16 (%tuple.type.765) = out_param call_param1 -// CHECK:STDOUT: %return: ref @Y.as.A.impl.F.%tuple.type.loc16 (%tuple.type.765) = return_slot %return.param +// CHECK:STDOUT: %u.param: @Y.as.A.impl.F.%ptr.loc16_22.1 (%ptr.79f131.1) = value_param call_param0 +// CHECK:STDOUT: %.loc16_22: type = splice_block %ptr.loc16_22.2 [symbolic = %ptr.loc16_22.1 (constants.%ptr.79f131.1)] { +// CHECK:STDOUT: %U.ref.loc16_21: type = name_ref U, %U.loc16_8.2 [symbolic = %U.loc16_8.1 (constants.%U.8b3)] +// CHECK:STDOUT: %ptr.loc16_22.2: type = ptr_type %U.ref.loc16_21 [symbolic = %ptr.loc16_22.1 (constants.%ptr.79f131.1)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %u: @Y.as.A.impl.F.%ptr.loc16_22.1 (%ptr.79f131.1) = bind_name u, %u.param +// CHECK:STDOUT: %return.param: ref @Y.as.A.impl.F.%tuple.type.loc16 (%tuple.type.c14) = out_param call_param1 +// CHECK:STDOUT: %return: ref @Y.as.A.impl.F.%tuple.type.loc16 (%tuple.type.c14) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -408,16 +439,17 @@ fn CallIndirect() { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @A.F(@A.%T.loc5_13.2: type, @A.%Self.1: @A.%A.type (%A.type.806), %U.loc6_8.2: type) { // CHECK:STDOUT: %U.loc6_8.1: type = bind_symbolic_name U, 2 [symbolic = %U.loc6_8.1 (constants.%U.2cb)] -// CHECK:STDOUT: %pattern_type.loc6_18: type = pattern_type %U.loc6_8.1 [symbolic = %pattern_type.loc6_18 (constants.%pattern_type.20f)] +// CHECK:STDOUT: %ptr.loc6_22.1: type = ptr_type %U.loc6_8.1 [symbolic = %ptr.loc6_22.1 (constants.%ptr.204)] +// CHECK:STDOUT: %pattern_type.loc6_18: type = pattern_type %ptr.loc6_22.1 [symbolic = %pattern_type.loc6_18 (constants.%pattern_type.eee)] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.8b3)] // CHECK:STDOUT: %A.type: type = facet_type <@A, @A(%T)> [symbolic = %A.type (constants.%A.type.806)] // CHECK:STDOUT: %Self: @A.F.%A.type (%A.type.806) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.b74)] -// CHECK:STDOUT: %tuple.type.loc6_38.1: type = tuple_type (type, %A.type, type) [symbolic = %tuple.type.loc6_38.1 (constants.%tuple.type.4c5)] -// CHECK:STDOUT: %Self.as_type.loc6_38.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc6_38.1 (constants.%Self.as_type.327)] -// CHECK:STDOUT: %tuple.type.loc6_38.2: type = tuple_type (%T, %Self.as_type.loc6_38.1, %U.loc6_8.1) [symbolic = %tuple.type.loc6_38.2 (constants.%tuple.type.6ec)] -// CHECK:STDOUT: %pattern_type.loc6_24: type = pattern_type %tuple.type.loc6_38.2 [symbolic = %pattern_type.loc6_24 (constants.%pattern_type.e2e)] +// CHECK:STDOUT: %tuple.type.loc6_40.1: type = tuple_type (type, %A.type, type) [symbolic = %tuple.type.loc6_40.1 (constants.%tuple.type.4c5)] +// CHECK:STDOUT: %Self.as_type.loc6_40.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc6_40.1 (constants.%Self.as_type.327)] +// CHECK:STDOUT: %tuple.type.loc6_40.2: type = tuple_type (%T, %Self.as_type.loc6_40.1, %ptr.loc6_22.1) [symbolic = %tuple.type.loc6_40.2 (constants.%tuple.type.5a8)] +// CHECK:STDOUT: %pattern_type.loc6_25: type = pattern_type %tuple.type.loc6_40.2 [symbolic = %pattern_type.loc6_25 (constants.%pattern_type.0eb)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%u.param: @A.F.%U.loc6_8.1 (%U.2cb)) -> @A.F.%tuple.type.loc6_38.2 (%tuple.type.6ec); +// CHECK:STDOUT: fn(%u.param: @A.F.%ptr.loc6_22.1 (%ptr.204)) -> @A.F.%tuple.type.loc6_40.2 (%tuple.type.5a8); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @X.as.Destroy.impl.Op(%self.param: %ptr.d17) = "no_op"; @@ -428,118 +460,135 @@ fn CallIndirect() { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Y.as.A.impl.F(%U.loc16_8.2: type) { // CHECK:STDOUT: %U.loc16_8.1: type = bind_symbolic_name U, 0 [symbolic = %U.loc16_8.1 (constants.%U.8b3)] -// CHECK:STDOUT: %pattern_type.loc16_18: type = pattern_type %U.loc16_8.1 [symbolic = %pattern_type.loc16_18 (constants.%pattern_type.7dc)] -// CHECK:STDOUT: %tuple.type.loc16: type = tuple_type (constants.%X, constants.%Y, %U.loc16_8.1) [symbolic = %tuple.type.loc16 (constants.%tuple.type.765)] -// CHECK:STDOUT: %pattern_type.loc16_24: type = pattern_type %tuple.type.loc16 [symbolic = %pattern_type.loc16_24 (constants.%pattern_type.340)] +// CHECK:STDOUT: %ptr.loc16_22.1: type = ptr_type %U.loc16_8.1 [symbolic = %ptr.loc16_22.1 (constants.%ptr.79f131.1)] +// CHECK:STDOUT: %pattern_type.loc16_18: type = pattern_type %ptr.loc16_22.1 [symbolic = %pattern_type.loc16_18 (constants.%pattern_type.afe393.1)] +// CHECK:STDOUT: %tuple.type.loc16: type = tuple_type (constants.%X, constants.%Y, %ptr.loc16_22.1) [symbolic = %tuple.type.loc16 (constants.%tuple.type.c14)] +// CHECK:STDOUT: %pattern_type.loc16_25: type = pattern_type %tuple.type.loc16 [symbolic = %pattern_type.loc16_25 (constants.%pattern_type.ac9)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc16_24: = require_complete_type %tuple.type.loc16 [symbolic = %require_complete.loc16_24 (constants.%require_complete.816)] -// CHECK:STDOUT: %require_complete.loc16_19: = require_complete_type %U.loc16_8.1 [symbolic = %require_complete.loc16_19 (constants.%require_complete.4ae)] -// CHECK:STDOUT: %tuple.type.loc17: type = tuple_type (constants.%empty_struct_type, constants.%empty_struct_type, %U.loc16_8.1) [symbolic = %tuple.type.loc17 (constants.%tuple.type.a41)] +// CHECK:STDOUT: %require_complete.loc16_25: = require_complete_type %tuple.type.loc16 [symbolic = %require_complete.loc16_25 (constants.%require_complete.86f)] +// CHECK:STDOUT: %require_complete.loc16_19: = require_complete_type %ptr.loc16_22.1 [symbolic = %require_complete.loc16_19 (constants.%require_complete.6e5e64.1)] +// CHECK:STDOUT: %tuple.type.loc17: type = tuple_type (constants.%empty_struct_type, constants.%empty_struct_type, %ptr.loc16_22.1) [symbolic = %tuple.type.loc17 (constants.%tuple.type.e44)] +// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr.loc16_22.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.cb2)] +// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.loc16_22.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet.def)] +// CHECK:STDOUT: %.loc17_21.2: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc17_21.2 (constants.%.fe5)] +// CHECK:STDOUT: %impl.elem0.loc17_21.2: @Y.as.A.impl.F.%.loc17_21.2 (%.fe5) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc17_21.2 (constants.%impl.elem0.429)] +// CHECK:STDOUT: %specific_impl_fn.loc17_21.2: = specific_impl_function %impl.elem0.loc17_21.2, @Copy.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc17_21.2 (constants.%specific_impl_fn.d8a)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%u.param: @Y.as.A.impl.F.%U.loc16_8.1 (%U.8b3)) -> %return.param: @Y.as.A.impl.F.%tuple.type.loc16 (%tuple.type.765) { +// CHECK:STDOUT: fn(%u.param: @Y.as.A.impl.F.%ptr.loc16_22.1 (%ptr.79f131.1)) -> %return.param: @Y.as.A.impl.F.%tuple.type.loc16 (%tuple.type.c14) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc17_14.1: %empty_struct_type = struct_literal () // CHECK:STDOUT: %.loc17_18.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %u.ref: @Y.as.A.impl.F.%U.loc16_8.1 (%U.8b3) = name_ref u, %u -// CHECK:STDOUT: %.loc17_22.1: @Y.as.A.impl.F.%tuple.type.loc17 (%tuple.type.a41) = tuple_literal (%.loc17_14.1, %.loc17_18.1, %u.ref) +// CHECK:STDOUT: %u.ref: @Y.as.A.impl.F.%ptr.loc16_22.1 (%ptr.79f131.1) = name_ref u, %u +// CHECK:STDOUT: %.loc17_22.1: @Y.as.A.impl.F.%tuple.type.loc17 (%tuple.type.e44) = tuple_literal (%.loc17_14.1, %.loc17_18.1, %u.ref) // CHECK:STDOUT: %tuple.elem0: ref %X = tuple_access %return, element0 // CHECK:STDOUT: %.loc17_14.2: init %X = class_init (), %tuple.elem0 [concrete = constants.%X.val] // CHECK:STDOUT: %.loc17_22.2: init %X = converted %.loc17_14.1, %.loc17_14.2 [concrete = constants.%X.val] // CHECK:STDOUT: %tuple.elem1: ref %Y = tuple_access %return, element1 // CHECK:STDOUT: %.loc17_18.2: init %Y = class_init (), %tuple.elem1 [concrete = constants.%Y.val] // CHECK:STDOUT: %.loc17_22.3: init %Y = converted %.loc17_18.1, %.loc17_18.2 [concrete = constants.%Y.val] -// CHECK:STDOUT: %tuple.elem2: ref @Y.as.A.impl.F.%U.loc16_8.1 (%U.8b3) = tuple_access %return, element2 -// CHECK:STDOUT: %.loc17_22.4: init @Y.as.A.impl.F.%U.loc16_8.1 (%U.8b3) = initialize_from %u.ref to %tuple.elem2 -// CHECK:STDOUT: %.loc17_22.5: init @Y.as.A.impl.F.%tuple.type.loc16 (%tuple.type.765) = tuple_init (%.loc17_22.2, %.loc17_22.3, %.loc17_22.4) to %return -// CHECK:STDOUT: %.loc17_23: init @Y.as.A.impl.F.%tuple.type.loc16 (%tuple.type.765) = converted %.loc17_22.1, %.loc17_22.5 +// CHECK:STDOUT: %impl.elem0.loc17_21.1: @Y.as.A.impl.F.%.loc17_21.2 (%.fe5) = impl_witness_access constants.%Copy.lookup_impl_witness.cb2, element0 [symbolic = %impl.elem0.loc17_21.2 (constants.%impl.elem0.429)] +// CHECK:STDOUT: %bound_method.loc17_21.1: = bound_method %u.ref, %impl.elem0.loc17_21.1 +// CHECK:STDOUT: %specific_impl_fn.loc17_21.1: = specific_impl_function %impl.elem0.loc17_21.1, @Copy.Op(constants.%Copy.facet.def) [symbolic = %specific_impl_fn.loc17_21.2 (constants.%specific_impl_fn.d8a)] +// CHECK:STDOUT: %bound_method.loc17_21.2: = bound_method %u.ref, %specific_impl_fn.loc17_21.1 +// CHECK:STDOUT: %.loc17_21.1: init @Y.as.A.impl.F.%ptr.loc16_22.1 (%ptr.79f131.1) = call %bound_method.loc17_21.2(%u.ref) +// CHECK:STDOUT: %tuple.elem2: ref @Y.as.A.impl.F.%ptr.loc16_22.1 (%ptr.79f131.1) = tuple_access %return, element2 +// CHECK:STDOUT: %.loc17_22.4: init @Y.as.A.impl.F.%ptr.loc16_22.1 (%ptr.79f131.1) = initialize_from %.loc17_21.1 to %tuple.elem2 +// CHECK:STDOUT: %.loc17_22.5: init @Y.as.A.impl.F.%tuple.type.loc16 (%tuple.type.c14) = tuple_init (%.loc17_22.2, %.loc17_22.3, %.loc17_22.4) to %return +// CHECK:STDOUT: %.loc17_23: init @Y.as.A.impl.F.%tuple.type.loc16 (%tuple.type.c14) = converted %.loc17_22.1, %.loc17_22.5 // CHECK:STDOUT: return %.loc17_23 to %return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Call() { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %u.patt: %pattern_type.8f9 = binding_pattern u [concrete] +// CHECK:STDOUT: %u.var_patt: %pattern_type.8f9 = var_pattern %u.patt [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %u.var: ref %Z = var %u.var_patt +// CHECK:STDOUT: %Z.ref.loc22: type = name_ref Z, file.%Z.decl [concrete = constants.%Z] +// CHECK:STDOUT: %u: ref %Z = bind_name u, %u.var // CHECK:STDOUT: %Y.ref: type = name_ref Y, file.%Y.decl [concrete = constants.%Y] // CHECK:STDOUT: %A.ref: %A.type.495 = name_ref A, file.%A.decl [concrete = constants.%A.generic] // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %A.type: type = facet_type <@A, @A(constants.%X)> [concrete = constants.%A.type.515] // CHECK:STDOUT: %A.facet: %A.type.515 = facet_value constants.%Y, (constants.%A.impl_witness) [concrete = constants.%A.facet.f2b] -// CHECK:STDOUT: %.loc22_6: %A.type.515 = converted %Y.ref, %A.facet [concrete = constants.%A.facet.f2b] -// CHECK:STDOUT: %.loc22_14.1: %A.assoc_type.296 = specific_constant @A.%assoc0.loc6_39.1, @A(constants.%X) [concrete = constants.%assoc0.5f6] -// CHECK:STDOUT: %F.ref: %A.assoc_type.296 = name_ref F, %.loc22_14.1 [concrete = constants.%assoc0.5f6] -// CHECK:STDOUT: %as_type: type = facet_access_type %.loc22_6 [concrete = constants.%Y] -// CHECK:STDOUT: %.loc22_14.2: type = converted %.loc22_6, %as_type [concrete = constants.%Y] +// CHECK:STDOUT: %.loc23_6: %A.type.515 = converted %Y.ref, %A.facet [concrete = constants.%A.facet.f2b] +// CHECK:STDOUT: %.loc23_14.1: %A.assoc_type.296 = specific_constant @A.%assoc0.loc6_41.1, @A(constants.%X) [concrete = constants.%assoc0.5f6] +// CHECK:STDOUT: %F.ref: %A.assoc_type.296 = name_ref F, %.loc23_14.1 [concrete = constants.%assoc0.5f6] +// CHECK:STDOUT: %as_type: type = facet_access_type %.loc23_6 [concrete = constants.%Y] +// CHECK:STDOUT: %.loc23_14.2: type = converted %.loc23_6, %as_type [concrete = constants.%Y] // CHECK:STDOUT: %impl.elem0: %.7c0 = impl_witness_access constants.%A.impl_witness, element0 [concrete = constants.%Y.as.A.impl.F] -// CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z] -// CHECK:STDOUT: %.loc22_21.1: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %Z.ref.loc23: type = name_ref Z, file.%Z.decl [concrete = constants.%Z] +// CHECK:STDOUT: %u.ref: ref %Z = name_ref u, %u +// CHECK:STDOUT: %addr.loc23_20: %ptr.fb6 = addr_of %u.ref // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Y.as.A.impl.F(constants.%Z) [concrete = constants.%Y.as.A.impl.F.specific_fn] -// CHECK:STDOUT: %.loc22_22.1: ref %tuple.type.f6b = temporary_storage -// CHECK:STDOUT: %.loc22_21.2: ref %Z = temporary_storage -// CHECK:STDOUT: %.loc22_21.3: init %Z = class_init (), %.loc22_21.2 [concrete = constants.%Z.val] -// CHECK:STDOUT: %.loc22_21.4: ref %Z = temporary %.loc22_21.2, %.loc22_21.3 -// CHECK:STDOUT: %.loc22_21.5: ref %Z = converted %.loc22_21.1, %.loc22_21.4 -// CHECK:STDOUT: %.loc22_21.6: %Z = bind_value %.loc22_21.5 -// CHECK:STDOUT: %Y.as.A.impl.F.call: init %tuple.type.f6b = call %specific_fn(%.loc22_21.6) to %.loc22_22.1 -// CHECK:STDOUT: %.loc22_22.2: ref %tuple.type.f6b = temporary %.loc22_22.1, %Y.as.A.impl.F.call -// CHECK:STDOUT: %T.as.Destroy.impl.Op.bound: = bound_method %.loc22_22.2, constants.%T.as.Destroy.impl.Op.47b -// CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: = specific_function constants.%T.as.Destroy.impl.Op.47b, @T.as.Destroy.impl.Op(constants.%tuple.type.f6b) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method: = bound_method %.loc22_22.2, %T.as.Destroy.impl.Op.specific_fn -// CHECK:STDOUT: %addr.loc22_22: %ptr.959 = addr_of %.loc22_22.2 -// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr.loc22_22) -// CHECK:STDOUT: %Z.as.Destroy.impl.Op.bound: = bound_method %.loc22_21.4, constants.%Z.as.Destroy.impl.Op -// CHECK:STDOUT: %addr.loc22_21: %ptr.fb6 = addr_of %.loc22_21.4 -// CHECK:STDOUT: %Z.as.Destroy.impl.Op.call: init %empty_tuple.type = call %Z.as.Destroy.impl.Op.bound(%addr.loc22_21) +// CHECK:STDOUT: %.loc23_22.1: ref %tuple.type.092 = temporary_storage +// CHECK:STDOUT: %Y.as.A.impl.F.call: init %tuple.type.092 = call %specific_fn(%addr.loc23_20) to %.loc23_22.1 +// CHECK:STDOUT: %.loc23_22.2: ref %tuple.type.092 = temporary %.loc23_22.1, %Y.as.A.impl.F.call +// CHECK:STDOUT: %T.as.Destroy.impl.Op.bound: = bound_method %.loc23_22.2, constants.%T.as.Destroy.impl.Op.64e +// CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: = specific_function constants.%T.as.Destroy.impl.Op.64e, @T.as.Destroy.impl.Op(constants.%tuple.type.092) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method: = bound_method %.loc23_22.2, %T.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %addr.loc23_22: %ptr.5df = addr_of %.loc23_22.2 +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr.loc23_22) +// CHECK:STDOUT: %Z.as.Destroy.impl.Op.bound: = bound_method %u.var, constants.%Z.as.Destroy.impl.Op +// CHECK:STDOUT: %addr.loc22: %ptr.fb6 = addr_of %u.var +// CHECK:STDOUT: %Z.as.Destroy.impl.Op.call: init %empty_tuple.type = call %Z.as.Destroy.impl.Op.bound(%addr.loc22) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @CallGeneric(%T.loc25_16.2: %A.type.515) { -// CHECK:STDOUT: %T.loc25_16.1: %A.type.515 = bind_symbolic_name T, 0 [symbolic = %T.loc25_16.1 (constants.%T.3b6)] +// CHECK:STDOUT: generic fn @CallGeneric(%T.loc26_16.2: %A.type.515) { +// CHECK:STDOUT: %T.loc26_16.1: %A.type.515 = bind_symbolic_name T, 0 [symbolic = %T.loc26_16.1 (constants.%T.3b6)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %T.as_type.loc26_4.2: type = facet_access_type %T.loc25_16.1 [symbolic = %T.as_type.loc26_4.2 (constants.%T.as_type)] -// CHECK:STDOUT: %A.lookup_impl_witness: = lookup_impl_witness %T.loc25_16.1, @A, @A(constants.%X) [symbolic = %A.lookup_impl_witness (constants.%A.lookup_impl_witness)] -// CHECK:STDOUT: %A.facet: %A.type.515 = facet_value %T.as_type.loc26_4.2, (%A.lookup_impl_witness) [symbolic = %A.facet (constants.%A.facet.97b)] -// CHECK:STDOUT: %.loc26_4.3: type = fn_type_with_self_type constants.%A.F.type.13d, %A.facet [symbolic = %.loc26_4.3 (constants.%.7c8)] -// CHECK:STDOUT: %impl.elem0.loc26_4.2: @CallGeneric.%.loc26_4.3 (%.7c8) = impl_witness_access %A.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc26_4.2 (constants.%impl.elem0.eda)] -// CHECK:STDOUT: %specific_impl_fn.loc26_4.2: = specific_impl_function %impl.elem0.loc26_4.2, @A.F(constants.%X, %A.facet, constants.%Z) [symbolic = %specific_impl_fn.loc26_4.2 (constants.%specific_impl_fn.9ce)] -// CHECK:STDOUT: %tuple.type: type = tuple_type (constants.%X, %T.as_type.loc26_4.2, constants.%Z) [symbolic = %tuple.type (constants.%tuple.type.379)] -// CHECK:STDOUT: %require_complete.loc26_12.1: = require_complete_type %tuple.type [symbolic = %require_complete.loc26_12.1 (constants.%require_complete.d0c)] +// CHECK:STDOUT: %T.as_type.loc28_4.2: type = facet_access_type %T.loc26_16.1 [symbolic = %T.as_type.loc28_4.2 (constants.%T.as_type.fc2)] +// CHECK:STDOUT: %A.lookup_impl_witness: = lookup_impl_witness %T.loc26_16.1, @A, @A(constants.%X) [symbolic = %A.lookup_impl_witness (constants.%A.lookup_impl_witness)] +// CHECK:STDOUT: %A.facet: %A.type.515 = facet_value %T.as_type.loc28_4.2, (%A.lookup_impl_witness) [symbolic = %A.facet (constants.%A.facet.97b)] +// CHECK:STDOUT: %.loc28_4.3: type = fn_type_with_self_type constants.%A.F.type.13d, %A.facet [symbolic = %.loc28_4.3 (constants.%.7c8)] +// CHECK:STDOUT: %impl.elem0.loc28_4.2: @CallGeneric.%.loc28_4.3 (%.7c8) = impl_witness_access %A.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_4.2 (constants.%impl.elem0.eda)] +// CHECK:STDOUT: %specific_impl_fn.loc28_4.2: = specific_impl_function %impl.elem0.loc28_4.2, @A.F(constants.%X, %A.facet, constants.%Z) [symbolic = %specific_impl_fn.loc28_4.2 (constants.%specific_impl_fn.9ce)] +// CHECK:STDOUT: %tuple.type: type = tuple_type (constants.%X, %T.as_type.loc28_4.2, constants.%ptr.fb6) [symbolic = %tuple.type (constants.%tuple.type.fd8)] +// CHECK:STDOUT: %require_complete.loc28_12.1: = require_complete_type %tuple.type [symbolic = %require_complete.loc28_12.1 (constants.%require_complete.f71)] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %tuple.type, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %tuple.type, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.a89)] -// CHECK:STDOUT: %.loc26_12.5: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc26_12.5 (constants.%.a0b)] -// CHECK:STDOUT: %impl.elem0.loc26_12.2: @CallGeneric.%.loc26_12.5 (%.a0b) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc26_12.2 (constants.%impl.elem0.80a)] -// CHECK:STDOUT: %specific_impl_fn.loc26_12.2: = specific_impl_function %impl.elem0.loc26_12.2, @Destroy.Op(%Destroy.facet) [symbolic = %specific_impl_fn.loc26_12.2 (constants.%specific_impl_fn.515)] -// CHECK:STDOUT: %ptr: type = ptr_type %tuple.type [symbolic = %ptr (constants.%ptr.e41)] -// CHECK:STDOUT: %require_complete.loc26_12.2: = require_complete_type %ptr [symbolic = %require_complete.loc26_12.2 (constants.%require_complete.1f9)] +// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %tuple.type, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.709)] +// CHECK:STDOUT: %.loc28_12.5: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc28_12.5 (constants.%.768)] +// CHECK:STDOUT: %impl.elem0.loc28_12.2: @CallGeneric.%.loc28_12.5 (%.768) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_12.2 (constants.%impl.elem0.c2c)] +// CHECK:STDOUT: %specific_impl_fn.loc28_12.2: = specific_impl_function %impl.elem0.loc28_12.2, @Destroy.Op(%Destroy.facet) [symbolic = %specific_impl_fn.loc28_12.2 (constants.%specific_impl_fn.5e2)] +// CHECK:STDOUT: %ptr: type = ptr_type %tuple.type [symbolic = %ptr (constants.%ptr.1b6)] +// CHECK:STDOUT: %require_complete.loc28_12.2: = require_complete_type %ptr [symbolic = %require_complete.loc28_12.2 (constants.%require_complete.cda)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %T.ref: %A.type.515 = name_ref T, %T.loc25_16.2 [symbolic = %T.loc25_16.1 (constants.%T.3b6)] -// CHECK:STDOUT: %.loc26_4.1: %A.assoc_type.296 = specific_constant @A.%assoc0.loc6_39.1, @A(constants.%X) [concrete = constants.%assoc0.5f6] -// CHECK:STDOUT: %F.ref: %A.assoc_type.296 = name_ref F, %.loc26_4.1 [concrete = constants.%assoc0.5f6] -// CHECK:STDOUT: %T.as_type.loc26_4.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc26_4.2 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc26_4.2: type = converted %T.ref, %T.as_type.loc26_4.1 [symbolic = %T.as_type.loc26_4.2 (constants.%T.as_type)] -// CHECK:STDOUT: %impl.elem0.loc26_4.1: @CallGeneric.%.loc26_4.3 (%.7c8) = impl_witness_access constants.%A.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc26_4.2 (constants.%impl.elem0.eda)] -// CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z] -// CHECK:STDOUT: %.loc26_11.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %specific_impl_fn.loc26_4.1: = specific_impl_function %impl.elem0.loc26_4.1, @A.F(constants.%X, constants.%A.facet.97b, constants.%Z) [symbolic = %specific_impl_fn.loc26_4.2 (constants.%specific_impl_fn.9ce)] -// CHECK:STDOUT: %.loc26_12.1: ref @CallGeneric.%tuple.type (%tuple.type.379) = temporary_storage -// CHECK:STDOUT: %.loc26_11.2: ref %Z = temporary_storage -// CHECK:STDOUT: %.loc26_11.3: init %Z = class_init (), %.loc26_11.2 [concrete = constants.%Z.val] -// CHECK:STDOUT: %.loc26_11.4: ref %Z = temporary %.loc26_11.2, %.loc26_11.3 -// CHECK:STDOUT: %.loc26_11.5: ref %Z = converted %.loc26_11.1, %.loc26_11.4 -// CHECK:STDOUT: %.loc26_11.6: %Z = bind_value %.loc26_11.5 -// CHECK:STDOUT: %.loc26_12.2: init @CallGeneric.%tuple.type (%tuple.type.379) = call %specific_impl_fn.loc26_4.1(%.loc26_11.6) to %.loc26_12.1 -// CHECK:STDOUT: %.loc26_12.3: ref @CallGeneric.%tuple.type (%tuple.type.379) = temporary %.loc26_12.1, %.loc26_12.2 -// CHECK:STDOUT: %impl.elem0.loc26_12.1: @CallGeneric.%.loc26_12.5 (%.a0b) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc26_12.2 (constants.%impl.elem0.80a)] -// CHECK:STDOUT: %bound_method.loc26_12.1: = bound_method %.loc26_12.3, %impl.elem0.loc26_12.1 -// CHECK:STDOUT: %specific_impl_fn.loc26_12.1: = specific_impl_function %impl.elem0.loc26_12.1, @Destroy.Op(constants.%Destroy.facet.a89) [symbolic = %specific_impl_fn.loc26_12.2 (constants.%specific_impl_fn.515)] -// CHECK:STDOUT: %bound_method.loc26_12.2: = bound_method %.loc26_12.3, %specific_impl_fn.loc26_12.1 -// CHECK:STDOUT: %addr.loc26_12: @CallGeneric.%ptr (%ptr.e41) = addr_of %.loc26_12.3 -// CHECK:STDOUT: %.loc26_12.4: init %empty_tuple.type = call %bound_method.loc26_12.2(%addr.loc26_12) -// CHECK:STDOUT: %Z.as.Destroy.impl.Op.bound: = bound_method %.loc26_11.4, constants.%Z.as.Destroy.impl.Op -// CHECK:STDOUT: %addr.loc26_11: %ptr.fb6 = addr_of %.loc26_11.4 -// CHECK:STDOUT: %Z.as.Destroy.impl.Op.call: init %empty_tuple.type = call %Z.as.Destroy.impl.Op.bound(%addr.loc26_11) +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %u.patt: %pattern_type.8f9 = binding_pattern u [concrete] +// CHECK:STDOUT: %u.var_patt: %pattern_type.8f9 = var_pattern %u.patt [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %u.var: ref %Z = var %u.var_patt +// CHECK:STDOUT: %Z.ref.loc27: type = name_ref Z, file.%Z.decl [concrete = constants.%Z] +// CHECK:STDOUT: %u: ref %Z = bind_name u, %u.var +// CHECK:STDOUT: %T.ref: %A.type.515 = name_ref T, %T.loc26_16.2 [symbolic = %T.loc26_16.1 (constants.%T.3b6)] +// CHECK:STDOUT: %.loc28_4.1: %A.assoc_type.296 = specific_constant @A.%assoc0.loc6_41.1, @A(constants.%X) [concrete = constants.%assoc0.5f6] +// CHECK:STDOUT: %F.ref: %A.assoc_type.296 = name_ref F, %.loc28_4.1 [concrete = constants.%assoc0.5f6] +// CHECK:STDOUT: %T.as_type.loc28_4.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc28_4.2 (constants.%T.as_type.fc2)] +// CHECK:STDOUT: %.loc28_4.2: type = converted %T.ref, %T.as_type.loc28_4.1 [symbolic = %T.as_type.loc28_4.2 (constants.%T.as_type.fc2)] +// CHECK:STDOUT: %impl.elem0.loc28_4.1: @CallGeneric.%.loc28_4.3 (%.7c8) = impl_witness_access constants.%A.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_4.2 (constants.%impl.elem0.eda)] +// CHECK:STDOUT: %Z.ref.loc28: type = name_ref Z, file.%Z.decl [concrete = constants.%Z] +// CHECK:STDOUT: %u.ref: ref %Z = name_ref u, %u +// CHECK:STDOUT: %addr.loc28_10: %ptr.fb6 = addr_of %u.ref +// CHECK:STDOUT: %specific_impl_fn.loc28_4.1: = specific_impl_function %impl.elem0.loc28_4.1, @A.F(constants.%X, constants.%A.facet.97b, constants.%Z) [symbolic = %specific_impl_fn.loc28_4.2 (constants.%specific_impl_fn.9ce)] +// CHECK:STDOUT: %.loc28_12.1: ref @CallGeneric.%tuple.type (%tuple.type.fd8) = temporary_storage +// CHECK:STDOUT: %.loc28_12.2: init @CallGeneric.%tuple.type (%tuple.type.fd8) = call %specific_impl_fn.loc28_4.1(%addr.loc28_10) to %.loc28_12.1 +// CHECK:STDOUT: %.loc28_12.3: ref @CallGeneric.%tuple.type (%tuple.type.fd8) = temporary %.loc28_12.1, %.loc28_12.2 +// CHECK:STDOUT: %impl.elem0.loc28_12.1: @CallGeneric.%.loc28_12.5 (%.768) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_12.2 (constants.%impl.elem0.c2c)] +// CHECK:STDOUT: %bound_method.loc28_12.1: = bound_method %.loc28_12.3, %impl.elem0.loc28_12.1 +// CHECK:STDOUT: %specific_impl_fn.loc28_12.1: = specific_impl_function %impl.elem0.loc28_12.1, @Destroy.Op(constants.%Destroy.facet.709) [symbolic = %specific_impl_fn.loc28_12.2 (constants.%specific_impl_fn.5e2)] +// CHECK:STDOUT: %bound_method.loc28_12.2: = bound_method %.loc28_12.3, %specific_impl_fn.loc28_12.1 +// CHECK:STDOUT: %addr.loc28_12: @CallGeneric.%ptr (%ptr.1b6) = addr_of %.loc28_12.3 +// CHECK:STDOUT: %.loc28_12.4: init %empty_tuple.type = call %bound_method.loc28_12.2(%addr.loc28_12) +// CHECK:STDOUT: %Z.as.Destroy.impl.Op.bound: = bound_method %u.var, constants.%Z.as.Destroy.impl.Op +// CHECK:STDOUT: %addr.loc27: %ptr.fb6 = addr_of %u.var +// CHECK:STDOUT: %Z.as.Destroy.impl.Op.call: init %empty_tuple.type = call %Z.as.Destroy.impl.Op.bound(%addr.loc27) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -549,7 +598,7 @@ fn CallIndirect() { // CHECK:STDOUT: %CallGeneric.ref: %CallGeneric.type = name_ref CallGeneric, file.%CallGeneric.decl [concrete = constants.%CallGeneric] // CHECK:STDOUT: %Y.ref: type = name_ref Y, file.%Y.decl [concrete = constants.%Y] // CHECK:STDOUT: %A.facet: %A.type.515 = facet_value constants.%Y, (constants.%A.impl_witness) [concrete = constants.%A.facet.f2b] -// CHECK:STDOUT: %.loc30: %A.type.515 = converted %Y.ref, %A.facet [concrete = constants.%A.facet.f2b] +// CHECK:STDOUT: %.loc32: %A.type.515 = converted %Y.ref, %A.facet [concrete = constants.%A.facet.f2b] // CHECK:STDOUT: %CallGeneric.specific_fn: = specific_function %CallGeneric.ref, @CallGeneric(constants.%A.facet.f2b) [concrete = constants.%CallGeneric.specific_fn] // CHECK:STDOUT: %CallGeneric.call: init %empty_tuple.type = call %CallGeneric.specific_fn() // CHECK:STDOUT: return @@ -561,14 +610,15 @@ fn CallIndirect() { // CHECK:STDOUT: // CHECK:STDOUT: specific @A.F(constants.%T.8b3, constants.%Self.b74, constants.%U.2cb) { // CHECK:STDOUT: %U.loc6_8.1 => constants.%U.2cb -// CHECK:STDOUT: %pattern_type.loc6_18 => constants.%pattern_type.20f +// CHECK:STDOUT: %ptr.loc6_22.1 => constants.%ptr.204 +// CHECK:STDOUT: %pattern_type.loc6_18 => constants.%pattern_type.eee // CHECK:STDOUT: %T => constants.%T.8b3 // CHECK:STDOUT: %A.type => constants.%A.type.806 // CHECK:STDOUT: %Self => constants.%Self.b74 -// CHECK:STDOUT: %tuple.type.loc6_38.1 => constants.%tuple.type.4c5 -// CHECK:STDOUT: %Self.as_type.loc6_38.1 => constants.%Self.as_type.327 -// CHECK:STDOUT: %tuple.type.loc6_38.2 => constants.%tuple.type.6ec -// CHECK:STDOUT: %pattern_type.loc6_24 => constants.%pattern_type.e2e +// CHECK:STDOUT: %tuple.type.loc6_40.1 => constants.%tuple.type.4c5 +// CHECK:STDOUT: %Self.as_type.loc6_40.1 => constants.%Self.as_type.327 +// CHECK:STDOUT: %tuple.type.loc6_40.2 => constants.%tuple.type.5a8 +// CHECK:STDOUT: %pattern_type.loc6_25 => constants.%pattern_type.0eb // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @A(constants.%X) { @@ -580,87 +630,97 @@ fn CallIndirect() { // CHECK:STDOUT: %A.F.type => constants.%A.F.type.13d // CHECK:STDOUT: %A.F => constants.%A.F.d83 // CHECK:STDOUT: %A.assoc_type => constants.%A.assoc_type.296 -// CHECK:STDOUT: %assoc0.loc6_39.2 => constants.%assoc0.5f6 +// CHECK:STDOUT: %assoc0.loc6_41.2 => constants.%assoc0.5f6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Y.as.A.impl.F(constants.%U.8b3) { // CHECK:STDOUT: %U.loc16_8.1 => constants.%U.8b3 -// CHECK:STDOUT: %pattern_type.loc16_18 => constants.%pattern_type.7dc -// CHECK:STDOUT: %tuple.type.loc16 => constants.%tuple.type.765 -// CHECK:STDOUT: %pattern_type.loc16_24 => constants.%pattern_type.340 +// CHECK:STDOUT: %ptr.loc16_22.1 => constants.%ptr.79f131.1 +// CHECK:STDOUT: %pattern_type.loc16_18 => constants.%pattern_type.afe393.1 +// CHECK:STDOUT: %tuple.type.loc16 => constants.%tuple.type.c14 +// CHECK:STDOUT: %pattern_type.loc16_25 => constants.%pattern_type.ac9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @A.F(constants.%X, constants.%A.facet.f2b, constants.%U.8b3) { // CHECK:STDOUT: %U.loc6_8.1 => constants.%U.8b3 -// CHECK:STDOUT: %pattern_type.loc6_18 => constants.%pattern_type.7dc +// CHECK:STDOUT: %ptr.loc6_22.1 => constants.%ptr.79f131.1 +// CHECK:STDOUT: %pattern_type.loc6_18 => constants.%pattern_type.afe393.1 // CHECK:STDOUT: %T => constants.%X // CHECK:STDOUT: %A.type => constants.%A.type.515 // CHECK:STDOUT: %Self => constants.%A.facet.f2b -// CHECK:STDOUT: %tuple.type.loc6_38.1 => constants.%tuple.type.281 -// CHECK:STDOUT: %Self.as_type.loc6_38.1 => constants.%Y -// CHECK:STDOUT: %tuple.type.loc6_38.2 => constants.%tuple.type.765 -// CHECK:STDOUT: %pattern_type.loc6_24 => constants.%pattern_type.340 +// CHECK:STDOUT: %tuple.type.loc6_40.1 => constants.%tuple.type.281 +// CHECK:STDOUT: %Self.as_type.loc6_40.1 => constants.%Y +// CHECK:STDOUT: %tuple.type.loc6_40.2 => constants.%tuple.type.c14 +// CHECK:STDOUT: %pattern_type.loc6_25 => constants.%pattern_type.ac9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Y.as.A.impl.F(constants.%Z) { // CHECK:STDOUT: %U.loc16_8.1 => constants.%Z -// CHECK:STDOUT: %pattern_type.loc16_18 => constants.%pattern_type.8f9 -// CHECK:STDOUT: %tuple.type.loc16 => constants.%tuple.type.f6b -// CHECK:STDOUT: %pattern_type.loc16_24 => constants.%pattern_type.ef1 +// CHECK:STDOUT: %ptr.loc16_22.1 => constants.%ptr.fb6 +// CHECK:STDOUT: %pattern_type.loc16_18 => constants.%pattern_type.f76 +// CHECK:STDOUT: %tuple.type.loc16 => constants.%tuple.type.092 +// CHECK:STDOUT: %pattern_type.loc16_25 => constants.%pattern_type.48d // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc16_24 => constants.%complete_type.a64 -// CHECK:STDOUT: %require_complete.loc16_19 => constants.%complete_type.357 -// CHECK:STDOUT: %tuple.type.loc17 => constants.%tuple.type.9c8 +// CHECK:STDOUT: %require_complete.loc16_25 => constants.%complete_type.05d +// CHECK:STDOUT: %require_complete.loc16_19 => constants.%complete_type.d3e +// CHECK:STDOUT: %tuple.type.loc17 => constants.%tuple.type.953 +// CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.impl_witness.f8c +// CHECK:STDOUT: %Copy.facet => constants.%Copy.facet.27d +// CHECK:STDOUT: %.loc17_21.2 => constants.%.67f +// CHECK:STDOUT: %impl.elem0.loc17_21.2 => constants.%ptr.as.Copy.impl.Op.ac3 +// CHECK:STDOUT: %specific_impl_fn.loc17_21.2 => constants.%ptr.as.Copy.impl.Op.specific_fn // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @CallGeneric(constants.%T.3b6) { -// CHECK:STDOUT: %T.loc25_16.1 => constants.%T.3b6 +// CHECK:STDOUT: %T.loc26_16.1 => constants.%T.3b6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @A.F(constants.%X, constants.%A.facet.97b, constants.%Z) { // CHECK:STDOUT: %U.loc6_8.1 => constants.%Z -// CHECK:STDOUT: %pattern_type.loc6_18 => constants.%pattern_type.8f9 +// CHECK:STDOUT: %ptr.loc6_22.1 => constants.%ptr.fb6 +// CHECK:STDOUT: %pattern_type.loc6_18 => constants.%pattern_type.f76 // CHECK:STDOUT: %T => constants.%X // CHECK:STDOUT: %A.type => constants.%A.type.515 // CHECK:STDOUT: %Self => constants.%A.facet.97b -// CHECK:STDOUT: %tuple.type.loc6_38.1 => constants.%tuple.type.281 -// CHECK:STDOUT: %Self.as_type.loc6_38.1 => constants.%T.as_type -// CHECK:STDOUT: %tuple.type.loc6_38.2 => constants.%tuple.type.379 -// CHECK:STDOUT: %pattern_type.loc6_24 => constants.%pattern_type.fcb +// CHECK:STDOUT: %tuple.type.loc6_40.1 => constants.%tuple.type.281 +// CHECK:STDOUT: %Self.as_type.loc6_40.1 => constants.%T.as_type.fc2 +// CHECK:STDOUT: %tuple.type.loc6_40.2 => constants.%tuple.type.fd8 +// CHECK:STDOUT: %pattern_type.loc6_25 => constants.%pattern_type.1d1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @CallGeneric(constants.%A.facet.f2b) { -// CHECK:STDOUT: %T.loc25_16.1 => constants.%A.facet.f2b +// CHECK:STDOUT: %T.loc26_16.1 => constants.%A.facet.f2b // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %T.as_type.loc26_4.2 => constants.%Y +// CHECK:STDOUT: %T.as_type.loc28_4.2 => constants.%Y // CHECK:STDOUT: %A.lookup_impl_witness => constants.%A.impl_witness // CHECK:STDOUT: %A.facet => constants.%A.facet.f2b -// CHECK:STDOUT: %.loc26_4.3 => constants.%.7c0 -// CHECK:STDOUT: %impl.elem0.loc26_4.2 => constants.%Y.as.A.impl.F -// CHECK:STDOUT: %specific_impl_fn.loc26_4.2 => constants.%Y.as.A.impl.F.specific_fn -// CHECK:STDOUT: %tuple.type => constants.%tuple.type.f6b -// CHECK:STDOUT: %require_complete.loc26_12.1 => constants.%complete_type.a64 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%Destroy.impl_witness.324 -// CHECK:STDOUT: %Destroy.facet => constants.%Destroy.facet.0e8 -// CHECK:STDOUT: %.loc26_12.5 => constants.%.c95 -// CHECK:STDOUT: %impl.elem0.loc26_12.2 => constants.%T.as.Destroy.impl.Op.47b -// CHECK:STDOUT: %specific_impl_fn.loc26_12.2 => constants.%T.as.Destroy.impl.Op.specific_fn -// CHECK:STDOUT: %ptr => constants.%ptr.959 -// CHECK:STDOUT: %require_complete.loc26_12.2 => constants.%complete_type.456 +// CHECK:STDOUT: %.loc28_4.3 => constants.%.7c0 +// CHECK:STDOUT: %impl.elem0.loc28_4.2 => constants.%Y.as.A.impl.F +// CHECK:STDOUT: %specific_impl_fn.loc28_4.2 => constants.%Y.as.A.impl.F.specific_fn +// CHECK:STDOUT: %tuple.type => constants.%tuple.type.092 +// CHECK:STDOUT: %require_complete.loc28_12.1 => constants.%complete_type.05d +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%Destroy.impl_witness.d7d +// CHECK:STDOUT: %Destroy.facet => constants.%Destroy.facet.ed1 +// CHECK:STDOUT: %.loc28_12.5 => constants.%.928 +// CHECK:STDOUT: %impl.elem0.loc28_12.2 => constants.%T.as.Destroy.impl.Op.64e +// CHECK:STDOUT: %specific_impl_fn.loc28_12.2 => constants.%T.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %ptr => constants.%ptr.5df +// CHECK:STDOUT: %require_complete.loc28_12.2 => constants.%complete_type.aab // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @A.F(constants.%X, constants.%A.facet.f2b, constants.%Z) { // CHECK:STDOUT: %U.loc6_8.1 => constants.%Z -// CHECK:STDOUT: %pattern_type.loc6_18 => constants.%pattern_type.8f9 +// CHECK:STDOUT: %ptr.loc6_22.1 => constants.%ptr.fb6 +// CHECK:STDOUT: %pattern_type.loc6_18 => constants.%pattern_type.f76 // CHECK:STDOUT: %T => constants.%X // CHECK:STDOUT: %A.type => constants.%A.type.515 // CHECK:STDOUT: %Self => constants.%A.facet.f2b -// CHECK:STDOUT: %tuple.type.loc6_38.1 => constants.%tuple.type.281 -// CHECK:STDOUT: %Self.as_type.loc6_38.1 => constants.%Y -// CHECK:STDOUT: %tuple.type.loc6_38.2 => constants.%tuple.type.f6b -// CHECK:STDOUT: %pattern_type.loc6_24 => constants.%pattern_type.ef1 +// CHECK:STDOUT: %tuple.type.loc6_40.1 => constants.%tuple.type.281 +// CHECK:STDOUT: %Self.as_type.loc6_40.1 => constants.%Y +// CHECK:STDOUT: %tuple.type.loc6_40.2 => constants.%tuple.type.092 +// CHECK:STDOUT: %pattern_type.loc6_25 => constants.%pattern_type.48d // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- generic_method_more_params.carbon diff --git a/toolchain/check/testdata/interface/import.carbon b/toolchain/check/testdata/interface/import.carbon index 48ba2b78f281..81fb98cfd964 100644 --- a/toolchain/check/testdata/interface/import.carbon +++ b/toolchain/check/testdata/interface/import.carbon @@ -2,7 +2,7 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/none.carbon +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/convert.carbon // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". // EXTRA-ARGS: --dump-sem-ir-ranges=if-present // @@ -75,13 +75,22 @@ var f: ForwardDeclared* = &f_ref.f; // CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.f [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .Empty = %Empty.decl // CHECK:STDOUT: .Basic = %Basic.decl // CHECK:STDOUT: .ForwardDeclared = %ForwardDeclared.decl // CHECK:STDOUT: .f_ref = %f_ref // CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Empty.decl: type = interface_decl @Empty [concrete = constants.%Empty.type] {} {} // CHECK:STDOUT: %Basic.decl: type = interface_decl @Basic [concrete = constants.%Basic.type] {} {} // CHECK:STDOUT: %ForwardDeclared.decl: type = interface_decl @ForwardDeclared [concrete = constants.%ForwardDeclared.type] {} {} @@ -180,12 +189,25 @@ var f: ForwardDeclared* = &f_ref.f; // CHECK:STDOUT: %ForwardDeclared.assoc_type: type = assoc_entity_type @ForwardDeclared [concrete] // CHECK:STDOUT: %assoc0.d40: %ForwardDeclared.assoc_type = assoc_entity element0, imports.%Main.import_ref.69a [concrete] // CHECK:STDOUT: %assoc1.e3d: %ForwardDeclared.assoc_type = assoc_entity element1, imports.%Main.import_ref.1cc [concrete] -// CHECK:STDOUT: %ptr: type = ptr_type %ForwardDeclared.type [concrete] -// CHECK:STDOUT: %pattern_type.d44: type = pattern_type %ptr [concrete] +// CHECK:STDOUT: %ptr.ebe: type = ptr_type %ForwardDeclared.type [concrete] +// CHECK:STDOUT: %pattern_type.d44: type = pattern_type %ptr.ebe [concrete] // CHECK:STDOUT: %struct_type.f: type = struct_type {.f: %ForwardDeclared.type} [concrete] // CHECK:STDOUT: %pattern_type.ffe: type = pattern_type %struct_type.f [concrete] // CHECK:STDOUT: %.b5f: ref %ForwardDeclared.type = struct_access imports.%f_ref.var, element0 [concrete] -// CHECK:STDOUT: %addr: %ptr = addr_of %.b5f [concrete] +// CHECK:STDOUT: %addr: %ptr.ebe = addr_of %.b5f [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.f23: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.8b3) [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.abf: %ptr.as.Copy.impl.Op.type.f23 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.419: = impl_witness imports.%Copy.impl_witness_table.a71, @ptr.as.Copy.impl(%ForwardDeclared.type) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.7db: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%ForwardDeclared.type) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.a58: %ptr.as.Copy.impl.Op.type.7db = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.4d8: %Copy.type = facet_value %ptr.ebe, (%Copy.impl_witness.419) [concrete] +// CHECK:STDOUT: %.b59: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.4d8 [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.bound: = bound_method %addr, %ptr.as.Copy.impl.Op.a58 [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.a58, @ptr.as.Copy.impl.Op(%ForwardDeclared.type) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %addr, %ptr.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -193,13 +215,18 @@ var f: ForwardDeclared* = &f_ref.f; // CHECK:STDOUT: %Main.Basic: type = import_ref Main//a, Basic, loaded [concrete = constants.%Basic.type] // CHECK:STDOUT: %Main.ForwardDeclared: type = import_ref Main//a, ForwardDeclared, loaded [concrete = constants.%ForwardDeclared.type] // CHECK:STDOUT: %Main.f_ref: ref %struct_type.f = import_ref Main//a, f_ref, loaded [concrete = %f_ref.var] -// CHECK:STDOUT: %Main.import_ref.03a = import_ref Main//a, inst17 [no loc], unloaded -// CHECK:STDOUT: %Main.import_ref.e4b = import_ref Main//a, inst22 [no loc], unloaded +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: .Copy = %Core.Copy +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: %Main.import_ref.03a = import_ref Main//a, inst19 [no loc], unloaded +// CHECK:STDOUT: %Main.import_ref.e4b = import_ref Main//a, inst24 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.3d5: %Basic.assoc_type = import_ref Main//a, loc8_8, loaded [concrete = constants.%assoc0.fee] // CHECK:STDOUT: %Main.import_ref.760: %Basic.assoc_type = import_ref Main//a, loc9_9, loaded [concrete = constants.%assoc1.4ea] // CHECK:STDOUT: %Main.T.44f = import_ref Main//a, T, unloaded // CHECK:STDOUT: %Main.F.eea = import_ref Main//a, F, unloaded -// CHECK:STDOUT: %Main.import_ref.3bd = import_ref Main//a, inst37 [no loc], unloaded +// CHECK:STDOUT: %Main.import_ref.3bd = import_ref Main//a, inst39 [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.ad1: %ForwardDeclared.assoc_type = import_ref Main//a, loc16_8, loaded [concrete = constants.%assoc0.d40] // CHECK:STDOUT: %Main.import_ref.339: %ForwardDeclared.assoc_type = import_ref Main//a, loc17_9, loaded [concrete = constants.%assoc1.e3d] // CHECK:STDOUT: %Main.T.6ee = import_ref Main//a, T, unloaded @@ -211,6 +238,9 @@ var f: ForwardDeclared* = &f_ref.f; // CHECK:STDOUT: %f_ref.patt: %pattern_type.ffe = binding_pattern f_ref [concrete] // CHECK:STDOUT: %f_ref.var_patt: %pattern_type.ffe = var_pattern %f_ref.patt [concrete] // CHECK:STDOUT: %f_ref.var: ref %struct_type.f = var %f_ref.var_patt [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.de9: @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op.type (%ptr.as.Copy.impl.Op.type.f23) = import_ref Core//prelude/parts/copy, loc32_31, loaded [symbolic = @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op (constants.%ptr.as.Copy.impl.Op.abf)] +// CHECK:STDOUT: %Copy.impl_witness_table.a71 = impl_witness_table (%Core.import_ref.de9), @ptr.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -219,6 +249,7 @@ var f: ForwardDeclared* = &f_ref.f; // CHECK:STDOUT: .Basic = imports.%Main.Basic // CHECK:STDOUT: .ForwardDeclared = imports.%Main.ForwardDeclared // CHECK:STDOUT: .f_ref = imports.%Main.f_ref +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .UseEmpty = %UseEmpty.decl // CHECK:STDOUT: .UseBasic = %UseBasic.decl // CHECK:STDOUT: .UseForwardDeclared = %UseForwardDeclared.decl @@ -228,6 +259,7 @@ var f: ForwardDeclared* = &f_ref.f; // CHECK:STDOUT: .UseForwardDeclaredF = %UseForwardDeclaredF // CHECK:STDOUT: .f = %f // CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %UseEmpty.decl: %UseEmpty.type = fn_decl @UseEmpty [concrete = constants.%UseEmpty] { // CHECK:STDOUT: %e.patt: %pattern_type.291 = binding_pattern e [concrete] @@ -269,12 +301,12 @@ var f: ForwardDeclared* = &f_ref.f; // CHECK:STDOUT: %f.patt: %pattern_type.d44 = binding_pattern f [concrete] // CHECK:STDOUT: %f.var_patt: %pattern_type.d44 = var_pattern %f.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %f.var: ref %ptr = var %f.var_patt [concrete] -// CHECK:STDOUT: %.loc16: type = splice_block %ptr [concrete = constants.%ptr] { +// CHECK:STDOUT: %f.var: ref %ptr.ebe = var %f.var_patt [concrete] +// CHECK:STDOUT: %.loc16: type = splice_block %ptr [concrete = constants.%ptr.ebe] { // CHECK:STDOUT: %ForwardDeclared.ref.loc16: type = name_ref ForwardDeclared, imports.%Main.ForwardDeclared [concrete = constants.%ForwardDeclared.type] -// CHECK:STDOUT: %ptr: type = ptr_type %ForwardDeclared.ref.loc16 [concrete = constants.%ptr] +// CHECK:STDOUT: %ptr: type = ptr_type %ForwardDeclared.ref.loc16 [concrete = constants.%ptr.ebe] // CHECK:STDOUT: } -// CHECK:STDOUT: %f: ref %ptr = bind_name f, %f.var [concrete = %f.var] +// CHECK:STDOUT: %f: ref %ptr.ebe = bind_name f, %f.var [concrete = %f.var] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Empty [from "a.carbon"] { @@ -318,8 +350,13 @@ var f: ForwardDeclared* = &f_ref.f; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %f_ref.ref: ref %struct_type.f = name_ref f_ref, imports.%Main.f_ref [concrete = imports.%f_ref.var] // CHECK:STDOUT: %.loc16: ref %ForwardDeclared.type = struct_access %f_ref.ref, element0 [concrete = constants.%.b5f] -// CHECK:STDOUT: %addr: %ptr = addr_of %.loc16 [concrete = constants.%addr] -// CHECK:STDOUT: assign file.%f.var, %addr +// CHECK:STDOUT: %addr: %ptr.ebe = addr_of %.loc16 [concrete = constants.%addr] +// CHECK:STDOUT: %impl.elem0: %.b59 = impl_witness_access constants.%Copy.impl_witness.419, element0 [concrete = constants.%ptr.as.Copy.impl.Op.a58] +// CHECK:STDOUT: %bound_method.loc16_27.1: = bound_method %addr, %impl.elem0 [concrete = constants.%ptr.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @ptr.as.Copy.impl.Op(constants.%ForwardDeclared.type) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc16_27.2: = bound_method %addr, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.ebe = call %bound_method.loc16_27.2(%addr) [concrete = constants.%addr] +// CHECK:STDOUT: assign file.%f.var, %ptr.as.Copy.impl.Op.call // CHECK:STDOUT: return // CHECK:STDOUT: } // 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 6598b217e6d8..e852f645f2ed 100644 --- a/toolchain/check/testdata/interface/todo_define_not_default.carbon +++ b/toolchain/check/testdata/interface/todo_define_not_default.carbon @@ -72,7 +72,7 @@ interface I { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/class/constructor.carbon b/toolchain/check/testdata/interop/cpp/class/constructor.carbon index eaf5efd61788..29be6e7a3965 100644 --- a/toolchain/check/testdata/interop/cpp/class/constructor.carbon +++ b/toolchain/check/testdata/interop/cpp/class/constructor.carbon @@ -325,7 +325,7 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -470,7 +470,7 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -589,9 +589,9 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] -// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/parts/int, loc25_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] +// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/parts/int, loc32_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] // CHECK:STDOUT: %As.impl_witness_table.3fe = impl_witness_table (%Core.import_ref.52c), @Core.IntLiteral.as.As.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -713,9 +713,9 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] -// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/parts/int, loc25_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] +// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/parts/int, loc32_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] // CHECK:STDOUT: %As.impl_witness_table.3fe = impl_witness_table (%Core.import_ref.52c), @Core.IntLiteral.as.As.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/class/field.carbon b/toolchain/check/testdata/interop/cpp/class/field.carbon index f96074017d22..21515fad411f 100644 --- a/toolchain/check/testdata/interop/cpp/class/field.carbon +++ b/toolchain/check/testdata/interop/cpp/class/field.carbon @@ -224,14 +224,27 @@ fn Test(m: Cpp.UnsupportedMembers*) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Struct: type = class_type @Struct [concrete] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %tuple.type.189: type = tuple_type (%i32, %i32, %i32) [concrete] // CHECK:STDOUT: %Struct.elem.86b: type = unbound_element_type %Struct, %i32 [concrete] // CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [concrete] // CHECK:STDOUT: %Struct.elem.765: type = unbound_element_type %Struct, %ptr.235 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/types/int, loc21_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%s.param: %Struct) -> %return.param: %tuple.type.189 { @@ -250,13 +263,28 @@ fn Test(m: Cpp.UnsupportedMembers*) { // CHECK:STDOUT: %.loc8_23.2: %ptr.235 = bind_value %.loc8_23.1 // CHECK:STDOUT: %.loc8_21.1: ref %i32 = deref %.loc8_23.2 // CHECK:STDOUT: %.loc8_25.1: %tuple.type.189 = tuple_literal (%.loc8_12.2, %.loc8_17.2, %.loc8_21.1) +// CHECK:STDOUT: %impl.elem0.loc8_12: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc8_12.1: = bound_method %.loc8_12.2, %impl.elem0.loc8_12 +// CHECK:STDOUT: %specific_fn.loc8_12: = specific_function %impl.elem0.loc8_12, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_12.2: = bound_method %.loc8_12.2, %specific_fn.loc8_12 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc8_12: init %i32 = call %bound_method.loc8_12.2(%.loc8_12.2) // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %return, element0 -// CHECK:STDOUT: %.loc8_25.2: init %i32 = initialize_from %.loc8_12.2 to %tuple.elem0 +// CHECK:STDOUT: %.loc8_25.2: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc8_12 to %tuple.elem0 +// CHECK:STDOUT: %impl.elem0.loc8_17: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc8_17.1: = bound_method %.loc8_17.2, %impl.elem0.loc8_17 +// CHECK:STDOUT: %specific_fn.loc8_17: = specific_function %impl.elem0.loc8_17, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_17.2: = bound_method %.loc8_17.2, %specific_fn.loc8_17 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc8_17: init %i32 = call %bound_method.loc8_17.2(%.loc8_17.2) // CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access %return, element1 -// CHECK:STDOUT: %.loc8_25.3: init %i32 = initialize_from %.loc8_17.2 to %tuple.elem1 +// CHECK:STDOUT: %.loc8_25.3: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc8_17 to %tuple.elem1 // CHECK:STDOUT: %.loc8_21.2: %i32 = bind_value %.loc8_21.1 +// CHECK:STDOUT: %impl.elem0.loc8_21: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc8_21.1: = bound_method %.loc8_21.2, %impl.elem0.loc8_21 +// CHECK:STDOUT: %specific_fn.loc8_21: = specific_function %impl.elem0.loc8_21, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_21.2: = bound_method %.loc8_21.2, %specific_fn.loc8_21 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc8_21: init %i32 = call %bound_method.loc8_21.2(%.loc8_21.2) // CHECK:STDOUT: %tuple.elem2: ref %i32 = tuple_access %return, element2 -// CHECK:STDOUT: %.loc8_25.4: init %i32 = initialize_from %.loc8_21.2 to %tuple.elem2 +// CHECK:STDOUT: %.loc8_25.4: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc8_21 to %tuple.elem2 // CHECK:STDOUT: %.loc8_25.5: init %tuple.type.189 = tuple_init (%.loc8_25.2, %.loc8_25.3, %.loc8_25.4) to %return // CHECK:STDOUT: %.loc8_26: init %tuple.type.189 = converted %.loc8_25.1, %.loc8_25.5 // CHECK:STDOUT: return %.loc8_26 to %return diff --git a/toolchain/check/testdata/interop/cpp/class/template.carbon b/toolchain/check/testdata/interop/cpp/class/template.carbon index aa617b40364f..0a7db0be9dea 100644 --- a/toolchain/check/testdata/interop/cpp/class/template.carbon +++ b/toolchain/check/testdata/interop/cpp/class/template.carbon @@ -173,7 +173,7 @@ var y: Cpp.Xint.r#type = 0; // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %X.decl.dec4cb.1: type = class_decl @X.1 [concrete = constants.%X.32d59e.1] {} {} -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %X.decl.dec4cb.2: type = class_decl @X.2 [concrete = constants.%X.32d59e.2] {} {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interop/cpp/enum/convert.carbon b/toolchain/check/testdata/interop/cpp/enum/convert.carbon index 3caca32bdd5a..3b91b9a82827 100644 --- a/toolchain/check/testdata/interop/cpp/enum/convert.carbon +++ b/toolchain/check/testdata/interop/cpp/enum/convert.carbon @@ -127,7 +127,7 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Enum.decl: type = class_decl @Enum [concrete = constants.%Enum] {} {} // CHECK:STDOUT: %int_0: %Enum = int_value 0 [concrete = constants.%int_0.420] -// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/parts/int, loc25_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] +// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/parts/int, loc32_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] // CHECK:STDOUT: %As.impl_witness_table.3fe = impl_witness_table (%Core.import_ref.52c), @Core.IntLiteral.as.As.impl [concrete] // CHECK:STDOUT: %Other.decl: type = class_decl @Other [concrete = constants.%Other] {} {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interop/cpp/enum/copy.carbon b/toolchain/check/testdata/interop/cpp/enum/copy.carbon index 32ef1f097beb..3a50e0653efa 100644 --- a/toolchain/check/testdata/interop/cpp/enum/copy.carbon +++ b/toolchain/check/testdata/interop/cpp/enum/copy.carbon @@ -67,8 +67,10 @@ fn F() { // CHECK:STDOUT: %Cpp.ref.loc8_21: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %Enum.ref.loc8_24: type = name_ref Enum, imports.%Enum.decl [concrete = constants.%Enum] // CHECK:STDOUT: %a.ref.loc8: %Enum = name_ref a, imports.%int_0 [concrete = constants.%int_0] -// CHECK:STDOUT: assign %a.var, %a.ref.loc8 -// CHECK:STDOUT: %.loc8: type = splice_block %Enum.ref.loc8_13 [concrete = constants.%Enum] { +// CHECK:STDOUT: %.loc8_29.1: ref %Enum = temporary_storage +// CHECK:STDOUT: %.loc8_29.2: ref %Enum = temporary %.loc8_29.1, %a.ref.loc8 +// CHECK:STDOUT: assign %a.var, %.loc8_29.2 +// CHECK:STDOUT: %.loc8_13: type = splice_block %Enum.ref.loc8_13 [concrete = constants.%Enum] { // CHECK:STDOUT: %Cpp.ref.loc8_10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %Enum.ref.loc8_13: type = name_ref Enum, imports.%Enum.decl [concrete = constants.%Enum] // CHECK:STDOUT: } @@ -77,12 +79,24 @@ fn F() { // CHECK:STDOUT: %Cpp.ref.loc10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %Enum.ref.loc10: type = name_ref Enum, imports.%Enum.decl [concrete = constants.%Enum] // CHECK:STDOUT: %b.ref: %Enum = name_ref b, imports.%int_1 [concrete = constants.%int_1] -// CHECK:STDOUT: assign %a.ref.loc10, %b.ref -// CHECK:STDOUT: %T.as.Destroy.impl.Op.bound: = bound_method %a.var, constants.%T.as.Destroy.impl.Op.bbe +// CHECK:STDOUT: %.loc10_15.1: ref %Enum = temporary_storage +// CHECK:STDOUT: %.loc10_15.2: ref %Enum = temporary %.loc10_15.1, %b.ref +// CHECK:STDOUT: assign %a.ref.loc10, %.loc10_15.2 +// CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc10: = bound_method %.loc10_15.2, constants.%T.as.Destroy.impl.Op.bbe // CHECK:STDOUT: -// CHECK:STDOUT: %bound_method: = bound_method %a.var, %T.as.Destroy.impl.Op.specific_fn -// CHECK:STDOUT: %addr: %ptr.47b = addr_of %a.var -// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr) +// CHECK:STDOUT: %bound_method.loc10: = bound_method %.loc10_15.2, %T.as.Destroy.impl.Op.specific_fn.1 +// CHECK:STDOUT: %addr.loc10: %ptr.47b = addr_of %.loc10_15.2 +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc10: init %empty_tuple.type = call %bound_method.loc10(%addr.loc10) +// CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc8_29: = bound_method %.loc8_29.2, constants.%T.as.Destroy.impl.Op.bbe +// CHECK:STDOUT: +// CHECK:STDOUT: %bound_method.loc8_29: = bound_method %.loc8_29.2, %T.as.Destroy.impl.Op.specific_fn.2 +// CHECK:STDOUT: %addr.loc8_29: %ptr.47b = addr_of %.loc8_29.2 +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc8_29: init %empty_tuple.type = call %bound_method.loc8_29(%addr.loc8_29) +// CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc8_3: = bound_method %a.var, constants.%T.as.Destroy.impl.Op.bbe +// CHECK:STDOUT: +// CHECK:STDOUT: %bound_method.loc8_3: = bound_method %a.var, %T.as.Destroy.impl.Op.specific_fn.3 +// CHECK:STDOUT: %addr.loc8_3: %ptr.47b = addr_of %a.var +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc8_3: init %empty_tuple.type = call %bound_method.loc8_3(%addr.loc8_3) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/arithmetic_types_bridged.carbon b/toolchain/check/testdata/interop/cpp/function/arithmetic_types_bridged.carbon index a628a52e1a5e..22d8ea4330ca 100644 --- a/toolchain/check/testdata/interop/cpp/function/arithmetic_types_bridged.carbon +++ b/toolchain/check/testdata/interop/cpp/function/arithmetic_types_bridged.carbon @@ -694,6 +694,14 @@ fn F() { // CHECK:STDOUT: %foo__carbon_thunk.type: type = fn_type @foo__carbon_thunk [concrete] // CHECK:STDOUT: %foo__carbon_thunk: %foo__carbon_thunk.type = struct_value () [concrete] // CHECK:STDOUT: %true: bool = bool_literal true [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Copy.impl_witness.09f: = impl_witness imports.%Copy.impl_witness_table.47e [concrete] +// CHECK:STDOUT: %Copy.facet.dcd: %Copy.type = facet_value bool, (%Copy.impl_witness.09f) [concrete] +// CHECK:STDOUT: %.235: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.dcd [concrete] +// CHECK:STDOUT: %bool.as.Copy.impl.Op.type: type = fn_type @bool.as.Copy.impl.Op [concrete] +// CHECK:STDOUT: %bool.as.Copy.impl.Op: %bool.as.Copy.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %bool.as.Copy.impl.Op.bound: = bound_method %true, %bool.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.type.19a: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(bool) [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.4f7: %T.as.Destroy.impl.Op.type.19a = struct_value () [concrete] // CHECK:STDOUT: } @@ -713,6 +721,8 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import_ref.297: %bool.as.Copy.impl.Op.type = import_ref Core//prelude/copy, loc19_31, loaded [concrete = constants.%bool.as.Copy.impl.Op] +// CHECK:STDOUT: %Copy.impl_witness_table.47e = impl_witness_table (%Core.import_ref.297), @bool.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -720,15 +730,18 @@ fn F() { // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %foo.ref: %foo.type = name_ref foo, imports.%foo.decl [concrete = constants.%foo] // CHECK:STDOUT: %true: bool = bool_literal true [concrete = constants.%true] +// CHECK:STDOUT: %impl.elem0: %.235 = impl_witness_access constants.%Copy.impl_witness.09f, element0 [concrete = constants.%bool.as.Copy.impl.Op] +// CHECK:STDOUT: %bound_method.loc8_11.1: = bound_method %true, %impl.elem0 [concrete = constants.%bool.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %bool.as.Copy.impl.Op.call: init bool = call %bound_method.loc8_11.1(%true) [concrete = constants.%true] // CHECK:STDOUT: %.loc8_11.1: ref bool = temporary_storage -// CHECK:STDOUT: %.loc8_11.2: ref bool = temporary %.loc8_11.1, %true +// CHECK:STDOUT: %.loc8_11.2: ref bool = temporary %.loc8_11.1, %bool.as.Copy.impl.Op.call // CHECK:STDOUT: %addr.loc8_15: %ptr.bb2 = addr_of %.loc8_11.2 // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc8_15) // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound: = bound_method %.loc8_11.2, constants.%T.as.Destroy.impl.Op.4f7 // CHECK:STDOUT: -// CHECK:STDOUT: %bound_method: = bound_method %.loc8_11.2, %T.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %bound_method.loc8_11.2: = bound_method %.loc8_11.2, %T.as.Destroy.impl.Op.specific_fn // CHECK:STDOUT: %addr.loc8_11: %ptr.bb2 = addr_of %.loc8_11.2 -// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr.loc8_11) +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8_11.2(%addr.loc8_11) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -742,6 +755,14 @@ fn F() { // CHECK:STDOUT: %foo__carbon_thunk.type: type = fn_type @foo__carbon_thunk [concrete] // CHECK:STDOUT: %foo__carbon_thunk: %foo__carbon_thunk.type = struct_value () [concrete] // CHECK:STDOUT: %false: bool = bool_literal false [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Copy.impl_witness.09f: = impl_witness imports.%Copy.impl_witness_table.47e [concrete] +// CHECK:STDOUT: %Copy.facet.dcd: %Copy.type = facet_value bool, (%Copy.impl_witness.09f) [concrete] +// CHECK:STDOUT: %.235: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.dcd [concrete] +// CHECK:STDOUT: %bool.as.Copy.impl.Op.type: type = fn_type @bool.as.Copy.impl.Op [concrete] +// CHECK:STDOUT: %bool.as.Copy.impl.Op: %bool.as.Copy.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %bool.as.Copy.impl.Op.bound: = bound_method %false, %bool.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.type.19a: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(bool) [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.4f7: %T.as.Destroy.impl.Op.type.19a = struct_value () [concrete] // CHECK:STDOUT: } @@ -761,6 +782,8 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import_ref.297: %bool.as.Copy.impl.Op.type = import_ref Core//prelude/copy, loc19_31, loaded [concrete = constants.%bool.as.Copy.impl.Op] +// CHECK:STDOUT: %Copy.impl_witness_table.47e = impl_witness_table (%Core.import_ref.297), @bool.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -768,15 +791,18 @@ fn F() { // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %foo.ref: %foo.type = name_ref foo, imports.%foo.decl [concrete = constants.%foo] // CHECK:STDOUT: %false: bool = bool_literal false [concrete = constants.%false] +// CHECK:STDOUT: %impl.elem0: %.235 = impl_witness_access constants.%Copy.impl_witness.09f, element0 [concrete = constants.%bool.as.Copy.impl.Op] +// CHECK:STDOUT: %bound_method.loc8_11.1: = bound_method %false, %impl.elem0 [concrete = constants.%bool.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %bool.as.Copy.impl.Op.call: init bool = call %bound_method.loc8_11.1(%false) [concrete = constants.%false] // CHECK:STDOUT: %.loc8_11.1: ref bool = temporary_storage -// CHECK:STDOUT: %.loc8_11.2: ref bool = temporary %.loc8_11.1, %false +// CHECK:STDOUT: %.loc8_11.2: ref bool = temporary %.loc8_11.1, %bool.as.Copy.impl.Op.call // CHECK:STDOUT: %addr.loc8_16: %ptr.bb2 = addr_of %.loc8_11.2 // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc8_16) // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound: = bound_method %.loc8_11.2, constants.%T.as.Destroy.impl.Op.4f7 // CHECK:STDOUT: -// CHECK:STDOUT: %bound_method: = bound_method %.loc8_11.2, %T.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %bound_method.loc8_11.2: = bound_method %.loc8_11.2, %T.as.Destroy.impl.Op.specific_fn // CHECK:STDOUT: %addr.loc8_11: %ptr.bb2 = addr_of %.loc8_11.2 -// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr.loc8_11) +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8_11.2(%addr.loc8_11) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -785,6 +811,7 @@ fn F() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i8: type = class_type @Int, @Int(%int_8) [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] @@ -813,8 +840,20 @@ fn F() { // CHECK:STDOUT: %.63d: type = fn_type_with_self_type %ImplicitAs.Convert.type.e79, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: = bound_method %int_-1.638, %Core.IntLiteral.as.ImplicitAs.impl.Convert.05d [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.05d, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_8) [concrete] -// CHECK:STDOUT: %bound_method: = bound_method %int_-1.638, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] +// CHECK:STDOUT: %bound_method.cc3: = bound_method %int_-1.638, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_-1.416: %i8 = int_value -1 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.537: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_8) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.9aa: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_8) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.44c: %Int.as.Copy.impl.Op.type.9aa = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.b85: %Copy.type = facet_value %i8, (%Copy.impl_witness.537) [concrete] +// CHECK:STDOUT: %.b82: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.b85 [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.bound: = bound_method %int_-1.416, %Int.as.Copy.impl.Op.44c [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.44c, @Int.as.Copy.impl.Op(%int_8) [concrete] +// CHECK:STDOUT: %bound_method.9d3: = bound_method %int_-1.416, %Int.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %Int.as.Destroy.impl.Op.type.5cb: type = fn_type @Int.as.Destroy.impl.Op, @Int.as.Destroy.impl(%int_8) [concrete] // CHECK:STDOUT: %Int.as.Destroy.impl.Op.d9e: %Int.as.Destroy.impl.Op.type.5cb = struct_value () [concrete] // CHECK:STDOUT: } @@ -837,8 +876,10 @@ fn F() { // CHECK:STDOUT: %Core.import_ref.abd = import_ref Core//prelude/operators/arithmetic, loc111_50, unloaded // CHECK:STDOUT: %Core.import_ref.037: %Core.IntLiteral.as.Negate.impl.Op.type = import_ref Core//prelude/operators/arithmetic, loc112_31, loaded [concrete = constants.%Core.IntLiteral.as.Negate.impl.Op] // CHECK:STDOUT: %Negate.impl_witness_table = impl_witness_table (%Core.import_ref.abd, %Core.import_ref.037), @Core.IntLiteral.as.Negate.impl [concrete] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/types/int, loc20_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/types/int, loc27_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/types/int, loc21_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -849,24 +890,29 @@ fn F() { // CHECK:STDOUT: %impl.elem1: %.e9a = impl_witness_access constants.%Negate.impl_witness, element1 [concrete = constants.%Core.IntLiteral.as.Negate.impl.Op] // CHECK:STDOUT: %bound_method.loc8_11.1: = bound_method %int_1, %impl.elem1 [concrete = constants.%Core.IntLiteral.as.Negate.impl.Op.bound] // CHECK:STDOUT: %Core.IntLiteral.as.Negate.impl.Op.call: init Core.IntLiteral = call %bound_method.loc8_11.1(%int_1) [concrete = constants.%int_-1.638] -// CHECK:STDOUT: %impl.elem0: %.63d = impl_witness_access constants.%ImplicitAs.impl_witness.f3c, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.05d] -// CHECK:STDOUT: %bound_method.loc8_11.2: = bound_method %Core.IntLiteral.as.Negate.impl.Op.call, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_8) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc8_11.3: = bound_method %Core.IntLiteral.as.Negate.impl.Op.call, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %impl.elem0.loc8_11.1: %.63d = impl_witness_access constants.%ImplicitAs.impl_witness.f3c, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.05d] +// CHECK:STDOUT: %bound_method.loc8_11.2: = bound_method %Core.IntLiteral.as.Negate.impl.Op.call, %impl.elem0.loc8_11.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc8_11.1: = specific_function %impl.elem0.loc8_11.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_8) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_11.3: = bound_method %Core.IntLiteral.as.Negate.impl.Op.call, %specific_fn.loc8_11.1 [concrete = constants.%bound_method.cc3] // CHECK:STDOUT: %.loc8_11.1: Core.IntLiteral = value_of_initializer %Core.IntLiteral.as.Negate.impl.Op.call [concrete = constants.%int_-1.638] // CHECK:STDOUT: %.loc8_11.2: Core.IntLiteral = converted %Core.IntLiteral.as.Negate.impl.Op.call, %.loc8_11.1 [concrete = constants.%int_-1.638] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i8 = call %bound_method.loc8_11.3(%.loc8_11.2) [concrete = constants.%int_-1.416] // CHECK:STDOUT: %.loc8_11.3: %i8 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_-1.416] // CHECK:STDOUT: %.loc8_11.4: %i8 = converted %Core.IntLiteral.as.Negate.impl.Op.call, %.loc8_11.3 [concrete = constants.%int_-1.416] +// CHECK:STDOUT: %impl.elem0.loc8_11.2: %.b82 = impl_witness_access constants.%Copy.impl_witness.537, element0 [concrete = constants.%Int.as.Copy.impl.Op.44c] +// CHECK:STDOUT: %bound_method.loc8_11.4: = bound_method %.loc8_11.4, %impl.elem0.loc8_11.2 [concrete = constants.%Int.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %specific_fn.loc8_11.2: = specific_function %impl.elem0.loc8_11.2, @Int.as.Copy.impl.Op(constants.%int_8) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_11.5: = bound_method %.loc8_11.4, %specific_fn.loc8_11.2 [concrete = constants.%bound_method.9d3] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i8 = call %bound_method.loc8_11.5(%.loc8_11.4) [concrete = constants.%int_-1.416] // CHECK:STDOUT: %.loc8_11.5: ref %i8 = temporary_storage -// CHECK:STDOUT: %.loc8_11.6: ref %i8 = temporary %.loc8_11.5, %.loc8_11.4 +// CHECK:STDOUT: %.loc8_11.6: ref %i8 = temporary %.loc8_11.5, %Int.as.Copy.impl.Op.call // CHECK:STDOUT: %addr.loc8_13: %ptr.5c1 = addr_of %.loc8_11.6 // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc8_13) // CHECK:STDOUT: %Int.as.Destroy.impl.Op.bound: = bound_method %.loc8_11.6, constants.%Int.as.Destroy.impl.Op.d9e // CHECK:STDOUT: -// CHECK:STDOUT: %bound_method.loc8_11.4: = bound_method %.loc8_11.6, %Int.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %bound_method.loc8_11.6: = bound_method %.loc8_11.6, %Int.as.Destroy.impl.Op.specific_fn // CHECK:STDOUT: %addr.loc8_11: %ptr.5c1 = addr_of %.loc8_11.6 -// CHECK:STDOUT: %Int.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8_11.4(%addr.loc8_11) +// CHECK:STDOUT: %Int.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8_11.6(%addr.loc8_11) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -875,6 +921,7 @@ fn F() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %u8: type = class_type @UInt, @UInt(%int_8) [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] @@ -894,8 +941,20 @@ fn F() { // CHECK:STDOUT: %.bc7: type = fn_type_with_self_type %ImplicitAs.Convert.type.951, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.f59 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.f59, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_8) [concrete] -// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] +// CHECK:STDOUT: %bound_method.43c: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.e80: %u8 = int_value 1 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.type.464: type = fn_type @UInt.as.Copy.impl.Op, @UInt.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.be7: %UInt.as.Copy.impl.Op.type.464 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f2e: = impl_witness imports.%Copy.impl_witness_table.70d, @UInt.as.Copy.impl(%int_8) [concrete] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.type.da2: type = fn_type @UInt.as.Copy.impl.Op, @UInt.as.Copy.impl(%int_8) [concrete] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.818: %UInt.as.Copy.impl.Op.type.da2 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.01f: %Copy.type = facet_value %u8, (%Copy.impl_witness.f2e) [concrete] +// CHECK:STDOUT: %.ad6: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.01f [concrete] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.bound: = bound_method %int_1.e80, %UInt.as.Copy.impl.Op.818 [concrete] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.specific_fn: = specific_function %UInt.as.Copy.impl.Op.818, @UInt.as.Copy.impl.Op(%int_8) [concrete] +// CHECK:STDOUT: %bound_method.cb0: = bound_method %int_1.e80, %UInt.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %UInt.as.Destroy.impl.Op.type.225: type = fn_type @UInt.as.Destroy.impl.Op, @UInt.as.Destroy.impl(%int_8) [concrete] // CHECK:STDOUT: %UInt.as.Destroy.impl.Op.cff: %UInt.as.Destroy.impl.Op.type.225 = struct_value () [concrete] // CHECK:STDOUT: } @@ -915,8 +974,10 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.104: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.367) = import_ref Core//prelude/types/uint, loc21_40, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.8f6)] +// CHECK:STDOUT: %Core.import_ref.104: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.367) = import_ref Core//prelude/types/uint, loc28_40, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.8f6)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b63 = impl_witness_table (%Core.import_ref.104), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.46f: @UInt.as.Copy.impl.%UInt.as.Copy.impl.Op.type (%UInt.as.Copy.impl.Op.type.464) = import_ref Core//prelude/types/uint, loc22_31, loaded [symbolic = @UInt.as.Copy.impl.%UInt.as.Copy.impl.Op (constants.%UInt.as.Copy.impl.Op.be7)] +// CHECK:STDOUT: %Copy.impl_witness_table.70d = impl_witness_table (%Core.import_ref.46f), @UInt.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -924,22 +985,27 @@ fn F() { // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %foo.ref: %foo.type = name_ref foo, imports.%foo.decl [concrete = constants.%foo] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0: %.bc7 = impl_witness_access constants.%ImplicitAs.impl_witness.038, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f59] -// CHECK:STDOUT: %bound_method.loc8_11.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_8) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc8_11.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %impl.elem0.loc8_11.1: %.bc7 = impl_witness_access constants.%ImplicitAs.impl_witness.038, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f59] +// CHECK:STDOUT: %bound_method.loc8_11.1: = bound_method %int_1, %impl.elem0.loc8_11.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc8_11.1: = specific_function %impl.elem0.loc8_11.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_8) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_11.2: = bound_method %int_1, %specific_fn.loc8_11.1 [concrete = constants.%bound_method.43c] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %u8 = call %bound_method.loc8_11.2(%int_1) [concrete = constants.%int_1.e80] // CHECK:STDOUT: %.loc8_11.1: %u8 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.e80] // CHECK:STDOUT: %.loc8_11.2: %u8 = converted %int_1, %.loc8_11.1 [concrete = constants.%int_1.e80] +// CHECK:STDOUT: %impl.elem0.loc8_11.2: %.ad6 = impl_witness_access constants.%Copy.impl_witness.f2e, element0 [concrete = constants.%UInt.as.Copy.impl.Op.818] +// CHECK:STDOUT: %bound_method.loc8_11.3: = bound_method %.loc8_11.2, %impl.elem0.loc8_11.2 [concrete = constants.%UInt.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %specific_fn.loc8_11.2: = specific_function %impl.elem0.loc8_11.2, @UInt.as.Copy.impl.Op(constants.%int_8) [concrete = constants.%UInt.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_11.4: = bound_method %.loc8_11.2, %specific_fn.loc8_11.2 [concrete = constants.%bound_method.cb0] +// CHECK:STDOUT: %UInt.as.Copy.impl.Op.call: init %u8 = call %bound_method.loc8_11.4(%.loc8_11.2) [concrete = constants.%int_1.e80] // CHECK:STDOUT: %.loc8_11.3: ref %u8 = temporary_storage -// CHECK:STDOUT: %.loc8_11.4: ref %u8 = temporary %.loc8_11.3, %.loc8_11.2 +// CHECK:STDOUT: %.loc8_11.4: ref %u8 = temporary %.loc8_11.3, %UInt.as.Copy.impl.Op.call // CHECK:STDOUT: %addr.loc8_12: %ptr.3e8 = addr_of %.loc8_11.4 // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc8_12) // CHECK:STDOUT: %UInt.as.Destroy.impl.Op.bound: = bound_method %.loc8_11.4, constants.%UInt.as.Destroy.impl.Op.cff // CHECK:STDOUT: -// CHECK:STDOUT: %bound_method.loc8_11.3: = bound_method %.loc8_11.4, %UInt.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %bound_method.loc8_11.5: = bound_method %.loc8_11.4, %UInt.as.Destroy.impl.Op.specific_fn // CHECK:STDOUT: %addr.loc8_11: %ptr.3e8 = addr_of %.loc8_11.4 -// CHECK:STDOUT: %UInt.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8_11.3(%addr.loc8_11) +// CHECK:STDOUT: %UInt.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8_11.5(%addr.loc8_11) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -963,6 +1029,14 @@ fn F() { // CHECK:STDOUT: %Core.CharLiteral.as.ImplicitAs.impl.Convert: %Core.CharLiteral.as.ImplicitAs.impl.Convert.type = struct_value () [concrete] // CHECK:STDOUT: %Core.CharLiteral.as.ImplicitAs.impl.Convert.bound: = bound_method %.d16, %Core.CharLiteral.as.ImplicitAs.impl.Convert [concrete] // CHECK:STDOUT: %int_88: %Char = int_value 88 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Copy.impl_witness.0c3: = impl_witness imports.%Copy.impl_witness_table.e5f [concrete] +// CHECK:STDOUT: %Copy.facet.2e3: %Copy.type = facet_value %Char, (%Copy.impl_witness.0c3) [concrete] +// CHECK:STDOUT: %.579: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.2e3 [concrete] +// CHECK:STDOUT: %Char.as.Copy.impl.Op.type: type = fn_type @Char.as.Copy.impl.Op [concrete] +// CHECK:STDOUT: %Char.as.Copy.impl.Op: %Char.as.Copy.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Char.as.Copy.impl.Op.bound: = bound_method %int_88, %Char.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %Char.as.Destroy.impl.Op.type: type = fn_type @Char.as.Destroy.impl.Op [concrete] // CHECK:STDOUT: %Char.as.Destroy.impl.Op: %Char.as.Destroy.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: } @@ -982,8 +1056,10 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.adf: %Core.CharLiteral.as.ImplicitAs.impl.Convert.type = import_ref Core//prelude/types/char, loc18_36, loaded [concrete = constants.%Core.CharLiteral.as.ImplicitAs.impl.Convert] -// CHECK:STDOUT: %ImplicitAs.impl_witness_table.97b = impl_witness_table (%Core.import_ref.adf), @Core.CharLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.adf1: %Core.CharLiteral.as.ImplicitAs.impl.Convert.type = import_ref Core//prelude/types/char, loc23_36, loaded [concrete = constants.%Core.CharLiteral.as.ImplicitAs.impl.Convert] +// CHECK:STDOUT: %ImplicitAs.impl_witness_table.97b = impl_witness_table (%Core.import_ref.adf1), @Core.CharLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.a11: %Char.as.Copy.impl.Op.type = import_ref Core//prelude/types/char, loc19_31, loaded [concrete = constants.%Char.as.Copy.impl.Op] +// CHECK:STDOUT: %Copy.impl_witness_table.e5f = impl_witness_table (%Core.import_ref.a11), @Char.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -991,13 +1067,16 @@ fn F() { // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %foo.ref: %foo.type = name_ref foo, imports.%foo.decl [concrete = constants.%foo] // CHECK:STDOUT: %.loc8_11.1: Core.CharLiteral = char_value U+0058 [concrete = constants.%.d16] -// CHECK:STDOUT: %impl.elem0: %.674 = impl_witness_access constants.%ImplicitAs.impl_witness.ce4, element0 [concrete = constants.%Core.CharLiteral.as.ImplicitAs.impl.Convert] -// CHECK:STDOUT: %bound_method: = bound_method %.loc8_11.1, %impl.elem0 [concrete = constants.%Core.CharLiteral.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %Core.CharLiteral.as.ImplicitAs.impl.Convert.call: init %Char = call %bound_method(%.loc8_11.1) [concrete = constants.%int_88] +// CHECK:STDOUT: %impl.elem0.loc8_11.1: %.674 = impl_witness_access constants.%ImplicitAs.impl_witness.ce4, element0 [concrete = constants.%Core.CharLiteral.as.ImplicitAs.impl.Convert] +// CHECK:STDOUT: %bound_method.loc8_11.1: = bound_method %.loc8_11.1, %impl.elem0.loc8_11.1 [concrete = constants.%Core.CharLiteral.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %Core.CharLiteral.as.ImplicitAs.impl.Convert.call: init %Char = call %bound_method.loc8_11.1(%.loc8_11.1) [concrete = constants.%int_88] // CHECK:STDOUT: %.loc8_11.2: %Char = value_of_initializer %Core.CharLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_88] // CHECK:STDOUT: %.loc8_11.3: %Char = converted %.loc8_11.1, %.loc8_11.2 [concrete = constants.%int_88] +// CHECK:STDOUT: %impl.elem0.loc8_11.2: %.579 = impl_witness_access constants.%Copy.impl_witness.0c3, element0 [concrete = constants.%Char.as.Copy.impl.Op] +// CHECK:STDOUT: %bound_method.loc8_11.2: = bound_method %.loc8_11.3, %impl.elem0.loc8_11.2 [concrete = constants.%Char.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %Char.as.Copy.impl.Op.call: init %Char = call %bound_method.loc8_11.2(%.loc8_11.3) [concrete = constants.%int_88] // CHECK:STDOUT: %.loc8_11.4: ref %Char = temporary_storage -// CHECK:STDOUT: %.loc8_11.5: ref %Char = temporary %.loc8_11.4, %.loc8_11.3 +// CHECK:STDOUT: %.loc8_11.5: ref %Char = temporary %.loc8_11.4, %Char.as.Copy.impl.Op.call // CHECK:STDOUT: %addr.loc8_14: %ptr.fb0 = addr_of %.loc8_11.5 // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc8_14) // CHECK:STDOUT: %Char.as.Destroy.impl.Op.bound: = bound_method %.loc8_11.5, constants.%Char.as.Destroy.impl.Op @@ -1063,7 +1142,7 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/types/int, loc20_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/types/int, loc27_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1130,6 +1209,7 @@ fn F() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] @@ -1149,8 +1229,20 @@ fn F() { // CHECK:STDOUT: %.a59: type = fn_type_with_self_type %As.Convert.type.be5, %As.facet [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.3d5 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.As.impl.Convert.3d5, @Core.IntLiteral.as.As.impl.Convert(%int_16) [concrete] -// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete] +// CHECK:STDOUT: %bound_method.0a7: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.f90: %i16 = int_value 1 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.52b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_16) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.520: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_16) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.9da: %Int.as.Copy.impl.Op.type.520 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.fd9: %Copy.type = facet_value %i16, (%Copy.impl_witness.52b) [concrete] +// CHECK:STDOUT: %.79d: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.fd9 [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.bound: = bound_method %int_1.f90, %Int.as.Copy.impl.Op.9da [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.9da, @Int.as.Copy.impl.Op(%int_16) [concrete] +// CHECK:STDOUT: %bound_method.efc: = bound_method %int_1.f90, %Int.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %Int.as.Destroy.impl.Op.type.135: type = fn_type @Int.as.Destroy.impl.Op, @Int.as.Destroy.impl(%int_16) [concrete] // CHECK:STDOUT: %Int.as.Destroy.impl.Op.718: %Int.as.Destroy.impl.Op.type.135 = struct_value () [concrete] // CHECK:STDOUT: } @@ -1170,8 +1262,10 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/types/int, loc29_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] +// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/types/int, loc36_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] // CHECK:STDOUT: %As.impl_witness_table.3fe = impl_witness_table (%Core.import_ref.52c), @Core.IntLiteral.as.As.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/types/int, loc21_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -1181,22 +1275,27 @@ fn F() { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] -// CHECK:STDOUT: %impl.elem0: %.a59 = impl_witness_access constants.%As.impl_witness.30d, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.3d5] -// CHECK:STDOUT: %bound_method.loc8_13.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.As.impl.Convert(constants.%int_16) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc8_13.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %impl.elem0.loc8_13.1: %.a59 = impl_witness_access constants.%As.impl_witness.30d, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.3d5] +// CHECK:STDOUT: %bound_method.loc8_13.1: = bound_method %int_1, %impl.elem0.loc8_13.1 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc8_13.1: = specific_function %impl.elem0.loc8_13.1, @Core.IntLiteral.as.As.impl.Convert(constants.%int_16) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_13.2: = bound_method %int_1, %specific_fn.loc8_13.1 [concrete = constants.%bound_method.0a7] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i16 = call %bound_method.loc8_13.2(%int_1) [concrete = constants.%int_1.f90] // CHECK:STDOUT: %.loc8_13.1: %i16 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.f90] // CHECK:STDOUT: %.loc8_13.2: %i16 = converted %int_1, %.loc8_13.1 [concrete = constants.%int_1.f90] +// CHECK:STDOUT: %impl.elem0.loc8_13.2: %.79d = impl_witness_access constants.%Copy.impl_witness.52b, element0 [concrete = constants.%Int.as.Copy.impl.Op.9da] +// CHECK:STDOUT: %bound_method.loc8_13.3: = bound_method %.loc8_13.2, %impl.elem0.loc8_13.2 [concrete = constants.%Int.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %specific_fn.loc8_13.2: = specific_function %impl.elem0.loc8_13.2, @Int.as.Copy.impl.Op(constants.%int_16) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_13.4: = bound_method %.loc8_13.2, %specific_fn.loc8_13.2 [concrete = constants.%bound_method.efc] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i16 = call %bound_method.loc8_13.4(%.loc8_13.2) [concrete = constants.%int_1.f90] // CHECK:STDOUT: %.loc8_13.3: ref %i16 = temporary_storage -// CHECK:STDOUT: %.loc8_13.4: ref %i16 = temporary %.loc8_13.3, %.loc8_13.2 +// CHECK:STDOUT: %.loc8_13.4: ref %i16 = temporary %.loc8_13.3, %Int.as.Copy.impl.Op.call // CHECK:STDOUT: %addr.loc8_19: %ptr.251 = addr_of %.loc8_13.4 // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc8_19) // CHECK:STDOUT: %Int.as.Destroy.impl.Op.bound: = bound_method %.loc8_13.4, constants.%Int.as.Destroy.impl.Op.718 // CHECK:STDOUT: -// CHECK:STDOUT: %bound_method.loc8_13.3: = bound_method %.loc8_13.4, %Int.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %bound_method.loc8_13.5: = bound_method %.loc8_13.4, %Int.as.Destroy.impl.Op.specific_fn // CHECK:STDOUT: %addr.loc8_13: %ptr.251 = addr_of %.loc8_13.4 -// CHECK:STDOUT: %Int.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8_13.3(%addr.loc8_13) +// CHECK:STDOUT: %Int.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8_13.5(%addr.loc8_13) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1205,6 +1304,7 @@ fn F() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] @@ -1224,8 +1324,20 @@ fn F() { // CHECK:STDOUT: %.8df: type = fn_type_with_self_type %ImplicitAs.Convert.type.fa6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: = bound_method %int_32767.f4b, %Core.IntLiteral.as.ImplicitAs.impl.Convert.1f1 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.1f1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_16) [concrete] -// CHECK:STDOUT: %bound_method: = bound_method %int_32767.f4b, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] +// CHECK:STDOUT: %bound_method.2e8: = bound_method %int_32767.f4b, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_32767.faa: %i16 = int_value 32767 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.52b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_16) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.520: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_16) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.9da: %Int.as.Copy.impl.Op.type.520 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.fd9: %Copy.type = facet_value %i16, (%Copy.impl_witness.52b) [concrete] +// CHECK:STDOUT: %.79d: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.fd9 [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.bound: = bound_method %int_32767.faa, %Int.as.Copy.impl.Op.9da [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.9da, @Int.as.Copy.impl.Op(%int_16) [concrete] +// CHECK:STDOUT: %bound_method.a7f: = bound_method %int_32767.faa, %Int.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %Int.as.Destroy.impl.Op.type.135: type = fn_type @Int.as.Destroy.impl.Op, @Int.as.Destroy.impl(%int_16) [concrete] // CHECK:STDOUT: %Int.as.Destroy.impl.Op.718: %Int.as.Destroy.impl.Op.type.135 = struct_value () [concrete] // CHECK:STDOUT: } @@ -1245,8 +1357,10 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/types/int, loc20_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/types/int, loc27_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/types/int, loc21_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -1254,22 +1368,27 @@ fn F() { // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %foo.ref: %foo.type = name_ref foo, imports.%foo.decl [concrete = constants.%foo] // CHECK:STDOUT: %int_32767: Core.IntLiteral = int_value 32767 [concrete = constants.%int_32767.f4b] -// CHECK:STDOUT: %impl.elem0: %.8df = impl_witness_access constants.%ImplicitAs.impl_witness.43c, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.1f1] -// CHECK:STDOUT: %bound_method.loc8_11.1: = bound_method %int_32767, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_16) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc8_11.2: = bound_method %int_32767, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %impl.elem0.loc8_11.1: %.8df = impl_witness_access constants.%ImplicitAs.impl_witness.43c, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.1f1] +// CHECK:STDOUT: %bound_method.loc8_11.1: = bound_method %int_32767, %impl.elem0.loc8_11.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc8_11.1: = specific_function %impl.elem0.loc8_11.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_16) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_11.2: = bound_method %int_32767, %specific_fn.loc8_11.1 [concrete = constants.%bound_method.2e8] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i16 = call %bound_method.loc8_11.2(%int_32767) [concrete = constants.%int_32767.faa] // CHECK:STDOUT: %.loc8_11.1: %i16 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_32767.faa] // CHECK:STDOUT: %.loc8_11.2: %i16 = converted %int_32767, %.loc8_11.1 [concrete = constants.%int_32767.faa] +// CHECK:STDOUT: %impl.elem0.loc8_11.2: %.79d = impl_witness_access constants.%Copy.impl_witness.52b, element0 [concrete = constants.%Int.as.Copy.impl.Op.9da] +// CHECK:STDOUT: %bound_method.loc8_11.3: = bound_method %.loc8_11.2, %impl.elem0.loc8_11.2 [concrete = constants.%Int.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %specific_fn.loc8_11.2: = specific_function %impl.elem0.loc8_11.2, @Int.as.Copy.impl.Op(constants.%int_16) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_11.4: = bound_method %.loc8_11.2, %specific_fn.loc8_11.2 [concrete = constants.%bound_method.a7f] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i16 = call %bound_method.loc8_11.4(%.loc8_11.2) [concrete = constants.%int_32767.faa] // CHECK:STDOUT: %.loc8_11.3: ref %i16 = temporary_storage -// CHECK:STDOUT: %.loc8_11.4: ref %i16 = temporary %.loc8_11.3, %.loc8_11.2 +// CHECK:STDOUT: %.loc8_11.4: ref %i16 = temporary %.loc8_11.3, %Int.as.Copy.impl.Op.call // CHECK:STDOUT: %addr.loc8_17: %ptr.251 = addr_of %.loc8_11.4 // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc8_17) // CHECK:STDOUT: %Int.as.Destroy.impl.Op.bound: = bound_method %.loc8_11.4, constants.%Int.as.Destroy.impl.Op.718 // CHECK:STDOUT: -// CHECK:STDOUT: %bound_method.loc8_11.3: = bound_method %.loc8_11.4, %Int.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %bound_method.loc8_11.5: = bound_method %.loc8_11.4, %Int.as.Destroy.impl.Op.specific_fn // CHECK:STDOUT: %addr.loc8_11: %ptr.251 = addr_of %.loc8_11.4 -// CHECK:STDOUT: %Int.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8_11.3(%addr.loc8_11) +// CHECK:STDOUT: %Int.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8_11.5(%addr.loc8_11) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1278,6 +1397,7 @@ fn F() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] @@ -1306,8 +1426,20 @@ fn F() { // CHECK:STDOUT: %.8df: type = fn_type_with_self_type %ImplicitAs.Convert.type.fa6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: = bound_method %int_-32768.882, %Core.IntLiteral.as.ImplicitAs.impl.Convert.1f1 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.1f1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_16) [concrete] -// CHECK:STDOUT: %bound_method: = bound_method %int_-32768.882, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] +// CHECK:STDOUT: %bound_method.b0d: = bound_method %int_-32768.882, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_-32768.7e5: %i16 = int_value -32768 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.52b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_16) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.520: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_16) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.9da: %Int.as.Copy.impl.Op.type.520 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.fd9: %Copy.type = facet_value %i16, (%Copy.impl_witness.52b) [concrete] +// CHECK:STDOUT: %.79d: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.fd9 [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.bound: = bound_method %int_-32768.7e5, %Int.as.Copy.impl.Op.9da [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.9da, @Int.as.Copy.impl.Op(%int_16) [concrete] +// CHECK:STDOUT: %bound_method.503: = bound_method %int_-32768.7e5, %Int.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %Int.as.Destroy.impl.Op.type.135: type = fn_type @Int.as.Destroy.impl.Op, @Int.as.Destroy.impl(%int_16) [concrete] // CHECK:STDOUT: %Int.as.Destroy.impl.Op.718: %Int.as.Destroy.impl.Op.type.135 = struct_value () [concrete] // CHECK:STDOUT: } @@ -1330,8 +1462,10 @@ fn F() { // CHECK:STDOUT: %Core.import_ref.abd = import_ref Core//prelude/operators/arithmetic, loc111_50, unloaded // CHECK:STDOUT: %Core.import_ref.037: %Core.IntLiteral.as.Negate.impl.Op.type = import_ref Core//prelude/operators/arithmetic, loc112_31, loaded [concrete = constants.%Core.IntLiteral.as.Negate.impl.Op] // CHECK:STDOUT: %Negate.impl_witness_table = impl_witness_table (%Core.import_ref.abd, %Core.import_ref.037), @Core.IntLiteral.as.Negate.impl [concrete] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/types/int, loc20_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/types/int, loc27_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/types/int, loc21_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -1342,24 +1476,29 @@ fn F() { // CHECK:STDOUT: %impl.elem1: %.e9a = impl_witness_access constants.%Negate.impl_witness, element1 [concrete = constants.%Core.IntLiteral.as.Negate.impl.Op] // CHECK:STDOUT: %bound_method.loc8_11.1: = bound_method %int_32768, %impl.elem1 [concrete = constants.%Core.IntLiteral.as.Negate.impl.Op.bound] // CHECK:STDOUT: %Core.IntLiteral.as.Negate.impl.Op.call: init Core.IntLiteral = call %bound_method.loc8_11.1(%int_32768) [concrete = constants.%int_-32768.882] -// CHECK:STDOUT: %impl.elem0: %.8df = impl_witness_access constants.%ImplicitAs.impl_witness.43c, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.1f1] -// CHECK:STDOUT: %bound_method.loc8_11.2: = bound_method %Core.IntLiteral.as.Negate.impl.Op.call, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_16) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc8_11.3: = bound_method %Core.IntLiteral.as.Negate.impl.Op.call, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %impl.elem0.loc8_11.1: %.8df = impl_witness_access constants.%ImplicitAs.impl_witness.43c, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.1f1] +// CHECK:STDOUT: %bound_method.loc8_11.2: = bound_method %Core.IntLiteral.as.Negate.impl.Op.call, %impl.elem0.loc8_11.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc8_11.1: = specific_function %impl.elem0.loc8_11.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_16) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_11.3: = bound_method %Core.IntLiteral.as.Negate.impl.Op.call, %specific_fn.loc8_11.1 [concrete = constants.%bound_method.b0d] // CHECK:STDOUT: %.loc8_11.1: Core.IntLiteral = value_of_initializer %Core.IntLiteral.as.Negate.impl.Op.call [concrete = constants.%int_-32768.882] // CHECK:STDOUT: %.loc8_11.2: Core.IntLiteral = converted %Core.IntLiteral.as.Negate.impl.Op.call, %.loc8_11.1 [concrete = constants.%int_-32768.882] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i16 = call %bound_method.loc8_11.3(%.loc8_11.2) [concrete = constants.%int_-32768.7e5] // CHECK:STDOUT: %.loc8_11.3: %i16 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_-32768.7e5] // CHECK:STDOUT: %.loc8_11.4: %i16 = converted %Core.IntLiteral.as.Negate.impl.Op.call, %.loc8_11.3 [concrete = constants.%int_-32768.7e5] +// CHECK:STDOUT: %impl.elem0.loc8_11.2: %.79d = impl_witness_access constants.%Copy.impl_witness.52b, element0 [concrete = constants.%Int.as.Copy.impl.Op.9da] +// CHECK:STDOUT: %bound_method.loc8_11.4: = bound_method %.loc8_11.4, %impl.elem0.loc8_11.2 [concrete = constants.%Int.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %specific_fn.loc8_11.2: = specific_function %impl.elem0.loc8_11.2, @Int.as.Copy.impl.Op(constants.%int_16) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_11.5: = bound_method %.loc8_11.4, %specific_fn.loc8_11.2 [concrete = constants.%bound_method.503] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i16 = call %bound_method.loc8_11.5(%.loc8_11.4) [concrete = constants.%int_-32768.7e5] // CHECK:STDOUT: %.loc8_11.5: ref %i16 = temporary_storage -// CHECK:STDOUT: %.loc8_11.6: ref %i16 = temporary %.loc8_11.5, %.loc8_11.4 +// CHECK:STDOUT: %.loc8_11.6: ref %i16 = temporary %.loc8_11.5, %Int.as.Copy.impl.Op.call // CHECK:STDOUT: %addr.loc8_18: %ptr.251 = addr_of %.loc8_11.6 // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc8_18) // CHECK:STDOUT: %Int.as.Destroy.impl.Op.bound: = bound_method %.loc8_11.6, constants.%Int.as.Destroy.impl.Op.718 // CHECK:STDOUT: -// CHECK:STDOUT: %bound_method.loc8_11.4: = bound_method %.loc8_11.6, %Int.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %bound_method.loc8_11.6: = bound_method %.loc8_11.6, %Int.as.Destroy.impl.Op.specific_fn // CHECK:STDOUT: %addr.loc8_11: %ptr.251 = addr_of %.loc8_11.6 -// CHECK:STDOUT: %Int.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8_11.4(%addr.loc8_11) +// CHECK:STDOUT: %Int.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8_11.6(%addr.loc8_11) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1368,6 +1507,7 @@ fn F() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] @@ -1387,8 +1527,20 @@ fn F() { // CHECK:STDOUT: %.a59: type = fn_type_with_self_type %As.Convert.type.be5, %As.facet [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.3d5 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.As.impl.Convert.3d5, @Core.IntLiteral.as.As.impl.Convert(%int_16) [concrete] -// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete] +// CHECK:STDOUT: %bound_method.0a7: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.f90: %i16 = int_value 1 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.52b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_16) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.520: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_16) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.9da: %Int.as.Copy.impl.Op.type.520 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.fd9: %Copy.type = facet_value %i16, (%Copy.impl_witness.52b) [concrete] +// CHECK:STDOUT: %.79d: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.fd9 [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.bound: = bound_method %int_1.f90, %Int.as.Copy.impl.Op.9da [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.9da, @Int.as.Copy.impl.Op(%int_16) [concrete] +// CHECK:STDOUT: %bound_method.efc: = bound_method %int_1.f90, %Int.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %Int.as.Destroy.impl.Op.type.135: type = fn_type @Int.as.Destroy.impl.Op, @Int.as.Destroy.impl(%int_16) [concrete] // CHECK:STDOUT: %Int.as.Destroy.impl.Op.718: %Int.as.Destroy.impl.Op.type.135 = struct_value () [concrete] // CHECK:STDOUT: } @@ -1408,8 +1560,10 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/types/int, loc29_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] +// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/types/int, loc36_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] // CHECK:STDOUT: %As.impl_witness_table.3fe = impl_witness_table (%Core.import_ref.52c), @Core.IntLiteral.as.As.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/types/int, loc21_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -1419,22 +1573,27 @@ fn F() { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] -// CHECK:STDOUT: %impl.elem0: %.a59 = impl_witness_access constants.%As.impl_witness.30d, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.3d5] -// CHECK:STDOUT: %bound_method.loc8_13.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.As.impl.Convert(constants.%int_16) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc8_13.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %impl.elem0.loc8_13.1: %.a59 = impl_witness_access constants.%As.impl_witness.30d, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.3d5] +// CHECK:STDOUT: %bound_method.loc8_13.1: = bound_method %int_1, %impl.elem0.loc8_13.1 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc8_13.1: = specific_function %impl.elem0.loc8_13.1, @Core.IntLiteral.as.As.impl.Convert(constants.%int_16) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_13.2: = bound_method %int_1, %specific_fn.loc8_13.1 [concrete = constants.%bound_method.0a7] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i16 = call %bound_method.loc8_13.2(%int_1) [concrete = constants.%int_1.f90] // CHECK:STDOUT: %.loc8_13.1: %i16 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.f90] // CHECK:STDOUT: %.loc8_13.2: %i16 = converted %int_1, %.loc8_13.1 [concrete = constants.%int_1.f90] +// CHECK:STDOUT: %impl.elem0.loc8_13.2: %.79d = impl_witness_access constants.%Copy.impl_witness.52b, element0 [concrete = constants.%Int.as.Copy.impl.Op.9da] +// CHECK:STDOUT: %bound_method.loc8_13.3: = bound_method %.loc8_13.2, %impl.elem0.loc8_13.2 [concrete = constants.%Int.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %specific_fn.loc8_13.2: = specific_function %impl.elem0.loc8_13.2, @Int.as.Copy.impl.Op(constants.%int_16) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_13.4: = bound_method %.loc8_13.2, %specific_fn.loc8_13.2 [concrete = constants.%bound_method.efc] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i16 = call %bound_method.loc8_13.4(%.loc8_13.2) [concrete = constants.%int_1.f90] // CHECK:STDOUT: %.loc8_13.3: ref %i16 = temporary_storage -// CHECK:STDOUT: %.loc8_13.4: ref %i16 = temporary %.loc8_13.3, %.loc8_13.2 +// CHECK:STDOUT: %.loc8_13.4: ref %i16 = temporary %.loc8_13.3, %Int.as.Copy.impl.Op.call // CHECK:STDOUT: %addr.loc8_19: %ptr.251 = addr_of %.loc8_13.4 // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc8_19) // CHECK:STDOUT: %Int.as.Destroy.impl.Op.bound: = bound_method %.loc8_13.4, constants.%Int.as.Destroy.impl.Op.718 // CHECK:STDOUT: -// CHECK:STDOUT: %bound_method.loc8_13.3: = bound_method %.loc8_13.4, %Int.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %bound_method.loc8_13.5: = bound_method %.loc8_13.4, %Int.as.Destroy.impl.Op.specific_fn // CHECK:STDOUT: %addr.loc8_13: %ptr.251 = addr_of %.loc8_13.4 -// CHECK:STDOUT: %Int.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8_13.3(%addr.loc8_13) +// CHECK:STDOUT: %Int.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8_13.5(%addr.loc8_13) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1443,6 +1602,7 @@ fn F() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] @@ -1462,8 +1622,20 @@ fn F() { // CHECK:STDOUT: %.a59: type = fn_type_with_self_type %As.Convert.type.be5, %As.facet [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.3d5 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.As.impl.Convert.3d5, @Core.IntLiteral.as.As.impl.Convert(%int_16) [concrete] -// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete] +// CHECK:STDOUT: %bound_method.0a7: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.f90: %i16 = int_value 1 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.52b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_16) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.520: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_16) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.9da: %Int.as.Copy.impl.Op.type.520 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.fd9: %Copy.type = facet_value %i16, (%Copy.impl_witness.52b) [concrete] +// CHECK:STDOUT: %.79d: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.fd9 [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.bound: = bound_method %int_1.f90, %Int.as.Copy.impl.Op.9da [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.9da, @Int.as.Copy.impl.Op(%int_16) [concrete] +// CHECK:STDOUT: %bound_method.efc: = bound_method %int_1.f90, %Int.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %Int.as.Destroy.impl.Op.type.135: type = fn_type @Int.as.Destroy.impl.Op, @Int.as.Destroy.impl(%int_16) [concrete] // CHECK:STDOUT: %Int.as.Destroy.impl.Op.718: %Int.as.Destroy.impl.Op.type.135 = struct_value () [concrete] // CHECK:STDOUT: } @@ -1483,8 +1655,10 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/types/int, loc29_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] +// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/types/int, loc36_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] // CHECK:STDOUT: %As.impl_witness_table.3fe = impl_witness_table (%Core.import_ref.52c), @Core.IntLiteral.as.As.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/types/int, loc21_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -1494,22 +1668,27 @@ fn F() { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] -// CHECK:STDOUT: %impl.elem0: %.a59 = impl_witness_access constants.%As.impl_witness.30d, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.3d5] -// CHECK:STDOUT: %bound_method.loc8_13.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.As.impl.Convert(constants.%int_16) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc8_13.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %impl.elem0.loc8_13.1: %.a59 = impl_witness_access constants.%As.impl_witness.30d, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.3d5] +// CHECK:STDOUT: %bound_method.loc8_13.1: = bound_method %int_1, %impl.elem0.loc8_13.1 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc8_13.1: = specific_function %impl.elem0.loc8_13.1, @Core.IntLiteral.as.As.impl.Convert(constants.%int_16) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_13.2: = bound_method %int_1, %specific_fn.loc8_13.1 [concrete = constants.%bound_method.0a7] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i16 = call %bound_method.loc8_13.2(%int_1) [concrete = constants.%int_1.f90] // CHECK:STDOUT: %.loc8_13.1: %i16 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.f90] // CHECK:STDOUT: %.loc8_13.2: %i16 = converted %int_1, %.loc8_13.1 [concrete = constants.%int_1.f90] +// CHECK:STDOUT: %impl.elem0.loc8_13.2: %.79d = impl_witness_access constants.%Copy.impl_witness.52b, element0 [concrete = constants.%Int.as.Copy.impl.Op.9da] +// CHECK:STDOUT: %bound_method.loc8_13.3: = bound_method %.loc8_13.2, %impl.elem0.loc8_13.2 [concrete = constants.%Int.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %specific_fn.loc8_13.2: = specific_function %impl.elem0.loc8_13.2, @Int.as.Copy.impl.Op(constants.%int_16) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_13.4: = bound_method %.loc8_13.2, %specific_fn.loc8_13.2 [concrete = constants.%bound_method.efc] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i16 = call %bound_method.loc8_13.4(%.loc8_13.2) [concrete = constants.%int_1.f90] // CHECK:STDOUT: %.loc8_13.3: ref %i16 = temporary_storage -// CHECK:STDOUT: %.loc8_13.4: ref %i16 = temporary %.loc8_13.3, %.loc8_13.2 +// CHECK:STDOUT: %.loc8_13.4: ref %i16 = temporary %.loc8_13.3, %Int.as.Copy.impl.Op.call // CHECK:STDOUT: %addr.loc8_19: %ptr.251 = addr_of %.loc8_13.4 // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc8_19) // CHECK:STDOUT: %Int.as.Destroy.impl.Op.bound: = bound_method %.loc8_13.4, constants.%Int.as.Destroy.impl.Op.718 // CHECK:STDOUT: -// CHECK:STDOUT: %bound_method.loc8_13.3: = bound_method %.loc8_13.4, %Int.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %bound_method.loc8_13.5: = bound_method %.loc8_13.4, %Int.as.Destroy.impl.Op.specific_fn // CHECK:STDOUT: %addr.loc8_13: %ptr.251 = addr_of %.loc8_13.4 -// CHECK:STDOUT: %Int.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8_13.3(%addr.loc8_13) +// CHECK:STDOUT: %Int.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8_13.5(%addr.loc8_13) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1518,6 +1697,7 @@ fn F() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] @@ -1537,8 +1717,20 @@ fn F() { // CHECK:STDOUT: %.a59: type = fn_type_with_self_type %As.Convert.type.be5, %As.facet [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.3d5 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.As.impl.Convert.3d5, @Core.IntLiteral.as.As.impl.Convert(%int_16) [concrete] -// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete] +// CHECK:STDOUT: %bound_method.0a7: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.f90: %i16 = int_value 1 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.52b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_16) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.520: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_16) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.9da: %Int.as.Copy.impl.Op.type.520 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.fd9: %Copy.type = facet_value %i16, (%Copy.impl_witness.52b) [concrete] +// CHECK:STDOUT: %.79d: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.fd9 [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.bound: = bound_method %int_1.f90, %Int.as.Copy.impl.Op.9da [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.9da, @Int.as.Copy.impl.Op(%int_16) [concrete] +// CHECK:STDOUT: %bound_method.efc: = bound_method %int_1.f90, %Int.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %Int.as.Destroy.impl.Op.type.135: type = fn_type @Int.as.Destroy.impl.Op, @Int.as.Destroy.impl(%int_16) [concrete] // CHECK:STDOUT: %Int.as.Destroy.impl.Op.718: %Int.as.Destroy.impl.Op.type.135 = struct_value () [concrete] // CHECK:STDOUT: } @@ -1558,8 +1750,10 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/types/int, loc29_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] +// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/types/int, loc36_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] // CHECK:STDOUT: %As.impl_witness_table.3fe = impl_witness_table (%Core.import_ref.52c), @Core.IntLiteral.as.As.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/types/int, loc21_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -1569,22 +1763,27 @@ fn F() { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] -// CHECK:STDOUT: %impl.elem0: %.a59 = impl_witness_access constants.%As.impl_witness.30d, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.3d5] -// CHECK:STDOUT: %bound_method.loc8_13.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.As.impl.Convert(constants.%int_16) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc8_13.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %impl.elem0.loc8_13.1: %.a59 = impl_witness_access constants.%As.impl_witness.30d, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.3d5] +// CHECK:STDOUT: %bound_method.loc8_13.1: = bound_method %int_1, %impl.elem0.loc8_13.1 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc8_13.1: = specific_function %impl.elem0.loc8_13.1, @Core.IntLiteral.as.As.impl.Convert(constants.%int_16) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_13.2: = bound_method %int_1, %specific_fn.loc8_13.1 [concrete = constants.%bound_method.0a7] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i16 = call %bound_method.loc8_13.2(%int_1) [concrete = constants.%int_1.f90] // CHECK:STDOUT: %.loc8_13.1: %i16 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.f90] // CHECK:STDOUT: %.loc8_13.2: %i16 = converted %int_1, %.loc8_13.1 [concrete = constants.%int_1.f90] +// CHECK:STDOUT: %impl.elem0.loc8_13.2: %.79d = impl_witness_access constants.%Copy.impl_witness.52b, element0 [concrete = constants.%Int.as.Copy.impl.Op.9da] +// CHECK:STDOUT: %bound_method.loc8_13.3: = bound_method %.loc8_13.2, %impl.elem0.loc8_13.2 [concrete = constants.%Int.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %specific_fn.loc8_13.2: = specific_function %impl.elem0.loc8_13.2, @Int.as.Copy.impl.Op(constants.%int_16) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_13.4: = bound_method %.loc8_13.2, %specific_fn.loc8_13.2 [concrete = constants.%bound_method.efc] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i16 = call %bound_method.loc8_13.4(%.loc8_13.2) [concrete = constants.%int_1.f90] // CHECK:STDOUT: %.loc8_13.3: ref %i16 = temporary_storage -// CHECK:STDOUT: %.loc8_13.4: ref %i16 = temporary %.loc8_13.3, %.loc8_13.2 +// CHECK:STDOUT: %.loc8_13.4: ref %i16 = temporary %.loc8_13.3, %Int.as.Copy.impl.Op.call // CHECK:STDOUT: %addr.loc8_19: %ptr.251 = addr_of %.loc8_13.4 // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc8_19) // CHECK:STDOUT: %Int.as.Destroy.impl.Op.bound: = bound_method %.loc8_13.4, constants.%Int.as.Destroy.impl.Op.718 // CHECK:STDOUT: -// CHECK:STDOUT: %bound_method.loc8_13.3: = bound_method %.loc8_13.4, %Int.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %bound_method.loc8_13.5: = bound_method %.loc8_13.4, %Int.as.Destroy.impl.Op.specific_fn // CHECK:STDOUT: %addr.loc8_13: %ptr.251 = addr_of %.loc8_13.4 -// CHECK:STDOUT: %Int.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8_13.3(%addr.loc8_13) +// CHECK:STDOUT: %Int.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8_13.5(%addr.loc8_13) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1593,6 +1792,7 @@ fn F() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] @@ -1612,8 +1812,20 @@ fn F() { // CHECK:STDOUT: %.a59: type = fn_type_with_self_type %As.Convert.type.be5, %As.facet [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.3d5 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.As.impl.Convert.3d5, @Core.IntLiteral.as.As.impl.Convert(%int_16) [concrete] -// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete] +// CHECK:STDOUT: %bound_method.0a7: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.f90: %i16 = int_value 1 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.52b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_16) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.520: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_16) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.9da: %Int.as.Copy.impl.Op.type.520 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.fd9: %Copy.type = facet_value %i16, (%Copy.impl_witness.52b) [concrete] +// CHECK:STDOUT: %.79d: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.fd9 [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.bound: = bound_method %int_1.f90, %Int.as.Copy.impl.Op.9da [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.9da, @Int.as.Copy.impl.Op(%int_16) [concrete] +// CHECK:STDOUT: %bound_method.efc: = bound_method %int_1.f90, %Int.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %Int.as.Destroy.impl.Op.type.135: type = fn_type @Int.as.Destroy.impl.Op, @Int.as.Destroy.impl(%int_16) [concrete] // CHECK:STDOUT: %Int.as.Destroy.impl.Op.718: %Int.as.Destroy.impl.Op.type.135 = struct_value () [concrete] // CHECK:STDOUT: } @@ -1633,8 +1845,10 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/types/int, loc29_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] +// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/types/int, loc36_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] // CHECK:STDOUT: %As.impl_witness_table.3fe = impl_witness_table (%Core.import_ref.52c), @Core.IntLiteral.as.As.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/types/int, loc21_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -1644,22 +1858,27 @@ fn F() { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] -// CHECK:STDOUT: %impl.elem0: %.a59 = impl_witness_access constants.%As.impl_witness.30d, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.3d5] -// CHECK:STDOUT: %bound_method.loc8_13.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.As.impl.Convert(constants.%int_16) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc8_13.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %impl.elem0.loc8_13.1: %.a59 = impl_witness_access constants.%As.impl_witness.30d, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.3d5] +// CHECK:STDOUT: %bound_method.loc8_13.1: = bound_method %int_1, %impl.elem0.loc8_13.1 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc8_13.1: = specific_function %impl.elem0.loc8_13.1, @Core.IntLiteral.as.As.impl.Convert(constants.%int_16) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_13.2: = bound_method %int_1, %specific_fn.loc8_13.1 [concrete = constants.%bound_method.0a7] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i16 = call %bound_method.loc8_13.2(%int_1) [concrete = constants.%int_1.f90] // CHECK:STDOUT: %.loc8_13.1: %i16 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.f90] // CHECK:STDOUT: %.loc8_13.2: %i16 = converted %int_1, %.loc8_13.1 [concrete = constants.%int_1.f90] +// CHECK:STDOUT: %impl.elem0.loc8_13.2: %.79d = impl_witness_access constants.%Copy.impl_witness.52b, element0 [concrete = constants.%Int.as.Copy.impl.Op.9da] +// CHECK:STDOUT: %bound_method.loc8_13.3: = bound_method %.loc8_13.2, %impl.elem0.loc8_13.2 [concrete = constants.%Int.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %specific_fn.loc8_13.2: = specific_function %impl.elem0.loc8_13.2, @Int.as.Copy.impl.Op(constants.%int_16) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_13.4: = bound_method %.loc8_13.2, %specific_fn.loc8_13.2 [concrete = constants.%bound_method.efc] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i16 = call %bound_method.loc8_13.4(%.loc8_13.2) [concrete = constants.%int_1.f90] // CHECK:STDOUT: %.loc8_13.3: ref %i16 = temporary_storage -// CHECK:STDOUT: %.loc8_13.4: ref %i16 = temporary %.loc8_13.3, %.loc8_13.2 +// CHECK:STDOUT: %.loc8_13.4: ref %i16 = temporary %.loc8_13.3, %Int.as.Copy.impl.Op.call // CHECK:STDOUT: %addr.loc8_19: %ptr.251 = addr_of %.loc8_13.4 // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc8_19) // CHECK:STDOUT: %Int.as.Destroy.impl.Op.bound: = bound_method %.loc8_13.4, constants.%Int.as.Destroy.impl.Op.718 // CHECK:STDOUT: -// CHECK:STDOUT: %bound_method.loc8_13.3: = bound_method %.loc8_13.4, %Int.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %bound_method.loc8_13.5: = bound_method %.loc8_13.4, %Int.as.Destroy.impl.Op.specific_fn // CHECK:STDOUT: %addr.loc8_13: %ptr.251 = addr_of %.loc8_13.4 -// CHECK:STDOUT: %Int.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8_13.3(%addr.loc8_13) +// CHECK:STDOUT: %Int.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8_13.5(%addr.loc8_13) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1707,7 +1926,7 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/types/int, loc29_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] +// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/types/int, loc36_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] // CHECK:STDOUT: %As.impl_witness_table.3fe = impl_witness_table (%Core.import_ref.52c), @Core.IntLiteral.as.As.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1873,8 +2092,20 @@ fn F() { // CHECK:STDOUT: %.854: type = fn_type_with_self_type %As.Convert.type.c23, %As.facet [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.As.impl.Convert.bound: = bound_method %float.c64, %Core.FloatLiteral.as.As.impl.Convert.fa6 [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.As.impl.Convert.specific_fn: = specific_function %Core.FloatLiteral.as.As.impl.Convert.fa6, @Core.FloatLiteral.as.As.impl.Convert(%int_16) [concrete] -// CHECK:STDOUT: %bound_method: = bound_method %float.c64, %Core.FloatLiteral.as.As.impl.Convert.specific_fn [concrete] +// CHECK:STDOUT: %bound_method.cd4: = bound_method %float.c64, %Core.FloatLiteral.as.As.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %float.032: %f16.a6a = float_value 0.7998 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.type.a25: type = fn_type @Float.as.Copy.impl.Op, @Float.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.623: %Float.as.Copy.impl.Op.type.a25 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.160: = impl_witness imports.%Copy.impl_witness_table.e1b, @Float.as.Copy.impl(%int_16) [concrete] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.type.b7e: type = fn_type @Float.as.Copy.impl.Op, @Float.as.Copy.impl(%int_16) [concrete] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.bcd: %Float.as.Copy.impl.Op.type.b7e = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.606: %Copy.type = facet_value %f16.a6a, (%Copy.impl_witness.160) [concrete] +// CHECK:STDOUT: %.60b: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.606 [concrete] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.bound: = bound_method %float.032, %Float.as.Copy.impl.Op.bcd [concrete] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.specific_fn: = specific_function %Float.as.Copy.impl.Op.bcd, @Float.as.Copy.impl.Op(%int_16) [concrete] +// CHECK:STDOUT: %bound_method.5dc: = bound_method %float.032, %Float.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %Float.as.Destroy.impl.Op.type.c42: type = fn_type @Float.as.Destroy.impl.Op, @Float.as.Destroy.impl(%int_16) [concrete] // CHECK:STDOUT: %Float.as.Destroy.impl.Op.bd5: %Float.as.Destroy.impl.Op.type.c42 = struct_value () [concrete] // CHECK:STDOUT: } @@ -1894,8 +2125,10 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.497: @Core.FloatLiteral.as.As.impl.%Core.FloatLiteral.as.As.impl.Convert.type (%Core.FloatLiteral.as.As.impl.Convert.type.b91) = import_ref Core//prelude/types/float, loc27_40, loaded [symbolic = @Core.FloatLiteral.as.As.impl.%Core.FloatLiteral.as.As.impl.Convert (constants.%Core.FloatLiteral.as.As.impl.Convert.e7c)] +// CHECK:STDOUT: %Core.import_ref.497: @Core.FloatLiteral.as.As.impl.%Core.FloatLiteral.as.As.impl.Convert.type (%Core.FloatLiteral.as.As.impl.Convert.type.b91) = import_ref Core//prelude/types/float, loc34_40, loaded [symbolic = @Core.FloatLiteral.as.As.impl.%Core.FloatLiteral.as.As.impl.Convert (constants.%Core.FloatLiteral.as.As.impl.Convert.e7c)] // CHECK:STDOUT: %As.impl_witness_table = impl_witness_table (%Core.import_ref.497), @Core.FloatLiteral.as.As.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.419: @Float.as.Copy.impl.%Float.as.Copy.impl.Op.type (%Float.as.Copy.impl.Op.type.a25) = import_ref Core//prelude/types/float, loc22_31, loaded [symbolic = @Float.as.Copy.impl.%Float.as.Copy.impl.Op (constants.%Float.as.Copy.impl.Op.623)] +// CHECK:STDOUT: %Copy.impl_witness_table.e1b = impl_witness_table (%Core.import_ref.419), @Float.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -1905,22 +2138,27 @@ fn F() { // CHECK:STDOUT: %float: Core.FloatLiteral = float_literal_value 8e-1 [concrete = constants.%float.c64] // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] // CHECK:STDOUT: %f16: type = class_type @Float, @Float(constants.%int_16) [concrete = constants.%f16.a6a] -// CHECK:STDOUT: %impl.elem0: %.854 = impl_witness_access constants.%As.impl_witness.88c, element0 [concrete = constants.%Core.FloatLiteral.as.As.impl.Convert.fa6] -// CHECK:STDOUT: %bound_method.loc8_15.1: = bound_method %float, %impl.elem0 [concrete = constants.%Core.FloatLiteral.as.As.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.FloatLiteral.as.As.impl.Convert(constants.%int_16) [concrete = constants.%Core.FloatLiteral.as.As.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc8_15.2: = bound_method %float, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %impl.elem0.loc8_15.1: %.854 = impl_witness_access constants.%As.impl_witness.88c, element0 [concrete = constants.%Core.FloatLiteral.as.As.impl.Convert.fa6] +// CHECK:STDOUT: %bound_method.loc8_15.1: = bound_method %float, %impl.elem0.loc8_15.1 [concrete = constants.%Core.FloatLiteral.as.As.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc8_15.1: = specific_function %impl.elem0.loc8_15.1, @Core.FloatLiteral.as.As.impl.Convert(constants.%int_16) [concrete = constants.%Core.FloatLiteral.as.As.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_15.2: = bound_method %float, %specific_fn.loc8_15.1 [concrete = constants.%bound_method.cd4] // CHECK:STDOUT: %Core.FloatLiteral.as.As.impl.Convert.call: init %f16.a6a = call %bound_method.loc8_15.2(%float) [concrete = constants.%float.032] // CHECK:STDOUT: %.loc8_15.1: %f16.a6a = value_of_initializer %Core.FloatLiteral.as.As.impl.Convert.call [concrete = constants.%float.032] // CHECK:STDOUT: %.loc8_15.2: %f16.a6a = converted %float, %.loc8_15.1 [concrete = constants.%float.032] +// CHECK:STDOUT: %impl.elem0.loc8_15.2: %.60b = impl_witness_access constants.%Copy.impl_witness.160, element0 [concrete = constants.%Float.as.Copy.impl.Op.bcd] +// CHECK:STDOUT: %bound_method.loc8_15.3: = bound_method %.loc8_15.2, %impl.elem0.loc8_15.2 [concrete = constants.%Float.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %specific_fn.loc8_15.2: = specific_function %impl.elem0.loc8_15.2, @Float.as.Copy.impl.Op(constants.%int_16) [concrete = constants.%Float.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_15.4: = bound_method %.loc8_15.2, %specific_fn.loc8_15.2 [concrete = constants.%bound_method.5dc] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.call: init %f16.a6a = call %bound_method.loc8_15.4(%.loc8_15.2) [concrete = constants.%float.032] // CHECK:STDOUT: %.loc8_15.3: ref %f16.a6a = temporary_storage -// CHECK:STDOUT: %.loc8_15.4: ref %f16.a6a = temporary %.loc8_15.3, %.loc8_15.2 +// CHECK:STDOUT: %.loc8_15.4: ref %f16.a6a = temporary %.loc8_15.3, %Float.as.Copy.impl.Op.call // CHECK:STDOUT: %addr.loc8_21: %ptr.823 = addr_of %.loc8_15.4 // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc8_21) // CHECK:STDOUT: %Float.as.Destroy.impl.Op.bound: = bound_method %.loc8_15.4, constants.%Float.as.Destroy.impl.Op.bd5 // CHECK:STDOUT: -// CHECK:STDOUT: %bound_method.loc8_15.3: = bound_method %.loc8_15.4, %Float.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %bound_method.loc8_15.5: = bound_method %.loc8_15.4, %Float.as.Destroy.impl.Op.specific_fn // CHECK:STDOUT: %addr.loc8_15: %ptr.823 = addr_of %.loc8_15.4 -// CHECK:STDOUT: %Float.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8_15.3(%addr.loc8_15) +// CHECK:STDOUT: %Float.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8_15.5(%addr.loc8_15) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1948,8 +2186,20 @@ fn F() { // CHECK:STDOUT: %.372: type = fn_type_with_self_type %As.Convert.type.f5e, %As.facet [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.As.impl.Convert.bound: = bound_method %float.c64, %Core.FloatLiteral.as.As.impl.Convert.3c7 [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.As.impl.Convert.specific_fn: = specific_function %Core.FloatLiteral.as.As.impl.Convert.3c7, @Core.FloatLiteral.as.As.impl.Convert(%int_32) [concrete] -// CHECK:STDOUT: %bound_method: = bound_method %float.c64, %Core.FloatLiteral.as.As.impl.Convert.specific_fn [concrete] +// CHECK:STDOUT: %bound_method.e41: = bound_method %float.c64, %Core.FloatLiteral.as.As.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %float.4cb: %f32.97e = float_value 0.800000011 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.type.a25: type = fn_type @Float.as.Copy.impl.Op, @Float.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.623: %Float.as.Copy.impl.Op.type.a25 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.0a7: = impl_witness imports.%Copy.impl_witness_table.e1b, @Float.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.type.58c: type = fn_type @Float.as.Copy.impl.Op, @Float.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.377: %Float.as.Copy.impl.Op.type.58c = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.333: %Copy.type = facet_value %f32.97e, (%Copy.impl_witness.0a7) [concrete] +// CHECK:STDOUT: %.72a: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.333 [concrete] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.bound: = bound_method %float.4cb, %Float.as.Copy.impl.Op.377 [concrete] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.specific_fn: = specific_function %Float.as.Copy.impl.Op.377, @Float.as.Copy.impl.Op(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.02e: = bound_method %float.4cb, %Float.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %Float.as.Destroy.impl.Op.type.d27: type = fn_type @Float.as.Destroy.impl.Op, @Float.as.Destroy.impl(%int_32) [concrete] // CHECK:STDOUT: %Float.as.Destroy.impl.Op.232: %Float.as.Destroy.impl.Op.type.d27 = struct_value () [concrete] // CHECK:STDOUT: } @@ -1969,8 +2219,10 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.497: @Core.FloatLiteral.as.As.impl.%Core.FloatLiteral.as.As.impl.Convert.type (%Core.FloatLiteral.as.As.impl.Convert.type.b91) = import_ref Core//prelude/types/float, loc27_40, loaded [symbolic = @Core.FloatLiteral.as.As.impl.%Core.FloatLiteral.as.As.impl.Convert (constants.%Core.FloatLiteral.as.As.impl.Convert.e7c)] +// CHECK:STDOUT: %Core.import_ref.497: @Core.FloatLiteral.as.As.impl.%Core.FloatLiteral.as.As.impl.Convert.type (%Core.FloatLiteral.as.As.impl.Convert.type.b91) = import_ref Core//prelude/types/float, loc34_40, loaded [symbolic = @Core.FloatLiteral.as.As.impl.%Core.FloatLiteral.as.As.impl.Convert (constants.%Core.FloatLiteral.as.As.impl.Convert.e7c)] // CHECK:STDOUT: %As.impl_witness_table = impl_witness_table (%Core.import_ref.497), @Core.FloatLiteral.as.As.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.419: @Float.as.Copy.impl.%Float.as.Copy.impl.Op.type (%Float.as.Copy.impl.Op.type.a25) = import_ref Core//prelude/types/float, loc22_31, loaded [symbolic = @Float.as.Copy.impl.%Float.as.Copy.impl.Op (constants.%Float.as.Copy.impl.Op.623)] +// CHECK:STDOUT: %Copy.impl_witness_table.e1b = impl_witness_table (%Core.import_ref.419), @Float.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -1980,22 +2232,27 @@ fn F() { // CHECK:STDOUT: %float: Core.FloatLiteral = float_literal_value 8e-1 [concrete = constants.%float.c64] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %f32: type = class_type @Float, @Float(constants.%int_32) [concrete = constants.%f32.97e] -// CHECK:STDOUT: %impl.elem0: %.372 = impl_witness_access constants.%As.impl_witness.992, element0 [concrete = constants.%Core.FloatLiteral.as.As.impl.Convert.3c7] -// CHECK:STDOUT: %bound_method.loc8_15.1: = bound_method %float, %impl.elem0 [concrete = constants.%Core.FloatLiteral.as.As.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.FloatLiteral.as.As.impl.Convert(constants.%int_32) [concrete = constants.%Core.FloatLiteral.as.As.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc8_15.2: = bound_method %float, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %impl.elem0.loc8_15.1: %.372 = impl_witness_access constants.%As.impl_witness.992, element0 [concrete = constants.%Core.FloatLiteral.as.As.impl.Convert.3c7] +// CHECK:STDOUT: %bound_method.loc8_15.1: = bound_method %float, %impl.elem0.loc8_15.1 [concrete = constants.%Core.FloatLiteral.as.As.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc8_15.1: = specific_function %impl.elem0.loc8_15.1, @Core.FloatLiteral.as.As.impl.Convert(constants.%int_32) [concrete = constants.%Core.FloatLiteral.as.As.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_15.2: = bound_method %float, %specific_fn.loc8_15.1 [concrete = constants.%bound_method.e41] // CHECK:STDOUT: %Core.FloatLiteral.as.As.impl.Convert.call: init %f32.97e = call %bound_method.loc8_15.2(%float) [concrete = constants.%float.4cb] // CHECK:STDOUT: %.loc8_15.1: %f32.97e = value_of_initializer %Core.FloatLiteral.as.As.impl.Convert.call [concrete = constants.%float.4cb] // CHECK:STDOUT: %.loc8_15.2: %f32.97e = converted %float, %.loc8_15.1 [concrete = constants.%float.4cb] +// CHECK:STDOUT: %impl.elem0.loc8_15.2: %.72a = impl_witness_access constants.%Copy.impl_witness.0a7, element0 [concrete = constants.%Float.as.Copy.impl.Op.377] +// CHECK:STDOUT: %bound_method.loc8_15.3: = bound_method %.loc8_15.2, %impl.elem0.loc8_15.2 [concrete = constants.%Float.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %specific_fn.loc8_15.2: = specific_function %impl.elem0.loc8_15.2, @Float.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Float.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_15.4: = bound_method %.loc8_15.2, %specific_fn.loc8_15.2 [concrete = constants.%bound_method.02e] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.call: init %f32.97e = call %bound_method.loc8_15.4(%.loc8_15.2) [concrete = constants.%float.4cb] // CHECK:STDOUT: %.loc8_15.3: ref %f32.97e = temporary_storage -// CHECK:STDOUT: %.loc8_15.4: ref %f32.97e = temporary %.loc8_15.3, %.loc8_15.2 +// CHECK:STDOUT: %.loc8_15.4: ref %f32.97e = temporary %.loc8_15.3, %Float.as.Copy.impl.Op.call // CHECK:STDOUT: %addr.loc8_21: %ptr.0bc = addr_of %.loc8_15.4 // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc8_21) // CHECK:STDOUT: %Float.as.Destroy.impl.Op.bound: = bound_method %.loc8_15.4, constants.%Float.as.Destroy.impl.Op.232 // CHECK:STDOUT: -// CHECK:STDOUT: %bound_method.loc8_15.3: = bound_method %.loc8_15.4, %Float.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %bound_method.loc8_15.5: = bound_method %.loc8_15.4, %Float.as.Destroy.impl.Op.specific_fn // CHECK:STDOUT: %addr.loc8_15: %ptr.0bc = addr_of %.loc8_15.4 -// CHECK:STDOUT: %Float.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8_15.3(%addr.loc8_15) +// CHECK:STDOUT: %Float.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8_15.5(%addr.loc8_15) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2023,8 +2280,20 @@ fn F() { // CHECK:STDOUT: %.ec3: type = fn_type_with_self_type %As.Convert.type.8fc, %As.facet [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.As.impl.Convert.bound: = bound_method %float.c64, %Core.FloatLiteral.as.As.impl.Convert.251 [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.As.impl.Convert.specific_fn: = specific_function %Core.FloatLiteral.as.As.impl.Convert.251, @Core.FloatLiteral.as.As.impl.Convert(%int_64) [concrete] -// CHECK:STDOUT: %bound_method: = bound_method %float.c64, %Core.FloatLiteral.as.As.impl.Convert.specific_fn [concrete] +// CHECK:STDOUT: %bound_method.e45: = bound_method %float.c64, %Core.FloatLiteral.as.As.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %float.0fc: %f64.d77 = float_value 0.80000000000000004 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.type.a25: type = fn_type @Float.as.Copy.impl.Op, @Float.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.623: %Float.as.Copy.impl.Op.type.a25 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.160: = impl_witness imports.%Copy.impl_witness_table.e1b, @Float.as.Copy.impl(%int_64) [concrete] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.type.256: type = fn_type @Float.as.Copy.impl.Op, @Float.as.Copy.impl(%int_64) [concrete] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.47e: %Float.as.Copy.impl.Op.type.256 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.2da: %Copy.type = facet_value %f64.d77, (%Copy.impl_witness.160) [concrete] +// CHECK:STDOUT: %.2ef: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.2da [concrete] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.bound: = bound_method %float.0fc, %Float.as.Copy.impl.Op.47e [concrete] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.specific_fn: = specific_function %Float.as.Copy.impl.Op.47e, @Float.as.Copy.impl.Op(%int_64) [concrete] +// CHECK:STDOUT: %bound_method.514: = bound_method %float.0fc, %Float.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %Float.as.Destroy.impl.Op.type.ce0: type = fn_type @Float.as.Destroy.impl.Op, @Float.as.Destroy.impl(%int_64) [concrete] // CHECK:STDOUT: %Float.as.Destroy.impl.Op.af3: %Float.as.Destroy.impl.Op.type.ce0 = struct_value () [concrete] // CHECK:STDOUT: } @@ -2044,8 +2313,10 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.497: @Core.FloatLiteral.as.As.impl.%Core.FloatLiteral.as.As.impl.Convert.type (%Core.FloatLiteral.as.As.impl.Convert.type.b91) = import_ref Core//prelude/types/float, loc27_40, loaded [symbolic = @Core.FloatLiteral.as.As.impl.%Core.FloatLiteral.as.As.impl.Convert (constants.%Core.FloatLiteral.as.As.impl.Convert.e7c)] +// CHECK:STDOUT: %Core.import_ref.497: @Core.FloatLiteral.as.As.impl.%Core.FloatLiteral.as.As.impl.Convert.type (%Core.FloatLiteral.as.As.impl.Convert.type.b91) = import_ref Core//prelude/types/float, loc34_40, loaded [symbolic = @Core.FloatLiteral.as.As.impl.%Core.FloatLiteral.as.As.impl.Convert (constants.%Core.FloatLiteral.as.As.impl.Convert.e7c)] // CHECK:STDOUT: %As.impl_witness_table = impl_witness_table (%Core.import_ref.497), @Core.FloatLiteral.as.As.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.419: @Float.as.Copy.impl.%Float.as.Copy.impl.Op.type (%Float.as.Copy.impl.Op.type.a25) = import_ref Core//prelude/types/float, loc22_31, loaded [symbolic = @Float.as.Copy.impl.%Float.as.Copy.impl.Op (constants.%Float.as.Copy.impl.Op.623)] +// CHECK:STDOUT: %Copy.impl_witness_table.e1b = impl_witness_table (%Core.import_ref.419), @Float.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -2055,22 +2326,27 @@ fn F() { // CHECK:STDOUT: %float: Core.FloatLiteral = float_literal_value 8e-1 [concrete = constants.%float.c64] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] // CHECK:STDOUT: %f64: type = class_type @Float, @Float(constants.%int_64) [concrete = constants.%f64.d77] -// CHECK:STDOUT: %impl.elem0: %.ec3 = impl_witness_access constants.%As.impl_witness.b46, element0 [concrete = constants.%Core.FloatLiteral.as.As.impl.Convert.251] -// CHECK:STDOUT: %bound_method.loc8_15.1: = bound_method %float, %impl.elem0 [concrete = constants.%Core.FloatLiteral.as.As.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.FloatLiteral.as.As.impl.Convert(constants.%int_64) [concrete = constants.%Core.FloatLiteral.as.As.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc8_15.2: = bound_method %float, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %impl.elem0.loc8_15.1: %.ec3 = impl_witness_access constants.%As.impl_witness.b46, element0 [concrete = constants.%Core.FloatLiteral.as.As.impl.Convert.251] +// CHECK:STDOUT: %bound_method.loc8_15.1: = bound_method %float, %impl.elem0.loc8_15.1 [concrete = constants.%Core.FloatLiteral.as.As.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc8_15.1: = specific_function %impl.elem0.loc8_15.1, @Core.FloatLiteral.as.As.impl.Convert(constants.%int_64) [concrete = constants.%Core.FloatLiteral.as.As.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_15.2: = bound_method %float, %specific_fn.loc8_15.1 [concrete = constants.%bound_method.e45] // CHECK:STDOUT: %Core.FloatLiteral.as.As.impl.Convert.call: init %f64.d77 = call %bound_method.loc8_15.2(%float) [concrete = constants.%float.0fc] // CHECK:STDOUT: %.loc8_15.1: %f64.d77 = value_of_initializer %Core.FloatLiteral.as.As.impl.Convert.call [concrete = constants.%float.0fc] // CHECK:STDOUT: %.loc8_15.2: %f64.d77 = converted %float, %.loc8_15.1 [concrete = constants.%float.0fc] +// CHECK:STDOUT: %impl.elem0.loc8_15.2: %.2ef = impl_witness_access constants.%Copy.impl_witness.160, element0 [concrete = constants.%Float.as.Copy.impl.Op.47e] +// CHECK:STDOUT: %bound_method.loc8_15.3: = bound_method %.loc8_15.2, %impl.elem0.loc8_15.2 [concrete = constants.%Float.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %specific_fn.loc8_15.2: = specific_function %impl.elem0.loc8_15.2, @Float.as.Copy.impl.Op(constants.%int_64) [concrete = constants.%Float.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_15.4: = bound_method %.loc8_15.2, %specific_fn.loc8_15.2 [concrete = constants.%bound_method.514] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.call: init %f64.d77 = call %bound_method.loc8_15.4(%.loc8_15.2) [concrete = constants.%float.0fc] // CHECK:STDOUT: %.loc8_15.3: ref %f64.d77 = temporary_storage -// CHECK:STDOUT: %.loc8_15.4: ref %f64.d77 = temporary %.loc8_15.3, %.loc8_15.2 +// CHECK:STDOUT: %.loc8_15.4: ref %f64.d77 = temporary %.loc8_15.3, %Float.as.Copy.impl.Op.call // CHECK:STDOUT: %addr.loc8_21: %ptr.bcc = addr_of %.loc8_15.4 // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc8_21) // CHECK:STDOUT: %Float.as.Destroy.impl.Op.bound: = bound_method %.loc8_15.4, constants.%Float.as.Destroy.impl.Op.af3 // CHECK:STDOUT: -// CHECK:STDOUT: %bound_method.loc8_15.3: = bound_method %.loc8_15.4, %Float.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %bound_method.loc8_15.5: = bound_method %.loc8_15.4, %Float.as.Destroy.impl.Op.specific_fn // CHECK:STDOUT: %addr.loc8_15: %ptr.bcc = addr_of %.loc8_15.4 -// CHECK:STDOUT: %Float.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8_15.3(%addr.loc8_15) +// CHECK:STDOUT: %Float.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8_15.5(%addr.loc8_15) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2098,8 +2374,20 @@ fn F() { // CHECK:STDOUT: %.be5: type = fn_type_with_self_type %As.Convert.type.3bf, %As.facet [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.As.impl.Convert.bound: = bound_method %float.c64, %Core.FloatLiteral.as.As.impl.Convert.e2e [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.As.impl.Convert.specific_fn: = specific_function %Core.FloatLiteral.as.As.impl.Convert.e2e, @Core.FloatLiteral.as.As.impl.Convert(%int_128) [concrete] -// CHECK:STDOUT: %bound_method: = bound_method %float.c64, %Core.FloatLiteral.as.As.impl.Convert.specific_fn [concrete] +// CHECK:STDOUT: %bound_method.a26: = bound_method %float.c64, %Core.FloatLiteral.as.As.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %float.709: %f128.b8c = float_value 0.800000000000000000000000000000000039 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.type.a25: type = fn_type @Float.as.Copy.impl.Op, @Float.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.623: %Float.as.Copy.impl.Op.type.a25 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.ebd: = impl_witness imports.%Copy.impl_witness_table.e1b, @Float.as.Copy.impl(%int_128) [concrete] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.type.ce7: type = fn_type @Float.as.Copy.impl.Op, @Float.as.Copy.impl(%int_128) [concrete] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.f9a: %Float.as.Copy.impl.Op.type.ce7 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.1d3: %Copy.type = facet_value %f128.b8c, (%Copy.impl_witness.ebd) [concrete] +// CHECK:STDOUT: %.9f3: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.1d3 [concrete] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.bound: = bound_method %float.709, %Float.as.Copy.impl.Op.f9a [concrete] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.specific_fn: = specific_function %Float.as.Copy.impl.Op.f9a, @Float.as.Copy.impl.Op(%int_128) [concrete] +// CHECK:STDOUT: %bound_method.bf0: = bound_method %float.709, %Float.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %Float.as.Destroy.impl.Op.type.d56: type = fn_type @Float.as.Destroy.impl.Op, @Float.as.Destroy.impl(%int_128) [concrete] // CHECK:STDOUT: %Float.as.Destroy.impl.Op.74e: %Float.as.Destroy.impl.Op.type.d56 = struct_value () [concrete] // CHECK:STDOUT: } @@ -2119,8 +2407,10 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.497: @Core.FloatLiteral.as.As.impl.%Core.FloatLiteral.as.As.impl.Convert.type (%Core.FloatLiteral.as.As.impl.Convert.type.b91) = import_ref Core//prelude/types/float, loc27_40, loaded [symbolic = @Core.FloatLiteral.as.As.impl.%Core.FloatLiteral.as.As.impl.Convert (constants.%Core.FloatLiteral.as.As.impl.Convert.e7c)] +// CHECK:STDOUT: %Core.import_ref.497: @Core.FloatLiteral.as.As.impl.%Core.FloatLiteral.as.As.impl.Convert.type (%Core.FloatLiteral.as.As.impl.Convert.type.b91) = import_ref Core//prelude/types/float, loc34_40, loaded [symbolic = @Core.FloatLiteral.as.As.impl.%Core.FloatLiteral.as.As.impl.Convert (constants.%Core.FloatLiteral.as.As.impl.Convert.e7c)] // CHECK:STDOUT: %As.impl_witness_table = impl_witness_table (%Core.import_ref.497), @Core.FloatLiteral.as.As.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.419: @Float.as.Copy.impl.%Float.as.Copy.impl.Op.type (%Float.as.Copy.impl.Op.type.a25) = import_ref Core//prelude/types/float, loc22_31, loaded [symbolic = @Float.as.Copy.impl.%Float.as.Copy.impl.Op (constants.%Float.as.Copy.impl.Op.623)] +// CHECK:STDOUT: %Copy.impl_witness_table.e1b = impl_witness_table (%Core.import_ref.419), @Float.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -2130,22 +2420,27 @@ fn F() { // CHECK:STDOUT: %float: Core.FloatLiteral = float_literal_value 8e-1 [concrete = constants.%float.c64] // CHECK:STDOUT: %int_128: Core.IntLiteral = int_value 128 [concrete = constants.%int_128] // CHECK:STDOUT: %f128: type = class_type @Float, @Float(constants.%int_128) [concrete = constants.%f128.b8c] -// CHECK:STDOUT: %impl.elem0: %.be5 = impl_witness_access constants.%As.impl_witness.c7e, element0 [concrete = constants.%Core.FloatLiteral.as.As.impl.Convert.e2e] -// CHECK:STDOUT: %bound_method.loc8_15.1: = bound_method %float, %impl.elem0 [concrete = constants.%Core.FloatLiteral.as.As.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.FloatLiteral.as.As.impl.Convert(constants.%int_128) [concrete = constants.%Core.FloatLiteral.as.As.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc8_15.2: = bound_method %float, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %impl.elem0.loc8_15.1: %.be5 = impl_witness_access constants.%As.impl_witness.c7e, element0 [concrete = constants.%Core.FloatLiteral.as.As.impl.Convert.e2e] +// CHECK:STDOUT: %bound_method.loc8_15.1: = bound_method %float, %impl.elem0.loc8_15.1 [concrete = constants.%Core.FloatLiteral.as.As.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc8_15.1: = specific_function %impl.elem0.loc8_15.1, @Core.FloatLiteral.as.As.impl.Convert(constants.%int_128) [concrete = constants.%Core.FloatLiteral.as.As.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_15.2: = bound_method %float, %specific_fn.loc8_15.1 [concrete = constants.%bound_method.a26] // CHECK:STDOUT: %Core.FloatLiteral.as.As.impl.Convert.call: init %f128.b8c = call %bound_method.loc8_15.2(%float) [concrete = constants.%float.709] // CHECK:STDOUT: %.loc8_15.1: %f128.b8c = value_of_initializer %Core.FloatLiteral.as.As.impl.Convert.call [concrete = constants.%float.709] // CHECK:STDOUT: %.loc8_15.2: %f128.b8c = converted %float, %.loc8_15.1 [concrete = constants.%float.709] +// CHECK:STDOUT: %impl.elem0.loc8_15.2: %.9f3 = impl_witness_access constants.%Copy.impl_witness.ebd, element0 [concrete = constants.%Float.as.Copy.impl.Op.f9a] +// CHECK:STDOUT: %bound_method.loc8_15.3: = bound_method %.loc8_15.2, %impl.elem0.loc8_15.2 [concrete = constants.%Float.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %specific_fn.loc8_15.2: = specific_function %impl.elem0.loc8_15.2, @Float.as.Copy.impl.Op(constants.%int_128) [concrete = constants.%Float.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_15.4: = bound_method %.loc8_15.2, %specific_fn.loc8_15.2 [concrete = constants.%bound_method.bf0] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.call: init %f128.b8c = call %bound_method.loc8_15.4(%.loc8_15.2) [concrete = constants.%float.709] // CHECK:STDOUT: %.loc8_15.3: ref %f128.b8c = temporary_storage -// CHECK:STDOUT: %.loc8_15.4: ref %f128.b8c = temporary %.loc8_15.3, %.loc8_15.2 +// CHECK:STDOUT: %.loc8_15.4: ref %f128.b8c = temporary %.loc8_15.3, %Float.as.Copy.impl.Op.call // CHECK:STDOUT: %addr.loc8_22: %ptr.402 = addr_of %.loc8_15.4 // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc8_22) // CHECK:STDOUT: %Float.as.Destroy.impl.Op.bound: = bound_method %.loc8_15.4, constants.%Float.as.Destroy.impl.Op.74e // CHECK:STDOUT: -// CHECK:STDOUT: %bound_method.loc8_15.3: = bound_method %.loc8_15.4, %Float.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %bound_method.loc8_15.5: = bound_method %.loc8_15.4, %Float.as.Destroy.impl.Op.specific_fn // CHECK:STDOUT: %addr.loc8_15: %ptr.402 = addr_of %.loc8_15.4 -// CHECK:STDOUT: %Float.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8_15.3(%addr.loc8_15) +// CHECK:STDOUT: %Float.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8_15.5(%addr.loc8_15) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/arithmetic_types_direct.carbon b/toolchain/check/testdata/interop/cpp/function/arithmetic_types_direct.carbon index 39b653c348d1..021325903a4a 100644 --- a/toolchain/check/testdata/interop/cpp/function/arithmetic_types_direct.carbon +++ b/toolchain/check/testdata/interop/cpp/function/arithmetic_types_direct.carbon @@ -502,7 +502,7 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -557,7 +557,7 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -624,7 +624,7 @@ fn F() { // CHECK:STDOUT: %Core.import_ref.abd = import_ref Core//prelude/parts/int_literal, loc13_50, unloaded // CHECK:STDOUT: %Core.import_ref.037: %Core.IntLiteral.as.Negate.impl.Op.type = import_ref Core//prelude/parts/int_literal, loc14_31, loaded [concrete = constants.%Core.IntLiteral.as.Negate.impl.Op] // CHECK:STDOUT: %Negate.impl_witness_table = impl_witness_table (%Core.import_ref.abd, %Core.import_ref.037), @Core.IntLiteral.as.Negate.impl [concrete] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -684,7 +684,7 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -739,7 +739,7 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -794,7 +794,7 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.104: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.367) = import_ref Core//prelude/parts/uint, loc16_40, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.8f6)] +// CHECK:STDOUT: %Core.import_ref.104: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.367) = import_ref Core//prelude/parts/uint, loc23_40, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.8f6)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b63 = impl_witness_table (%Core.import_ref.104), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -849,7 +849,7 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -908,7 +908,7 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -986,7 +986,7 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %foo2.decl: %foo2.type = fn_decl @foo2 [concrete = constants.%foo2] { // CHECK:STDOUT: @@ -1073,7 +1073,7 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1154,7 +1154,7 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1396,7 +1396,7 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/full_semir.carbon b/toolchain/check/testdata/interop/cpp/function/full_semir.carbon index e73b48a3d230..7dc307c9a8f7 100644 --- a/toolchain/check/testdata/interop/cpp/function/full_semir.carbon +++ b/toolchain/check/testdata/interop/cpp/function/full_semir.carbon @@ -74,6 +74,7 @@ fn F() { // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [concrete] // CHECK:STDOUT: %pattern_type.2f8: type = pattern_type %i16 [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] @@ -97,8 +98,20 @@ fn F() { // CHECK:STDOUT: %.a59: type = fn_type_with_self_type %As.Convert.type.be5, %As.facet [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.3d5 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.As.impl.Convert.3d5, @Core.IntLiteral.as.As.impl.Convert(%int_16) [concrete] -// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete] +// CHECK:STDOUT: %bound_method.0a7: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.f90: %i16 = int_value 1 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.52b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_16) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.520: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_16) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.9da: %Int.as.Copy.impl.Op.type.520 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.fd9: %Copy.type = facet_value %i16, (%Copy.impl_witness.52b) [concrete] +// CHECK:STDOUT: %.79d: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.fd9 [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.bound: = bound_method %int_1.f90, %Int.as.Copy.impl.Op.9da [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.9da, @Int.as.Copy.impl.Op(%int_16) [concrete] +// CHECK:STDOUT: %bound_method.efc: = bound_method %int_1.f90, %Int.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Int.as.Destroy.impl.Op.type.135: type = fn_type @Int.as.Destroy.impl.Op, @Int.as.Destroy.impl(%int_16) [concrete] // CHECK:STDOUT: %Int.as.Destroy.impl.Op.718: %Int.as.Destroy.impl.Op.type.135 = struct_value () [concrete] @@ -109,6 +122,7 @@ fn F() { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .As = %Core.As +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -141,8 +155,11 @@ fn F() { // CHECK:STDOUT: %a: %ptr.251 = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//prelude/parts/as, As, loaded [concrete = constants.%As.generic] -// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/parts/int, loc25_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] +// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/parts/int, loc32_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] // CHECK:STDOUT: %As.impl_witness_table.3fe = impl_witness_table (%Core.import_ref.52c), @Core.IntLiteral.as.As.impl [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -166,22 +183,27 @@ fn F() { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] -// CHECK:STDOUT: %impl.elem0: %.a59 = impl_witness_access constants.%As.impl_witness.30d, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.3d5] -// CHECK:STDOUT: %bound_method.loc7_13.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.As.impl.Convert(constants.%int_16) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc7_13.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %impl.elem0.loc7_13.1: %.a59 = impl_witness_access constants.%As.impl_witness.30d, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.3d5] +// CHECK:STDOUT: %bound_method.loc7_13.1: = bound_method %int_1, %impl.elem0.loc7_13.1 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc7_13.1: = specific_function %impl.elem0.loc7_13.1, @Core.IntLiteral.as.As.impl.Convert(constants.%int_16) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc7_13.2: = bound_method %int_1, %specific_fn.loc7_13.1 [concrete = constants.%bound_method.0a7] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i16 = call %bound_method.loc7_13.2(%int_1) [concrete = constants.%int_1.f90] // CHECK:STDOUT: %.loc7_13.1: %i16 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.f90] // CHECK:STDOUT: %.loc7_13.2: %i16 = converted %int_1, %.loc7_13.1 [concrete = constants.%int_1.f90] +// CHECK:STDOUT: %impl.elem0.loc7_13.2: %.79d = impl_witness_access constants.%Copy.impl_witness.52b, element0 [concrete = constants.%Int.as.Copy.impl.Op.9da] +// CHECK:STDOUT: %bound_method.loc7_13.3: = bound_method %.loc7_13.2, %impl.elem0.loc7_13.2 [concrete = constants.%Int.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %specific_fn.loc7_13.2: = specific_function %impl.elem0.loc7_13.2, @Int.as.Copy.impl.Op(constants.%int_16) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc7_13.4: = bound_method %.loc7_13.2, %specific_fn.loc7_13.2 [concrete = constants.%bound_method.efc] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i16 = call %bound_method.loc7_13.4(%.loc7_13.2) [concrete = constants.%int_1.f90] // CHECK:STDOUT: %.loc7_13.3: ref %i16 = temporary_storage -// CHECK:STDOUT: %.loc7_13.4: ref %i16 = temporary %.loc7_13.3, %.loc7_13.2 +// CHECK:STDOUT: %.loc7_13.4: ref %i16 = temporary %.loc7_13.3, %Int.as.Copy.impl.Op.call // CHECK:STDOUT: %addr.loc7_19: %ptr.251 = addr_of %.loc7_13.4 // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc7_19) // CHECK:STDOUT: %Int.as.Destroy.impl.Op.bound: = bound_method %.loc7_13.4, constants.%Int.as.Destroy.impl.Op.718 // CHECK:STDOUT: %Int.as.Destroy.impl.Op.specific_fn: = specific_function constants.%Int.as.Destroy.impl.Op.718, @Int.as.Destroy.impl.Op(constants.%int_16) [concrete = constants.%Int.as.Destroy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc7_13.3: = bound_method %.loc7_13.4, %Int.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %bound_method.loc7_13.5: = bound_method %.loc7_13.4, %Int.as.Destroy.impl.Op.specific_fn // CHECK:STDOUT: %addr.loc7_13: %ptr.251 = addr_of %.loc7_13.4 -// CHECK:STDOUT: %Int.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc7_13.3(%addr.loc7_13) +// CHECK:STDOUT: %Int.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc7_13.5(%addr.loc7_13) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -245,7 +267,7 @@ fn F() { // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/in_template.carbon b/toolchain/check/testdata/interop/cpp/function/in_template.carbon index 8bf588c1af11..1c033cc6448d 100644 --- a/toolchain/check/testdata/interop/cpp/function/in_template.carbon +++ b/toolchain/check/testdata/interop/cpp/function/in_template.carbon @@ -70,7 +70,7 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/operators.carbon b/toolchain/check/testdata/interop/cpp/function/operators.carbon index 66233bf3c89b..c2fa61acd67f 100644 --- a/toolchain/check/testdata/interop/cpp/function/operators.carbon +++ b/toolchain/check/testdata/interop/cpp/function/operators.carbon @@ -1052,7 +1052,7 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/types/int, loc20_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/types/int, loc27_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %operator>>__carbon_thunk.decl: %operator>>__carbon_thunk.type = fn_decl @operator>>__carbon_thunk [concrete = constants.%operator>>__carbon_thunk] { // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/pointer.carbon b/toolchain/check/testdata/interop/cpp/function/pointer.carbon index 8db8a2515d44..0b8d7f12b9fd 100644 --- a/toolchain/check/testdata/interop/cpp/function/pointer.carbon +++ b/toolchain/check/testdata/interop/cpp/function/pointer.carbon @@ -255,6 +255,17 @@ fn F() { // CHECK:STDOUT: %S.val: %S = struct_value () [concrete] // CHECK:STDOUT: %ptr.5c7: type = ptr_type %S [concrete] // CHECK:STDOUT: %pattern_type.259: type = pattern_type %ptr.5c7 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.f23: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.8b3) [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.abf: %ptr.as.Copy.impl.Op.type.f23 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.dea: = impl_witness imports.%Copy.impl_witness_table.a71, @ptr.as.Copy.impl(%S) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.7f7: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%S) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.0c6: %ptr.as.Copy.impl.Op.type.7f7 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.334: %Copy.type = facet_value %ptr.5c7, (%Copy.impl_witness.dea) [concrete] +// CHECK:STDOUT: %.816: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.334 [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.0c6, @ptr.as.Copy.impl.Op(%S) [concrete] // CHECK:STDOUT: %ptr.dfe: type = ptr_type %ptr.5c7 [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] @@ -271,6 +282,8 @@ fn F() { // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %S.decl: type = class_decl @S [concrete = constants.%S] {} {} +// CHECK:STDOUT: %Core.import_ref.de9: @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op.type (%ptr.as.Copy.impl.Op.type.f23) = import_ref Core//prelude/parts/copy, loc32_31, loaded [symbolic = @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op (constants.%ptr.as.Copy.impl.Op.abf)] +// CHECK:STDOUT: %Copy.impl_witness_table.a71 = impl_witness_table (%Core.import_ref.de9), @ptr.as.Copy.impl [concrete] // CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] { // CHECK:STDOUT: // CHECK:STDOUT: } { @@ -301,7 +314,12 @@ fn F() { // CHECK:STDOUT: %p.var: ref %ptr.5c7 = var %p.var_patt // CHECK:STDOUT: %s.ref: ref %S = name_ref s, %s // CHECK:STDOUT: %addr.loc9_19: %ptr.5c7 = addr_of %s.ref -// CHECK:STDOUT: assign %p.var, %addr.loc9_19 +// CHECK:STDOUT: %impl.elem0: %.816 = impl_witness_access constants.%Copy.impl_witness.dea, element0 [concrete = constants.%ptr.as.Copy.impl.Op.0c6] +// CHECK:STDOUT: %bound_method.loc9_19.1: = bound_method %addr.loc9_19, %impl.elem0 +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @ptr.as.Copy.impl.Op(constants.%S) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_19.2: = bound_method %addr.loc9_19, %specific_fn +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.5c7 = call %bound_method.loc9_19.2(%addr.loc9_19) +// CHECK:STDOUT: assign %p.var, %ptr.as.Copy.impl.Op.call // CHECK:STDOUT: %.loc9: type = splice_block %ptr [concrete = constants.%ptr.5c7] { // CHECK:STDOUT: %Cpp.ref.loc9: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %S.ref.loc9: type = name_ref S, imports.%S.decl [concrete = constants.%S] @@ -315,9 +333,9 @@ fn F() { // CHECK:STDOUT: %foo.call: init %empty_tuple.type = call %foo.ref(%addr.loc10) // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc9: = bound_method %p.var, constants.%T.as.Destroy.impl.Op.014 // CHECK:STDOUT: -// CHECK:STDOUT: %bound_method.loc9: = bound_method %p.var, %T.as.Destroy.impl.Op.specific_fn.1 +// CHECK:STDOUT: %bound_method.loc9_3: = bound_method %p.var, %T.as.Destroy.impl.Op.specific_fn.1 // CHECK:STDOUT: %addr.loc9_3: %ptr.dfe = addr_of %p.var -// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc9: init %empty_tuple.type = call %bound_method.loc9(%addr.loc9_3) +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc9: init %empty_tuple.type = call %bound_method.loc9_3(%addr.loc9_3) // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc8: = bound_method %s.var, constants.%T.as.Destroy.impl.Op.777 // CHECK:STDOUT: // CHECK:STDOUT: %bound_method.loc8: = bound_method %s.var, %T.as.Destroy.impl.Op.specific_fn.2 diff --git a/toolchain/check/testdata/interop/cpp/import.carbon b/toolchain/check/testdata/interop/cpp/import.carbon index 2c19ac05e17f..92babc95796e 100644 --- a/toolchain/check/testdata/interop/cpp/import.carbon +++ b/toolchain/check/testdata/interop/cpp/import.carbon @@ -85,9 +85,9 @@ fn F() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Main.FooShort: %foo_short.type = import_ref Main//api, FooShort, loaded [concrete = constants.%foo_short] // CHECK:STDOUT: %Main.FooInt: %foo_int.type = import_ref Main//api, FooInt, loaded [concrete = constants.%foo_int] -// CHECK:STDOUT: %Core.import_ref.49e: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.2ac) = import_ref Core//prelude/parts/int, loc25_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.128)] +// CHECK:STDOUT: %Core.import_ref.49e: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.2ac) = import_ref Core//prelude/parts/int, loc32_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.128)] // CHECK:STDOUT: %As.impl_witness_table.ae5 = impl_witness_table (%Core.import_ref.49e), @Core.IntLiteral.as.As.impl [concrete] -// CHECK:STDOUT: %Core.import_ref.7bb: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.8a0) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.1d6)] +// CHECK:STDOUT: %Core.import_ref.7bb: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.8a0) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.1d6)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.ba4 = impl_witness_table (%Core.import_ref.7bb), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/typedef.carbon b/toolchain/check/testdata/interop/cpp/typedef.carbon index 2aed6d35768d..3ad1fe3fb60d 100644 --- a/toolchain/check/testdata/interop/cpp/typedef.carbon +++ b/toolchain/check/testdata/interop/cpp/typedef.carbon @@ -73,6 +73,17 @@ fn H(var c: Cpp.C, var d: Cpp.D) { // CHECK:STDOUT: %int_42.c68: %i32 = int_value 42 [concrete] // CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [concrete] // CHECK:STDOUT: %pattern_type.fe8: type = pattern_type %ptr.235 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.f23: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.8b3) [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.abf: %ptr.as.Copy.impl.Op.type.f23 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.19c: = impl_witness imports.%Copy.impl_witness_table.a71, @ptr.as.Copy.impl(%i32) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.3ea: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%i32) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.2f4: %ptr.as.Copy.impl.Op.type.3ea = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.bab: %Copy.type = facet_value %ptr.235, (%Copy.impl_witness.19c) [concrete] +// CHECK:STDOUT: %.284: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.bab [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.2f4, @ptr.as.Copy.impl.Op(%i32) [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.type.f2e: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%ptr.235) [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.fad: %T.as.Destroy.impl.Op.type.f2e = struct_value () [concrete] // CHECK:STDOUT: %ptr.5d5: type = ptr_type %ptr.235 [concrete] @@ -86,8 +97,10 @@ fn H(var c: Cpp.C, var d: Cpp.D) { // CHECK:STDOUT: .bar = @F.%i32.1 // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.de9: @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op.type (%ptr.as.Copy.impl.Op.type.f23) = import_ref Core//prelude/parts/copy, loc32_31, loaded [symbolic = @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op (constants.%ptr.as.Copy.impl.Op.abf)] +// CHECK:STDOUT: %Copy.impl_witness_table.a71 = impl_witness_table (%Core.import_ref.de9), @ptr.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -98,10 +111,10 @@ fn H(var c: Cpp.C, var d: Cpp.D) { // CHECK:STDOUT: } // CHECK:STDOUT: %n.var: ref %i32 = var %n.var_patt // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [concrete = constants.%int_42.20e] -// CHECK:STDOUT: %impl.elem0: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] -// CHECK:STDOUT: %bound_method.loc8_3.1: = bound_method %int_42, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc8_3.2: = bound_method %int_42, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %impl.elem0.loc8: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] +// CHECK:STDOUT: %bound_method.loc8_3.1: = bound_method %int_42, %impl.elem0.loc8 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc8: = specific_function %impl.elem0.loc8, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_3.2: = bound_method %int_42, %specific_fn.loc8 [concrete = constants.%bound_method] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc8_3.2(%int_42) [concrete = constants.%int_42.c68] // CHECK:STDOUT: %.loc8_3: init %i32 = converted %int_42, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_42.c68] // CHECK:STDOUT: assign %n.var, %.loc8_3 @@ -118,7 +131,12 @@ fn H(var c: Cpp.C, var d: Cpp.D) { // CHECK:STDOUT: %p.var: ref %ptr.235 = var %p.var_patt // CHECK:STDOUT: %n.ref: ref %i32 = name_ref n, %n // CHECK:STDOUT: %addr.loc10_21: %ptr.235 = addr_of %n.ref -// CHECK:STDOUT: assign %p.var, %addr.loc10_21 +// CHECK:STDOUT: %impl.elem0.loc10: %.284 = impl_witness_access constants.%Copy.impl_witness.19c, element0 [concrete = constants.%ptr.as.Copy.impl.Op.2f4] +// CHECK:STDOUT: %bound_method.loc10_21.1: = bound_method %addr.loc10_21, %impl.elem0.loc10 +// CHECK:STDOUT: %specific_fn.loc10: = specific_function %impl.elem0.loc10, @ptr.as.Copy.impl.Op(constants.%i32) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_21.2: = bound_method %addr.loc10_21, %specific_fn.loc10 +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.235 = call %bound_method.loc10_21.2(%addr.loc10_21) +// CHECK:STDOUT: assign %p.var, %ptr.as.Copy.impl.Op.call // CHECK:STDOUT: %.loc10: type = splice_block %ptr [concrete = constants.%ptr.235] { // CHECK:STDOUT: %Cpp.ref.loc10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: @@ -128,9 +146,9 @@ fn H(var c: Cpp.C, var d: Cpp.D) { // CHECK:STDOUT: %p: ref %ptr.235 = bind_name p, %p.var // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound: = bound_method %p.var, constants.%T.as.Destroy.impl.Op.fad // CHECK:STDOUT: -// CHECK:STDOUT: %bound_method.loc10: = bound_method %p.var, %T.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %bound_method.loc10_3: = bound_method %p.var, %T.as.Destroy.impl.Op.specific_fn // CHECK:STDOUT: %addr.loc10_3: %ptr.5d5 = addr_of %p.var -// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc10(%addr.loc10_3) +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc10_3(%addr.loc10_3) // CHECK:STDOUT: %Int.as.Destroy.impl.Op.bound: = bound_method %n.var, constants.%Int.as.Destroy.impl.Op.054 // CHECK:STDOUT: // CHECK:STDOUT: %bound_method.loc8_3.3: = bound_method %n.var, %Int.as.Destroy.impl.Op.specific_fn @@ -146,6 +164,17 @@ fn H(var c: Cpp.C, var d: Cpp.D) { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete] // CHECK:STDOUT: %pattern_type.a31: type = pattern_type %ptr.d9e [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.f23: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.8b3) [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.abf: %ptr.as.Copy.impl.Op.type.f23 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.643: = impl_witness imports.%Copy.impl_witness_table.a71, @ptr.as.Copy.impl(%C) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.ab9: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%C) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.8d1: %ptr.as.Copy.impl.Op.type.ab9 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.506: %Copy.type = facet_value %ptr.d9e, (%Copy.impl_witness.643) [concrete] +// CHECK:STDOUT: %.d15: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.506 [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.8d1, @ptr.as.Copy.impl.Op(%C) [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.type.899: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%ptr.d9e) [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.6aa: %T.as.Destroy.impl.Op.type.899 = struct_value () [concrete] // CHECK:STDOUT: %ptr.01d: type = ptr_type %ptr.d9e [concrete] @@ -158,6 +187,8 @@ fn H(var c: Cpp.C, var d: Cpp.D) { // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {} +// CHECK:STDOUT: %Core.import_ref.de9: @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op.type (%ptr.as.Copy.impl.Op.type.f23) = import_ref Core//prelude/parts/copy, loc32_31, loaded [symbolic = @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op (constants.%ptr.as.Copy.impl.Op.abf)] +// CHECK:STDOUT: %Copy.impl_witness_table.a71 = impl_witness_table (%Core.import_ref.de9), @ptr.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @H(%c.param: %C, %d.param: %C) { @@ -169,7 +200,12 @@ fn H(var c: Cpp.C, var d: Cpp.D) { // CHECK:STDOUT: %pd.var: ref %ptr.d9e = var %pd.var_patt // CHECK:STDOUT: %c.ref: ref %C = name_ref c, %c // CHECK:STDOUT: %addr.loc9_20: %ptr.d9e = addr_of %c.ref -// CHECK:STDOUT: assign %pd.var, %addr.loc9_20 +// CHECK:STDOUT: %impl.elem0.loc9: %.d15 = impl_witness_access constants.%Copy.impl_witness.643, element0 [concrete = constants.%ptr.as.Copy.impl.Op.8d1] +// CHECK:STDOUT: %bound_method.loc9_20.1: = bound_method %addr.loc9_20, %impl.elem0.loc9 +// CHECK:STDOUT: %specific_fn.loc9: = specific_function %impl.elem0.loc9, @ptr.as.Copy.impl.Op(constants.%C) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_20.2: = bound_method %addr.loc9_20, %specific_fn.loc9 +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc9: init %ptr.d9e = call %bound_method.loc9_20.2(%addr.loc9_20) +// CHECK:STDOUT: assign %pd.var, %ptr.as.Copy.impl.Op.call.loc9 // CHECK:STDOUT: %.loc9: type = splice_block %ptr.loc9 [concrete = constants.%ptr.d9e] { // CHECK:STDOUT: %Cpp.ref.loc9: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %D.ref.loc9: type = name_ref D, imports.%C.decl [concrete = constants.%C] @@ -183,7 +219,12 @@ fn H(var c: Cpp.C, var d: Cpp.D) { // CHECK:STDOUT: %pc.var: ref %ptr.d9e = var %pc.var_patt // CHECK:STDOUT: %d.ref: ref %C = name_ref d, %d // CHECK:STDOUT: %addr.loc10_20: %ptr.d9e = addr_of %d.ref -// CHECK:STDOUT: assign %pc.var, %addr.loc10_20 +// CHECK:STDOUT: %impl.elem0.loc10: %.d15 = impl_witness_access constants.%Copy.impl_witness.643, element0 [concrete = constants.%ptr.as.Copy.impl.Op.8d1] +// CHECK:STDOUT: %bound_method.loc10_20.1: = bound_method %addr.loc10_20, %impl.elem0.loc10 +// CHECK:STDOUT: %specific_fn.loc10: = specific_function %impl.elem0.loc10, @ptr.as.Copy.impl.Op(constants.%C) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_20.2: = bound_method %addr.loc10_20, %specific_fn.loc10 +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc10: init %ptr.d9e = call %bound_method.loc10_20.2(%addr.loc10_20) +// CHECK:STDOUT: assign %pc.var, %ptr.as.Copy.impl.Op.call.loc10 // CHECK:STDOUT: %.loc10: type = splice_block %ptr.loc10 [concrete = constants.%ptr.d9e] { // CHECK:STDOUT: %Cpp.ref.loc10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc10: type = name_ref C, imports.%C.decl [concrete = constants.%C] @@ -192,14 +233,14 @@ fn H(var c: Cpp.C, var d: Cpp.D) { // CHECK:STDOUT: %pc: ref %ptr.d9e = bind_name pc, %pc.var // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc10: = bound_method %pc.var, constants.%T.as.Destroy.impl.Op.6aa // CHECK:STDOUT: -// CHECK:STDOUT: %bound_method.loc10: = bound_method %pc.var, %T.as.Destroy.impl.Op.specific_fn.1 +// CHECK:STDOUT: %bound_method.loc10_3: = bound_method %pc.var, %T.as.Destroy.impl.Op.specific_fn.1 // CHECK:STDOUT: %addr.loc10_3: %ptr.01d = addr_of %pc.var -// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc10: init %empty_tuple.type = call %bound_method.loc10(%addr.loc10_3) +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc10: init %empty_tuple.type = call %bound_method.loc10_3(%addr.loc10_3) // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc9: = bound_method %pd.var, constants.%T.as.Destroy.impl.Op.6aa // CHECK:STDOUT: -// CHECK:STDOUT: %bound_method.loc9: = bound_method %pd.var, %T.as.Destroy.impl.Op.specific_fn.2 +// CHECK:STDOUT: %bound_method.loc9_3: = bound_method %pd.var, %T.as.Destroy.impl.Op.specific_fn.2 // CHECK:STDOUT: %addr.loc9_3: %ptr.01d = addr_of %pd.var -// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc9: init %empty_tuple.type = call %bound_method.loc9(%addr.loc9_3) +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc9: init %empty_tuple.type = call %bound_method.loc9_3(%addr.loc9_3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/compile_time_bindings.carbon b/toolchain/check/testdata/let/compile_time_bindings.carbon index 37f858e33b3e..b419eeb73c4d 100644 --- a/toolchain/check/testdata/let/compile_time_bindings.carbon +++ b/toolchain/check/testdata/let/compile_time_bindings.carbon @@ -793,7 +793,7 @@ impl i32 as Empty { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -883,7 +883,7 @@ impl i32 as Empty { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1220,7 +1220,7 @@ impl i32 as Empty { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/fail_duplicate_decl.carbon b/toolchain/check/testdata/let/fail_duplicate_decl.carbon index 4dcb9ca57dce..b5741e675aa4 100644 --- a/toolchain/check/testdata/let/fail_duplicate_decl.carbon +++ b/toolchain/check/testdata/let/fail_duplicate_decl.carbon @@ -66,7 +66,7 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/fail_modifiers.carbon b/toolchain/check/testdata/let/fail_modifiers.carbon index d816f06b10f5..bc4e97a55a0c 100644 --- a/toolchain/check/testdata/let/fail_modifiers.carbon +++ b/toolchain/check/testdata/let/fail_modifiers.carbon @@ -124,7 +124,7 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/generic.carbon b/toolchain/check/testdata/let/generic.carbon index e024bcdb01df..9844b64e4bb8 100644 --- a/toolchain/check/testdata/let/generic.carbon +++ b/toolchain/check/testdata/let/generic.carbon @@ -15,7 +15,7 @@ fn F() { let T:! type = i32; var p: T*; - var a: T = *p; + let a: T = *p; } // CHECK:STDOUT: --- generic.carbon @@ -37,17 +37,12 @@ fn F() { // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.de0: = lookup_impl_witness %T, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.facet.572: %Destroy.type = facet_value %T, (%Destroy.lookup_impl_witness.de0) [symbolic] -// CHECK:STDOUT: %.f8c: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.572 [symbolic] -// CHECK:STDOUT: %impl.elem0.796: %.f8c = impl_witness_access %Destroy.lookup_impl_witness.de0, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.127: = specific_impl_function %impl.elem0.796, @Destroy.Op(%Destroy.facet.572) [symbolic] // CHECK:STDOUT: %ptr.a13: type = ptr_type %ptr.79f [symbolic] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.3af: = lookup_impl_witness %ptr.79f, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.facet.a81: %Destroy.type = facet_value %ptr.79f, (%Destroy.lookup_impl_witness.3af) [symbolic] -// CHECK:STDOUT: %.dc4: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.a81 [symbolic] -// CHECK:STDOUT: %impl.elem0.5ac: %.dc4 = impl_witness_access %Destroy.lookup_impl_witness.3af, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.fb8: = specific_impl_function %impl.elem0.5ac, @Destroy.Op(%Destroy.facet.a81) [symbolic] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %ptr.79f, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %ptr.79f, (%Destroy.lookup_impl_witness) [symbolic] +// CHECK:STDOUT: %.dc4: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet [symbolic] +// CHECK:STDOUT: %impl.elem0: %.dc4 = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @Destroy.Op(%Destroy.facet) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -91,28 +86,19 @@ fn F() { // CHECK:STDOUT: %p: ref %ptr.79f = bind_name p, %p.var // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %a.patt: %pattern_type.7dc = binding_pattern a [concrete] -// CHECK:STDOUT: %a.var_patt: %pattern_type.7dc = var_pattern %a.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %a.var: ref %T = var %a.var_patt // CHECK:STDOUT: %p.ref: ref %ptr.79f = name_ref p, %p // CHECK:STDOUT: %.loc18_15: %ptr.79f = bind_value %p.ref // CHECK:STDOUT: %.loc18_14.1: ref %T = deref %.loc18_15 -// CHECK:STDOUT: %.loc18_14.2: %T = bind_value %.loc18_14.1 -// CHECK:STDOUT: assign %a.var, %.loc18_14.2 // CHECK:STDOUT: %T.ref.loc18: type = name_ref T, %T [symbolic = constants.%T] -// CHECK:STDOUT: %a: ref %T = bind_name a, %a.var -// CHECK:STDOUT: %impl.elem0.loc18: %.f8c = impl_witness_access constants.%Destroy.lookup_impl_witness.de0, element0 [symbolic = constants.%impl.elem0.796] -// CHECK:STDOUT: %bound_method.loc18_3.1: = bound_method %a.var, %impl.elem0.loc18 -// CHECK:STDOUT: %specific_impl_fn.loc18: = specific_impl_function %impl.elem0.loc18, @Destroy.Op(constants.%Destroy.facet.572) [symbolic = constants.%specific_impl_fn.127] -// CHECK:STDOUT: %bound_method.loc18_3.2: = bound_method %a.var, %specific_impl_fn.loc18 -// CHECK:STDOUT: %addr.loc18: %ptr.79f = addr_of %a.var -// CHECK:STDOUT: %.loc18_3: init %empty_tuple.type = call %bound_method.loc18_3.2(%addr.loc18) -// CHECK:STDOUT: %impl.elem0.loc17: %.dc4 = impl_witness_access constants.%Destroy.lookup_impl_witness.3af, element0 [symbolic = constants.%impl.elem0.5ac] -// CHECK:STDOUT: %bound_method.loc17_3.1: = bound_method %p.var, %impl.elem0.loc17 -// CHECK:STDOUT: %specific_impl_fn.loc17: = specific_impl_function %impl.elem0.loc17, @Destroy.Op(constants.%Destroy.facet.a81) [symbolic = constants.%specific_impl_fn.fb8] -// CHECK:STDOUT: %bound_method.loc17_3.2: = bound_method %p.var, %specific_impl_fn.loc17 -// CHECK:STDOUT: %addr.loc17: %ptr.a13 = addr_of %p.var -// CHECK:STDOUT: %.loc17_3: init %empty_tuple.type = call %bound_method.loc17_3.2(%addr.loc17) +// CHECK:STDOUT: %.loc18_14.2: %T = bind_value %.loc18_14.1 +// CHECK:STDOUT: %a: %T = bind_name a, %.loc18_14.2 +// CHECK:STDOUT: %impl.elem0: %.dc4 = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %bound_method.loc17_3.1: = bound_method %p.var, %impl.elem0 +// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @Destroy.Op(constants.%Destroy.facet) [symbolic = constants.%specific_impl_fn] +// CHECK:STDOUT: %bound_method.loc17_3.2: = bound_method %p.var, %specific_impl_fn +// CHECK:STDOUT: %addr: %ptr.a13 = addr_of %p.var +// CHECK:STDOUT: %.loc17_3: init %empty_tuple.type = call %bound_method.loc17_3.2(%addr) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/global.carbon b/toolchain/check/testdata/let/global.carbon index 130f68c97e61..ec210887b6d5 100644 --- a/toolchain/check/testdata/let/global.carbon +++ b/toolchain/check/testdata/let/global.carbon @@ -54,7 +54,7 @@ fn F() -> i32 { return n; } // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/shadowed_decl.carbon b/toolchain/check/testdata/let/shadowed_decl.carbon index 89028370510c..526fe5ae62bc 100644 --- a/toolchain/check/testdata/let/shadowed_decl.carbon +++ b/toolchain/check/testdata/let/shadowed_decl.carbon @@ -56,7 +56,7 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/main_run/return_i32.carbon b/toolchain/check/testdata/main_run/return_i32.carbon index c8d5f623605b..397c9c71b073 100644 --- a/toolchain/check/testdata/main_run/return_i32.carbon +++ b/toolchain/check/testdata/main_run/return_i32.carbon @@ -51,7 +51,7 @@ fn Run() -> i32 { return 0; } // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/namespace/add_to_import.carbon b/toolchain/check/testdata/namespace/add_to_import.carbon index 12135e08e25f..751cc0ea0f9d 100644 --- a/toolchain/check/testdata/namespace/add_to_import.carbon +++ b/toolchain/check/testdata/namespace/add_to_import.carbon @@ -86,7 +86,7 @@ var a: i32 = NS.A(); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/namespace/alias.carbon b/toolchain/check/testdata/namespace/alias.carbon index e4276ecb8563..d468f92dbfe9 100644 --- a/toolchain/check/testdata/namespace/alias.carbon +++ b/toolchain/check/testdata/namespace/alias.carbon @@ -66,7 +66,7 @@ fn D() -> i32 { return C(); } // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon b/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon index 9d4bf2c78c33..437884ddaf36 100644 --- a/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon +++ b/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon @@ -64,7 +64,7 @@ fn ns.A() -> i32 { return 0; } // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/namespace/name_poisoning.carbon b/toolchain/check/testdata/namespace/name_poisoning.carbon index 5a8737e29984..4af8be7e2fe1 100644 --- a/toolchain/check/testdata/namespace/name_poisoning.carbon +++ b/toolchain/check/testdata/namespace/name_poisoning.carbon @@ -2,7 +2,7 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/destroy.carbon +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/convert.carbon // // AUTOUPDATE // TIP: To test this file alone, run: diff --git a/toolchain/check/testdata/namespace/shadow.carbon b/toolchain/check/testdata/namespace/shadow.carbon index 9626e501ddcf..4fd78e8d18e0 100644 --- a/toolchain/check/testdata/namespace/shadow.carbon +++ b/toolchain/check/testdata/namespace/shadow.carbon @@ -81,7 +81,7 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/builtin/and.carbon b/toolchain/check/testdata/operators/builtin/and.carbon index 58ff975bf06c..9f31058b2f0e 100644 --- a/toolchain/check/testdata/operators/builtin/and.carbon +++ b/toolchain/check/testdata/operators/builtin/and.carbon @@ -47,6 +47,14 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: %false: bool = bool_literal false [concrete] // CHECK:STDOUT: %Constant.type: type = fn_type @Constant [concrete] // CHECK:STDOUT: %Constant: %Constant.type = struct_value () [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Copy.impl_witness.09f: = impl_witness imports.%Copy.impl_witness_table.47e [concrete] +// CHECK:STDOUT: %Copy.facet.dcd: %Copy.type = facet_value bool, (%Copy.impl_witness.09f) [concrete] +// CHECK:STDOUT: %.235: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.dcd [concrete] +// CHECK:STDOUT: %bool.as.Copy.impl.Op.type: type = fn_type @bool.as.Copy.impl.Op [concrete] +// CHECK:STDOUT: %bool.as.Copy.impl.Op: %bool.as.Copy.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %bool.as.Copy.impl.Op.bound: = bound_method %true, %bool.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] @@ -65,11 +73,15 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Bool = %Core.Bool +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = constants.%Bool] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.297: %bool.as.Copy.impl.Op.type = import_ref Core//prelude/parts/copy, loc16_31, loaded [concrete = constants.%bool.as.Copy.impl.Op] +// CHECK:STDOUT: %Copy.impl_witness_table.47e = impl_witness_table (%Core.import_ref.297), @bool.as.Copy.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -169,7 +181,10 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: } // CHECK:STDOUT: %a.var: ref bool = var %a.var_patt // CHECK:STDOUT: %true.loc23_47: bool = bool_literal true [concrete = constants.%true] -// CHECK:STDOUT: assign %a.var, %true.loc23_47 +// CHECK:STDOUT: %impl.elem0: %.235 = impl_witness_access constants.%Copy.impl_witness.09f, element0 [concrete = constants.%bool.as.Copy.impl.Op] +// CHECK:STDOUT: %bound_method.loc23_47: = bound_method %true.loc23_47, %impl.elem0 [concrete = constants.%bool.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %bool.as.Copy.impl.Op.call: init bool = call %bound_method.loc23_47(%true.loc23_47) [concrete = constants.%true] +// CHECK:STDOUT: assign %a.var, %bool.as.Copy.impl.Op.call // CHECK:STDOUT: br !.loc23_13 // CHECK:STDOUT: // CHECK:STDOUT: !.loc23_13: @@ -342,9 +357,9 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc24: init %empty_tuple.type = call %bound_method.loc24(%addr.loc24) // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc23: = bound_method %a.var, constants.%T.as.Destroy.impl.Op.4f7 // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn.4: = specific_function constants.%T.as.Destroy.impl.Op.4f7, @T.as.Destroy.impl.Op(bool) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn.e5c] -// CHECK:STDOUT: %bound_method.loc23: = bound_method %a.var, %T.as.Destroy.impl.Op.specific_fn.4 +// CHECK:STDOUT: %bound_method.loc23_3: = bound_method %a.var, %T.as.Destroy.impl.Op.specific_fn.4 // CHECK:STDOUT: %addr.loc23: %ptr.bb2 = addr_of %a.var -// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc23: init %empty_tuple.type = call %bound_method.loc23(%addr.loc23) +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc23: init %empty_tuple.type = call %bound_method.loc23_3(%addr.loc23) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/assignment.carbon b/toolchain/check/testdata/operators/builtin/assignment.carbon index f5e890fef7ae..c7f20d1cb350 100644 --- a/toolchain/check/testdata/operators/builtin/assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/assignment.carbon @@ -92,6 +92,17 @@ fn Main() { // CHECK:STDOUT: %struct: %struct_type.a.b.501 = struct_value (%int_1.5d2, %int_2.ef8) [concrete] // CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [concrete] // CHECK:STDOUT: %pattern_type.fe8: type = pattern_type %ptr.235 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.f23: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.8b3) [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.abf: %ptr.as.Copy.impl.Op.type.f23 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.19c: = impl_witness imports.%Copy.impl_witness_table.a71, @ptr.as.Copy.impl(%i32) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.3ea: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%i32) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.2f4: %ptr.as.Copy.impl.Op.type.3ea = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.bab: %Copy.type = facet_value %ptr.235, (%Copy.impl_witness.19c) [concrete] +// CHECK:STDOUT: %.284: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.bab [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.2f4, @ptr.as.Copy.impl.Op(%i32) [concrete] // CHECK:STDOUT: %int_5.64b: Core.IntLiteral = int_value 5 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.6c8: = bound_method %int_5.64b, %Core.IntLiteral.as.ImplicitAs.impl.Convert.592 [concrete] // CHECK:STDOUT: %bound_method.918: = bound_method %int_5.64b, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] @@ -121,14 +132,18 @@ fn Main() { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.de9: @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op.type (%ptr.as.Copy.impl.Op.type.f23) = import_ref Core//prelude/parts/copy, loc32_31, loaded [symbolic = @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op (constants.%ptr.as.Copy.impl.Op.abf)] +// CHECK:STDOUT: %Copy.impl_witness_table.a71 = impl_witness_table (%Core.import_ref.de9), @ptr.as.Copy.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -290,7 +305,12 @@ fn Main() { // CHECK:STDOUT: %p.var: ref %ptr.235 = var %p.var_patt // CHECK:STDOUT: %a.ref.loc27: ref %i32 = name_ref a, %a // CHECK:STDOUT: %addr.loc27_17: %ptr.235 = addr_of %a.ref.loc27 -// CHECK:STDOUT: assign %p.var, %addr.loc27_17 +// CHECK:STDOUT: %impl.elem0.loc27: %.284 = impl_witness_access constants.%Copy.impl_witness.19c, element0 [concrete = constants.%ptr.as.Copy.impl.Op.2f4] +// CHECK:STDOUT: %bound_method.loc27_17.1: = bound_method %addr.loc27_17, %impl.elem0.loc27 +// CHECK:STDOUT: %specific_fn.loc27: = specific_function %impl.elem0.loc27, @ptr.as.Copy.impl.Op(constants.%i32) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc27_17.2: = bound_method %addr.loc27_17, %specific_fn.loc27 +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.235 = call %bound_method.loc27_17.2(%addr.loc27_17) +// CHECK:STDOUT: assign %p.var, %ptr.as.Copy.impl.Op.call // CHECK:STDOUT: %.loc27: type = splice_block %ptr [concrete = constants.%ptr.235] { // CHECK:STDOUT: %int_32.loc27: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc27: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] @@ -334,9 +354,9 @@ fn Main() { // CHECK:STDOUT: assign %.loc30_3, %.loc30_29 // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc27: = bound_method %p.var, constants.%T.as.Destroy.impl.Op.fad // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn.1: = specific_function constants.%T.as.Destroy.impl.Op.fad, @T.as.Destroy.impl.Op(constants.%ptr.235) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn.d25] -// CHECK:STDOUT: %bound_method.loc27: = bound_method %p.var, %T.as.Destroy.impl.Op.specific_fn.1 +// CHECK:STDOUT: %bound_method.loc27_3: = bound_method %p.var, %T.as.Destroy.impl.Op.specific_fn.1 // CHECK:STDOUT: %addr.loc27_3: %ptr.5d5 = addr_of %p.var -// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc27: init %empty_tuple.type = call %bound_method.loc27(%addr.loc27_3) +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc27: init %empty_tuple.type = call %bound_method.loc27_3(%addr.loc27_3) // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc23: = bound_method %c.var, constants.%T.as.Destroy.impl.Op.722 // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn.2: = specific_function constants.%T.as.Destroy.impl.Op.722, @T.as.Destroy.impl.Op(constants.%struct_type.a.b.501) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn.e4c] // CHECK:STDOUT: %bound_method.loc23_3: = bound_method %c.var, %T.as.Destroy.impl.Op.specific_fn.2 diff --git a/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon b/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon index 6b4fe13c742b..35fc6ab01c19 100644 --- a/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon @@ -76,6 +76,14 @@ fn Main() { // CHECK:STDOUT: %Main: %Main.type = struct_value () [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Copy.impl_witness.9a8: = impl_witness imports.%Copy.impl_witness_table.529 [concrete] +// CHECK:STDOUT: %Copy.facet.c98: %Copy.type = facet_value Core.IntLiteral, (%Copy.impl_witness.9a8) [concrete] +// CHECK:STDOUT: %.f07: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.c98 [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.Copy.impl.Op.type: type = fn_type @Core.IntLiteral.as.Copy.impl.Op [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.Copy.impl.Op: %Core.IntLiteral.as.Copy.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.Copy.impl.Op.bound.74e: = bound_method %int_2.ecc, %Core.IntLiteral.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] // CHECK:STDOUT: %ImplicitAs.type.e8c: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete] @@ -95,6 +103,8 @@ fn Main() { // CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.Copy.impl.Op.bound.04c: = bound_method %int_3.1ba, %Core.IntLiteral.as.Copy.impl.Op [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.Copy.impl.Op.bound.e8e: = bound_method %int_4, %Core.IntLiteral.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %tuple.302: %tuple.type.f94 = tuple_value (%int_3.1ba, %int_4) [concrete] // CHECK:STDOUT: %tuple.ad8: %tuple.type.f94 = tuple_value (%int_1.5b8, %int_2.ecc) [concrete] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete] @@ -107,6 +117,12 @@ fn Main() { // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %tuple.21c: %tuple.type.d07 = tuple_value (%int_1.5d2, %int_2.ef8) [concrete] // CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [concrete] +// CHECK:STDOUT: %Copy.impl_witness.fde: = impl_witness imports.%Copy.impl_witness_table.095 [concrete] +// CHECK:STDOUT: %Copy.facet.0af: %Copy.type = facet_value type, (%Copy.impl_witness.fde) [concrete] +// CHECK:STDOUT: %.130: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.0af [concrete] +// CHECK:STDOUT: %type.as.Copy.impl.Op.type: type = fn_type @type.as.Copy.impl.Op [concrete] +// CHECK:STDOUT: %type.as.Copy.impl.Op: %type.as.Copy.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %type.as.Copy.impl.Op.bound: = bound_method %ptr.235, %type.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %struct_type.x.y: type = struct_type {.x: Core.IntLiteral, .y: Core.IntLiteral} [concrete] // CHECK:STDOUT: %struct.a0d: %struct_type.x.y = struct_value (%int_3.1ba, %int_4) [concrete] // CHECK:STDOUT: %struct.004: %struct_type.x.y = struct_value (%int_1.5b8, %int_2.ecc) [concrete] @@ -127,15 +143,21 @@ fn Main() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs // CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.cac: %Core.IntLiteral.as.Copy.impl.Op.type = import_ref Core//prelude/parts/copy, loc28_31, loaded [concrete = constants.%Core.IntLiteral.as.Copy.impl.Op] +// CHECK:STDOUT: %Copy.impl_witness_table.529 = impl_witness_table (%Core.import_ref.cac), @Core.IntLiteral.as.Copy.impl [concrete] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.7bd: %type.as.Copy.impl.Op.type = import_ref Core//prelude/parts/copy, loc36_31, loaded [concrete = constants.%type.as.Copy.impl.Op] +// CHECK:STDOUT: %Copy.impl_witness_table.095 = impl_witness_table (%Core.import_ref.7bd), @type.as.Copy.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -164,7 +186,10 @@ fn Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1.loc22: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %int_2.loc22: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] -// CHECK:STDOUT: assign %int_1.loc22, %int_2.loc22 +// CHECK:STDOUT: %impl.elem0.loc22: %.f07 = impl_witness_access constants.%Copy.impl_witness.9a8, element0 [concrete = constants.%Core.IntLiteral.as.Copy.impl.Op] +// CHECK:STDOUT: %bound_method.loc22: = bound_method %int_2.loc22, %impl.elem0.loc22 [concrete = constants.%Core.IntLiteral.as.Copy.impl.Op.bound.74e] +// CHECK:STDOUT: %Core.IntLiteral.as.Copy.impl.Op.call.loc22: init Core.IntLiteral = call %bound_method.loc22(%int_2.loc22) [concrete = constants.%int_2.ecc] +// CHECK:STDOUT: assign %int_1.loc22, %Core.IntLiteral.as.Copy.impl.Op.call.loc22 // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] // CHECK:STDOUT: %F.call: init %i32 = call %F.ref() // CHECK:STDOUT: %int_1.loc27: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] @@ -181,10 +206,16 @@ fn Main() { // CHECK:STDOUT: %int_3.loc32: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %int_4.loc32: Core.IntLiteral = int_value 4 [concrete = constants.%int_4] // CHECK:STDOUT: %.loc32_17.1: %tuple.type.f94 = tuple_literal (%int_3.loc32, %int_4.loc32) +// CHECK:STDOUT: %impl.elem0.loc32_13: %.f07 = impl_witness_access constants.%Copy.impl_witness.9a8, element0 [concrete = constants.%Core.IntLiteral.as.Copy.impl.Op] +// CHECK:STDOUT: %bound_method.loc32_13: = bound_method %int_3.loc32, %impl.elem0.loc32_13 [concrete = constants.%Core.IntLiteral.as.Copy.impl.Op.bound.04c] +// CHECK:STDOUT: %Core.IntLiteral.as.Copy.impl.Op.call.loc32_13: init Core.IntLiteral = call %bound_method.loc32_13(%int_3.loc32) [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %tuple.elem0.loc32: Core.IntLiteral = tuple_access %.loc32_8.1, element0 -// CHECK:STDOUT: %.loc32_17.2: init Core.IntLiteral = initialize_from %int_3.loc32 to %tuple.elem0.loc32 [concrete = constants.%int_3.1ba] +// CHECK:STDOUT: %.loc32_17.2: init Core.IntLiteral = initialize_from %Core.IntLiteral.as.Copy.impl.Op.call.loc32_13 to %tuple.elem0.loc32 [concrete = constants.%int_3.1ba] +// CHECK:STDOUT: %impl.elem0.loc32_16: %.f07 = impl_witness_access constants.%Copy.impl_witness.9a8, element0 [concrete = constants.%Core.IntLiteral.as.Copy.impl.Op] +// CHECK:STDOUT: %bound_method.loc32_16: = bound_method %int_4.loc32, %impl.elem0.loc32_16 [concrete = constants.%Core.IntLiteral.as.Copy.impl.Op.bound.e8e] +// CHECK:STDOUT: %Core.IntLiteral.as.Copy.impl.Op.call.loc32_16: init Core.IntLiteral = call %bound_method.loc32_16(%int_4.loc32) [concrete = constants.%int_4] // CHECK:STDOUT: %tuple.elem1.loc32: Core.IntLiteral = tuple_access %.loc32_8.1, element1 -// CHECK:STDOUT: %.loc32_17.3: init Core.IntLiteral = initialize_from %int_4.loc32 to %tuple.elem1.loc32 [concrete = constants.%int_4] +// CHECK:STDOUT: %.loc32_17.3: init Core.IntLiteral = initialize_from %Core.IntLiteral.as.Copy.impl.Op.call.loc32_16 to %tuple.elem1.loc32 [concrete = constants.%int_4] // CHECK:STDOUT: %.loc32_17.4: init %tuple.type.f94 = tuple_init (%.loc32_17.2, %.loc32_17.3) to %.loc32_8.1 [concrete = constants.%tuple.302] // CHECK:STDOUT: %.loc32_10: init %tuple.type.f94 = converted %.loc32_17.1, %.loc32_17.4 [concrete = constants.%tuple.302] // CHECK:STDOUT: assign %.loc32_8.1, %.loc32_10 @@ -242,17 +273,26 @@ fn Main() { // CHECK:STDOUT: %int_32.loc43_9: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc43_9: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %ptr: type = ptr_type %i32.loc43_9 [concrete = constants.%ptr.235] -// CHECK:STDOUT: assign %i32.loc43_3, %ptr +// CHECK:STDOUT: %impl.elem0.loc43: %.130 = impl_witness_access constants.%Copy.impl_witness.fde, element0 [concrete = constants.%type.as.Copy.impl.Op] +// CHECK:STDOUT: %bound_method.loc43: = bound_method %ptr, %impl.elem0.loc43 [concrete = constants.%type.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %type.as.Copy.impl.Op.call: init type = call %bound_method.loc43(%ptr) [concrete = constants.%ptr.235] +// CHECK:STDOUT: assign %i32.loc43_3, %type.as.Copy.impl.Op.call // CHECK:STDOUT: %int_1.loc48: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %int_2.loc48: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %.loc48_18.1: %struct_type.x.y = struct_literal (%int_1.loc48, %int_2.loc48) // CHECK:STDOUT: %int_3.loc48: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %int_4.loc48: Core.IntLiteral = int_value 4 [concrete = constants.%int_4] // CHECK:STDOUT: %.loc48_37.1: %struct_type.x.y = struct_literal (%int_3.loc48, %int_4.loc48) +// CHECK:STDOUT: %impl.elem0.loc48_28: %.f07 = impl_witness_access constants.%Copy.impl_witness.9a8, element0 [concrete = constants.%Core.IntLiteral.as.Copy.impl.Op] +// CHECK:STDOUT: %bound_method.loc48_28: = bound_method %int_3.loc48, %impl.elem0.loc48_28 [concrete = constants.%Core.IntLiteral.as.Copy.impl.Op.bound.04c] +// CHECK:STDOUT: %Core.IntLiteral.as.Copy.impl.Op.call.loc48_28: init Core.IntLiteral = call %bound_method.loc48_28(%int_3.loc48) [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %.loc48_37.2: Core.IntLiteral = struct_access %.loc48_18.1, element0 -// CHECK:STDOUT: %.loc48_37.3: init Core.IntLiteral = initialize_from %int_3.loc48 to %.loc48_37.2 [concrete = constants.%int_3.1ba] +// CHECK:STDOUT: %.loc48_37.3: init Core.IntLiteral = initialize_from %Core.IntLiteral.as.Copy.impl.Op.call.loc48_28 to %.loc48_37.2 [concrete = constants.%int_3.1ba] +// CHECK:STDOUT: %impl.elem0.loc48_36: %.f07 = impl_witness_access constants.%Copy.impl_witness.9a8, element0 [concrete = constants.%Core.IntLiteral.as.Copy.impl.Op] +// CHECK:STDOUT: %bound_method.loc48_36: = bound_method %int_4.loc48, %impl.elem0.loc48_36 [concrete = constants.%Core.IntLiteral.as.Copy.impl.Op.bound.e8e] +// CHECK:STDOUT: %Core.IntLiteral.as.Copy.impl.Op.call.loc48_36: init Core.IntLiteral = call %bound_method.loc48_36(%int_4.loc48) [concrete = constants.%int_4] // CHECK:STDOUT: %.loc48_37.4: Core.IntLiteral = struct_access %.loc48_18.1, element1 -// CHECK:STDOUT: %.loc48_37.5: init Core.IntLiteral = initialize_from %int_4.loc48 to %.loc48_37.4 [concrete = constants.%int_4] +// CHECK:STDOUT: %.loc48_37.5: init Core.IntLiteral = initialize_from %Core.IntLiteral.as.Copy.impl.Op.call.loc48_36 to %.loc48_37.4 [concrete = constants.%int_4] // CHECK:STDOUT: %.loc48_37.6: init %struct_type.x.y = struct_init (%.loc48_37.3, %.loc48_37.5) to %.loc48_18.1 [concrete = constants.%struct.a0d] // CHECK:STDOUT: %.loc48_20: init %struct_type.x.y = converted %.loc48_37.1, %.loc48_37.6 [concrete = constants.%struct.a0d] // CHECK:STDOUT: assign %.loc48_18.1, %.loc48_20 diff --git a/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon b/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon index 47452af2fcc7..ac214d4e1771 100644 --- a/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon @@ -35,6 +35,7 @@ fn Main() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] @@ -62,6 +63,16 @@ fn Main() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.c36: = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.592 [concrete] // CHECK:STDOUT: %bound_method.f79: = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Int.as.Destroy.impl.Op.type.11b: type = fn_type @Int.as.Destroy.impl.Op, @Int.as.Destroy.impl(%int_32) [concrete] // CHECK:STDOUT: %Int.as.Destroy.impl.Op.054: %Int.as.Destroy.impl.Op.type.11b = struct_value () [concrete] @@ -73,14 +84,18 @@ fn Main() { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -124,10 +139,10 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %a.var: ref %i32 = var %a.var_patt // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] -// CHECK:STDOUT: %impl.elem0: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] -// CHECK:STDOUT: %bound_method.loc18_3.1: = bound_method %int_3, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.c36] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc18_3.2: = bound_method %int_3, %specific_fn [concrete = constants.%bound_method.f79] +// CHECK:STDOUT: %impl.elem0.loc18: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] +// CHECK:STDOUT: %bound_method.loc18_3.1: = bound_method %int_3, %impl.elem0.loc18 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.c36] +// CHECK:STDOUT: %specific_fn.loc18: = specific_function %impl.elem0.loc18, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc18_3.2: = bound_method %int_3, %specific_fn.loc18 [concrete = constants.%bound_method.f79] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc18_3.2(%int_3) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc18_3: init %i32 = converted %int_3, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_3.822] // CHECK:STDOUT: assign %a.var, %.loc18_3 @@ -140,7 +155,12 @@ fn Main() { // CHECK:STDOUT: %a.ref.loc23_7: ref %i32 = name_ref a, %a // CHECK:STDOUT: %a.ref.loc23_10: ref %i32 = name_ref a, %a // CHECK:STDOUT: %.loc23: %i32 = bind_value %a.ref.loc23_10 -// CHECK:STDOUT: assign %a.ref.loc23_3, %.loc23 +// CHECK:STDOUT: %impl.elem0.loc23: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc23_10.1: = bound_method %.loc23, %impl.elem0.loc23 +// CHECK:STDOUT: %specific_fn.loc23: = specific_function %impl.elem0.loc23, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc23_10.2: = bound_method %.loc23, %specific_fn.loc23 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc23_10.2(%.loc23) +// CHECK:STDOUT: assign %a.ref.loc23_3, %Int.as.Copy.impl.Op.call // CHECK:STDOUT: %a.ref.loc28_3: ref %i32 = name_ref a, %a // CHECK:STDOUT: %a.ref.loc28_7: ref %i32 = name_ref a, %a // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] 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 1b874e0f72b3..41b599569d91 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon @@ -70,7 +70,7 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/builtin/or.carbon b/toolchain/check/testdata/operators/builtin/or.carbon index a85de77a24cd..e33c79682453 100644 --- a/toolchain/check/testdata/operators/builtin/or.carbon +++ b/toolchain/check/testdata/operators/builtin/or.carbon @@ -47,6 +47,14 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: %Constant.type: type = fn_type @Constant [concrete] // CHECK:STDOUT: %Constant: %Constant.type = struct_value () [concrete] // CHECK:STDOUT: %false: bool = bool_literal false [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Copy.impl_witness.09f: = impl_witness imports.%Copy.impl_witness_table.47e [concrete] +// CHECK:STDOUT: %Copy.facet.dcd: %Copy.type = facet_value bool, (%Copy.impl_witness.09f) [concrete] +// CHECK:STDOUT: %.235: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.dcd [concrete] +// CHECK:STDOUT: %bool.as.Copy.impl.Op.type: type = fn_type @bool.as.Copy.impl.Op [concrete] +// CHECK:STDOUT: %bool.as.Copy.impl.Op: %bool.as.Copy.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %bool.as.Copy.impl.Op.bound: = bound_method %true, %bool.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] @@ -65,11 +73,15 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Bool = %Core.Bool +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = constants.%Bool] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.297: %bool.as.Copy.impl.Op.type = import_ref Core//prelude/parts/copy, loc16_31, loaded [concrete = constants.%bool.as.Copy.impl.Op] +// CHECK:STDOUT: %Copy.impl_witness_table.47e = impl_witness_table (%Core.import_ref.297), @bool.as.Copy.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -170,7 +182,10 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: } // CHECK:STDOUT: %a.var: ref bool = var %a.var_patt // CHECK:STDOUT: %true.loc23_46: bool = bool_literal true [concrete = constants.%true] -// CHECK:STDOUT: assign %a.var, %true.loc23_46 +// CHECK:STDOUT: %impl.elem0.loc23: %.235 = impl_witness_access constants.%Copy.impl_witness.09f, element0 [concrete = constants.%bool.as.Copy.impl.Op] +// CHECK:STDOUT: %bound_method.loc23_46: = bound_method %true.loc23_46, %impl.elem0.loc23 [concrete = constants.%bool.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %bool.as.Copy.impl.Op.call.loc23: init bool = call %bound_method.loc23_46(%true.loc23_46) [concrete = constants.%true] +// CHECK:STDOUT: assign %a.var, %bool.as.Copy.impl.Op.call.loc23 // CHECK:STDOUT: br !.loc23_13 // CHECK:STDOUT: // CHECK:STDOUT: !.loc23_13: @@ -210,7 +225,10 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: } // CHECK:STDOUT: %b.var: ref bool = var %b.var_patt // CHECK:STDOUT: %true.loc24_47: bool = bool_literal true [concrete = constants.%true] -// CHECK:STDOUT: assign %b.var, %true.loc24_47 +// CHECK:STDOUT: %impl.elem0.loc24: %.235 = impl_witness_access constants.%Copy.impl_witness.09f, element0 [concrete = constants.%bool.as.Copy.impl.Op] +// CHECK:STDOUT: %bound_method.loc24_47: = bound_method %true.loc24_47, %impl.elem0.loc24 [concrete = constants.%bool.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %bool.as.Copy.impl.Op.call.loc24: init bool = call %bound_method.loc24_47(%true.loc24_47) [concrete = constants.%true] +// CHECK:STDOUT: assign %b.var, %bool.as.Copy.impl.Op.call.loc24 // CHECK:STDOUT: br !.loc24_13 // CHECK:STDOUT: // CHECK:STDOUT: !.loc24_13: @@ -250,7 +268,10 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: } // CHECK:STDOUT: %c.var: ref bool = var %c.var_patt // CHECK:STDOUT: %true.loc25_47: bool = bool_literal true [concrete = constants.%true] -// CHECK:STDOUT: assign %c.var, %true.loc25_47 +// CHECK:STDOUT: %impl.elem0.loc25: %.235 = impl_witness_access constants.%Copy.impl_witness.09f, element0 [concrete = constants.%bool.as.Copy.impl.Op] +// CHECK:STDOUT: %bound_method.loc25_47: = bound_method %true.loc25_47, %impl.elem0.loc25 [concrete = constants.%bool.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %bool.as.Copy.impl.Op.call.loc25: init bool = call %bound_method.loc25_47(%true.loc25_47) [concrete = constants.%true] +// CHECK:STDOUT: assign %c.var, %bool.as.Copy.impl.Op.call.loc25 // CHECK:STDOUT: br !.loc25_13 // CHECK:STDOUT: // CHECK:STDOUT: !.loc25_13: @@ -333,19 +354,19 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc26: init %empty_tuple.type = call %bound_method.loc26(%addr.loc26) // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc25: = bound_method %c.var, constants.%T.as.Destroy.impl.Op.4f7 // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn.2: = specific_function constants.%T.as.Destroy.impl.Op.4f7, @T.as.Destroy.impl.Op(bool) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn.e5c] -// CHECK:STDOUT: %bound_method.loc25: = bound_method %c.var, %T.as.Destroy.impl.Op.specific_fn.2 +// CHECK:STDOUT: %bound_method.loc25_3: = bound_method %c.var, %T.as.Destroy.impl.Op.specific_fn.2 // CHECK:STDOUT: %addr.loc25: %ptr.bb2 = addr_of %c.var -// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc25: init %empty_tuple.type = call %bound_method.loc25(%addr.loc25) +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc25: init %empty_tuple.type = call %bound_method.loc25_3(%addr.loc25) // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc24: = bound_method %b.var, constants.%T.as.Destroy.impl.Op.4f7 // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn.3: = specific_function constants.%T.as.Destroy.impl.Op.4f7, @T.as.Destroy.impl.Op(bool) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn.e5c] -// CHECK:STDOUT: %bound_method.loc24: = bound_method %b.var, %T.as.Destroy.impl.Op.specific_fn.3 +// CHECK:STDOUT: %bound_method.loc24_3: = bound_method %b.var, %T.as.Destroy.impl.Op.specific_fn.3 // CHECK:STDOUT: %addr.loc24: %ptr.bb2 = addr_of %b.var -// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc24: init %empty_tuple.type = call %bound_method.loc24(%addr.loc24) +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc24: init %empty_tuple.type = call %bound_method.loc24_3(%addr.loc24) // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc23: = bound_method %a.var, constants.%T.as.Destroy.impl.Op.4f7 // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn.4: = specific_function constants.%T.as.Destroy.impl.Op.4f7, @T.as.Destroy.impl.Op(bool) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn.e5c] -// CHECK:STDOUT: %bound_method.loc23: = bound_method %a.var, %T.as.Destroy.impl.Op.specific_fn.4 +// CHECK:STDOUT: %bound_method.loc23_3: = bound_method %a.var, %T.as.Destroy.impl.Op.specific_fn.4 // CHECK:STDOUT: %addr.loc23: %ptr.bb2 = addr_of %a.var -// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc23: init %empty_tuple.type = call %bound_method.loc23(%addr.loc23) +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc23: init %empty_tuple.type = call %bound_method.loc23_3(%addr.loc23) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -357,7 +378,10 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: } // CHECK:STDOUT: %a.var: ref bool = var %a.var_patt // CHECK:STDOUT: %true.loc30_43: bool = bool_literal true [concrete = constants.%true] -// CHECK:STDOUT: assign %a.var, %true.loc30_43 +// CHECK:STDOUT: %impl.elem0: %.235 = impl_witness_access constants.%Copy.impl_witness.09f, element0 [concrete = constants.%bool.as.Copy.impl.Op] +// CHECK:STDOUT: %bound_method.loc30_43: = bound_method %true.loc30_43, %impl.elem0 [concrete = constants.%bool.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %bool.as.Copy.impl.Op.call: init bool = call %bound_method.loc30_43(%true.loc30_43) [concrete = constants.%true] +// CHECK:STDOUT: assign %a.var, %bool.as.Copy.impl.Op.call // CHECK:STDOUT: br !.loc30_13 // CHECK:STDOUT: // CHECK:STDOUT: !.loc30_13: @@ -393,9 +417,9 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: %a: ref bool = bind_name a, %a.var // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound: = bound_method %a.var, constants.%T.as.Destroy.impl.Op.4f7 // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: = specific_function constants.%T.as.Destroy.impl.Op.4f7, @T.as.Destroy.impl.Op(bool) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn.e5c] -// CHECK:STDOUT: %bound_method: = bound_method %a.var, %T.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %bound_method.loc30_3: = bound_method %a.var, %T.as.Destroy.impl.Op.specific_fn // CHECK:STDOUT: %addr: %ptr.bb2 = addr_of %a.var -// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr) +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc30_3(%addr) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/unary_op.carbon b/toolchain/check/testdata/operators/builtin/unary_op.carbon index 8ad7870bd620..76ff3927dfeb 100644 --- a/toolchain/check/testdata/operators/builtin/unary_op.carbon +++ b/toolchain/check/testdata/operators/builtin/unary_op.carbon @@ -39,6 +39,14 @@ fn Constant() { // CHECK:STDOUT: %Constant: %Constant.type = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Copy.impl_witness.09f: = impl_witness imports.%Copy.impl_witness_table.47e [concrete] +// CHECK:STDOUT: %Copy.facet.dcd: %Copy.type = facet_value bool, (%Copy.impl_witness.09f) [concrete] +// CHECK:STDOUT: %.235: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.dcd [concrete] +// CHECK:STDOUT: %bool.as.Copy.impl.Op.type: type = fn_type @bool.as.Copy.impl.Op [concrete] +// CHECK:STDOUT: %bool.as.Copy.impl.Op: %bool.as.Copy.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %bool.as.Copy.impl.Op.bound: = bound_method %true, %bool.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.type.19a: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(bool) [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.4f7: %T.as.Destroy.impl.Op.type.19a = struct_value () [concrete] @@ -53,11 +61,15 @@ fn Constant() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Bool = %Core.Bool +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = constants.%Bool] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.297: %bool.as.Copy.impl.Op.type = import_ref Core//prelude/parts/copy, loc16_31, loaded [concrete = constants.%bool.as.Copy.impl.Op] +// CHECK:STDOUT: %Copy.impl_witness_table.47e = impl_witness_table (%Core.import_ref.297), @bool.as.Copy.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -158,7 +170,10 @@ fn Constant() { // CHECK:STDOUT: } // CHECK:STDOUT: %b.var: ref bool = var %b.var_patt // CHECK:STDOUT: %true.loc24: bool = bool_literal true [concrete = constants.%true] -// CHECK:STDOUT: assign %b.var, %true.loc24 +// CHECK:STDOUT: %impl.elem0: %.235 = impl_witness_access constants.%Copy.impl_witness.09f, element0 [concrete = constants.%bool.as.Copy.impl.Op] +// CHECK:STDOUT: %bound_method.loc24_43: = bound_method %true.loc24, %impl.elem0 [concrete = constants.%bool.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %bool.as.Copy.impl.Op.call: init bool = call %bound_method.loc24_43(%true.loc24) [concrete = constants.%true] +// CHECK:STDOUT: assign %b.var, %bool.as.Copy.impl.Op.call // CHECK:STDOUT: br !.loc24_17 // CHECK:STDOUT: // CHECK:STDOUT: !.loc24_17: @@ -185,9 +200,9 @@ fn Constant() { // CHECK:STDOUT: %b: ref bool = bind_name b, %b.var // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc24: = bound_method %b.var, constants.%T.as.Destroy.impl.Op.4f7 // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn.1: = specific_function constants.%T.as.Destroy.impl.Op.4f7, @T.as.Destroy.impl.Op(bool) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn.e5c] -// CHECK:STDOUT: %bound_method.loc24: = bound_method %b.var, %T.as.Destroy.impl.Op.specific_fn.1 +// CHECK:STDOUT: %bound_method.loc24_3: = bound_method %b.var, %T.as.Destroy.impl.Op.specific_fn.1 // CHECK:STDOUT: %addr.loc24: %ptr.bb2 = addr_of %b.var -// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc24: init %empty_tuple.type = call %bound_method.loc24(%addr.loc24) +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc24: init %empty_tuple.type = call %bound_method.loc24_3(%addr.loc24) // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc23: = bound_method %a.var, constants.%T.as.Destroy.impl.Op.bae // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn.2: = specific_function constants.%T.as.Destroy.impl.Op.bae, @T.as.Destroy.impl.Op(constants.%empty_tuple.type) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn.900] // CHECK:STDOUT: %bound_method.loc23: = bound_method %a.var, %T.as.Destroy.impl.Op.specific_fn.2 diff --git a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon index 87af22b9c929..54120ef81851 100644 --- a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon +++ b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon @@ -43,6 +43,7 @@ fn Test() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %complete_type.f8a: = complete_type_witness %i32.builtin [concrete] @@ -67,6 +68,17 @@ fn Test() { // CHECK:STDOUT: %i32.as.ImplicitAs.impl.Convert.type: type = fn_type @i32.as.ImplicitAs.impl.Convert [concrete] // CHECK:STDOUT: %i32.as.ImplicitAs.impl.Convert: %i32.as.ImplicitAs.impl.Convert.type = struct_value () [concrete] // CHECK:STDOUT: %ImplicitAs.facet.647: %ImplicitAs.type.d1b = facet_value %i32, (%ImplicitAs.impl_witness.713) [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %ImplicitAs.type.e8c: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete] // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete] // CHECK:STDOUT: %ImplicitAs.impl_witness.00a: = impl_witness file.%ImplicitAs.impl_witness_table.loc23 [concrete] @@ -79,12 +91,11 @@ fn Test() { // CHECK:STDOUT: %Sink_X: %Sink_X.type = struct_value () [concrete] // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self] -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] -// CHECK:STDOUT: %pattern_type.7dcd0a.2: type = pattern_type %T [symbolic] +// CHECK:STDOUT: %pattern_type.7dcd0a.2: type = pattern_type %T.8b3 [symbolic] // CHECK:STDOUT: %Source.type: type = fn_type @Source [concrete] // CHECK:STDOUT: %Source: %Source.type = struct_value () [concrete] -// CHECK:STDOUT: %require_complete.4ae: = require_complete_type %T [symbolic] -// CHECK:STDOUT: %Source.specific_fn.ff0: = specific_function %Source, @Source(%T) [symbolic] +// CHECK:STDOUT: %require_complete.4ae: = require_complete_type %T.8b3 [symbolic] +// CHECK:STDOUT: %Source.specific_fn.ff0: = specific_function %Source, @Source(%T.8b3) [symbolic] // CHECK:STDOUT: %Test.type: type = fn_type @Test [concrete] // CHECK:STDOUT: %Test: %Test.type = struct_value () [concrete] // CHECK:STDOUT: %Source.specific_fn.363: = specific_function %Source, @Source(%X) [concrete] @@ -98,12 +109,16 @@ fn Test() { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -161,11 +176,11 @@ fn Test() { // CHECK:STDOUT: %return.patt: @Source.%pattern_type (%pattern_type.7dcd0a.2) = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: @Source.%pattern_type (%pattern_type.7dcd0a.2) = out_param_pattern %return.patt, call_param0 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc31_24: type = name_ref T, %T.loc31_11.2 [symbolic = %T.loc31_11.1 (constants.%T)] +// CHECK:STDOUT: %T.ref.loc31_24: type = name_ref T, %T.loc31_11.2 [symbolic = %T.loc31_11.1 (constants.%T.8b3)] // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %T.loc31_11.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc31_11.1 (constants.%T)] -// CHECK:STDOUT: %return.param: ref @Source.%T.loc31_11.1 (%T) = out_param call_param0 -// CHECK:STDOUT: %return: ref @Source.%T.loc31_11.1 (%T) = return_slot %return.param +// CHECK:STDOUT: %T.loc31_11.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc31_11.1 (constants.%T.8b3)] +// CHECK:STDOUT: %return.param: ref @Source.%T.loc31_11.1 (%T.8b3) = out_param call_param0 +// CHECK:STDOUT: %return: ref @Source.%T.loc31_11.1 (%T.8b3) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Test.decl: %Test.type = fn_decl @Test [concrete = constants.%Test] {} {} // CHECK:STDOUT: } @@ -254,8 +269,13 @@ fn Test() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %i32 = name_ref self, %self // CHECK:STDOUT: %.loc20_51.1: %struct_type.n = struct_literal (%self.ref) +// CHECK:STDOUT: %impl.elem0: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc20_47.1: = bound_method %self.ref, %impl.elem0 +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc20_47.2: = bound_method %self.ref, %specific_fn +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc20_47.2(%self.ref) // CHECK:STDOUT: %.loc20_51.2: ref %i32 = class_element_access %return, element0 -// CHECK:STDOUT: %.loc20_51.3: init %i32 = initialize_from %self.ref to %.loc20_51.2 +// CHECK:STDOUT: %.loc20_51.3: init %i32 = initialize_from %Int.as.Copy.impl.Op.call to %.loc20_51.2 // CHECK:STDOUT: %.loc20_51.4: init %X = class_init (%.loc20_51.3), %return // CHECK:STDOUT: %.loc20_52: init %X = converted %.loc20_51.1, %.loc20_51.4 // CHECK:STDOUT: return %.loc20_52 to %return @@ -275,21 +295,21 @@ fn Test() { // CHECK:STDOUT: fn @Sink_X(%x.param: %X); // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Source(%T.loc31_11.2: type) { -// CHECK:STDOUT: %T.loc31_11.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc31_11.1 (constants.%T)] +// CHECK:STDOUT: %T.loc31_11.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc31_11.1 (constants.%T.8b3)] // CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc31_11.1 [symbolic = %pattern_type (constants.%pattern_type.7dcd0a.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %T.loc31_11.1 [symbolic = %require_complete (constants.%require_complete.4ae)] // CHECK:STDOUT: %Source.specific_fn.loc31_35.2: = specific_function constants.%Source, @Source(%T.loc31_11.1) [symbolic = %Source.specific_fn.loc31_35.2 (constants.%Source.specific_fn.ff0)] // CHECK:STDOUT: -// CHECK:STDOUT: fn() -> @Source.%T.loc31_11.1 (%T) { +// CHECK:STDOUT: fn() -> @Source.%T.loc31_11.1 (%T.8b3) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Source.ref: %Source.type = name_ref Source, file.%Source.decl [concrete = constants.%Source] -// CHECK:STDOUT: %T.ref.loc31_42: type = name_ref T, %T.loc31_11.2 [symbolic = %T.loc31_11.1 (constants.%T)] -// CHECK:STDOUT: %Source.specific_fn.loc31_35.1: = specific_function %Source.ref, @Source(constants.%T) [symbolic = %Source.specific_fn.loc31_35.2 (constants.%Source.specific_fn.ff0)] -// CHECK:STDOUT: %Source.call: init @Source.%T.loc31_11.1 (%T) = call %Source.specific_fn.loc31_35.1() -// CHECK:STDOUT: %.loc31_44.1: @Source.%T.loc31_11.1 (%T) = value_of_initializer %Source.call -// CHECK:STDOUT: %.loc31_44.2: @Source.%T.loc31_11.1 (%T) = converted %Source.call, %.loc31_44.1 +// CHECK:STDOUT: %T.ref.loc31_42: type = name_ref T, %T.loc31_11.2 [symbolic = %T.loc31_11.1 (constants.%T.8b3)] +// CHECK:STDOUT: %Source.specific_fn.loc31_35.1: = specific_function %Source.ref, @Source(constants.%T.8b3) [symbolic = %Source.specific_fn.loc31_35.2 (constants.%Source.specific_fn.ff0)] +// CHECK:STDOUT: %Source.call: init @Source.%T.loc31_11.1 (%T.8b3) = call %Source.specific_fn.loc31_35.1() +// CHECK:STDOUT: %.loc31_44.1: @Source.%T.loc31_11.1 (%T.8b3) = value_of_initializer %Source.call +// CHECK:STDOUT: %.loc31_44.2: @Source.%T.loc31_11.1 (%T.8b3) = converted %Source.call, %.loc31_44.1 // CHECK:STDOUT: return %.loc31_44.2 // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -335,8 +355,8 @@ fn Test() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Source(constants.%T) { -// CHECK:STDOUT: %T.loc31_11.1 => constants.%T +// CHECK:STDOUT: specific @Source(constants.%T.8b3) { +// CHECK:STDOUT: %T.loc31_11.1 => constants.%T.8b3 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dcd0a.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: diff --git a/toolchain/check/testdata/operators/overloaded/index_with_prelude.carbon b/toolchain/check/testdata/operators/overloaded/index_with_prelude.carbon index 02e89a21c1be..016d05b6bd74 100644 --- a/toolchain/check/testdata/operators/overloaded/index_with_prelude.carbon +++ b/toolchain/check/testdata/operators/overloaded/index_with_prelude.carbon @@ -385,7 +385,7 @@ let x: i32 = c[0]; // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.IndexWith: %IndexWith.type.504 = import_ref Core//prelude/operators/index, IndexWith, loaded [concrete = constants.%IndexWith.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/types/int, loc20_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/types/int, loc27_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/package_expr/syntax.carbon b/toolchain/check/testdata/package_expr/syntax.carbon index f17bc4a80831..2229eb163db8 100644 --- a/toolchain/check/testdata/package_expr/syntax.carbon +++ b/toolchain/check/testdata/package_expr/syntax.carbon @@ -51,6 +51,7 @@ fn Main() { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete] @@ -70,19 +71,33 @@ fn Main() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.592, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -117,17 +132,22 @@ fn Main() { // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] -// CHECK:STDOUT: %impl.elem0: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] -// CHECK:STDOUT: %bound_method.loc4_1.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc4_1.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %impl.elem0.loc4: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] +// CHECK:STDOUT: %bound_method.loc4_1.1: = bound_method %int_0, %impl.elem0.loc4 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc4: = specific_function %impl.elem0.loc4, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc4_1.2: = bound_method %int_0, %specific_fn.loc4 [concrete = constants.%bound_method] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc4_1.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc4: init %i32 = converted %int_0, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_0.6a9] // CHECK:STDOUT: assign file.%x.var, %.loc4 // CHECK:STDOUT: %package.ref: = name_ref package, package [concrete = package] // CHECK:STDOUT: %x.ref: ref %i32 = name_ref x, file.%x [concrete = file.%x.var] // CHECK:STDOUT: %.loc5: %i32 = bind_value %x.ref -// CHECK:STDOUT: assign file.%y.var, %.loc5 +// CHECK:STDOUT: %impl.elem0.loc5: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc5_21.1: = bound_method %.loc5, %impl.elem0.loc5 +// CHECK:STDOUT: %specific_fn.loc5: = specific_function %impl.elem0.loc5, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc5_21.2: = bound_method %.loc5, %specific_fn.loc5 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc5_21.2(%.loc5) +// CHECK:STDOUT: assign file.%y.var, %Int.as.Copy.impl.Op.call // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -138,6 +158,7 @@ fn Main() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete] @@ -163,6 +184,16 @@ fn Main() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.a02: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.592 [concrete] // CHECK:STDOUT: %bound_method.b59: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Int.as.Destroy.impl.Op.type.11b: type = fn_type @Int.as.Destroy.impl.Op, @Int.as.Destroy.impl(%int_32) [concrete] // CHECK:STDOUT: %Int.as.Destroy.impl.Op.054: %Int.as.Destroy.impl.Op.type.11b = struct_value () [concrete] @@ -174,14 +205,18 @@ fn Main() { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -213,10 +248,10 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %x.var: ref %i32 = var %x.var_patt // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] -// CHECK:STDOUT: %bound_method.loc7_3.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.a02] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc7_3.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method.b59] +// CHECK:STDOUT: %impl.elem0.loc7: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] +// CHECK:STDOUT: %bound_method.loc7_3.1: = bound_method %int_1, %impl.elem0.loc7 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.a02] +// CHECK:STDOUT: %specific_fn.loc7: = specific_function %impl.elem0.loc7, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc7_3.2: = bound_method %int_1, %specific_fn.loc7 [concrete = constants.%bound_method.b59] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc7_3.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc7_3: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.5d2] // CHECK:STDOUT: assign %x.var, %.loc7_3 @@ -233,7 +268,12 @@ fn Main() { // CHECK:STDOUT: %package.ref: = name_ref package, package [concrete = package] // CHECK:STDOUT: %x.ref: ref %i32 = name_ref x, file.%x [concrete = file.%x.var] // CHECK:STDOUT: %.loc9_23: %i32 = bind_value %x.ref -// CHECK:STDOUT: assign %y.var, %.loc9_23 +// CHECK:STDOUT: %impl.elem0.loc9: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc9_23.1: = bound_method %.loc9_23, %impl.elem0.loc9 +// CHECK:STDOUT: %specific_fn.loc9: = specific_function %impl.elem0.loc9, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_23.2: = bound_method %.loc9_23, %specific_fn.loc9 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc9_23.2(%.loc9_23) +// CHECK:STDOUT: assign %y.var, %Int.as.Copy.impl.Op.call // CHECK:STDOUT: %.loc9_10: type = splice_block %i32.loc9 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc9: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc9: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] @@ -241,9 +281,9 @@ fn Main() { // CHECK:STDOUT: %y: ref %i32 = bind_name y, %y.var // CHECK:STDOUT: %Int.as.Destroy.impl.Op.bound.loc9: = bound_method %y.var, constants.%Int.as.Destroy.impl.Op.054 // CHECK:STDOUT: %Int.as.Destroy.impl.Op.specific_fn.1: = specific_function constants.%Int.as.Destroy.impl.Op.054, @Int.as.Destroy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Destroy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc9: = bound_method %y.var, %Int.as.Destroy.impl.Op.specific_fn.1 +// CHECK:STDOUT: %bound_method.loc9_3: = bound_method %y.var, %Int.as.Destroy.impl.Op.specific_fn.1 // CHECK:STDOUT: %addr.loc9: %ptr.235 = addr_of %y.var -// CHECK:STDOUT: %Int.as.Destroy.impl.Op.call.loc9: init %empty_tuple.type = call %bound_method.loc9(%addr.loc9) +// CHECK:STDOUT: %Int.as.Destroy.impl.Op.call.loc9: init %empty_tuple.type = call %bound_method.loc9_3(%addr.loc9) // CHECK:STDOUT: %Int.as.Destroy.impl.Op.bound.loc7: = bound_method %x.var, constants.%Int.as.Destroy.impl.Op.054 // CHECK:STDOUT: %Int.as.Destroy.impl.Op.specific_fn.2: = specific_function constants.%Int.as.Destroy.impl.Op.054, @Int.as.Destroy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Destroy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc7_3.3: = bound_method %x.var, %Int.as.Destroy.impl.Op.specific_fn.2 diff --git a/toolchain/check/testdata/packages/implicit_imports_prelude.carbon b/toolchain/check/testdata/packages/implicit_imports_prelude.carbon index e8a863a9af7b..106ebfcb0b0e 100644 --- a/toolchain/check/testdata/packages/implicit_imports_prelude.carbon +++ b/toolchain/check/testdata/packages/implicit_imports_prelude.carbon @@ -62,7 +62,7 @@ var b: i32 = a; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -102,15 +102,27 @@ var b: i32 = a; // CHECK:STDOUT: constants { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %pattern_type.501: type = pattern_type %i32 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.f3d: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6d8: %Int.as.Copy.impl.Op.type.f3d = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.13a: = impl_witness imports.%Copy.impl_witness_table.fef, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.17b: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.83b: %Int.as.Copy.impl.Op.type.17b = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.acf: %Copy.type = facet_value %i32, (%Copy.impl_witness.13a) [concrete] +// CHECK:STDOUT: %.1a7: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.acf [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.83b, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Main.a: ref %i32 = import_ref Main//lib, a, loaded [concrete = %a.var] // CHECK:STDOUT: %Core.ece: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -118,6 +130,9 @@ var b: i32 = a; // CHECK:STDOUT: %a.patt: %pattern_type.501 = binding_pattern a [concrete] // CHECK:STDOUT: %a.var_patt: %pattern_type.501 = var_pattern %a.patt [concrete] // CHECK:STDOUT: %a.var: ref %i32 = var %a.var_patt [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.526: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.f3d) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6d8)] +// CHECK:STDOUT: %Copy.impl_witness_table.fef = impl_witness_table (%Core.import_ref.526), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -145,7 +160,12 @@ var b: i32 = a; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: ref %i32 = name_ref a, imports.%Main.a [concrete = imports.%a.var] // CHECK:STDOUT: %.loc4: %i32 = bind_value %a.ref -// CHECK:STDOUT: assign file.%b.var, %.loc4 +// CHECK:STDOUT: %impl.elem0: %.1a7 = impl_witness_access constants.%Copy.impl_witness.13a, element0 [concrete = constants.%Int.as.Copy.impl.Op.83b] +// CHECK:STDOUT: %bound_method.loc4_14.1: = bound_method %.loc4, %impl.elem0 +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc4_14.2: = bound_method %.loc4, %specific_fn +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc4_14.2(%.loc4) +// CHECK:STDOUT: assign file.%b.var, %Int.as.Copy.impl.Op.call // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/raw_core.carbon b/toolchain/check/testdata/packages/raw_core.carbon index dd2e39eae259..328abce77d27 100644 --- a/toolchain/check/testdata/packages/raw_core.carbon +++ b/toolchain/check/testdata/packages/raw_core.carbon @@ -197,6 +197,7 @@ var c: r#Core = {.n = 0 as Core.Int(32)}; // CHECK:STDOUT: %Core: type = class_type @Core [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %Core.elem: type = unbound_element_type %Core, %i32 [concrete] @@ -225,9 +226,21 @@ var c: r#Core = {.n = 0 as Core.Int(32)}; // CHECK:STDOUT: %.323: type = fn_type_with_self_type %As.Convert.type.99b, %As.facet [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: = bound_method %int_0.5c6, %Core.IntLiteral.as.As.impl.Convert.11b [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.As.impl.Convert.11b, @Core.IntLiteral.as.As.impl.Convert(%int_32) [concrete] -// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete] +// CHECK:STDOUT: %bound_method.385: = bound_method %int_0.5c6, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %.96d: ref %i32 = class_element_access file.%c.var, element0 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.bound: = bound_method %int_0.6a9, %Int.as.Copy.impl.Op.87e [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.06d: = bound_method %int_0.6a9, %Int.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %Core.val: %Core = struct_value (%int_0.6a9) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -236,14 +249,18 @@ var c: r#Core = {.n = 0 as Core.Int(32)}; // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: .As = %Core.As +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//prelude/parts/as, As, loaded [concrete = constants.%As.generic] -// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/parts/int, loc25_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] +// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/parts/int, loc32_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] // CHECK:STDOUT: %As.impl_witness_table.3fe = impl_witness_table (%Core.import_ref.52c), @Core.IntLiteral.as.As.impl [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -306,16 +323,21 @@ var c: r#Core = {.n = 0 as Core.Int(32)}; // CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %impl.elem0: %.323 = impl_witness_access constants.%As.impl_witness.a7b, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.11b] -// CHECK:STDOUT: %bound_method.loc6_25.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.As.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc6_25.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %impl.elem0.loc6_25.1: %.323 = impl_witness_access constants.%As.impl_witness.a7b, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.11b] +// CHECK:STDOUT: %bound_method.loc6_25.1: = bound_method %int_0, %impl.elem0.loc6_25.1 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc6_25.1: = specific_function %impl.elem0.loc6_25.1, @Core.IntLiteral.as.As.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_25.2: = bound_method %int_0, %specific_fn.loc6_25.1 [concrete = constants.%bound_method.385] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i32 = call %bound_method.loc6_25.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_25.1: %i32 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_25.2: %i32 = converted %int_0, %.loc6_25.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_40.1: %struct_type.n = struct_literal (%.loc6_25.2) +// CHECK:STDOUT: %impl.elem0.loc6_25.2: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc6_25.3: = bound_method %.loc6_25.2, %impl.elem0.loc6_25.2 [concrete = constants.%Int.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %specific_fn.loc6_25.2: = specific_function %impl.elem0.loc6_25.2, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_25.4: = bound_method %.loc6_25.2, %specific_fn.loc6_25.2 [concrete = constants.%bound_method.06d] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc6_25.4(%.loc6_25.2) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_40.2: ref %i32 = class_element_access file.%c.var, element0 [concrete = constants.%.96d] -// CHECK:STDOUT: %.loc6_40.3: init %i32 = initialize_from %.loc6_25.2 to %.loc6_40.2 [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc6_40.3: init %i32 = initialize_from %Int.as.Copy.impl.Op.call to %.loc6_40.2 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_40.4: init %Core = class_init (%.loc6_40.3), file.%c.var [concrete = constants.%Core.val] // CHECK:STDOUT: %.loc6_1: init %Core = converted %.loc6_40.1, %.loc6_40.4 [concrete = constants.%Core.val] // CHECK:STDOUT: assign file.%c.var, %.loc6_1 diff --git a/toolchain/check/testdata/pointer/address_of_deref.carbon b/toolchain/check/testdata/pointer/address_of_deref.carbon index 0dec478aa066..e32125932200 100644 --- a/toolchain/check/testdata/pointer/address_of_deref.carbon +++ b/toolchain/check/testdata/pointer/address_of_deref.carbon @@ -62,7 +62,7 @@ fn F() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/pointer/address_of_lvalue.carbon b/toolchain/check/testdata/pointer/address_of_lvalue.carbon index 53deafb23559..13c5f05cfcac 100644 --- a/toolchain/check/testdata/pointer/address_of_lvalue.carbon +++ b/toolchain/check/testdata/pointer/address_of_lvalue.carbon @@ -61,8 +61,25 @@ fn F() { // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %struct: %struct_type.a.b.501 = struct_value (%int_1.5d2, %int_2.ef8) [concrete] // CHECK:STDOUT: %pattern_type.8dd: type = pattern_type %ptr.3ee [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.f23: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.8b3) [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.abf: %ptr.as.Copy.impl.Op.type.f23 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.4c1: = impl_witness imports.%Copy.impl_witness_table.a71, @ptr.as.Copy.impl(%struct_type.a.b.501) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.3a9: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%struct_type.a.b.501) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.bbd: %ptr.as.Copy.impl.Op.type.3a9 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.a2d: %Copy.type = facet_value %ptr.3ee, (%Copy.impl_witness.4c1) [concrete] +// CHECK:STDOUT: %.78a: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.a2d [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn.572: = specific_function %ptr.as.Copy.impl.Op.bbd, @ptr.as.Copy.impl.Op(%struct_type.a.b.501) [concrete] // CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [concrete] // CHECK:STDOUT: %pattern_type.fe8: type = pattern_type %ptr.235 [concrete] +// CHECK:STDOUT: %Copy.impl_witness.19c: = impl_witness imports.%Copy.impl_witness_table.a71, @ptr.as.Copy.impl(%i32) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.3ea: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%i32) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.2f4: %ptr.as.Copy.impl.Op.type.3ea = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.bab: %Copy.type = facet_value %ptr.235, (%Copy.impl_witness.19c) [concrete] +// CHECK:STDOUT: %.284: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.bab [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn.582: = specific_function %ptr.as.Copy.impl.Op.2f4, @ptr.as.Copy.impl.Op(%i32) [concrete] // CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete] // CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [concrete] // CHECK:STDOUT: %ptr.261: type = ptr_type %tuple.type.d07 [concrete] @@ -91,14 +108,18 @@ fn F() { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.de9: @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op.type (%ptr.as.Copy.impl.Op.type.f23) = import_ref Core//prelude/parts/copy, loc32_31, loaded [symbolic = @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op (constants.%ptr.as.Copy.impl.Op.abf)] +// CHECK:STDOUT: %Copy.impl_witness_table.a71 = impl_witness_table (%Core.import_ref.de9), @ptr.as.Copy.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -155,7 +176,12 @@ fn F() { // CHECK:STDOUT: %p.var: ref %ptr.3ee = var %p.var_patt // CHECK:STDOUT: %s.ref.loc18: ref %struct_type.a.b.501 = name_ref s, %s // CHECK:STDOUT: %addr.loc18_32: %ptr.3ee = addr_of %s.ref.loc18 -// CHECK:STDOUT: assign %p.var, %addr.loc18_32 +// CHECK:STDOUT: %impl.elem0.loc18: %.78a = impl_witness_access constants.%Copy.impl_witness.4c1, element0 [concrete = constants.%ptr.as.Copy.impl.Op.bbd] +// CHECK:STDOUT: %bound_method.loc18_32.1: = bound_method %addr.loc18_32, %impl.elem0.loc18 +// CHECK:STDOUT: %specific_fn.loc18: = specific_function %impl.elem0.loc18, @ptr.as.Copy.impl.Op(constants.%struct_type.a.b.501) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn.572] +// CHECK:STDOUT: %bound_method.loc18_32.2: = bound_method %addr.loc18_32, %specific_fn.loc18 +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc18: init %ptr.3ee = call %bound_method.loc18_32.2(%addr.loc18_32) +// CHECK:STDOUT: assign %p.var, %ptr.as.Copy.impl.Op.call.loc18 // CHECK:STDOUT: %.loc18: type = splice_block %ptr.loc18 [concrete = constants.%ptr.3ee] { // CHECK:STDOUT: %int_32.loc18_15: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc18_15: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] @@ -173,7 +199,12 @@ fn F() { // CHECK:STDOUT: %s.ref.loc19: ref %struct_type.a.b.501 = name_ref s, %s // CHECK:STDOUT: %.loc19_19: ref %i32 = struct_access %s.ref.loc19, element0 // CHECK:STDOUT: %addr.loc19_17: %ptr.235 = addr_of %.loc19_19 -// CHECK:STDOUT: assign %q.var, %addr.loc19_17 +// CHECK:STDOUT: %impl.elem0.loc19: %.284 = impl_witness_access constants.%Copy.impl_witness.19c, element0 [concrete = constants.%ptr.as.Copy.impl.Op.2f4] +// CHECK:STDOUT: %bound_method.loc19_17.1: = bound_method %addr.loc19_17, %impl.elem0.loc19 +// CHECK:STDOUT: %specific_fn.loc19: = specific_function %impl.elem0.loc19, @ptr.as.Copy.impl.Op(constants.%i32) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn.582] +// CHECK:STDOUT: %bound_method.loc19_17.2: = bound_method %addr.loc19_17, %specific_fn.loc19 +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc19: init %ptr.235 = call %bound_method.loc19_17.2(%addr.loc19_17) +// CHECK:STDOUT: assign %q.var, %ptr.as.Copy.impl.Op.call.loc19 // CHECK:STDOUT: %.loc19_13: type = splice_block %ptr.loc19 [concrete = constants.%ptr.235] { // CHECK:STDOUT: %int_32.loc19: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc19: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] @@ -188,7 +219,12 @@ fn F() { // CHECK:STDOUT: %s.ref.loc20: ref %struct_type.a.b.501 = name_ref s, %s // CHECK:STDOUT: %.loc20_19: ref %i32 = struct_access %s.ref.loc20, element1 // CHECK:STDOUT: %addr.loc20_17: %ptr.235 = addr_of %.loc20_19 -// CHECK:STDOUT: assign %r.var, %addr.loc20_17 +// CHECK:STDOUT: %impl.elem0.loc20: %.284 = impl_witness_access constants.%Copy.impl_witness.19c, element0 [concrete = constants.%ptr.as.Copy.impl.Op.2f4] +// CHECK:STDOUT: %bound_method.loc20_17.1: = bound_method %addr.loc20_17, %impl.elem0.loc20 +// CHECK:STDOUT: %specific_fn.loc20: = specific_function %impl.elem0.loc20, @ptr.as.Copy.impl.Op(constants.%i32) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn.582] +// CHECK:STDOUT: %bound_method.loc20_17.2: = bound_method %addr.loc20_17, %specific_fn.loc20 +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc20: init %ptr.235 = call %bound_method.loc20_17.2(%addr.loc20_17) +// CHECK:STDOUT: assign %r.var, %ptr.as.Copy.impl.Op.call.loc20 // CHECK:STDOUT: %.loc20_13: type = splice_block %ptr.loc20 [concrete = constants.%ptr.235] { // CHECK:STDOUT: %int_32.loc20: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc20: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] @@ -240,7 +276,12 @@ fn F() { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %tuple.elem0.loc23: ref %i32 = tuple_access %t.ref.loc23, element0 // CHECK:STDOUT: %addr.loc23_18: %ptr.235 = addr_of %tuple.elem0.loc23 -// CHECK:STDOUT: assign %t0.var, %addr.loc23_18 +// CHECK:STDOUT: %impl.elem0.loc23: %.284 = impl_witness_access constants.%Copy.impl_witness.19c, element0 [concrete = constants.%ptr.as.Copy.impl.Op.2f4] +// CHECK:STDOUT: %bound_method.loc23_18.1: = bound_method %addr.loc23_18, %impl.elem0.loc23 +// CHECK:STDOUT: %specific_fn.loc23: = specific_function %impl.elem0.loc23, @ptr.as.Copy.impl.Op(constants.%i32) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn.582] +// CHECK:STDOUT: %bound_method.loc23_18.2: = bound_method %addr.loc23_18, %specific_fn.loc23 +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc23: init %ptr.235 = call %bound_method.loc23_18.2(%addr.loc23_18) +// CHECK:STDOUT: assign %t0.var, %ptr.as.Copy.impl.Op.call.loc23 // CHECK:STDOUT: %.loc23: type = splice_block %ptr.loc23 [concrete = constants.%ptr.235] { // CHECK:STDOUT: %int_32.loc23: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc23: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] @@ -256,7 +297,12 @@ fn F() { // CHECK:STDOUT: %int_1.loc24: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %tuple.elem1.loc24: ref %i32 = tuple_access %t.ref.loc24, element1 // CHECK:STDOUT: %addr.loc24_18: %ptr.235 = addr_of %tuple.elem1.loc24 -// CHECK:STDOUT: assign %t1.var, %addr.loc24_18 +// CHECK:STDOUT: %impl.elem0.loc24: %.284 = impl_witness_access constants.%Copy.impl_witness.19c, element0 [concrete = constants.%ptr.as.Copy.impl.Op.2f4] +// CHECK:STDOUT: %bound_method.loc24_18.1: = bound_method %addr.loc24_18, %impl.elem0.loc24 +// CHECK:STDOUT: %specific_fn.loc24: = specific_function %impl.elem0.loc24, @ptr.as.Copy.impl.Op(constants.%i32) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn.582] +// CHECK:STDOUT: %bound_method.loc24_18.2: = bound_method %addr.loc24_18, %specific_fn.loc24 +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc24: init %ptr.235 = call %bound_method.loc24_18.2(%addr.loc24_18) +// CHECK:STDOUT: assign %t1.var, %ptr.as.Copy.impl.Op.call.loc24 // CHECK:STDOUT: %.loc24: type = splice_block %ptr.loc24 [concrete = constants.%ptr.235] { // CHECK:STDOUT: %int_32.loc24: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc24: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] @@ -265,14 +311,14 @@ fn F() { // CHECK:STDOUT: %t1: ref %ptr.235 = bind_name t1, %t1.var // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc24: = bound_method %t1.var, constants.%T.as.Destroy.impl.Op.fad // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn.1: = specific_function constants.%T.as.Destroy.impl.Op.fad, @T.as.Destroy.impl.Op(constants.%ptr.235) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn.d25] -// CHECK:STDOUT: %bound_method.loc24: = bound_method %t1.var, %T.as.Destroy.impl.Op.specific_fn.1 +// CHECK:STDOUT: %bound_method.loc24_3: = bound_method %t1.var, %T.as.Destroy.impl.Op.specific_fn.1 // CHECK:STDOUT: %addr.loc24_3: %ptr.5d5 = addr_of %t1.var -// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc24: init %empty_tuple.type = call %bound_method.loc24(%addr.loc24_3) +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc24: init %empty_tuple.type = call %bound_method.loc24_3(%addr.loc24_3) // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc23: = bound_method %t0.var, constants.%T.as.Destroy.impl.Op.fad // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn.2: = specific_function constants.%T.as.Destroy.impl.Op.fad, @T.as.Destroy.impl.Op(constants.%ptr.235) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn.d25] -// CHECK:STDOUT: %bound_method.loc23: = bound_method %t0.var, %T.as.Destroy.impl.Op.specific_fn.2 +// CHECK:STDOUT: %bound_method.loc23_3: = bound_method %t0.var, %T.as.Destroy.impl.Op.specific_fn.2 // CHECK:STDOUT: %addr.loc23_3: %ptr.5d5 = addr_of %t0.var -// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc23: init %empty_tuple.type = call %bound_method.loc23(%addr.loc23_3) +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc23: init %empty_tuple.type = call %bound_method.loc23_3(%addr.loc23_3) // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc22: = bound_method %t.var, constants.%T.as.Destroy.impl.Op.55d // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn.3: = specific_function constants.%T.as.Destroy.impl.Op.55d, @T.as.Destroy.impl.Op(constants.%tuple.type.d07) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn.698] // CHECK:STDOUT: %bound_method.loc22_3: = bound_method %t.var, %T.as.Destroy.impl.Op.specific_fn.3 @@ -280,19 +326,19 @@ fn F() { // CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc22: init %empty_tuple.type = call %bound_method.loc22_3(%addr.loc22) // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc20: = bound_method %r.var, constants.%T.as.Destroy.impl.Op.fad // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn.4: = specific_function constants.%T.as.Destroy.impl.Op.fad, @T.as.Destroy.impl.Op(constants.%ptr.235) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn.d25] -// CHECK:STDOUT: %bound_method.loc20: = bound_method %r.var, %T.as.Destroy.impl.Op.specific_fn.4 +// CHECK:STDOUT: %bound_method.loc20_3: = bound_method %r.var, %T.as.Destroy.impl.Op.specific_fn.4 // CHECK:STDOUT: %addr.loc20_3: %ptr.5d5 = addr_of %r.var -// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc20: init %empty_tuple.type = call %bound_method.loc20(%addr.loc20_3) +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc20: init %empty_tuple.type = call %bound_method.loc20_3(%addr.loc20_3) // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc19: = bound_method %q.var, constants.%T.as.Destroy.impl.Op.fad // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn.5: = specific_function constants.%T.as.Destroy.impl.Op.fad, @T.as.Destroy.impl.Op(constants.%ptr.235) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn.d25] -// CHECK:STDOUT: %bound_method.loc19: = bound_method %q.var, %T.as.Destroy.impl.Op.specific_fn.5 +// CHECK:STDOUT: %bound_method.loc19_3: = bound_method %q.var, %T.as.Destroy.impl.Op.specific_fn.5 // CHECK:STDOUT: %addr.loc19_3: %ptr.5d5 = addr_of %q.var -// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc19: init %empty_tuple.type = call %bound_method.loc19(%addr.loc19_3) +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc19: init %empty_tuple.type = call %bound_method.loc19_3(%addr.loc19_3) // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc18: = bound_method %p.var, constants.%T.as.Destroy.impl.Op.5b4 // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn.6: = specific_function constants.%T.as.Destroy.impl.Op.5b4, @T.as.Destroy.impl.Op(constants.%ptr.3ee) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn.8af] -// CHECK:STDOUT: %bound_method.loc18: = bound_method %p.var, %T.as.Destroy.impl.Op.specific_fn.6 +// CHECK:STDOUT: %bound_method.loc18_3: = bound_method %p.var, %T.as.Destroy.impl.Op.specific_fn.6 // CHECK:STDOUT: %addr.loc18_3: %ptr.40c = addr_of %p.var -// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc18: init %empty_tuple.type = call %bound_method.loc18(%addr.loc18_3) +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc18: init %empty_tuple.type = call %bound_method.loc18_3(%addr.loc18_3) // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc16: = bound_method %s.var, constants.%T.as.Destroy.impl.Op.722 // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn.7: = specific_function constants.%T.as.Destroy.impl.Op.722, @T.as.Destroy.impl.Op(constants.%struct_type.a.b.501) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn.e4c] // CHECK:STDOUT: %bound_method.loc16_3: = bound_method %s.var, %T.as.Destroy.impl.Op.specific_fn.7 diff --git a/toolchain/check/testdata/pointer/basic.carbon b/toolchain/check/testdata/pointer/basic.carbon index b03b2e3194c3..9940a52de8f8 100644 --- a/toolchain/check/testdata/pointer/basic.carbon +++ b/toolchain/check/testdata/pointer/basic.carbon @@ -49,6 +49,17 @@ fn F() -> i32 { // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [concrete] // CHECK:STDOUT: %pattern_type.fe8: type = pattern_type %ptr.235 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.f23: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.8b3) [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.abf: %ptr.as.Copy.impl.Op.type.f23 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.19c: = impl_witness imports.%Copy.impl_witness_table.a71, @ptr.as.Copy.impl(%i32) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.3ea: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%i32) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.2f4: %ptr.as.Copy.impl.Op.type.3ea = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.bab: %Copy.type = facet_value %ptr.235, (%Copy.impl_witness.19c) [concrete] +// CHECK:STDOUT: %.284: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.bab [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.2f4, @ptr.as.Copy.impl.Op(%i32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.type.f2e: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%ptr.235) [concrete] // CHECK:STDOUT: %T.as.Destroy.impl.Op.fad: %T.as.Destroy.impl.Op.type.f2e = struct_value () [concrete] @@ -63,14 +74,18 @@ fn F() -> i32 { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.de9: @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op.type (%ptr.as.Copy.impl.Op.type.f23) = import_ref Core//prelude/parts/copy, loc32_31, loaded [symbolic = @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op (constants.%ptr.as.Copy.impl.Op.abf)] +// CHECK:STDOUT: %Copy.impl_witness_table.a71 = impl_witness_table (%Core.import_ref.de9), @ptr.as.Copy.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -99,10 +114,10 @@ fn F() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %n.var: ref %i32 = var %n.var_patt // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] -// CHECK:STDOUT: %impl.elem0: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] -// CHECK:STDOUT: %bound_method.loc16_3.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc16_3.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %impl.elem0.loc16: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] +// CHECK:STDOUT: %bound_method.loc16_3.1: = bound_method %int_0, %impl.elem0.loc16 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc16: = specific_function %impl.elem0.loc16, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc16_3.2: = bound_method %int_0, %specific_fn.loc16 [concrete = constants.%bound_method] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc16_3.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc16_3: init %i32 = converted %int_0, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_0.6a9] // CHECK:STDOUT: assign %n.var, %.loc16_3 @@ -118,7 +133,12 @@ fn F() -> i32 { // CHECK:STDOUT: %p.var: ref %ptr.235 = var %p.var_patt // CHECK:STDOUT: %n.ref: ref %i32 = name_ref n, %n // CHECK:STDOUT: %addr.loc17_17: %ptr.235 = addr_of %n.ref -// CHECK:STDOUT: assign %p.var, %addr.loc17_17 +// CHECK:STDOUT: %impl.elem0.loc17: %.284 = impl_witness_access constants.%Copy.impl_witness.19c, element0 [concrete = constants.%ptr.as.Copy.impl.Op.2f4] +// CHECK:STDOUT: %bound_method.loc17_17.1: = bound_method %addr.loc17_17, %impl.elem0.loc17 +// CHECK:STDOUT: %specific_fn.loc17: = specific_function %impl.elem0.loc17, @ptr.as.Copy.impl.Op(constants.%i32) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc17_17.2: = bound_method %addr.loc17_17, %specific_fn.loc17 +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.235 = call %bound_method.loc17_17.2(%addr.loc17_17) +// CHECK:STDOUT: assign %p.var, %ptr.as.Copy.impl.Op.call // CHECK:STDOUT: %.loc17: type = splice_block %ptr [concrete = constants.%ptr.235] { // CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] @@ -131,9 +151,9 @@ fn F() -> i32 { // CHECK:STDOUT: %.loc19_10.2: %i32 = bind_value %.loc19_10.1 // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound: = bound_method %p.var, constants.%T.as.Destroy.impl.Op.fad // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: = specific_function constants.%T.as.Destroy.impl.Op.fad, @T.as.Destroy.impl.Op(constants.%ptr.235) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc17: = bound_method %p.var, %T.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %bound_method.loc17_3: = bound_method %p.var, %T.as.Destroy.impl.Op.specific_fn // CHECK:STDOUT: %addr.loc17_3: %ptr.5d5 = addr_of %p.var -// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc17(%addr.loc17_3) +// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc17_3(%addr.loc17_3) // CHECK:STDOUT: %Int.as.Destroy.impl.Op.bound: = bound_method %n.var, constants.%Int.as.Destroy.impl.Op.054 // CHECK:STDOUT: %Int.as.Destroy.impl.Op.specific_fn: = specific_function constants.%Int.as.Destroy.impl.Op.054, @Int.as.Destroy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Destroy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc16_3.3: = bound_method %n.var, %Int.as.Destroy.impl.Op.specific_fn diff --git a/toolchain/check/testdata/pointer/import.carbon b/toolchain/check/testdata/pointer/import.carbon index 3c51813417bc..92657af29683 100644 --- a/toolchain/check/testdata/pointer/import.carbon +++ b/toolchain/check/testdata/pointer/import.carbon @@ -48,24 +48,41 @@ var a: i32* = a_ref; // CHECK:STDOUT: %.7ea: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: = bound_method %int_0.5c6, %Core.IntLiteral.as.ImplicitAs.impl.Convert.592 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.592, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] -// CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] +// CHECK:STDOUT: %bound_method.698: = bound_method %int_0.5c6, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] -// CHECK:STDOUT: %ptr: type = ptr_type %i32 [concrete] -// CHECK:STDOUT: %pattern_type.fe8: type = pattern_type %ptr [concrete] -// CHECK:STDOUT: %addr: %ptr = addr_of file.%a_orig.var [concrete] +// CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [concrete] +// CHECK:STDOUT: %pattern_type.fe8: type = pattern_type %ptr.235 [concrete] +// CHECK:STDOUT: %addr: %ptr.235 = addr_of file.%a_orig.var [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.f23: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.8b3) [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.abf: %ptr.as.Copy.impl.Op.type.f23 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.19c: = impl_witness imports.%Copy.impl_witness_table.a71, @ptr.as.Copy.impl(%i32) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.3ea: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%i32) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.2f4: %ptr.as.Copy.impl.Op.type.3ea = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.bab: %Copy.type = facet_value %ptr.235, (%Copy.impl_witness.19c) [concrete] +// CHECK:STDOUT: %.284: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.bab [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.bound: = bound_method %addr, %ptr.as.Copy.impl.Op.2f4 [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.2f4, @ptr.as.Copy.impl.Op(%i32) [concrete] +// CHECK:STDOUT: %bound_method.0fb: = bound_method %addr, %ptr.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.de9: @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op.type (%ptr.as.Copy.impl.Op.type.f23) = import_ref Core//prelude/parts/copy, loc32_31, loaded [symbolic = @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op (constants.%ptr.as.Copy.impl.Op.abf)] +// CHECK:STDOUT: %Copy.impl_witness_table.a71 = impl_witness_table (%Core.import_ref.de9), @ptr.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -89,28 +106,33 @@ var a: i32* = a_ref; // CHECK:STDOUT: %a_ref.patt: %pattern_type.fe8 = binding_pattern a_ref [concrete] // CHECK:STDOUT: %a_ref.var_patt: %pattern_type.fe8 = var_pattern %a_ref.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %a_ref.var: ref %ptr = var %a_ref.var_patt [concrete] -// CHECK:STDOUT: %.loc5: type = splice_block %ptr [concrete = constants.%ptr] { +// CHECK:STDOUT: %a_ref.var: ref %ptr.235 = var %a_ref.var_patt [concrete] +// CHECK:STDOUT: %.loc5: type = splice_block %ptr [concrete = constants.%ptr.235] { // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %ptr: type = ptr_type %i32.loc5 [concrete = constants.%ptr] +// CHECK:STDOUT: %ptr: type = ptr_type %i32.loc5 [concrete = constants.%ptr.235] // CHECK:STDOUT: } -// CHECK:STDOUT: %a_ref: ref %ptr = bind_name a_ref, %a_ref.var [concrete = %a_ref.var] +// CHECK:STDOUT: %a_ref: ref %ptr.235 = bind_name a_ref, %a_ref.var [concrete = %a_ref.var] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] -// CHECK:STDOUT: %impl.elem0: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] -// CHECK:STDOUT: %bound_method.loc4_1.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc4_1.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %impl.elem0.loc4: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] +// CHECK:STDOUT: %bound_method.loc4_1.1: = bound_method %int_0, %impl.elem0.loc4 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc4: = specific_function %impl.elem0.loc4, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc4_1.2: = bound_method %int_0, %specific_fn.loc4 [concrete = constants.%bound_method.698] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc4_1.2(%int_0) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc4: init %i32 = converted %int_0, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_0.6a9] // CHECK:STDOUT: assign file.%a_orig.var, %.loc4 // CHECK:STDOUT: %a_orig.ref: ref %i32 = name_ref a_orig, file.%a_orig [concrete = file.%a_orig.var] -// CHECK:STDOUT: %addr: %ptr = addr_of %a_orig.ref [concrete = constants.%addr] -// CHECK:STDOUT: assign file.%a_ref.var, %addr +// CHECK:STDOUT: %addr: %ptr.235 = addr_of %a_orig.ref [concrete = constants.%addr] +// CHECK:STDOUT: %impl.elem0.loc5: %.284 = impl_witness_access constants.%Copy.impl_witness.19c, element0 [concrete = constants.%ptr.as.Copy.impl.Op.2f4] +// CHECK:STDOUT: %bound_method.loc5_19.1: = bound_method %addr, %impl.elem0.loc5 [concrete = constants.%ptr.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %specific_fn.loc5: = specific_function %impl.elem0.loc5, @ptr.as.Copy.impl.Op(constants.%i32) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc5_19.2: = bound_method %addr, %specific_fn.loc5 [concrete = constants.%bound_method.0fb] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.235 = call %bound_method.loc5_19.2(%addr) [concrete = constants.%addr] +// CHECK:STDOUT: assign file.%a_ref.var, %ptr.as.Copy.impl.Op.call // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -119,24 +141,39 @@ var a: i32* = a_ref; // CHECK:STDOUT: constants { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.782: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.8b3) [symbolic] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.58c: %ptr.as.Copy.impl.Op.type.782 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] -// CHECK:STDOUT: %ptr: type = ptr_type %i32 [concrete] -// CHECK:STDOUT: %pattern_type.f6a: type = pattern_type %ptr [concrete] +// CHECK:STDOUT: %ptr.9e1: type = ptr_type %i32 [concrete] +// CHECK:STDOUT: %pattern_type.f6a: type = pattern_type %ptr.9e1 [concrete] +// CHECK:STDOUT: %Copy.impl_witness.0eb: = impl_witness imports.%Copy.impl_witness_table.3e8, @ptr.as.Copy.impl(%i32) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.757: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%i32) [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.4cc: %ptr.as.Copy.impl.Op.type.757 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.ee3: %Copy.type = facet_value %ptr.9e1, (%Copy.impl_witness.0eb) [concrete] +// CHECK:STDOUT: %.961: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.ee3 [concrete] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.4cc, @ptr.as.Copy.impl.Op(%i32) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Implicit.a_orig = import_ref Implicit//default, a_orig, unloaded -// CHECK:STDOUT: %Implicit.a_ref: ref %ptr = import_ref Implicit//default, a_ref, loaded [concrete = %a_ref.var] +// CHECK:STDOUT: %Implicit.a_ref: ref %ptr.9e1 = import_ref Implicit//default, a_ref, loaded [concrete = %a_ref.var] // CHECK:STDOUT: %Core.ece: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } +// CHECK:STDOUT: %Implicit.import_ref.e04: @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op.type (%ptr.as.Copy.impl.Op.type.782) = import_ref Implicit//default, inst292 [indirect], loaded [symbolic = @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op (constants.%ptr.as.Copy.impl.Op.58c)] +// CHECK:STDOUT: %Copy.impl_witness_table.3e8 = impl_witness_table (%Implicit.import_ref.e04), @ptr.as.Copy.impl [concrete] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %a_ref.patt: %pattern_type.f6a = binding_pattern a_ref [concrete] // CHECK:STDOUT: %a_ref.var_patt: %pattern_type.f6a = var_pattern %a_ref.patt [concrete] -// CHECK:STDOUT: %a_ref.var: ref %ptr = var %a_ref.var_patt [concrete] +// CHECK:STDOUT: %a_ref.var: ref %ptr.9e1 = var %a_ref.var_patt [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -153,20 +190,25 @@ var a: i32* = a_ref; // CHECK:STDOUT: %a.patt: %pattern_type.f6a = binding_pattern a [concrete] // CHECK:STDOUT: %a.var_patt: %pattern_type.f6a = var_pattern %a.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %a.var: ref %ptr = var %a.var_patt [concrete] -// CHECK:STDOUT: %.loc4: type = splice_block %ptr [concrete = constants.%ptr] { +// CHECK:STDOUT: %a.var: ref %ptr.9e1 = var %a.var_patt [concrete] +// CHECK:STDOUT: %.loc4: type = splice_block %ptr [concrete = constants.%ptr.9e1] { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %ptr: type = ptr_type %i32 [concrete = constants.%ptr] +// CHECK:STDOUT: %ptr: type = ptr_type %i32 [concrete = constants.%ptr.9e1] // CHECK:STDOUT: } -// CHECK:STDOUT: %a: ref %ptr = bind_name a, %a.var [concrete = %a.var] +// CHECK:STDOUT: %a: ref %ptr.9e1 = bind_name a, %a.var [concrete = %a.var] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a_ref.ref: ref %ptr = name_ref a_ref, imports.%Implicit.a_ref [concrete = imports.%a_ref.var] -// CHECK:STDOUT: %.loc4: %ptr = bind_value %a_ref.ref -// CHECK:STDOUT: assign file.%a.var, %.loc4 +// CHECK:STDOUT: %a_ref.ref: ref %ptr.9e1 = name_ref a_ref, imports.%Implicit.a_ref [concrete = imports.%a_ref.var] +// CHECK:STDOUT: %.loc4: %ptr.9e1 = bind_value %a_ref.ref +// CHECK:STDOUT: %impl.elem0: %.961 = impl_witness_access constants.%Copy.impl_witness.0eb, element0 [concrete = constants.%ptr.as.Copy.impl.Op.4cc] +// CHECK:STDOUT: %bound_method.loc4_15.1: = bound_method %.loc4, %impl.elem0 +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @ptr.as.Copy.impl.Op(constants.%i32) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc4_15.2: = bound_method %.loc4, %specific_fn +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.9e1 = call %bound_method.loc4_15.2(%.loc4) +// CHECK:STDOUT: assign file.%a.var, %ptr.as.Copy.impl.Op.call // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/primitives/type_literals.carbon b/toolchain/check/testdata/primitives/type_literals.carbon index 38930029a2a5..25e6012a25bd 100644 --- a/toolchain/check/testdata/primitives/type_literals.carbon +++ b/toolchain/check/testdata/primitives/type_literals.carbon @@ -74,7 +74,7 @@ var test_i1: i1; // CHECK:STDERR: ^~~ // CHECK:STDERR: var test_i15: i15; -// CHECK:STDERR: min_prelude/parts/int.carbon:10:9: error: integer type width of 1000000000 is greater than the maximum supported width of 8388608 [IntWidthTooLarge] +// CHECK:STDERR: min_prelude/parts/int.carbon:11:9: error: integer type width of 1000000000 is greater than the maximum supported width of 8388608 [IntWidthTooLarge] // CHECK:STDERR: adapt MakeInt(N); // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: fail_iN_bad_width.carbon:[[@LINE+4]]:23: note: in `i1000000000` used here [ResolvingSpecificHere] @@ -111,7 +111,7 @@ var test_u1: u1; // CHECK:STDERR: ^~~ // CHECK:STDERR: var test_u15: u15; -// CHECK:STDERR: min_prelude/parts/uint.carbon:10:9: error: integer type width of 1000000000 is greater than the maximum supported width of 8388608 [IntWidthTooLarge] +// CHECK:STDERR: min_prelude/parts/uint.carbon:11:9: error: integer type width of 1000000000 is greater than the maximum supported width of 8388608 [IntWidthTooLarge] // CHECK:STDERR: adapt MakeUInt(N); // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: fail_uN_bad_width.carbon:[[@LINE+4]]:23: note: in `u1000000000` used here [ResolvingSpecificHere] @@ -138,7 +138,7 @@ library "[[@TEST_NAME]]"; // CHECK:STDERR: ^~ // CHECK:STDERR: var test_f0: f0; -// CHECK:STDERR: min_prelude/parts/float.carbon:11:9: error: unsupported floating-point bit width 1 [CompileTimeFloatBitWidth] +// CHECK:STDERR: min_prelude/parts/float.carbon:12:9: error: unsupported floating-point bit width 1 [CompileTimeFloatBitWidth] // CHECK:STDERR: adapt MakeFloat(N); // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: fail_fN_bad_width.carbon:[[@LINE+4]]:14: note: in `f1` used here [ResolvingSpecificHere] @@ -146,7 +146,7 @@ var test_f0: f0; // CHECK:STDERR: ^~ // CHECK:STDERR: var test_f1: f1; -// CHECK:STDERR: min_prelude/parts/float.carbon:11:9: error: unsupported floating-point bit width 15 [CompileTimeFloatBitWidth] +// CHECK:STDERR: min_prelude/parts/float.carbon:12:9: error: unsupported floating-point bit width 15 [CompileTimeFloatBitWidth] // CHECK:STDERR: adapt MakeFloat(N); // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: fail_fN_bad_width.carbon:[[@LINE+4]]:15: note: in `f15` used here [ResolvingSpecificHere] @@ -155,7 +155,7 @@ var test_f1: f1; // CHECK:STDERR: var test_f15: f15; // TODO: Decide if we want to expose the x87 80-bit floating point type this way. -// CHECK:STDERR: min_prelude/parts/float.carbon:11:9: error: unsupported floating-point bit width 80 [CompileTimeFloatBitWidth] +// CHECK:STDERR: min_prelude/parts/float.carbon:12:9: error: unsupported floating-point bit width 80 [CompileTimeFloatBitWidth] // CHECK:STDERR: adapt MakeFloat(N); // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: fail_fN_bad_width.carbon:[[@LINE+4]]:15: note: in `f80` used here [ResolvingSpecificHere] @@ -163,7 +163,7 @@ var test_f15: f15; // CHECK:STDERR: ^~~ // CHECK:STDERR: var test_f80: f80; -// CHECK:STDERR: min_prelude/parts/float.carbon:11:9: error: unsupported floating-point bit width 100 [CompileTimeFloatBitWidth] +// CHECK:STDERR: min_prelude/parts/float.carbon:12:9: error: unsupported floating-point bit width 100 [CompileTimeFloatBitWidth] // CHECK:STDERR: adapt MakeFloat(N); // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: fail_fN_bad_width.carbon:[[@LINE+4]]:16: note: in `f100` used here [ResolvingSpecificHere] @@ -171,7 +171,7 @@ var test_f80: f80; // CHECK:STDERR: ^~~~ // CHECK:STDERR: var test_f100: f100; -// CHECK:STDERR: min_prelude/parts/float.carbon:11:9: error: unsupported floating-point bit width 1000000000 [CompileTimeFloatBitWidth] +// CHECK:STDERR: min_prelude/parts/float.carbon:12:9: error: unsupported floating-point bit width 1000000000 [CompileTimeFloatBitWidth] // CHECK:STDERR: adapt MakeFloat(N); // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: fail_fN_bad_width.carbon:[[@LINE+4]]:23: note: in `f1000000000` used here [ResolvingSpecificHere] @@ -179,7 +179,7 @@ var test_f100: f100; // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: var test_f1000000000: f1000000000; -// CHECK:STDERR: min_prelude/parts/float.carbon:11:9: error: unsupported floating-point bit width 1000000000000 [CompileTimeFloatBitWidth] +// CHECK:STDERR: min_prelude/parts/float.carbon:12:9: error: unsupported floating-point bit width 1000000000000 [CompileTimeFloatBitWidth] // CHECK:STDERR: adapt MakeFloat(N); // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: fail_fN_bad_width.carbon:[[@LINE+4]]:26: note: in `f1000000000000` used here [ResolvingSpecificHere] @@ -429,9 +429,19 @@ var x: type = 42; // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Copy.impl_witness.fde: = impl_witness imports.%Copy.impl_witness_table.095 [concrete] +// CHECK:STDOUT: %Copy.facet.0af: %Copy.type = facet_value type, (%Copy.impl_witness.fde) [concrete] +// CHECK:STDOUT: %.130: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.0af [concrete] +// CHECK:STDOUT: %type.as.Copy.impl.Op.type: type = fn_type @type.as.Copy.impl.Op [concrete] +// CHECK:STDOUT: %type.as.Copy.impl.Op: %type.as.Copy.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %type.as.Copy.impl.Op.bound: = bound_method %i32, %type.as.Copy.impl.Op [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core.import_ref.7bd: %type.as.Copy.impl.Op.type = import_ref Core//prelude/parts/copy, loc36_31, loaded [concrete = constants.%type.as.Copy.impl.Op] +// CHECK:STDOUT: %Copy.impl_witness_table.095 = impl_witness_table (%Core.import_ref.7bd), @type.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -447,7 +457,10 @@ var x: type = 42; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: assign file.%test_type.var, %i32 +// CHECK:STDOUT: %impl.elem0: %.130 = impl_witness_access constants.%Copy.impl_witness.fde, element0 [concrete = constants.%type.as.Copy.impl.Op] +// CHECK:STDOUT: %bound_method: = bound_method %i32, %impl.elem0 [concrete = constants.%type.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %type.as.Copy.impl.Op.call: init type = call %bound_method(%i32) [concrete = constants.%i32] +// CHECK:STDOUT: assign file.%test_type.var, %type.as.Copy.impl.Op.call // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/code_after_return_value.carbon b/toolchain/check/testdata/return/code_after_return_value.carbon index 596560353edb..6843335e71f6 100644 --- a/toolchain/check/testdata/return/code_after_return_value.carbon +++ b/toolchain/check/testdata/return/code_after_return_value.carbon @@ -54,6 +54,7 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.592, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method.698: = bound_method %int_0.5c6, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -61,14 +62,16 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: .Bool = %Core.Bool // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = constants.%Bool] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon index fbade0a97bcb..ccd92cb209b1 100644 --- a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon +++ b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon @@ -105,7 +105,7 @@ fn G() -> C { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon index 8d86f8a19666..909ccdc937ac 100644 --- a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon @@ -96,7 +96,7 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/return/fail_returned_var_type.carbon b/toolchain/check/testdata/return/fail_returned_var_type.carbon index 932a2a4820d6..fe94a7ab43cd 100644 --- a/toolchain/check/testdata/return/fail_returned_var_type.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_type.carbon @@ -76,7 +76,7 @@ fn Mismatch() -> i32 { // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Float: %Float.type = import_ref Core//prelude/parts/float, Float, loaded [concrete = constants.%Float.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.175: @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type (%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type.261) = import_ref Core//prelude/parts/float, loc15_41, loaded [symbolic = @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert (constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.4dd)] +// CHECK:STDOUT: %Core.import_ref.175: @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type (%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type.261) = import_ref Core//prelude/parts/float, loc20_41, loaded [symbolic = @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert (constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.4dd)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table = impl_witness_table (%Core.import_ref.175), @Core.FloatLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/return/fail_var_in_type.carbon b/toolchain/check/testdata/return/fail_var_in_type.carbon index 5f85c4c3d1e0..2e9df2532ccb 100644 --- a/toolchain/check/testdata/return/fail_var_in_type.carbon +++ b/toolchain/check/testdata/return/fail_var_in_type.carbon @@ -27,6 +27,14 @@ fn Six() -> x { return 6; } // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Copy.impl_witness.fde: = impl_witness imports.%Copy.impl_witness_table.095 [concrete] +// CHECK:STDOUT: %Copy.facet.0af: %Copy.type = facet_value type, (%Copy.impl_witness.fde) [concrete] +// CHECK:STDOUT: %.130: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.0af [concrete] +// CHECK:STDOUT: %type.as.Copy.impl.Op.type: type = fn_type @type.as.Copy.impl.Op [concrete] +// CHECK:STDOUT: %type.as.Copy.impl.Op: %type.as.Copy.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %type.as.Copy.impl.Op.bound: = bound_method %i32, %type.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %Six.type: type = fn_type @Six [concrete] // CHECK:STDOUT: %Six: %Six.type = struct_value () [concrete] // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [concrete] @@ -35,10 +43,14 @@ fn Six() -> x { return 6; } // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.7bd: %type.as.Copy.impl.Op.type = import_ref Core//prelude/parts/copy, loc36_31, loaded [concrete = constants.%type.as.Copy.impl.Op] +// CHECK:STDOUT: %Copy.impl_witness_table.095 = impl_witness_table (%Core.import_ref.7bd), @type.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -75,7 +87,10 @@ fn Six() -> x { return 6; } // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: assign file.%x.var, %i32 +// CHECK:STDOUT: %impl.elem0: %.130 = impl_witness_access constants.%Copy.impl_witness.fde, element0 [concrete = constants.%type.as.Copy.impl.Op] +// CHECK:STDOUT: %bound_method: = bound_method %i32, %impl.elem0 [concrete = constants.%type.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %type.as.Copy.impl.Op.call: init type = call %bound_method(%i32) [concrete = constants.%i32] +// CHECK:STDOUT: assign file.%x.var, %type.as.Copy.impl.Op.call // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/import_convert_function.carbon b/toolchain/check/testdata/return/import_convert_function.carbon index d69e2d3475d3..61fd83b1176f 100644 --- a/toolchain/check/testdata/return/import_convert_function.carbon +++ b/toolchain/check/testdata/return/import_convert_function.carbon @@ -183,7 +183,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -995,7 +995,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %P.import_ref.8f2: = import_ref P//library, loc4_19, loaded [concrete = constants.%complete_type.357] // CHECK:STDOUT: %P.import_ref.f65 = import_ref P//library, inst54 [no loc], unloaded // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %P.import_ref.dda: = import_ref P//library, loc8_33, loaded [concrete = constants.%ImplicitAs.impl_witness.e35] // CHECK:STDOUT: %P.import_ref.d2c: type = import_ref P//library, loc8_9, loaded [concrete = constants.%C.b00] diff --git a/toolchain/check/testdata/return/returned_var.carbon b/toolchain/check/testdata/return/returned_var.carbon index 9ed4306015fb..5b975d4bd487 100644 --- a/toolchain/check/testdata/return/returned_var.carbon +++ b/toolchain/check/testdata/return/returned_var.carbon @@ -96,7 +96,7 @@ fn G() -> i32 { // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/returned_var_scope.carbon b/toolchain/check/testdata/return/returned_var_scope.carbon index 52cde17cf58c..16ae5220d6f3 100644 --- a/toolchain/check/testdata/return/returned_var_scope.carbon +++ b/toolchain/check/testdata/return/returned_var_scope.carbon @@ -87,7 +87,7 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = constants.%Bool] diff --git a/toolchain/check/testdata/return/struct.carbon b/toolchain/check/testdata/return/struct.carbon index 526c9c3d5646..5198a8eadd2a 100644 --- a/toolchain/check/testdata/return/struct.carbon +++ b/toolchain/check/testdata/return/struct.carbon @@ -57,7 +57,7 @@ fn Main() -> {.a: i32} { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/tuple.carbon b/toolchain/check/testdata/return/tuple.carbon index 681ae7361e2e..8a504b548f4e 100644 --- a/toolchain/check/testdata/return/tuple.carbon +++ b/toolchain/check/testdata/return/tuple.carbon @@ -63,7 +63,7 @@ fn Main() -> (i32, i32) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/value.carbon b/toolchain/check/testdata/return/value.carbon index 8d44d88d5702..275da756d11f 100644 --- a/toolchain/check/testdata/return/value.carbon +++ b/toolchain/check/testdata/return/value.carbon @@ -54,7 +54,7 @@ fn Main() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/struct/fail_member_access_type.carbon b/toolchain/check/testdata/struct/fail_member_access_type.carbon index 3828f61ec514..bdb47117ddc1 100644 --- a/toolchain/check/testdata/struct/fail_member_access_type.carbon +++ b/toolchain/check/testdata/struct/fail_member_access_type.carbon @@ -64,7 +64,7 @@ var y: i32 = x.b; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Float: %Float.type = import_ref Core//prelude/parts/float, Float, loaded [concrete = constants.%Float.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.175: @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type (%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type.261) = import_ref Core//prelude/parts/float, loc15_41, loaded [symbolic = @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert (constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.4dd)] +// CHECK:STDOUT: %Core.import_ref.175: @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type (%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type.261) = import_ref Core//prelude/parts/float, loc20_41, loaded [symbolic = @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert (constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.4dd)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table = impl_witness_table (%Core.import_ref.175), @Core.FloatLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_non_member_access.carbon b/toolchain/check/testdata/struct/fail_non_member_access.carbon index c09ae8cb5c0c..2a5c2705fff2 100644 --- a/toolchain/check/testdata/struct/fail_non_member_access.carbon +++ b/toolchain/check/testdata/struct/fail_non_member_access.carbon @@ -59,7 +59,7 @@ var y: i32 = x.b; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/struct/import.carbon b/toolchain/check/testdata/struct/import.carbon index a10501b39810..805f1ea9f143 100644 --- a/toolchain/check/testdata/struct/import.carbon +++ b/toolchain/check/testdata/struct/import.carbon @@ -83,6 +83,7 @@ fn F() -> {.x: i32} { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4c1: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.e13: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4c1 = struct_value () [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] @@ -93,6 +94,16 @@ fn F() -> {.x: i32} { // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [concrete] // CHECK:STDOUT: %pattern_type.b54: type = pattern_type %struct_type.a [concrete] // CHECK:STDOUT: %.c27: ref %i32 = struct_access imports.%a_ref.var, element0 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.f3d: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6d8: %Int.as.Copy.impl.Op.type.f3d = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.13a: = impl_witness imports.%Copy.impl_witness_table.fef, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.17b: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.83b: %Int.as.Copy.impl.Op.type.17b = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.acf: %Copy.type = facet_value %i32, (%Copy.impl_witness.13a) [concrete] +// CHECK:STDOUT: %.1a7: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.acf [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.83b, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %tuple.type.85c: type = tuple_type (type) [concrete] // CHECK:STDOUT: %tuple.type.dd4: type = tuple_type (%i32) [concrete] // CHECK:STDOUT: %struct_type.b.c: type = struct_type {.b: %i32, .c: %tuple.type.dd4} [concrete] @@ -141,6 +152,8 @@ fn F() -> {.x: i32} { // CHECK:STDOUT: %a_ref.patt: %pattern_type.b54 = binding_pattern a_ref [concrete] // CHECK:STDOUT: %a_ref.var_patt: %pattern_type.b54 = var_pattern %a_ref.patt [concrete] // CHECK:STDOUT: %a_ref.var: ref %struct_type.a = var %a_ref.var_patt [concrete] +// CHECK:STDOUT: %Core.import_ref.526: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.f3d) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6d8)] +// CHECK:STDOUT: %Copy.impl_witness_table.fef = impl_witness_table (%Core.import_ref.526), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: %b_ref.patt: %pattern_type.020 = binding_pattern b_ref [concrete] // CHECK:STDOUT: %b_ref.var_patt: %pattern_type.020 = var_pattern %b_ref.patt [concrete] // CHECK:STDOUT: %b_ref.var: ref %struct_type.a.d.9db = var %b_ref.var_patt [concrete] @@ -212,29 +225,49 @@ fn F() -> {.x: i32} { // CHECK:STDOUT: %a_ref.ref: ref %struct_type.a = name_ref a_ref, imports.%Implicit.a_ref [concrete = imports.%a_ref.var] // CHECK:STDOUT: %.loc5_20.1: ref %i32 = struct_access %a_ref.ref, element0 [concrete = constants.%.c27] // CHECK:STDOUT: %.loc5_20.2: %i32 = bind_value %.loc5_20.1 -// CHECK:STDOUT: %.loc5_20.3: init %struct_type.a = struct_init (%.loc5_20.2) to file.%a.var +// CHECK:STDOUT: %impl.elem0.loc5: %.1a7 = impl_witness_access constants.%Copy.impl_witness.13a, element0 [concrete = constants.%Int.as.Copy.impl.Op.83b] +// CHECK:STDOUT: %bound_method.loc5_20.1: = bound_method %.loc5_20.2, %impl.elem0.loc5 +// CHECK:STDOUT: %specific_fn.loc5: = specific_function %impl.elem0.loc5, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc5_20.2: = bound_method %.loc5_20.2, %specific_fn.loc5 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc5: init %i32 = call %bound_method.loc5_20.2(%.loc5_20.2) +// CHECK:STDOUT: %.loc5_20.3: init %struct_type.a = struct_init (%Int.as.Copy.impl.Op.call.loc5) to file.%a.var // CHECK:STDOUT: %.loc5_1: init %struct_type.a = converted %a_ref.ref, %.loc5_20.3 // CHECK:STDOUT: assign file.%a.var, %.loc5_1 // CHECK:STDOUT: %b_ref.ref: ref %struct_type.a.d.9db = name_ref b_ref, imports.%Implicit.b_ref [concrete = imports.%b_ref.var] // CHECK:STDOUT: %.loc6_47.1: ref %struct_type.b.c = struct_access %b_ref.ref, element0 [concrete = constants.%.769] // CHECK:STDOUT: %.loc6_47.2: ref %i32 = struct_access %.loc6_47.1, element0 [concrete = constants.%.d8a] // CHECK:STDOUT: %.loc6_47.3: %i32 = bind_value %.loc6_47.2 +// CHECK:STDOUT: %impl.elem0.loc6_47.1: %.1a7 = impl_witness_access constants.%Copy.impl_witness.13a, element0 [concrete = constants.%Int.as.Copy.impl.Op.83b] +// CHECK:STDOUT: %bound_method.loc6_47.1: = bound_method %.loc6_47.3, %impl.elem0.loc6_47.1 +// CHECK:STDOUT: %specific_fn.loc6_47.1: = specific_function %impl.elem0.loc6_47.1, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_47.2: = bound_method %.loc6_47.3, %specific_fn.loc6_47.1 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc6_47.1: init %i32 = call %bound_method.loc6_47.2(%.loc6_47.3) // CHECK:STDOUT: %.loc6_47.4: ref %struct_type.b.c = struct_access file.%b.var, element0 [concrete = constants.%.92c] // CHECK:STDOUT: %.loc6_47.5: ref %i32 = struct_access %.loc6_47.4, element0 [concrete = constants.%.9dd] -// CHECK:STDOUT: %.loc6_47.6: init %i32 = initialize_from %.loc6_47.3 to %.loc6_47.5 +// CHECK:STDOUT: %.loc6_47.6: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc6_47.1 to %.loc6_47.5 // CHECK:STDOUT: %.loc6_47.7: ref %tuple.type.dd4 = struct_access %.loc6_47.1, element1 [concrete = constants.%.e5f] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %.loc6_47.7, element0 [concrete = constants.%tuple.elem0.aa5] // CHECK:STDOUT: %.loc6_47.8: %i32 = bind_value %tuple.elem0 +// CHECK:STDOUT: %impl.elem0.loc6_47.2: %.1a7 = impl_witness_access constants.%Copy.impl_witness.13a, element0 [concrete = constants.%Int.as.Copy.impl.Op.83b] +// CHECK:STDOUT: %bound_method.loc6_47.3: = bound_method %.loc6_47.8, %impl.elem0.loc6_47.2 +// CHECK:STDOUT: %specific_fn.loc6_47.2: = specific_function %impl.elem0.loc6_47.2, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_47.4: = bound_method %.loc6_47.8, %specific_fn.loc6_47.2 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc6_47.2: init %i32 = call %bound_method.loc6_47.4(%.loc6_47.8) // CHECK:STDOUT: %.loc6_47.9: ref %tuple.type.dd4 = struct_access %.loc6_47.4, element1 [concrete = constants.%.bbf] -// CHECK:STDOUT: %.loc6_47.10: init %tuple.type.dd4 = tuple_init (%.loc6_47.8) to %.loc6_47.9 +// CHECK:STDOUT: %.loc6_47.10: init %tuple.type.dd4 = tuple_init (%Int.as.Copy.impl.Op.call.loc6_47.2) to %.loc6_47.9 // CHECK:STDOUT: %.loc6_47.11: init %tuple.type.dd4 = converted %.loc6_47.7, %.loc6_47.10 // CHECK:STDOUT: %.loc6_47.12: init %tuple.type.dd4 = initialize_from %.loc6_47.11 to %.loc6_47.9 // CHECK:STDOUT: %.loc6_47.13: init %struct_type.b.c = struct_init (%.loc6_47.6, %.loc6_47.12) to %.loc6_47.4 // CHECK:STDOUT: %.loc6_47.14: init %struct_type.b.c = converted %.loc6_47.1, %.loc6_47.13 // CHECK:STDOUT: %.loc6_47.15: ref %i32 = struct_access %b_ref.ref, element1 [concrete = constants.%.dfe] // CHECK:STDOUT: %.loc6_47.16: %i32 = bind_value %.loc6_47.15 +// CHECK:STDOUT: %impl.elem0.loc6_47.3: %.1a7 = impl_witness_access constants.%Copy.impl_witness.13a, element0 [concrete = constants.%Int.as.Copy.impl.Op.83b] +// CHECK:STDOUT: %bound_method.loc6_47.5: = bound_method %.loc6_47.16, %impl.elem0.loc6_47.3 +// CHECK:STDOUT: %specific_fn.loc6_47.3: = specific_function %impl.elem0.loc6_47.3, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_47.6: = bound_method %.loc6_47.16, %specific_fn.loc6_47.3 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc6_47.3: init %i32 = call %bound_method.loc6_47.6(%.loc6_47.16) // CHECK:STDOUT: %.loc6_47.17: ref %i32 = struct_access file.%b.var, element1 [concrete = constants.%.607] -// CHECK:STDOUT: %.loc6_47.18: init %i32 = initialize_from %.loc6_47.16 to %.loc6_47.17 +// CHECK:STDOUT: %.loc6_47.18: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc6_47.3 to %.loc6_47.17 // CHECK:STDOUT: %.loc6_47.19: init %struct_type.a.d.9db = struct_init (%.loc6_47.14, %.loc6_47.18) to file.%b.var // CHECK:STDOUT: %.loc6_1: init %struct_type.a.d.9db = converted %b_ref.ref, %.loc6_47.19 // CHECK:STDOUT: assign file.%b.var, %.loc6_1 diff --git a/toolchain/check/testdata/struct/member_access.carbon b/toolchain/check/testdata/struct/member_access.carbon index 2fac5d635e36..2c089484f751 100644 --- a/toolchain/check/testdata/struct/member_access.carbon +++ b/toolchain/check/testdata/struct/member_access.carbon @@ -22,6 +22,7 @@ var z: i32 = y; // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete] // CHECK:STDOUT: %Float.type: type = generic_class_type @Float [concrete] // CHECK:STDOUT: %Float.generic: %Float.type = struct_value () [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %f64.d77: type = class_type @Float, @Float(%int_64) [concrete] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] @@ -65,6 +66,16 @@ var z: i32 = y; // CHECK:STDOUT: %bound_method.b59: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %struct: %struct_type.a.b.d2f = struct_value (%float.0a8, %int_1.5d2) [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -72,16 +83,20 @@ var z: i32 = y; // CHECK:STDOUT: .Float = %Core.Float // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Float: %Float.type = import_ref Core//prelude/parts/float, Float, loaded [concrete = constants.%Float.generic] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.175: @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type (%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type.261) = import_ref Core//prelude/parts/float, loc15_41, loaded [symbolic = @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert (constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.4dd)] +// CHECK:STDOUT: %Core.import_ref.175: @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type (%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type.261) = import_ref Core//prelude/parts/float, loc20_41, loaded [symbolic = @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert (constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.4dd)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.cc3 = impl_witness_table (%Core.import_ref.175), @Core.FloatLiteral.as.ImplicitAs.impl [concrete] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -154,10 +169,20 @@ var z: i32 = y; // CHECK:STDOUT: %x.ref: ref %struct_type.a.b.d2f = name_ref x, file.%x [concrete = file.%x.var] // CHECK:STDOUT: %.loc16_15.1: ref %i32 = struct_access %x.ref, element1 [concrete = constants.%.a00] // CHECK:STDOUT: %.loc16_15.2: %i32 = bind_value %.loc16_15.1 -// CHECK:STDOUT: assign file.%y.var, %.loc16_15.2 +// CHECK:STDOUT: %impl.elem0.loc16: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc16_15.1: = bound_method %.loc16_15.2, %impl.elem0.loc16 +// CHECK:STDOUT: %specific_fn.loc16: = specific_function %impl.elem0.loc16, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc16_15.2: = bound_method %.loc16_15.2, %specific_fn.loc16 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc16: init %i32 = call %bound_method.loc16_15.2(%.loc16_15.2) +// CHECK:STDOUT: assign file.%y.var, %Int.as.Copy.impl.Op.call.loc16 // CHECK:STDOUT: %y.ref: ref %i32 = name_ref y, file.%y [concrete = file.%y.var] // CHECK:STDOUT: %.loc17: %i32 = bind_value %y.ref -// CHECK:STDOUT: assign file.%z.var, %.loc17 +// CHECK:STDOUT: %impl.elem0.loc17: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc17_14.1: = bound_method %.loc17, %impl.elem0.loc17 +// CHECK:STDOUT: %specific_fn.loc17: = specific_function %impl.elem0.loc17, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc17_14.2: = bound_method %.loc17, %specific_fn.loc17 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc17: init %i32 = call %bound_method.loc17_14.2(%.loc17) +// CHECK:STDOUT: assign file.%z.var, %Int.as.Copy.impl.Op.call.loc17 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/struct/one_entry.carbon b/toolchain/check/testdata/struct/one_entry.carbon index dbb7b1dae581..baf36bde6ca0 100644 --- a/toolchain/check/testdata/struct/one_entry.carbon +++ b/toolchain/check/testdata/struct/one_entry.carbon @@ -21,6 +21,7 @@ var y: {.a: i32} = x; // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %struct_type.a.ba9: type = struct_type {.a: %i32} [concrete] // CHECK:STDOUT: %pattern_type.268: type = pattern_type %struct_type.a.ba9 [concrete] @@ -44,19 +45,33 @@ var y: {.a: i32} = x; // CHECK:STDOUT: %bound_method: = bound_method %int_4.0c1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete] // CHECK:STDOUT: %struct: %struct_type.a.ba9 = struct_value (%int_4.940) [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -94,10 +109,10 @@ var y: {.a: i32} = x; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1] // CHECK:STDOUT: %.loc15_27.1: %struct_type.a.a6c = struct_literal (%int_4) -// CHECK:STDOUT: %impl.elem0: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] -// CHECK:STDOUT: %bound_method.loc15_27.1: = bound_method %int_4, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc15_27.2: = bound_method %int_4, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %impl.elem0.loc15: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] +// CHECK:STDOUT: %bound_method.loc15_27.1: = bound_method %int_4, %impl.elem0.loc15 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc15: = specific_function %impl.elem0.loc15, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc15_27.2: = bound_method %int_4, %specific_fn.loc15 [concrete = constants.%bound_method] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc15_27.2(%int_4) [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc15_27.2: init %i32 = converted %int_4, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc15_27.3: init %struct_type.a.ba9 = struct_init (%.loc15_27.2) to file.%x.var [concrete = constants.%struct] @@ -106,7 +121,12 @@ var y: {.a: i32} = x; // CHECK:STDOUT: %x.ref: ref %struct_type.a.ba9 = name_ref x, file.%x [concrete = file.%x.var] // CHECK:STDOUT: %.loc16_20.1: ref %i32 = struct_access %x.ref, element0 [concrete = constants.%.499] // CHECK:STDOUT: %.loc16_20.2: %i32 = bind_value %.loc16_20.1 -// CHECK:STDOUT: %.loc16_20.3: init %struct_type.a.ba9 = struct_init (%.loc16_20.2) to file.%y.var +// CHECK:STDOUT: %impl.elem0.loc16: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc16_20.1: = bound_method %.loc16_20.2, %impl.elem0.loc16 +// CHECK:STDOUT: %specific_fn.loc16: = specific_function %impl.elem0.loc16, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc16_20.2: = bound_method %.loc16_20.2, %specific_fn.loc16 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc16_20.2(%.loc16_20.2) +// CHECK:STDOUT: %.loc16_20.3: init %struct_type.a.ba9 = struct_init (%Int.as.Copy.impl.Op.call) to file.%y.var // CHECK:STDOUT: %.loc16_1: init %struct_type.a.ba9 = converted %x.ref, %.loc16_20.3 // CHECK:STDOUT: assign file.%y.var, %.loc16_1 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/struct/partially_const.carbon b/toolchain/check/testdata/struct/partially_const.carbon index c86e0adeedbd..501542c86ee9 100644 --- a/toolchain/check/testdata/struct/partially_const.carbon +++ b/toolchain/check/testdata/struct/partially_const.carbon @@ -22,6 +22,7 @@ fn Make(n: i32) -> {.a: i32, .b: i32, .c: i32} { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %struct_type.a.b.c.0b6: type = struct_type {.a: %i32, .b: %i32, .c: %i32} [concrete] @@ -46,19 +47,33 @@ fn Make(n: i32) -> {.a: i32, .b: i32, .c: i32} { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.592, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -105,8 +120,13 @@ fn Make(n: i32) -> {.a: i32, .b: i32, .c: i32} { // CHECK:STDOUT: %.loc16_33.2: init %i32 = converted %int_0.loc16_16, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc16_33.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc16_33.3: ref %i32 = struct_access %return, element0 // CHECK:STDOUT: %.loc16_33.4: init %i32 = initialize_from %.loc16_33.2 to %.loc16_33.3 [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc16_24: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc16_24.1: = bound_method %n.ref, %impl.elem0.loc16_24 +// CHECK:STDOUT: %specific_fn.loc16_24: = specific_function %impl.elem0.loc16_24, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc16_24.2: = bound_method %n.ref, %specific_fn.loc16_24 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc16_24.2(%n.ref) // CHECK:STDOUT: %.loc16_33.5: ref %i32 = struct_access %return, element1 -// CHECK:STDOUT: %.loc16_33.6: init %i32 = initialize_from %n.ref to %.loc16_33.5 +// CHECK:STDOUT: %.loc16_33.6: init %i32 = initialize_from %Int.as.Copy.impl.Op.call to %.loc16_33.5 // CHECK:STDOUT: %impl.elem0.loc16_33.2: %.7ea = impl_witness_access constants.%ImplicitAs.impl_witness.acc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.592] // CHECK:STDOUT: %bound_method.loc16_33.3: = bound_method %int_0.loc16_32, %impl.elem0.loc16_33.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] // CHECK:STDOUT: %specific_fn.loc16_33.2: = specific_function %impl.elem0.loc16_33.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] diff --git a/toolchain/check/testdata/struct/reorder_fields.carbon b/toolchain/check/testdata/struct/reorder_fields.carbon index 0bbf9c501ac3..450e7ee1c52b 100644 --- a/toolchain/check/testdata/struct/reorder_fields.carbon +++ b/toolchain/check/testdata/struct/reorder_fields.carbon @@ -27,6 +27,7 @@ fn F() -> {.a: i32, .b: f64} { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %MakeI32.type: type = fn_type @MakeI32 [concrete] @@ -44,17 +45,41 @@ fn F() -> {.a: i32, .b: f64} { // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %struct_type.b.a: type = struct_type {.b: %f64.d77, .a: %i32} [concrete] // CHECK:STDOUT: %pattern_type.b43: type = pattern_type %struct_type.b.a [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.type.a25: type = fn_type @Float.as.Copy.impl.Op, @Float.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.623: %Float.as.Copy.impl.Op.type.a25 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.160: = impl_witness imports.%Copy.impl_witness_table.e1b, @Float.as.Copy.impl(%int_64) [concrete] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.type.256: type = fn_type @Float.as.Copy.impl.Op, @Float.as.Copy.impl(%int_64) [concrete] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.47e: %Float.as.Copy.impl.Op.type.256 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.2da: %Copy.type = facet_value %f64.d77, (%Copy.impl_witness.160) [concrete] +// CHECK:STDOUT: %.2ef: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.2da [concrete] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.specific_fn: = specific_function %Float.as.Copy.impl.Op.47e, @Float.as.Copy.impl.Op(%int_64) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .Float = %Core.Float +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Float: %Float.type = import_ref Core//prelude/parts/float, Float, loaded [concrete = constants.%Float.generic] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.419: @Float.as.Copy.impl.%Float.as.Copy.impl.Op.type (%Float.as.Copy.impl.Op.type.a25) = import_ref Core//prelude/parts/float, loc16_31, loaded [symbolic = @Float.as.Copy.impl.%Float.as.Copy.impl.Op (constants.%Float.as.Copy.impl.Op.623)] +// CHECK:STDOUT: %Copy.impl_witness_table.e1b = impl_witness_table (%Core.import_ref.419), @Float.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -143,11 +168,21 @@ fn F() -> {.a: i32, .b: f64} { // CHECK:STDOUT: %y: %struct_type.b.a = bind_name y, %.loc20_31.3 // CHECK:STDOUT: %y.ref: %struct_type.b.a = name_ref y, %y // CHECK:STDOUT: %.loc21_10.1: %i32 = struct_access %y.ref, element1 +// CHECK:STDOUT: %impl.elem0.loc21_10.1: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc21_10.1: = bound_method %.loc21_10.1, %impl.elem0.loc21_10.1 +// CHECK:STDOUT: %specific_fn.loc21_10.1: = specific_function %impl.elem0.loc21_10.1, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc21_10.2: = bound_method %.loc21_10.1, %specific_fn.loc21_10.1 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc21_10.2(%.loc21_10.1) // CHECK:STDOUT: %.loc21_10.2: ref %i32 = struct_access %return, element1 -// CHECK:STDOUT: %.loc21_10.3: init %i32 = initialize_from %.loc21_10.1 to %.loc21_10.2 +// CHECK:STDOUT: %.loc21_10.3: init %i32 = initialize_from %Int.as.Copy.impl.Op.call to %.loc21_10.2 // CHECK:STDOUT: %.loc21_10.4: %f64.d77 = struct_access %y.ref, element0 +// CHECK:STDOUT: %impl.elem0.loc21_10.2: %.2ef = impl_witness_access constants.%Copy.impl_witness.160, element0 [concrete = constants.%Float.as.Copy.impl.Op.47e] +// CHECK:STDOUT: %bound_method.loc21_10.3: = bound_method %.loc21_10.4, %impl.elem0.loc21_10.2 +// CHECK:STDOUT: %specific_fn.loc21_10.2: = specific_function %impl.elem0.loc21_10.2, @Float.as.Copy.impl.Op(constants.%int_64) [concrete = constants.%Float.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc21_10.4: = bound_method %.loc21_10.4, %specific_fn.loc21_10.2 +// CHECK:STDOUT: %Float.as.Copy.impl.Op.call: init %f64.d77 = call %bound_method.loc21_10.4(%.loc21_10.4) // CHECK:STDOUT: %.loc21_10.5: ref %f64.d77 = struct_access %return, element0 -// CHECK:STDOUT: %.loc21_10.6: init %f64.d77 = initialize_from %.loc21_10.4 to %.loc21_10.5 +// CHECK:STDOUT: %.loc21_10.6: init %f64.d77 = initialize_from %Float.as.Copy.impl.Op.call to %.loc21_10.5 // CHECK:STDOUT: %.loc21_10.7: init %struct_type.a.b = struct_init (%.loc21_10.3, %.loc21_10.6) to %return // CHECK:STDOUT: %.loc21_11: init %struct_type.a.b = converted %y.ref, %.loc21_10.7 // CHECK:STDOUT: return %.loc21_11 to %return diff --git a/toolchain/check/testdata/struct/tuple_as_element.carbon b/toolchain/check/testdata/struct/tuple_as_element.carbon index fd569863756a..b11181095e7e 100644 --- a/toolchain/check/testdata/struct/tuple_as_element.carbon +++ b/toolchain/check/testdata/struct/tuple_as_element.carbon @@ -21,6 +21,7 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %tuple.type.85c: type = tuple_type (type) [concrete] // CHECK:STDOUT: %tuple.type.a1c: type = tuple_type (%i32) [concrete] @@ -55,6 +56,16 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%int_2.ef8) [concrete] // CHECK:STDOUT: %struct: %struct_type.a.b.3d5 = struct_value (%int_1.5d2, %tuple) [concrete] // CHECK:STDOUT: %.f15: ref %i32 = struct_access file.%y.var, element0 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %.413: ref %tuple.type.a1c = struct_access file.%y.var, element1 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -62,13 +73,17 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -140,13 +155,23 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: %x.ref: ref %struct_type.a.b.3d5 = name_ref x, file.%x [concrete = file.%x.var] // CHECK:STDOUT: %.loc16_32.1: ref %i32 = struct_access %x.ref, element0 [concrete = constants.%.b14] // CHECK:STDOUT: %.loc16_32.2: %i32 = bind_value %.loc16_32.1 +// CHECK:STDOUT: %impl.elem0.loc16_32.1: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc16_32.1: = bound_method %.loc16_32.2, %impl.elem0.loc16_32.1 +// CHECK:STDOUT: %specific_fn.loc16_32.1: = specific_function %impl.elem0.loc16_32.1, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc16_32.2: = bound_method %.loc16_32.2, %specific_fn.loc16_32.1 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc16_32.1: init %i32 = call %bound_method.loc16_32.2(%.loc16_32.2) // CHECK:STDOUT: %.loc16_32.3: ref %i32 = struct_access file.%y.var, element0 [concrete = constants.%.f15] -// CHECK:STDOUT: %.loc16_32.4: init %i32 = initialize_from %.loc16_32.2 to %.loc16_32.3 +// CHECK:STDOUT: %.loc16_32.4: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc16_32.1 to %.loc16_32.3 // CHECK:STDOUT: %.loc16_32.5: ref %tuple.type.a1c = struct_access %x.ref, element1 [concrete = constants.%.dd9] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %.loc16_32.5, element0 [concrete = constants.%tuple.elem0.2a6] // CHECK:STDOUT: %.loc16_32.6: %i32 = bind_value %tuple.elem0 +// CHECK:STDOUT: %impl.elem0.loc16_32.2: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc16_32.3: = bound_method %.loc16_32.6, %impl.elem0.loc16_32.2 +// CHECK:STDOUT: %specific_fn.loc16_32.2: = specific_function %impl.elem0.loc16_32.2, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc16_32.4: = bound_method %.loc16_32.6, %specific_fn.loc16_32.2 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc16_32.2: init %i32 = call %bound_method.loc16_32.4(%.loc16_32.6) // CHECK:STDOUT: %.loc16_32.7: ref %tuple.type.a1c = struct_access file.%y.var, element1 [concrete = constants.%.413] -// CHECK:STDOUT: %.loc16_32.8: init %tuple.type.a1c = tuple_init (%.loc16_32.6) to %.loc16_32.7 +// CHECK:STDOUT: %.loc16_32.8: init %tuple.type.a1c = tuple_init (%Int.as.Copy.impl.Op.call.loc16_32.2) to %.loc16_32.7 // CHECK:STDOUT: %.loc16_32.9: init %tuple.type.a1c = converted %.loc16_32.5, %.loc16_32.8 // CHECK:STDOUT: %.loc16_32.10: init %tuple.type.a1c = initialize_from %.loc16_32.9 to %.loc16_32.7 // CHECK:STDOUT: %.loc16_32.11: init %struct_type.a.b.3d5 = struct_init (%.loc16_32.4, %.loc16_32.10) to file.%y.var diff --git a/toolchain/check/testdata/struct/two_entries.carbon b/toolchain/check/testdata/struct/two_entries.carbon index 04753ba62822..44d2bdb994e1 100644 --- a/toolchain/check/testdata/struct/two_entries.carbon +++ b/toolchain/check/testdata/struct/two_entries.carbon @@ -24,6 +24,7 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %struct_type.a.b.501: type = struct_type {.a: %i32, .b: %i32} [concrete] // CHECK:STDOUT: %pattern_type.851: type = pattern_type %struct_type.a.b.501 [concrete] @@ -53,6 +54,16 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: %.22f: ref %i32 = struct_access file.%x.var, element0 [concrete] // CHECK:STDOUT: %.5fc: ref %i32 = struct_access file.%x.var, element1 [concrete] // CHECK:STDOUT: %.4ca: ref %i32 = struct_access file.%y.var, element0 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %.86e: ref %i32 = struct_access file.%y.var, element1 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -60,13 +71,17 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -175,12 +190,22 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: %x.ref: ref %struct_type.a.b.501 = name_ref x, file.%x [concrete = file.%x.var] // CHECK:STDOUT: %.loc19_29.1: ref %i32 = struct_access %x.ref, element0 [concrete = constants.%.22f] // CHECK:STDOUT: %.loc19_29.2: %i32 = bind_value %.loc19_29.1 +// CHECK:STDOUT: %impl.elem0.loc19_29.1: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc19_29.1: = bound_method %.loc19_29.2, %impl.elem0.loc19_29.1 +// CHECK:STDOUT: %specific_fn.loc19_29.1: = specific_function %impl.elem0.loc19_29.1, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc19_29.2: = bound_method %.loc19_29.2, %specific_fn.loc19_29.1 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc19_29.1: init %i32 = call %bound_method.loc19_29.2(%.loc19_29.2) // CHECK:STDOUT: %.loc19_29.3: ref %i32 = struct_access file.%y.var, element0 [concrete = constants.%.4ca] -// CHECK:STDOUT: %.loc19_29.4: init %i32 = initialize_from %.loc19_29.2 to %.loc19_29.3 +// CHECK:STDOUT: %.loc19_29.4: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc19_29.1 to %.loc19_29.3 // CHECK:STDOUT: %.loc19_29.5: ref %i32 = struct_access %x.ref, element1 [concrete = constants.%.5fc] // CHECK:STDOUT: %.loc19_29.6: %i32 = bind_value %.loc19_29.5 +// CHECK:STDOUT: %impl.elem0.loc19_29.2: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc19_29.3: = bound_method %.loc19_29.6, %impl.elem0.loc19_29.2 +// CHECK:STDOUT: %specific_fn.loc19_29.2: = specific_function %impl.elem0.loc19_29.2, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc19_29.4: = bound_method %.loc19_29.6, %specific_fn.loc19_29.2 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc19_29.2: init %i32 = call %bound_method.loc19_29.4(%.loc19_29.6) // CHECK:STDOUT: %.loc19_29.7: ref %i32 = struct_access file.%y.var, element1 [concrete = constants.%.86e] -// CHECK:STDOUT: %.loc19_29.8: init %i32 = initialize_from %.loc19_29.6 to %.loc19_29.7 +// CHECK:STDOUT: %.loc19_29.8: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc19_29.2 to %.loc19_29.7 // CHECK:STDOUT: %.loc19_29.9: init %struct_type.a.b.501 = struct_init (%.loc19_29.4, %.loc19_29.8) to file.%y.var // CHECK:STDOUT: %.loc19_1: init %struct_type.a.b.501 = converted %x.ref, %.loc19_29.9 // CHECK:STDOUT: assign file.%y.var, %.loc19_1 diff --git a/toolchain/check/testdata/tuple/element_access.carbon b/toolchain/check/testdata/tuple/element_access.carbon index ad7bd1e4b157..3ea5b46cf881 100644 --- a/toolchain/check/testdata/tuple/element_access.carbon +++ b/toolchain/check/testdata/tuple/element_access.carbon @@ -97,7 +97,7 @@ var b: i32 = 0; // CHECK:STDERR: fail_non_deterministic_type.carbon:[[@LINE+11]]:17: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] // CHECK:STDERR: var c: i32 = a.(b); // CHECK:STDERR: ^ -// CHECK:STDERR: min_prelude/parts/int.carbon:20:3: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] +// CHECK:STDERR: min_prelude/parts/int.carbon:27:3: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] // CHECK:STDERR: fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -156,14 +156,27 @@ var b: i32 = a.({.index = 2}.index); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %tuple.type.a1c: type = tuple_type (%i32) [concrete] // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %tuple.elem0.4d5: ref %i32 = tuple_access file.%b.var, element0 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -186,7 +199,12 @@ var b: i32 = a.({.index = 2}.index); // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %tuple.elem0.loc6: ref %i32 = tuple_access %b.ref, element0 [concrete = constants.%tuple.elem0.4d5] // CHECK:STDOUT: %.loc6: %i32 = bind_value %tuple.elem0.loc6 -// CHECK:STDOUT: assign file.%c.var, %.loc6 +// CHECK:STDOUT: %impl.elem0.loc6: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc6_15.1: = bound_method %.loc6, %impl.elem0.loc6 +// CHECK:STDOUT: %specific_fn.loc6: = specific_function %impl.elem0.loc6, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_15.2: = bound_method %.loc6, %specific_fn.loc6 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc6: init %i32 = call %bound_method.loc6_15.2(%.loc6) +// CHECK:STDOUT: assign file.%c.var, %Int.as.Copy.impl.Op.call.loc6 // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -195,6 +213,7 @@ var b: i32 = a.({.index = 2}.index); // CHECK:STDOUT: constants { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %tuple.type.0ce: type = tuple_type (%empty_tuple.type, %i32) [concrete] // CHECK:STDOUT: %tuple.elem0: ref %empty_tuple.type = tuple_access file.%a.var, element0 [concrete] @@ -210,6 +229,16 @@ var b: i32 = a.({.index = 2}.index); // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %struct_type.index.b1b: type = struct_type {.index: Core.IntLiteral} [concrete] // CHECK:STDOUT: %struct.972: %struct_type.index.b1b = struct_value (%int_1.5b8) [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.857: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6aa: %Int.as.Copy.impl.Op.type.857 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.f0b: = impl_witness imports.%Copy.impl_witness_table.f59, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.af5: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.87e: %Int.as.Copy.impl.Op.type.af5 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.26d: %Copy.type = facet_value %i32, (%Copy.impl_witness.f0b) [concrete] +// CHECK:STDOUT: %.3c4: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.26d [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.87e, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %As.type.047: type = facet_type <@As, @As(%i32)> [concrete] @@ -243,9 +272,11 @@ var b: i32 = a.({.index = 2}.index); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core.import_ref.02e: @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert.type (%Int.as.ImplicitAs.impl.Convert.type.eb9) = import_ref Core//prelude/parts/int, loc20_44, loaded [symbolic = @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert (constants.%Int.as.ImplicitAs.impl.Convert.958)] +// CHECK:STDOUT: %Core.import_ref.02e: @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert.type (%Int.as.ImplicitAs.impl.Convert.type.eb9) = import_ref Core//prelude/parts/int, loc27_44, loaded [symbolic = @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert (constants.%Int.as.ImplicitAs.impl.Convert.958)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.13c = impl_witness_table (%Core.import_ref.02e), @Int.as.ImplicitAs.impl [concrete] -// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/parts/int, loc25_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] +// CHECK:STDOUT: %Core.import_ref.b3c: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.857) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6aa)] +// CHECK:STDOUT: %Copy.impl_witness_table.f59 = impl_witness_table (%Core.import_ref.b3c), @Int.as.Copy.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.52c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.676) = import_ref Core//prelude/parts/int, loc32_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.086)] // CHECK:STDOUT: %As.impl_witness_table.3fe = impl_witness_table (%Core.import_ref.52c), @Core.IntLiteral.as.As.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -293,7 +324,12 @@ var b: i32 = a.({.index = 2}.index); // CHECK:STDOUT: %.loc5_29: Core.IntLiteral = struct_access %.loc5_28.2, element0 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %tuple.elem1.loc5: ref %i32 = tuple_access %a.ref.loc5, element1 [concrete = constants.%tuple.elem1] // CHECK:STDOUT: %.loc5_15: %i32 = bind_value %tuple.elem1.loc5 -// CHECK:STDOUT: assign file.%b.var, %.loc5_15 +// CHECK:STDOUT: %impl.elem0.loc5: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc5_15.1: = bound_method %.loc5_15, %impl.elem0.loc5 +// CHECK:STDOUT: %specific_fn.loc5: = specific_function %impl.elem0.loc5, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc5_15.2: = bound_method %.loc5_15, %specific_fn.loc5 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc5: init %i32 = call %bound_method.loc5_15.2(%.loc5_15) +// CHECK:STDOUT: assign file.%b.var, %Int.as.Copy.impl.Op.call.loc5 // CHECK:STDOUT: %a.ref.loc6: ref %tuple.type.0ce = name_ref a, file.%a [concrete = file.%a.var] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] @@ -340,7 +376,12 @@ var b: i32 = a.({.index = 2}.index); // CHECK:STDOUT: %.loc7_36.3: Core.IntLiteral = converted %.loc7_36.1, %.loc7_36.2 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %tuple.elem1.loc7: ref %i32 = tuple_access %a.ref.loc7, element1 [concrete = constants.%tuple.elem1] // CHECK:STDOUT: %.loc7_15: %i32 = bind_value %tuple.elem1.loc7 -// CHECK:STDOUT: assign file.%d.var, %.loc7_15 +// CHECK:STDOUT: %impl.elem0.loc7_15: %.3c4 = impl_witness_access constants.%Copy.impl_witness.f0b, element0 [concrete = constants.%Int.as.Copy.impl.Op.87e] +// CHECK:STDOUT: %bound_method.loc7_15.1: = bound_method %.loc7_15, %impl.elem0.loc7_15 +// CHECK:STDOUT: %specific_fn.loc7_15: = specific_function %impl.elem0.loc7_15, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc7_15.2: = bound_method %.loc7_15, %specific_fn.loc7_15 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc7: init %i32 = call %bound_method.loc7_15.2(%.loc7_15) +// CHECK:STDOUT: assign file.%d.var, %Int.as.Copy.impl.Op.call.loc7 // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/tuple/import.carbon b/toolchain/check/testdata/tuple/import.carbon index a2c63977e1ec..1655af493a9c 100644 --- a/toolchain/check/testdata/tuple/import.carbon +++ b/toolchain/check/testdata/tuple/import.carbon @@ -85,6 +85,7 @@ fn F() -> (i32,) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4c1: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.e13: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4c1 = struct_value () [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] @@ -96,6 +97,16 @@ fn F() -> (i32,) { // CHECK:STDOUT: %tuple.type.dd4: type = tuple_type (%i32) [concrete] // CHECK:STDOUT: %pattern_type.2e8: type = pattern_type %tuple.type.dd4 [concrete] // CHECK:STDOUT: %tuple.elem0.994: ref %i32 = tuple_access imports.%a_ref.var, element0 [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.f3d: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.6d8: %Int.as.Copy.impl.Op.type.f3d = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.13a: = impl_witness imports.%Copy.impl_witness_table.fef, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.17b: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.83b: %Int.as.Copy.impl.Op.type.17b = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet.acf: %Copy.type = facet_value %i32, (%Copy.impl_witness.13a) [concrete] +// CHECK:STDOUT: %.1a7: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.acf [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.83b, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %tuple.type.8c7: type = tuple_type (%tuple.type.85c, type) [concrete] // CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete] // CHECK:STDOUT: %tuple.type.58c: type = tuple_type (%tuple.type.8c7, %tuple.type.24b) [concrete] @@ -149,6 +160,8 @@ fn F() -> (i32,) { // CHECK:STDOUT: %a_ref.patt: %pattern_type.2e8 = binding_pattern a_ref [concrete] // CHECK:STDOUT: %a_ref.var_patt: %pattern_type.2e8 = var_pattern %a_ref.patt [concrete] // CHECK:STDOUT: %a_ref.var: ref %tuple.type.dd4 = var %a_ref.var_patt [concrete] +// CHECK:STDOUT: %Core.import_ref.526: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.f3d) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6d8)] +// CHECK:STDOUT: %Copy.impl_witness_table.fef = impl_witness_table (%Core.import_ref.526), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: %b_ref.patt: %pattern_type.ab9 = binding_pattern b_ref [concrete] // CHECK:STDOUT: %b_ref.var_patt: %pattern_type.ab9 = var_pattern %b_ref.patt [concrete] // CHECK:STDOUT: %b_ref.var: ref %tuple.type.cfa = var %b_ref.var_patt [concrete] @@ -227,7 +240,12 @@ fn F() -> (i32,) { // CHECK:STDOUT: %a_ref.ref: ref %tuple.type.dd4 = name_ref a_ref, imports.%Implicit.a_ref [concrete = imports.%a_ref.var] // CHECK:STDOUT: %tuple.elem0.loc5: ref %i32 = tuple_access %a_ref.ref, element0 [concrete = constants.%tuple.elem0.994] // CHECK:STDOUT: %.loc5_17.1: %i32 = bind_value %tuple.elem0.loc5 -// CHECK:STDOUT: %.loc5_17.2: init %tuple.type.dd4 = tuple_init (%.loc5_17.1) to file.%a.var +// CHECK:STDOUT: %impl.elem0.loc5: %.1a7 = impl_witness_access constants.%Copy.impl_witness.13a, element0 [concrete = constants.%Int.as.Copy.impl.Op.83b] +// CHECK:STDOUT: %bound_method.loc5_17.1: = bound_method %.loc5_17.1, %impl.elem0.loc5 +// CHECK:STDOUT: %specific_fn.loc5: = specific_function %impl.elem0.loc5, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc5_17.2: = bound_method %.loc5_17.1, %specific_fn.loc5 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc5: init %i32 = call %bound_method.loc5_17.2(%.loc5_17.1) +// CHECK:STDOUT: %.loc5_17.2: init %tuple.type.dd4 = tuple_init (%Int.as.Copy.impl.Op.call.loc5) to file.%a.var // CHECK:STDOUT: %.loc5_1: init %tuple.type.dd4 = converted %a_ref.ref, %.loc5_17.2 // CHECK:STDOUT: assign file.%a.var, %.loc5_1 // CHECK:STDOUT: %b_ref.ref: ref %tuple.type.cfa = name_ref b_ref, imports.%Implicit.b_ref [concrete = imports.%b_ref.var] @@ -235,27 +253,47 @@ fn F() -> (i32,) { // CHECK:STDOUT: %tuple.elem0.loc6_38.2: ref %tuple.type.dd4 = tuple_access %tuple.elem0.loc6_38.1, element0 [concrete = constants.%tuple.elem0.4c9] // CHECK:STDOUT: %tuple.elem0.loc6_38.3: ref %i32 = tuple_access %tuple.elem0.loc6_38.2, element0 [concrete = constants.%tuple.elem0.390] // CHECK:STDOUT: %.loc6_38.1: %i32 = bind_value %tuple.elem0.loc6_38.3 +// CHECK:STDOUT: %impl.elem0.loc6_38.1: %.1a7 = impl_witness_access constants.%Copy.impl_witness.13a, element0 [concrete = constants.%Int.as.Copy.impl.Op.83b] +// CHECK:STDOUT: %bound_method.loc6_38.1: = bound_method %.loc6_38.1, %impl.elem0.loc6_38.1 +// CHECK:STDOUT: %specific_fn.loc6_38.1: = specific_function %impl.elem0.loc6_38.1, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_38.2: = bound_method %.loc6_38.1, %specific_fn.loc6_38.1 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc6_38.1: init %i32 = call %bound_method.loc6_38.2(%.loc6_38.1) // CHECK:STDOUT: %tuple.elem0.loc6_38.4: ref %tuple.type.154 = tuple_access file.%b.var, element0 [concrete = constants.%tuple.elem0.76a] // CHECK:STDOUT: %tuple.elem0.loc6_38.5: ref %tuple.type.dd4 = tuple_access %tuple.elem0.loc6_38.4, element0 [concrete = constants.%tuple.elem0.6fd] -// CHECK:STDOUT: %.loc6_38.2: init %tuple.type.dd4 = tuple_init (%.loc6_38.1) to %tuple.elem0.loc6_38.5 +// CHECK:STDOUT: %.loc6_38.2: init %tuple.type.dd4 = tuple_init (%Int.as.Copy.impl.Op.call.loc6_38.1) to %tuple.elem0.loc6_38.5 // CHECK:STDOUT: %.loc6_38.3: init %tuple.type.dd4 = converted %tuple.elem0.loc6_38.2, %.loc6_38.2 // CHECK:STDOUT: %.loc6_38.4: init %tuple.type.dd4 = initialize_from %.loc6_38.3 to %tuple.elem0.loc6_38.5 // CHECK:STDOUT: %tuple.elem1.loc6_38.1: ref %i32 = tuple_access %tuple.elem0.loc6_38.1, element1 [concrete = constants.%tuple.elem1.723] // CHECK:STDOUT: %.loc6_38.5: %i32 = bind_value %tuple.elem1.loc6_38.1 +// CHECK:STDOUT: %impl.elem0.loc6_38.2: %.1a7 = impl_witness_access constants.%Copy.impl_witness.13a, element0 [concrete = constants.%Int.as.Copy.impl.Op.83b] +// CHECK:STDOUT: %bound_method.loc6_38.3: = bound_method %.loc6_38.5, %impl.elem0.loc6_38.2 +// CHECK:STDOUT: %specific_fn.loc6_38.2: = specific_function %impl.elem0.loc6_38.2, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_38.4: = bound_method %.loc6_38.5, %specific_fn.loc6_38.2 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc6_38.2: init %i32 = call %bound_method.loc6_38.4(%.loc6_38.5) // CHECK:STDOUT: %tuple.elem1.loc6_38.2: ref %i32 = tuple_access %tuple.elem0.loc6_38.4, element1 [concrete = constants.%tuple.elem1.ae3] -// CHECK:STDOUT: %.loc6_38.6: init %i32 = initialize_from %.loc6_38.5 to %tuple.elem1.loc6_38.2 +// CHECK:STDOUT: %.loc6_38.6: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc6_38.2 to %tuple.elem1.loc6_38.2 // CHECK:STDOUT: %.loc6_38.7: init %tuple.type.154 = tuple_init (%.loc6_38.4, %.loc6_38.6) to %tuple.elem0.loc6_38.4 // CHECK:STDOUT: %.loc6_38.8: init %tuple.type.154 = converted %tuple.elem0.loc6_38.1, %.loc6_38.7 // CHECK:STDOUT: %tuple.elem1.loc6_38.3: ref %tuple.type.c2c = tuple_access %b_ref.ref, element1 [concrete = constants.%tuple.elem1.92b] // CHECK:STDOUT: %tuple.elem0.loc6_38.6: ref %i32 = tuple_access %tuple.elem1.loc6_38.3, element0 [concrete = constants.%tuple.elem0.2ff] // CHECK:STDOUT: %.loc6_38.9: %i32 = bind_value %tuple.elem0.loc6_38.6 +// CHECK:STDOUT: %impl.elem0.loc6_38.3: %.1a7 = impl_witness_access constants.%Copy.impl_witness.13a, element0 [concrete = constants.%Int.as.Copy.impl.Op.83b] +// CHECK:STDOUT: %bound_method.loc6_38.5: = bound_method %.loc6_38.9, %impl.elem0.loc6_38.3 +// CHECK:STDOUT: %specific_fn.loc6_38.3: = specific_function %impl.elem0.loc6_38.3, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_38.6: = bound_method %.loc6_38.9, %specific_fn.loc6_38.3 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc6_38.3: init %i32 = call %bound_method.loc6_38.6(%.loc6_38.9) // CHECK:STDOUT: %tuple.elem1.loc6_38.4: ref %tuple.type.c2c = tuple_access file.%b.var, element1 [concrete = constants.%tuple.elem1.4f3] // CHECK:STDOUT: %tuple.elem0.loc6_38.7: ref %i32 = tuple_access %tuple.elem1.loc6_38.4, element0 [concrete = constants.%tuple.elem0.790] -// CHECK:STDOUT: %.loc6_38.10: init %i32 = initialize_from %.loc6_38.9 to %tuple.elem0.loc6_38.7 +// CHECK:STDOUT: %.loc6_38.10: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc6_38.3 to %tuple.elem0.loc6_38.7 // CHECK:STDOUT: %tuple.elem1.loc6_38.5: ref %i32 = tuple_access %tuple.elem1.loc6_38.3, element1 [concrete = constants.%tuple.elem1.282] // CHECK:STDOUT: %.loc6_38.11: %i32 = bind_value %tuple.elem1.loc6_38.5 +// CHECK:STDOUT: %impl.elem0.loc6_38.4: %.1a7 = impl_witness_access constants.%Copy.impl_witness.13a, element0 [concrete = constants.%Int.as.Copy.impl.Op.83b] +// CHECK:STDOUT: %bound_method.loc6_38.7: = bound_method %.loc6_38.11, %impl.elem0.loc6_38.4 +// CHECK:STDOUT: %specific_fn.loc6_38.4: = specific_function %impl.elem0.loc6_38.4, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_38.8: = bound_method %.loc6_38.11, %specific_fn.loc6_38.4 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc6_38.4: init %i32 = call %bound_method.loc6_38.8(%.loc6_38.11) // CHECK:STDOUT: %tuple.elem1.loc6_38.6: ref %i32 = tuple_access %tuple.elem1.loc6_38.4, element1 [concrete = constants.%tuple.elem1.822] -// CHECK:STDOUT: %.loc6_38.12: init %i32 = initialize_from %.loc6_38.11 to %tuple.elem1.loc6_38.6 +// CHECK:STDOUT: %.loc6_38.12: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc6_38.4 to %tuple.elem1.loc6_38.6 // CHECK:STDOUT: %.loc6_38.13: init %tuple.type.c2c = tuple_init (%.loc6_38.10, %.loc6_38.12) to %tuple.elem1.loc6_38.4 // CHECK:STDOUT: %.loc6_38.14: init %tuple.type.c2c = converted %tuple.elem1.loc6_38.3, %.loc6_38.13 // CHECK:STDOUT: %.loc6_38.15: init %tuple.type.cfa = tuple_init (%.loc6_38.8, %.loc6_38.14) to file.%b.var diff --git a/toolchain/check/testdata/tuple/in_place_tuple_init.carbon b/toolchain/check/testdata/tuple/in_place_tuple_init.carbon index 3751ba01eb10..5d7cd4b99968 100644 --- a/toolchain/check/testdata/tuple/in_place_tuple_init.carbon +++ b/toolchain/check/testdata/tuple/in_place_tuple_init.carbon @@ -166,7 +166,7 @@ fn H() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] +// CHECK:STDOUT: %Core.import_ref.428: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.49e) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f01)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b6b = impl_witness_table (%Core.import_ref.428), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/var/fail_not_copyable.carbon b/toolchain/check/testdata/var/fail_not_copyable.carbon index 07afcefdd113..ba7916b33d79 100644 --- a/toolchain/check/testdata/var/fail_not_copyable.carbon +++ b/toolchain/check/testdata/var/fail_not_copyable.carbon @@ -15,7 +15,10 @@ class X { fn F(x: X) { // TODO: Decide on rules for when classes are copyable. - // CHECK:STDERR: fail_not_copyable.carbon:[[@LINE+4]]:14: error: cannot copy value of type `X` [CopyOfUncopyableType] + // CHECK:STDERR: fail_not_copyable.carbon:[[@LINE+7]]:14: error: cannot copy value of type `X` [CopyOfUncopyableType] + // CHECK:STDERR: var y: X = x; + // CHECK:STDERR: ^ + // CHECK:STDERR: fail_not_copyable.carbon:[[@LINE+4]]:14: note: type `X` does not implement interface `Core.Copy` [MissingImplInMemberAccessNote] // CHECK:STDERR: var y: X = x; // CHECK:STDERR: ^ // CHECK:STDERR: diff --git a/toolchain/lower/handle_call.cpp b/toolchain/lower/handle_call.cpp index 4edd85d30f0b..32436a3a2616 100644 --- a/toolchain/lower/handle_call.cpp +++ b/toolchain/lower/handle_call.cpp @@ -5,6 +5,7 @@ #include #include +#include "common/raw_string_ostream.h" #include "llvm/IR/Type.h" #include "llvm/IR/Value.h" #include "toolchain/lower/function_context.h" @@ -274,6 +275,10 @@ static auto HandleBuiltinCall(FunctionContext& context, SemIR::InstId inst_id, case SemIR::BuiltinFunctionKind::NoOp: return; + case SemIR::BuiltinFunctionKind::PrimitiveCopy: + context.SetLocal(inst_id, context.GetValue(arg_ids[0])); + return; + case SemIR::BuiltinFunctionKind::PrintChar: { auto* i32_type = llvm::IntegerType::getInt32Ty(context.llvm_context()); llvm::Value* arg_value = context.builder().CreateSExtOrTrunc( @@ -551,11 +556,27 @@ auto HandleInst(FunctionContext& context, SemIR::InstId inst_id, i32_type, static_cast(function.virtual_index) * 4)}), args); } else { - call = context.builder().CreateCall( + auto* callee = context.GetFileContext(callee_file) .GetOrCreateFunction(callee_function.function_id, - callee_function.resolved_specific_id), - args); + callee_function.resolved_specific_id); + auto describe_call = [&] { + RawStringOstream out; + out << "call "; + callee->printAsOperand(out); + out << "("; + llvm::ListSeparator sep; + for (auto* arg : args) { + out << sep; + arg->printAsOperand(out); + } + out << ")\n"; + callee->print(out); + return out.TakeStr(); + }; + CARBON_CHECK(callee->arg_size() == args.size(), + "Argument count mismatch: {0}", describe_call()); + call = context.builder().CreateCall(callee, args); } context.SetLocal(inst_id, call); diff --git a/toolchain/lower/testdata/array/iterate.carbon b/toolchain/lower/testdata/array/iterate.carbon index f3a6ffa74019..902e556688b1 100644 --- a/toolchain/lower/testdata/array/iterate.carbon +++ b/toolchain/lower/testdata/array/iterate.carbon @@ -30,7 +30,7 @@ fn F() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc16_43.3.temp = alloca [6 x i32], align 4, !dbg !7 // CHECK:STDOUT: %var = alloca i32, align 4, !dbg !8 -// CHECK:STDOUT: %.loc17_19.1.temp = alloca { i1, i32 }, align 8, !dbg !8 +// CHECK:STDOUT: %.loc17_19.3.temp = alloca { i1, i32 }, align 8, !dbg !8 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc16_43.3.temp), !dbg !7 // CHECK:STDOUT: %.loc16_43.4.array.index = getelementptr inbounds [6 x i32], ptr %.loc16_43.3.temp, i32 0, i64 0, !dbg !7 // CHECK:STDOUT: %.loc16_43.7.array.index = getelementptr inbounds [6 x i32], ptr %.loc16_43.3.temp, i32 0, i64 1, !dbg !7 @@ -39,19 +39,19 @@ fn F() { // CHECK:STDOUT: %.loc16_43.16.array.index = getelementptr inbounds [6 x i32], ptr %.loc16_43.3.temp, i32 0, i64 4, !dbg !7 // CHECK:STDOUT: %.loc16_43.19.array.index = getelementptr inbounds [6 x i32], ptr %.loc16_43.3.temp, i32 0, i64 5, !dbg !7 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %.loc16_43.3.temp, ptr align 4 @array.loc16_43.22, i64 24, i1 false), !dbg !7 -// CHECK:STDOUT: %array_type.as.Iterate.impl.NewCursor.call = call i32 @"_CNewCursor.bb5cc7788b91e55e:Iterate.Core.b2c3e6e8ff6963ef"(ptr %.loc16_43.3.temp), !dbg !8 +// CHECK:STDOUT: %array_type.as.Iterate.impl.NewCursor.call = call i32 @"_CNewCursor.9af210df0a072efb:Iterate.Core.5ffcaa626964d948"(ptr %.loc16_43.3.temp), !dbg !8 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %var), !dbg !8 // CHECK:STDOUT: store i32 %array_type.as.Iterate.impl.NewCursor.call, ptr %var, align 4, !dbg !8 // CHECK:STDOUT: br label %for.next, !dbg !8 // CHECK:STDOUT: // CHECK:STDOUT: for.next: ; preds = %for.body, %entry -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_19.1.temp), !dbg !8 -// CHECK:STDOUT: call void @"_CNext.bb5cc7788b91e55e:Iterate.Core.b2c3e6e8ff6963ef"(ptr %.loc17_19.1.temp, ptr %.loc16_43.3.temp, ptr %var), !dbg !8 -// CHECK:STDOUT: %Optional.HasValue.call = call i1 @_CHasValue.Optional.Core.b88d1103f417c6d4(ptr %.loc17_19.1.temp), !dbg !8 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_19.3.temp), !dbg !8 +// CHECK:STDOUT: call void @"_CNext.9af210df0a072efb:Iterate.Core.5ffcaa626964d948"(ptr %.loc17_19.3.temp, ptr %.loc16_43.3.temp, ptr %var), !dbg !8 +// CHECK:STDOUT: %Optional.HasValue.call = call i1 @_CHasValue.Optional.Core.b7c8e4dff2adcdaa(ptr %.loc17_19.3.temp), !dbg !8 // CHECK:STDOUT: br i1 %Optional.HasValue.call, label %for.body, label %for.done, !dbg !8 // CHECK:STDOUT: // CHECK:STDOUT: for.body: ; preds = %for.next -// CHECK:STDOUT: %Optional.Get.call = call i32 @_CGet.Optional.Core.b88d1103f417c6d4(ptr %.loc17_19.1.temp), !dbg !8 +// CHECK:STDOUT: %Optional.Get.call = call i32 @_CGet.Optional.Core.b7c8e4dff2adcdaa(ptr %.loc17_19.3.temp), !dbg !8 // CHECK:STDOUT: call void @_CG.Main(i32 %Optional.Get.call), !dbg !9 // CHECK:STDOUT: br label %for.next, !dbg !10 // CHECK:STDOUT: @@ -65,11 +65,11 @@ fn F() { // CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) // CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 // CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr i32 @"_CNewCursor.bb5cc7788b91e55e:Iterate.Core.b2c3e6e8ff6963ef"(ptr %self) !dbg !12 { +// CHECK:STDOUT: define linkonce_odr i32 @"_CNewCursor.9af210df0a072efb:Iterate.Core.5ffcaa626964d948"(ptr %self) !dbg !12 { // CHECK:STDOUT: ret i32 0, !dbg !14 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr void @"_CNext.bb5cc7788b91e55e:Iterate.Core.b2c3e6e8ff6963ef"(ptr sret({ i1, i32 }) %return, ptr %self, ptr %cursor) !dbg !15 { +// CHECK:STDOUT: define linkonce_odr void @"_CNext.9af210df0a072efb:Iterate.Core.5ffcaa626964d948"(ptr sret({ i1, i32 }) %return, ptr %self, ptr %cursor) !dbg !15 { // CHECK:STDOUT: %1 = load i32, ptr %cursor, align 4, !dbg !16 // CHECK:STDOUT: %2 = icmp slt i32 %1, 6, !dbg !16 // CHECK:STDOUT: br i1 %2, label %3, label %7, !dbg !17 @@ -80,22 +80,22 @@ fn F() { // CHECK:STDOUT: %5 = sub i32 %4, 1, !dbg !19 // CHECK:STDOUT: %array.index = getelementptr inbounds [6 x i32], ptr %self, i32 0, i32 %5, !dbg !20 // CHECK:STDOUT: %6 = load i32, ptr %array.index, align 4, !dbg !20 -// CHECK:STDOUT: call void @_CSome.Optional.Core.b88d1103f417c6d4(ptr %return, i32 %6), !dbg !21 +// CHECK:STDOUT: call void @_CSome.Optional.Core.b7c8e4dff2adcdaa(ptr %return, i32 %6), !dbg !21 // CHECK:STDOUT: ret void, !dbg !22 // CHECK:STDOUT: // CHECK:STDOUT: 7: ; preds = %0 -// CHECK:STDOUT: call void @_CNone.Optional.Core.b88d1103f417c6d4(ptr %return), !dbg !23 +// CHECK:STDOUT: call void @_CNone.Optional.Core.b7c8e4dff2adcdaa(ptr %return), !dbg !23 // CHECK:STDOUT: ret void, !dbg !24 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.b88d1103f417c6d4(ptr %self) !dbg !25 { +// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.b7c8e4dff2adcdaa(ptr %self) !dbg !25 { // CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i1, i32 }, ptr %self, i32 0, i32 0, !dbg !27 // CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !27 // CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !27 // CHECK:STDOUT: ret i1 %2, !dbg !28 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr i32 @_CGet.Optional.Core.b88d1103f417c6d4(ptr %self) !dbg !29 { +// CHECK:STDOUT: define linkonce_odr i32 @_CGet.Optional.Core.b7c8e4dff2adcdaa(ptr %self) !dbg !29 { // CHECK:STDOUT: %value = getelementptr inbounds nuw { i1, i32 }, ptr %self, i32 0, i32 1, !dbg !30 // CHECK:STDOUT: %1 = load i32, ptr %value, align 4, !dbg !30 // CHECK:STDOUT: ret i32 %1, !dbg !31 @@ -106,7 +106,7 @@ fn F() { // CHECK:STDOUT: ret void, !dbg !35 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.b88d1103f417c6d4(ptr sret({ i1, i32 }) %return, i32 %value) !dbg !36 { +// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.b7c8e4dff2adcdaa(ptr sret({ i1, i32 }) %return, i32 %value) !dbg !36 { // CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i1, i32 }, ptr %return, i32 0, i32 0, !dbg !37 // CHECK:STDOUT: %value1 = getelementptr inbounds nuw { i1, i32 }, ptr %return, i32 0, i32 1, !dbg !37 // CHECK:STDOUT: store i32 %value, ptr %value1, align 4, !dbg !37 @@ -114,7 +114,7 @@ fn F() { // CHECK:STDOUT: ret void, !dbg !38 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.b88d1103f417c6d4(ptr sret({ i1, i32 }) %return) !dbg !39 { +// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.b7c8e4dff2adcdaa(ptr sret({ i1, i32 }) %return) !dbg !39 { // CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i1, i32 }, ptr %return, i32 0, i32 0, !dbg !40 // CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !40 // CHECK:STDOUT: ret void, !dbg !41 @@ -153,39 +153,39 @@ fn F() { // CHECK:STDOUT: !9 = !DILocation(line: 18, column: 5, scope: !4) // CHECK:STDOUT: !10 = !DILocation(line: 17, column: 3, scope: !4) // CHECK:STDOUT: !11 = !DILocation(line: 15, column: 1, scope: !4) -// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "NewCursor", linkageName: "_CNewCursor.bb5cc7788b91e55e:Iterate.Core.b2c3e6e8ff6963ef", scope: null, file: !13, line: 21, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "NewCursor", linkageName: "_CNewCursor.9af210df0a072efb:Iterate.Core.5ffcaa626964d948", scope: null, file: !13, line: 23, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !13 = !DIFile(filename: "{{.*}}/prelude/iterate.carbon", directory: "") -// CHECK:STDOUT: !14 = !DILocation(line: 21, column: 39, scope: !12) -// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.bb5cc7788b91e55e:Iterate.Core.b2c3e6e8ff6963ef", scope: null, file: !13, line: 22, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !16 = !DILocation(line: 23, column: 9, scope: !15) -// CHECK:STDOUT: !17 = !DILocation(line: 23, column: 8, scope: !15) -// CHECK:STDOUT: !18 = !DILocation(line: 24, column: 7, scope: !15) -// CHECK:STDOUT: !19 = !DILocation(line: 25, column: 36, scope: !15) -// CHECK:STDOUT: !20 = !DILocation(line: 25, column: 31, scope: !15) -// CHECK:STDOUT: !21 = !DILocation(line: 25, column: 14, scope: !15) -// CHECK:STDOUT: !22 = !DILocation(line: 25, column: 7, scope: !15) -// CHECK:STDOUT: !23 = !DILocation(line: 27, column: 14, scope: !15) -// CHECK:STDOUT: !24 = !DILocation(line: 27, column: 7, scope: !15) -// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.b88d1103f417c6d4", scope: null, file: !26, line: 29, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !14 = !DILocation(line: 23, column: 39, scope: !12) +// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.9af210df0a072efb:Iterate.Core.5ffcaa626964d948", scope: null, file: !13, line: 24, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !16 = !DILocation(line: 25, column: 9, scope: !15) +// CHECK:STDOUT: !17 = !DILocation(line: 25, column: 8, scope: !15) +// CHECK:STDOUT: !18 = !DILocation(line: 26, column: 7, scope: !15) +// CHECK:STDOUT: !19 = !DILocation(line: 27, column: 36, scope: !15) +// CHECK:STDOUT: !20 = !DILocation(line: 27, column: 31, scope: !15) +// CHECK:STDOUT: !21 = !DILocation(line: 27, column: 14, scope: !15) +// CHECK:STDOUT: !22 = !DILocation(line: 27, column: 7, scope: !15) +// CHECK:STDOUT: !23 = !DILocation(line: 29, column: 14, scope: !15) +// CHECK:STDOUT: !24 = !DILocation(line: 29, column: 7, scope: !15) +// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.b7c8e4dff2adcdaa", scope: null, file: !26, line: 30, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !26 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !27 = !DILocation(line: 29, column: 46, scope: !25) -// CHECK:STDOUT: !28 = !DILocation(line: 29, column: 39, scope: !25) -// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.b88d1103f417c6d4", scope: null, file: !26, line: 30, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !30 = !DILocation(line: 30, column: 38, scope: !29) -// CHECK:STDOUT: !31 = !DILocation(line: 30, column: 31, scope: !29) -// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !33, line: 332, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !27 = !DILocation(line: 30, column: 46, scope: !25) +// CHECK:STDOUT: !28 = !DILocation(line: 30, column: 39, scope: !25) +// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.b7c8e4dff2adcdaa", scope: null, file: !26, line: 31, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !30 = !DILocation(line: 31, column: 38, scope: !29) +// CHECK:STDOUT: !31 = !DILocation(line: 31, column: 31, scope: !29) +// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !33, line: 339, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !33 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") -// CHECK:STDOUT: !34 = !DILocation(line: 334, column: 5, scope: !32) -// CHECK:STDOUT: !35 = !DILocation(line: 332, column: 3, scope: !32) -// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.b88d1103f417c6d4", scope: null, file: !26, line: 25, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !37 = !DILocation(line: 26, column: 12, scope: !36) -// CHECK:STDOUT: !38 = !DILocation(line: 26, column: 5, scope: !36) -// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.b88d1103f417c6d4", scope: null, file: !26, line: 19, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !40 = !DILocation(line: 21, column: 5, scope: !39) -// CHECK:STDOUT: !41 = !DILocation(line: 22, column: 5, scope: !39) -// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk.Int.Core:AddAssignWith.Core.f86036ee2cd10fd3", scope: null, file: !33, line: 268, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !34 = !DILocation(line: 341, column: 5, scope: !32) +// CHECK:STDOUT: !35 = !DILocation(line: 339, column: 3, scope: !32) +// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.b7c8e4dff2adcdaa", scope: null, file: !26, line: 26, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !37 = !DILocation(line: 27, column: 12, scope: !36) +// CHECK:STDOUT: !38 = !DILocation(line: 27, column: 5, scope: !36) +// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.b7c8e4dff2adcdaa", scope: null, file: !26, line: 20, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !40 = !DILocation(line: 22, column: 5, scope: !39) +// CHECK:STDOUT: !41 = !DILocation(line: 23, column: 5, scope: !39) +// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk.Int.Core:AddAssignWith.Core.f86036ee2cd10fd3", scope: null, file: !33, line: 275, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !43 = !DILocation(line: 4294967295, scope: !42) -// CHECK:STDOUT: !44 = !DILocation(line: 268, column: 3, scope: !42) +// CHECK:STDOUT: !44 = !DILocation(line: 275, column: 3, scope: !42) // CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.8b3d5d6a6c17be04:ImplicitAs.Core.1abd39b699024258", scope: null, file: !46, line: 23, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !46 = !DIFile(filename: "{{.*}}/prelude/operators/as.carbon", directory: "") // CHECK:STDOUT: !47 = !DILocation(line: 23, column: 38, scope: !45) diff --git a/toolchain/lower/testdata/builtins/types.carbon b/toolchain/lower/testdata/builtins/types.carbon index 4432ccfb60ad..7a16f32caf71 100644 --- a/toolchain/lower/testdata/builtins/types.carbon +++ b/toolchain/lower/testdata/builtins/types.carbon @@ -2,7 +2,7 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/destroy.carbon +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/convert.carbon // // AUTOUPDATE // TIP: To test this file alone, run: diff --git a/toolchain/lower/testdata/class/generic.carbon b/toolchain/lower/testdata/class/generic.carbon index 371ab3d55f14..6d0b1d3cccb3 100644 --- a/toolchain/lower/testdata/class/generic.carbon +++ b/toolchain/lower/testdata/class/generic.carbon @@ -50,10 +50,7 @@ class A(T:! type) { var y: T; } -fn Make[T:! type](x: T, y: T) -> A(T) { - // TODO: This should probably require a `Copy` constraint on `T`. - // For now we avoid calling it in cases that would attempt to - // copy a non-copyable type, as that would probably crash. +fn Make[T:! Core.Copy](x: T, y: T) -> A(T) { return {.x = x, .y = y}; } @@ -65,14 +62,15 @@ fn Empty() -> A(()) { return Make((), ()); } -fn Tuples() -> A((i32, i32)) { - let x: (i32, i32) = (1, 2); - // TODO: This fails to initialize the `A` object's fields. - // This happens because we generate SemIR assuming that the dependent - // type will have a copy value representation, and will need changes - // in SemIR for us to properly lower it. - return Make(x, x); -} +// TODO: Reintroduce this once it doesn't crash. +// fn Tuples() -> A((i32, i32)) { +// let x: (i32, i32) = (1, 2); +// // TODO: This fails to initialize the `A` object's fields. +// // This happens because we generate SemIR assuming that the dependent +// // type will have a copy value representation, and will need changes +// // in SemIR for us to properly lower it. +// return Make(x, x); +// } // --- access.carbon @@ -166,49 +164,34 @@ fn AccessTuple() -> (i32, i32, i32) { // CHECK:STDOUT: ; ModuleID = 'create_generic.carbon' // CHECK:STDOUT: source_filename = "create_generic.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: @tuple.loc25_28.6 = internal constant { i32, i32 } { i32 1, i32 2 } -// CHECK:STDOUT: // CHECK:STDOUT: define void @_CInts.Main(ptr sret({ i32, i32 }) %return) !dbg !4 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CMake.Main.b88d1103f417c6d4(ptr %return, i32 1, i32 2), !dbg !7 +// CHECK:STDOUT: call void @_CMake.Main.b7c8e4dff2adcdaa(ptr %return, i32 1, i32 2), !dbg !7 // CHECK:STDOUT: ret void, !dbg !8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: define void @_CEmpty.Main(ptr sret({ {}, {} }) %return) !dbg !9 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CMake.Main.e43630e9a6c38c3f(ptr %return), !dbg !10 +// CHECK:STDOUT: call void @_CMake.Main.35292afa1b663913(ptr %return), !dbg !10 // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @_CTuples.Main(ptr sret({ { i32, i32 }, { i32, i32 } }) %return) !dbg !12 { +// CHECK:STDOUT: define linkonce_odr void @_CMake.Main.b7c8e4dff2adcdaa(ptr sret({ i32, i32 }) %return, i32 %x, i32 %y) !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CMake.Main.29d34654e802e24e(ptr %return, ptr @tuple.loc25_28.6, ptr @tuple.loc25_28.6), !dbg !13 +// CHECK:STDOUT: %.loc10_25.2.x = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0, !dbg !13 +// CHECK:STDOUT: store i32 %x, ptr %.loc10_25.2.x, align 4, !dbg !13 +// CHECK:STDOUT: %.loc10_25.4.y = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !13 +// CHECK:STDOUT: store i32 %y, ptr %.loc10_25.4.y, align 4, !dbg !13 // CHECK:STDOUT: ret void, !dbg !14 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr void @_CMake.Main.b88d1103f417c6d4(ptr sret({ i32, i32 }) %return, i32 %x, i32 %y) !dbg !15 { +// CHECK:STDOUT: define linkonce_odr void @_CMake.Main.35292afa1b663913(ptr sret({ {}, {} }) %return) !dbg !15 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc13_25.2.x = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0, !dbg !16 -// CHECK:STDOUT: store i32 %x, ptr %.loc13_25.2.x, align 4, !dbg !16 -// CHECK:STDOUT: %.loc13_25.4.y = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !16 -// CHECK:STDOUT: store i32 %y, ptr %.loc13_25.4.y, align 4, !dbg !16 +// CHECK:STDOUT: %.loc10_25.2.x = getelementptr inbounds nuw { {}, {} }, ptr %return, i32 0, i32 0, !dbg !16 +// CHECK:STDOUT: %.loc10_25.4.y = getelementptr inbounds nuw { {}, {} }, ptr %return, i32 0, i32 1, !dbg !16 // CHECK:STDOUT: ret void, !dbg !17 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr void @_CMake.Main.e43630e9a6c38c3f(ptr sret({ {}, {} }) %return) !dbg !18 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc13_25.2.x = getelementptr inbounds nuw { {}, {} }, ptr %return, i32 0, i32 0, !dbg !19 -// CHECK:STDOUT: %.loc13_25.4.y = getelementptr inbounds nuw { {}, {} }, ptr %return, i32 0, i32 1, !dbg !19 -// CHECK:STDOUT: ret void, !dbg !20 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr void @_CMake.Main.29d34654e802e24e(ptr sret({ { i32, i32 }, { i32, i32 } }) %return, ptr %x, ptr %y) !dbg !21 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc13_25.2.x = getelementptr inbounds nuw { { i32, i32 }, { i32, i32 } }, ptr %return, i32 0, i32 0, !dbg !22 -// CHECK:STDOUT: %.loc13_25.4.y = getelementptr inbounds nuw { { i32, i32 }, { i32, i32 } }, ptr %return, i32 0, i32 1, !dbg !22 -// CHECK:STDOUT: ret void, !dbg !23 -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: @@ -216,26 +199,20 @@ fn AccessTuple() -> (i32, i32, i32) { // CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) // CHECK:STDOUT: !3 = !DIFile(filename: "create_generic.carbon", directory: "") -// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Ints", linkageName: "_CInts.Main", scope: null, file: !3, line: 16, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Ints", linkageName: "_CInts.Main", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} -// CHECK:STDOUT: !7 = !DILocation(line: 17, column: 10, scope: !4) -// CHECK:STDOUT: !8 = !DILocation(line: 17, column: 3, scope: !4) -// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "Empty", linkageName: "_CEmpty.Main", scope: null, file: !3, line: 20, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !10 = !DILocation(line: 21, column: 10, scope: !9) -// CHECK:STDOUT: !11 = !DILocation(line: 21, column: 3, scope: !9) -// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Tuples", linkageName: "_CTuples.Main", scope: null, file: !3, line: 24, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !13 = !DILocation(line: 30, column: 10, scope: !12) -// CHECK:STDOUT: !14 = !DILocation(line: 30, column: 3, scope: !12) -// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "Make", linkageName: "_CMake.Main.b88d1103f417c6d4", scope: null, file: !3, line: 9, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !16 = !DILocation(line: 13, column: 10, scope: !15) -// CHECK:STDOUT: !17 = !DILocation(line: 13, column: 3, scope: !15) -// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "Make", linkageName: "_CMake.Main.e43630e9a6c38c3f", scope: null, file: !3, line: 9, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !19 = !DILocation(line: 13, column: 10, scope: !18) -// CHECK:STDOUT: !20 = !DILocation(line: 13, column: 3, scope: !18) -// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "Make", linkageName: "_CMake.Main.29d34654e802e24e", scope: null, file: !3, line: 9, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !22 = !DILocation(line: 13, column: 10, scope: !21) -// CHECK:STDOUT: !23 = !DILocation(line: 13, column: 3, scope: !21) +// CHECK:STDOUT: !7 = !DILocation(line: 14, column: 10, scope: !4) +// CHECK:STDOUT: !8 = !DILocation(line: 14, column: 3, scope: !4) +// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "Empty", linkageName: "_CEmpty.Main", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !10 = !DILocation(line: 18, column: 10, scope: !9) +// CHECK:STDOUT: !11 = !DILocation(line: 18, column: 3, scope: !9) +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Make", linkageName: "_CMake.Main.b7c8e4dff2adcdaa", scope: null, file: !3, line: 9, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !13 = !DILocation(line: 10, column: 10, scope: !12) +// CHECK:STDOUT: !14 = !DILocation(line: 10, column: 3, scope: !12) +// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "Make", linkageName: "_CMake.Main.35292afa1b663913", scope: null, file: !3, line: 9, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !16 = !DILocation(line: 10, column: 10, scope: !15) +// CHECK:STDOUT: !17 = !DILocation(line: 10, column: 3, scope: !15) // CHECK:STDOUT: ; ModuleID = 'access.carbon' // CHECK:STDOUT: source_filename = "access.carbon" // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/for/bindings.carbon b/toolchain/lower/testdata/for/bindings.carbon index fd151b43626b..f66571656b3d 100644 --- a/toolchain/lower/testdata/for/bindings.carbon +++ b/toolchain/lower/testdata/for/bindings.carbon @@ -10,7 +10,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/for/bindings.carbon -class EmptyRange(T:! type) { +class EmptyRange(T:! Core.Copy) { impl as Core.Iterate where .CursorType = {} and .ElementType = T { fn NewCursor[self: Self]() -> {} { return {}; @@ -47,20 +47,20 @@ fn For() { // CHECK:STDOUT: %.loc29_33.8.temp = alloca { i32, i32 }, align 8, !dbg !8 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %r.var), !dbg !7 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %r.var, ptr align 1 @EmptyRange.val.loc27_3, i64 0, i1 false), !dbg !7 -// CHECK:STDOUT: call void @"_CNewCursor.EmptyRange.Main:Iterate.Core.29d34654e802e24e"(ptr %r.var), !dbg !8 +// CHECK:STDOUT: call void @"_CNewCursor.EmptyRange.Main:Iterate.Core.f45352a5f6977b6a"(ptr %r.var), !dbg !8 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %var), !dbg !8 // CHECK:STDOUT: br label %for.next, !dbg !8 // CHECK:STDOUT: // CHECK:STDOUT: for.next: ; preds = %for.body, %entry // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc29_33.1.temp), !dbg !8 -// CHECK:STDOUT: call void @"_CNext.EmptyRange.Main:Iterate.Core.29d34654e802e24e"(ptr %.loc29_33.1.temp, ptr %r.var, ptr %var), !dbg !8 -// CHECK:STDOUT: %Optional.HasValue.call = call i1 @_CHasValue.Optional.Core.29d34654e802e24e(ptr %.loc29_33.1.temp), !dbg !8 +// CHECK:STDOUT: call void @"_CNext.EmptyRange.Main:Iterate.Core.f45352a5f6977b6a"(ptr %.loc29_33.1.temp, ptr %r.var, ptr %var), !dbg !8 +// CHECK:STDOUT: %Optional.HasValue.call = call i1 @_CHasValue.Optional.Core.f45352a5f6977b6a(ptr %.loc29_33.1.temp), !dbg !8 // CHECK:STDOUT: br i1 %Optional.HasValue.call, label %for.body, label %for.done, !dbg !8 // CHECK:STDOUT: // CHECK:STDOUT: for.body: ; preds = %for.next // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !9 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc29_33.8.temp), !dbg !8 -// CHECK:STDOUT: call void @_CGet.Optional.Core.29d34654e802e24e(ptr %.loc29_33.8.temp, ptr %.loc29_33.1.temp), !dbg !8 +// CHECK:STDOUT: call void @_CGet.Optional.Core.f45352a5f6977b6a(ptr %.loc29_33.8.temp, ptr %.loc29_33.1.temp), !dbg !8 // CHECK:STDOUT: %tuple.elem0.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %.loc29_33.8.temp, i32 0, i32 0, !dbg !8 // CHECK:STDOUT: %tuple.elem1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %.loc29_33.8.temp, i32 0, i32 1, !dbg !8 // CHECK:STDOUT: %.loc29_33.11 = load i32, ptr %tuple.elem0.tuple.elem, align 4, !dbg !8 @@ -79,30 +79,30 @@ fn For() { // CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) // CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 // CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr void @"_CNewCursor.EmptyRange.Main:Iterate.Core.29d34654e802e24e"(ptr %self) !dbg !13 { +// CHECK:STDOUT: define linkonce_odr void @"_CNewCursor.EmptyRange.Main:Iterate.Core.f45352a5f6977b6a"(ptr %self) !dbg !13 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !14 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr void @"_CNext.EmptyRange.Main:Iterate.Core.29d34654e802e24e"(ptr sret({ i1, { i32, i32 } }) %return, ptr %self, ptr %cursor) !dbg !15 { +// CHECK:STDOUT: define linkonce_odr void @"_CNext.EmptyRange.Main:Iterate.Core.f45352a5f6977b6a"(ptr sret({ i1, { i32, i32 } }) %return, ptr %self, ptr %cursor) !dbg !15 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CNone.Optional.Core.29d34654e802e24e(ptr %return), !dbg !16 +// CHECK:STDOUT: call void @_CNone.Optional.Core.f45352a5f6977b6a(ptr %return), !dbg !16 // CHECK:STDOUT: ret void, !dbg !17 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.29d34654e802e24e(ptr %self) !dbg !18 { +// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.f45352a5f6977b6a(ptr %self) !dbg !18 { // CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i1, { i32, i32 } }, ptr %self, i32 0, i32 0, !dbg !20 // CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !20 // CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !20 // CHECK:STDOUT: ret i1 %2, !dbg !21 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr void @_CGet.Optional.Core.29d34654e802e24e(ptr sret({ i32, i32 }) %return, ptr %self) !dbg !22 { +// CHECK:STDOUT: define linkonce_odr void @_CGet.Optional.Core.f45352a5f6977b6a(ptr sret({ i32, i32 }) %return, ptr %self) !dbg !22 { // CHECK:STDOUT: %value = getelementptr inbounds nuw { i1, { i32, i32 } }, ptr %self, i32 0, i32 1, !dbg !23 // CHECK:STDOUT: ret void, !dbg !24 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.29d34654e802e24e(ptr sret({ i1, { i32, i32 } }) %return) !dbg !25 { +// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.f45352a5f6977b6a(ptr sret({ i1, { i32, i32 } }) %return) !dbg !25 { // CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i1, { i32, i32 } }, ptr %return, i32 0, i32 0, !dbg !26 // CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !26 // CHECK:STDOUT: ret void, !dbg !27 @@ -130,18 +130,18 @@ fn For() { // CHECK:STDOUT: !10 = !DILocation(line: 30, column: 5, scope: !4) // CHECK:STDOUT: !11 = !DILocation(line: 29, column: 3, scope: !4) // CHECK:STDOUT: !12 = !DILocation(line: 26, column: 1, scope: !4) -// CHECK:STDOUT: !13 = distinct !DISubprogram(name: "NewCursor", linkageName: "_CNewCursor.EmptyRange.Main:Iterate.Core.29d34654e802e24e", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !13 = distinct !DISubprogram(name: "NewCursor", linkageName: "_CNewCursor.EmptyRange.Main:Iterate.Core.f45352a5f6977b6a", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !14 = !DILocation(line: 16, column: 7, scope: !13) -// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.EmptyRange.Main:Iterate.Core.29d34654e802e24e", scope: null, file: !3, line: 18, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.EmptyRange.Main:Iterate.Core.f45352a5f6977b6a", scope: null, file: !3, line: 18, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !16 = !DILocation(line: 19, column: 14, scope: !15) // CHECK:STDOUT: !17 = !DILocation(line: 19, column: 7, scope: !15) -// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.29d34654e802e24e", scope: null, file: !19, line: 29, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.f45352a5f6977b6a", scope: null, file: !19, line: 30, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !19 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !20 = !DILocation(line: 29, column: 46, scope: !18) -// CHECK:STDOUT: !21 = !DILocation(line: 29, column: 39, scope: !18) -// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.29d34654e802e24e", scope: null, file: !19, line: 30, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !23 = !DILocation(line: 30, column: 38, scope: !22) -// CHECK:STDOUT: !24 = !DILocation(line: 30, column: 31, scope: !22) -// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.29d34654e802e24e", scope: null, file: !19, line: 19, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !26 = !DILocation(line: 21, column: 5, scope: !25) -// CHECK:STDOUT: !27 = !DILocation(line: 22, column: 5, scope: !25) +// CHECK:STDOUT: !20 = !DILocation(line: 30, column: 46, scope: !18) +// CHECK:STDOUT: !21 = !DILocation(line: 30, column: 39, scope: !18) +// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.f45352a5f6977b6a", scope: null, file: !19, line: 31, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !23 = !DILocation(line: 31, column: 38, scope: !22) +// CHECK:STDOUT: !24 = !DILocation(line: 31, column: 31, scope: !22) +// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.f45352a5f6977b6a", scope: null, file: !19, line: 20, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !26 = !DILocation(line: 22, column: 5, scope: !25) +// CHECK:STDOUT: !27 = !DILocation(line: 23, column: 5, scope: !25) diff --git a/toolchain/lower/testdata/for/break_continue.carbon b/toolchain/lower/testdata/for/break_continue.carbon index 9535b23ac164..3909986ed5e8 100644 --- a/toolchain/lower/testdata/for/break_continue.carbon +++ b/toolchain/lower/testdata/for/break_continue.carbon @@ -48,11 +48,11 @@ fn For() { // CHECK:STDOUT: for.next: ; preds = %if.else.loc22, %if.then.loc22, %entry // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_33.1.temp), !dbg !8 // CHECK:STDOUT: call void @"_CNext.IntRange.Core:Iterate.Core.be1e879c1ad406d8"(ptr %.loc20_33.1.temp, ptr %.loc20_32.1.temp, ptr %var), !dbg !8 -// CHECK:STDOUT: %Optional.HasValue.call = call i1 @_CHasValue.Optional.Core.b88d1103f417c6d4(ptr %.loc20_33.1.temp), !dbg !8 +// CHECK:STDOUT: %Optional.HasValue.call = call i1 @_CHasValue.Optional.Core.b7c8e4dff2adcdaa(ptr %.loc20_33.1.temp), !dbg !8 // CHECK:STDOUT: br i1 %Optional.HasValue.call, label %for.body, label %for.done, !dbg !8 // CHECK:STDOUT: // CHECK:STDOUT: for.body: ; preds = %for.next -// CHECK:STDOUT: %Optional.Get.call = call i32 @_CGet.Optional.Core.b88d1103f417c6d4(ptr %.loc20_33.1.temp), !dbg !8 +// CHECK:STDOUT: %Optional.Get.call = call i32 @_CGet.Optional.Core.b7c8e4dff2adcdaa(ptr %.loc20_33.1.temp), !dbg !8 // CHECK:STDOUT: %F.call = call i1 @_CF.Main(), !dbg !9 // CHECK:STDOUT: br i1 %F.call, label %if.then.loc21, label %if.else.loc21, !dbg !10 // CHECK:STDOUT: @@ -99,22 +99,22 @@ fn For() { // CHECK:STDOUT: 6: ; preds = %0 // CHECK:STDOUT: call void @"_COp.Int.Core:Inc.Core.be1e879c1ad406d8"(ptr %cursor), !dbg !28 // CHECK:STDOUT: %7 = load i32, ptr %1, align 4, !dbg !29 -// CHECK:STDOUT: call void @_CSome.Optional.Core.b88d1103f417c6d4(ptr %return, i32 %7), !dbg !30 +// CHECK:STDOUT: call void @_CSome.Optional.Core.b7c8e4dff2adcdaa(ptr %return, i32 %7), !dbg !30 // CHECK:STDOUT: ret void, !dbg !31 // CHECK:STDOUT: // CHECK:STDOUT: 8: ; preds = %0 -// CHECK:STDOUT: call void @_CNone.Optional.Core.b88d1103f417c6d4(ptr %return), !dbg !32 +// CHECK:STDOUT: call void @_CNone.Optional.Core.b7c8e4dff2adcdaa(ptr %return), !dbg !32 // CHECK:STDOUT: ret void, !dbg !33 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.b88d1103f417c6d4(ptr %self) !dbg !34 { +// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.b7c8e4dff2adcdaa(ptr %self) !dbg !34 { // CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i1, i32 }, ptr %self, i32 0, i32 0, !dbg !36 // CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !36 // CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !36 // CHECK:STDOUT: ret i1 %2, !dbg !37 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr i32 @_CGet.Optional.Core.b88d1103f417c6d4(ptr %self) !dbg !38 { +// CHECK:STDOUT: define linkonce_odr i32 @_CGet.Optional.Core.b7c8e4dff2adcdaa(ptr %self) !dbg !38 { // CHECK:STDOUT: %value = getelementptr inbounds nuw { i1, i32 }, ptr %self, i32 0, i32 1, !dbg !39 // CHECK:STDOUT: %1 = load i32, ptr %value, align 4, !dbg !39 // CHECK:STDOUT: ret i32 %1, !dbg !40 @@ -127,7 +127,7 @@ fn For() { // CHECK:STDOUT: ret void, !dbg !44 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.b88d1103f417c6d4(ptr sret({ i1, i32 }) %return, i32 %value) !dbg !45 { +// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.b7c8e4dff2adcdaa(ptr sret({ i1, i32 }) %return, i32 %value) !dbg !45 { // CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i1, i32 }, ptr %return, i32 0, i32 0, !dbg !46 // CHECK:STDOUT: %value1 = getelementptr inbounds nuw { i1, i32 }, ptr %return, i32 0, i32 1, !dbg !46 // CHECK:STDOUT: store i32 %value, ptr %value1, align 4, !dbg !46 @@ -135,7 +135,7 @@ fn For() { // CHECK:STDOUT: ret void, !dbg !47 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.b88d1103f417c6d4(ptr sret({ i1, i32 }) %return) !dbg !48 { +// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.b7c8e4dff2adcdaa(ptr sret({ i1, i32 }) %return) !dbg !48 { // CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i1, i32 }, ptr %return, i32 0, i32 0, !dbg !49 // CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !49 // CHECK:STDOUT: ret void, !dbg !50 @@ -195,26 +195,26 @@ fn For() { // CHECK:STDOUT: !31 = !DILocation(line: 30, column: 9, scope: !22) // CHECK:STDOUT: !32 = !DILocation(line: 32, column: 16, scope: !22) // CHECK:STDOUT: !33 = !DILocation(line: 32, column: 9, scope: !22) -// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.b88d1103f417c6d4", scope: null, file: !35, line: 29, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.b7c8e4dff2adcdaa", scope: null, file: !35, line: 30, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !35 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !36 = !DILocation(line: 29, column: 46, scope: !34) -// CHECK:STDOUT: !37 = !DILocation(line: 29, column: 39, scope: !34) -// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.b88d1103f417c6d4", scope: null, file: !35, line: 30, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !39 = !DILocation(line: 30, column: 38, scope: !38) -// CHECK:STDOUT: !40 = !DILocation(line: 30, column: 31, scope: !38) -// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !42, line: 332, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !36 = !DILocation(line: 30, column: 46, scope: !34) +// CHECK:STDOUT: !37 = !DILocation(line: 30, column: 39, scope: !34) +// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.b7c8e4dff2adcdaa", scope: null, file: !35, line: 31, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !39 = !DILocation(line: 31, column: 38, scope: !38) +// CHECK:STDOUT: !40 = !DILocation(line: 31, column: 31, scope: !38) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !42, line: 339, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !42 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") -// CHECK:STDOUT: !43 = !DILocation(line: 334, column: 5, scope: !41) -// CHECK:STDOUT: !44 = !DILocation(line: 332, column: 3, scope: !41) -// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.b88d1103f417c6d4", scope: null, file: !35, line: 25, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !46 = !DILocation(line: 26, column: 12, scope: !45) -// CHECK:STDOUT: !47 = !DILocation(line: 26, column: 5, scope: !45) -// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.b88d1103f417c6d4", scope: null, file: !35, line: 19, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !49 = !DILocation(line: 21, column: 5, scope: !48) -// CHECK:STDOUT: !50 = !DILocation(line: 22, column: 5, scope: !48) -// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk.Int.Core:AddAssignWith.Core.81406e440463ef1d", scope: null, file: !42, line: 268, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !43 = !DILocation(line: 341, column: 5, scope: !41) +// CHECK:STDOUT: !44 = !DILocation(line: 339, column: 3, scope: !41) +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.b7c8e4dff2adcdaa", scope: null, file: !35, line: 26, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !46 = !DILocation(line: 27, column: 12, scope: !45) +// CHECK:STDOUT: !47 = !DILocation(line: 27, column: 5, scope: !45) +// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.b7c8e4dff2adcdaa", scope: null, file: !35, line: 20, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !49 = !DILocation(line: 22, column: 5, scope: !48) +// CHECK:STDOUT: !50 = !DILocation(line: 23, column: 5, scope: !48) +// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk.Int.Core:AddAssignWith.Core.81406e440463ef1d", scope: null, file: !42, line: 275, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !52 = !DILocation(line: 4294967295, scope: !51) -// CHECK:STDOUT: !53 = !DILocation(line: 268, column: 3, scope: !51) +// CHECK:STDOUT: !53 = !DILocation(line: 275, column: 3, scope: !51) // CHECK:STDOUT: !54 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.8b3d5d6a6c17be04:ImplicitAs.Core.b88d1103f417c6d4", scope: null, file: !55, line: 23, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !55 = !DIFile(filename: "{{.*}}/prelude/operators/as.carbon", directory: "") // CHECK:STDOUT: !56 = !DILocation(line: 23, column: 38, scope: !54) diff --git a/toolchain/lower/testdata/for/for.carbon b/toolchain/lower/testdata/for/for.carbon index e4bd9bbf7f98..415cfafe7525 100644 --- a/toolchain/lower/testdata/for/for.carbon +++ b/toolchain/lower/testdata/for/for.carbon @@ -49,11 +49,11 @@ fn For() { // CHECK:STDOUT: for.next: ; preds = %for.body, %entry // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc21_33.1.temp), !dbg !8 // CHECK:STDOUT: call void @"_CNext.IntRange.Core:Iterate.Core.be1e879c1ad406d8"(ptr %.loc21_33.1.temp, ptr %.loc21_32.1.temp, ptr %var), !dbg !8 -// CHECK:STDOUT: %Optional.HasValue.call = call i1 @_CHasValue.Optional.Core.b88d1103f417c6d4(ptr %.loc21_33.1.temp), !dbg !8 +// CHECK:STDOUT: %Optional.HasValue.call = call i1 @_CHasValue.Optional.Core.b7c8e4dff2adcdaa(ptr %.loc21_33.1.temp), !dbg !8 // CHECK:STDOUT: br i1 %Optional.HasValue.call, label %for.body, label %for.done, !dbg !8 // CHECK:STDOUT: // CHECK:STDOUT: for.body: ; preds = %for.next -// CHECK:STDOUT: %Optional.Get.call = call i32 @_CGet.Optional.Core.b88d1103f417c6d4(ptr %.loc21_33.1.temp), !dbg !8 +// CHECK:STDOUT: %Optional.Get.call = call i32 @_CGet.Optional.Core.b7c8e4dff2adcdaa(ptr %.loc21_33.1.temp), !dbg !8 // CHECK:STDOUT: call void @_CG.Main(), !dbg !10 // CHECK:STDOUT: br label %for.next, !dbg !11 // CHECK:STDOUT: @@ -87,22 +87,22 @@ fn For() { // CHECK:STDOUT: 6: ; preds = %0 // CHECK:STDOUT: call void @"_COp.Int.Core:Inc.Core.be1e879c1ad406d8"(ptr %cursor), !dbg !24 // CHECK:STDOUT: %7 = load i32, ptr %1, align 4, !dbg !25 -// CHECK:STDOUT: call void @_CSome.Optional.Core.b88d1103f417c6d4(ptr %return, i32 %7), !dbg !26 +// CHECK:STDOUT: call void @_CSome.Optional.Core.b7c8e4dff2adcdaa(ptr %return, i32 %7), !dbg !26 // CHECK:STDOUT: ret void, !dbg !27 // CHECK:STDOUT: // CHECK:STDOUT: 8: ; preds = %0 -// CHECK:STDOUT: call void @_CNone.Optional.Core.b88d1103f417c6d4(ptr %return), !dbg !28 +// CHECK:STDOUT: call void @_CNone.Optional.Core.b7c8e4dff2adcdaa(ptr %return), !dbg !28 // CHECK:STDOUT: ret void, !dbg !29 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.b88d1103f417c6d4(ptr %self) !dbg !30 { +// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.b7c8e4dff2adcdaa(ptr %self) !dbg !30 { // CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i1, i32 }, ptr %self, i32 0, i32 0, !dbg !32 // CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !32 // CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !32 // CHECK:STDOUT: ret i1 %2, !dbg !33 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr i32 @_CGet.Optional.Core.b88d1103f417c6d4(ptr %self) !dbg !34 { +// CHECK:STDOUT: define linkonce_odr i32 @_CGet.Optional.Core.b7c8e4dff2adcdaa(ptr %self) !dbg !34 { // CHECK:STDOUT: %value = getelementptr inbounds nuw { i1, i32 }, ptr %self, i32 0, i32 1, !dbg !35 // CHECK:STDOUT: %1 = load i32, ptr %value, align 4, !dbg !35 // CHECK:STDOUT: ret i32 %1, !dbg !36 @@ -115,7 +115,7 @@ fn For() { // CHECK:STDOUT: ret void, !dbg !40 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.b88d1103f417c6d4(ptr sret({ i1, i32 }) %return, i32 %value) !dbg !41 { +// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.b7c8e4dff2adcdaa(ptr sret({ i1, i32 }) %return, i32 %value) !dbg !41 { // CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i1, i32 }, ptr %return, i32 0, i32 0, !dbg !42 // CHECK:STDOUT: %value1 = getelementptr inbounds nuw { i1, i32 }, ptr %return, i32 0, i32 1, !dbg !42 // CHECK:STDOUT: store i32 %value, ptr %value1, align 4, !dbg !42 @@ -123,7 +123,7 @@ fn For() { // CHECK:STDOUT: ret void, !dbg !43 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.b88d1103f417c6d4(ptr sret({ i1, i32 }) %return) !dbg !44 { +// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.b7c8e4dff2adcdaa(ptr sret({ i1, i32 }) %return) !dbg !44 { // CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i1, i32 }, ptr %return, i32 0, i32 0, !dbg !45 // CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !45 // CHECK:STDOUT: ret void, !dbg !46 @@ -179,26 +179,26 @@ fn For() { // CHECK:STDOUT: !27 = !DILocation(line: 30, column: 9, scope: !18) // CHECK:STDOUT: !28 = !DILocation(line: 32, column: 16, scope: !18) // CHECK:STDOUT: !29 = !DILocation(line: 32, column: 9, scope: !18) -// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.b88d1103f417c6d4", scope: null, file: !31, line: 29, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.b7c8e4dff2adcdaa", scope: null, file: !31, line: 30, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !31 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !32 = !DILocation(line: 29, column: 46, scope: !30) -// CHECK:STDOUT: !33 = !DILocation(line: 29, column: 39, scope: !30) -// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.b88d1103f417c6d4", scope: null, file: !31, line: 30, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !35 = !DILocation(line: 30, column: 38, scope: !34) -// CHECK:STDOUT: !36 = !DILocation(line: 30, column: 31, scope: !34) -// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !38, line: 332, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !32 = !DILocation(line: 30, column: 46, scope: !30) +// CHECK:STDOUT: !33 = !DILocation(line: 30, column: 39, scope: !30) +// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.b7c8e4dff2adcdaa", scope: null, file: !31, line: 31, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !35 = !DILocation(line: 31, column: 38, scope: !34) +// CHECK:STDOUT: !36 = !DILocation(line: 31, column: 31, scope: !34) +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !38, line: 339, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !38 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") -// CHECK:STDOUT: !39 = !DILocation(line: 334, column: 5, scope: !37) -// CHECK:STDOUT: !40 = !DILocation(line: 332, column: 3, scope: !37) -// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.b88d1103f417c6d4", scope: null, file: !31, line: 25, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !42 = !DILocation(line: 26, column: 12, scope: !41) -// CHECK:STDOUT: !43 = !DILocation(line: 26, column: 5, scope: !41) -// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.b88d1103f417c6d4", scope: null, file: !31, line: 19, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !45 = !DILocation(line: 21, column: 5, scope: !44) -// CHECK:STDOUT: !46 = !DILocation(line: 22, column: 5, scope: !44) -// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk.Int.Core:AddAssignWith.Core.81406e440463ef1d", scope: null, file: !38, line: 268, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !39 = !DILocation(line: 341, column: 5, scope: !37) +// CHECK:STDOUT: !40 = !DILocation(line: 339, column: 3, scope: !37) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.b7c8e4dff2adcdaa", scope: null, file: !31, line: 26, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !42 = !DILocation(line: 27, column: 12, scope: !41) +// CHECK:STDOUT: !43 = !DILocation(line: 27, column: 5, scope: !41) +// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.b7c8e4dff2adcdaa", scope: null, file: !31, line: 20, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !45 = !DILocation(line: 22, column: 5, scope: !44) +// CHECK:STDOUT: !46 = !DILocation(line: 23, column: 5, scope: !44) +// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk.Int.Core:AddAssignWith.Core.81406e440463ef1d", scope: null, file: !38, line: 275, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !48 = !DILocation(line: 4294967295, scope: !47) -// CHECK:STDOUT: !49 = !DILocation(line: 268, column: 3, scope: !47) +// CHECK:STDOUT: !49 = !DILocation(line: 275, column: 3, scope: !47) // CHECK:STDOUT: !50 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.8b3d5d6a6c17be04:ImplicitAs.Core.b88d1103f417c6d4", scope: null, file: !51, line: 23, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !51 = !DIFile(filename: "{{.*}}/prelude/operators/as.carbon", directory: "") // CHECK:STDOUT: !52 = !DILocation(line: 23, column: 38, scope: !50) diff --git a/toolchain/lower/testdata/operators/increment.carbon b/toolchain/lower/testdata/operators/increment.carbon index 2aa037c61e21..de19399b9f1a 100644 --- a/toolchain/lower/testdata/operators/increment.carbon +++ b/toolchain/lower/testdata/operators/increment.carbon @@ -66,13 +66,13 @@ fn IncrSigned() { // CHECK:STDOUT: !7 = !DILocation(line: 5, column: 3, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 6, column: 3, scope: !4) // CHECK:STDOUT: !9 = !DILocation(line: 4, column: 1, scope: !4) -// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !11, line: 332, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !11, line: 339, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !11 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") -// CHECK:STDOUT: !12 = !DILocation(line: 334, column: 5, scope: !10) -// CHECK:STDOUT: !13 = !DILocation(line: 332, column: 3, scope: !10) -// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk.Int.Core:AddAssignWith.Core.81406e440463ef1d", scope: null, file: !11, line: 268, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !12 = !DILocation(line: 341, column: 5, scope: !10) +// CHECK:STDOUT: !13 = !DILocation(line: 339, column: 3, scope: !10) +// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk.Int.Core:AddAssignWith.Core.81406e440463ef1d", scope: null, file: !11, line: 275, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !15 = !DILocation(line: 4294967295, scope: !14) -// CHECK:STDOUT: !16 = !DILocation(line: 268, column: 3, scope: !14) +// CHECK:STDOUT: !16 = !DILocation(line: 275, column: 3, scope: !14) // CHECK:STDOUT: !17 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.8b3d5d6a6c17be04:ImplicitAs.Core.b88d1103f417c6d4", scope: null, file: !18, line: 23, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !18 = !DIFile(filename: "{{.*}}/prelude/operators/as.carbon", directory: "") // CHECK:STDOUT: !19 = !DILocation(line: 23, column: 38, scope: !17) diff --git a/toolchain/sem_ir/builtin_function_kind.cpp b/toolchain/sem_ir/builtin_function_kind.cpp index efb89bf40ca3..432574bf92eb 100644 --- a/toolchain/sem_ir/builtin_function_kind.cpp +++ b/toolchain/sem_ir/builtin_function_kind.cpp @@ -8,6 +8,7 @@ #include "toolchain/sem_ir/file.h" #include "toolchain/sem_ir/ids.h" +#include "toolchain/sem_ir/type_info.h" #include "toolchain/sem_ir/typed_insts.h" namespace Carbon::SemIR { @@ -156,6 +157,17 @@ struct AnyFloat { // Constraint that requires the type to be the type type. using Type = BuiltinType; +// Constraint that a type supports a primitive copy. This happens if its +// initializing representation is a copy of its value representation. +struct PrimitiveCopyable { + static auto Check(const File& sem_ir, ValidateState& /*state*/, + TypeId type_id) -> bool { + return InitRepr::ForType(sem_ir, type_id).IsCopyOfObjectRepr() && + ValueRepr::ForType(sem_ir, type_id) + .IsCopyOfObjectRepr(sem_ir, type_id); + } +}; + // Checks that the specified type matches the given type constraint. template auto Check(const File& sem_ir, ValidateState& state, TypeId type_id) -> bool { @@ -261,11 +273,19 @@ using FloatU = TypeParam<1, AnyFloat>; // generic type parameter that is constrained to be a sized float type. using SizedFloatT = TypeParam<0, AnySizedFloat>; +// Convenience name used in the builtin type signatures below for a first +// generic type parameter that supports primitive copy. +using PrimitiveCopyParamT = TypeParam<0, PrimitiveCopyable>; + // Not a builtin function. constexpr BuiltinInfo None = {"", nullptr}; constexpr BuiltinInfo NoOp = {"no_op", ValidateNoOpSignature}; +constexpr BuiltinInfo PrimitiveCopy = { + "primitive_copy", + ValidateSignaturePrimitiveCopyParamT>}; + // Prints a single character. constexpr BuiltinInfo PrintChar = { "print.char", ValidateSignatureAnySizedInt>}; diff --git a/toolchain/sem_ir/builtin_function_kind.def b/toolchain/sem_ir/builtin_function_kind.def index a46d562f30ef..9be08bd914a5 100644 --- a/toolchain/sem_ir/builtin_function_kind.def +++ b/toolchain/sem_ir/builtin_function_kind.def @@ -22,6 +22,10 @@ CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(None) // A no-op function definition; calls should be elided when lowering. CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(NoOp) +// A primitive copy for types whose value and initializing representation are +// the same. +CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(PrimitiveCopy) + // Temporary builtins for primitive IO. CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(PrintChar) CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(PrintInt) diff --git a/toolchain/testing/testdata/min_prelude/convert.carbon b/toolchain/testing/testdata/min_prelude/convert.carbon index 8a11d20171e3..b302251db1a8 100644 --- a/toolchain/testing/testdata/min_prelude/convert.carbon +++ b/toolchain/testing/testdata/min_prelude/convert.carbon @@ -3,6 +3,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/as.carbon +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/copy.carbon // EXTRA-ARGS: --custom-core --exclude-dump-file-prefix=min_prelude/ // --- min_prelude/convert.carbon @@ -11,3 +12,4 @@ package Core library "prelude"; export import library "prelude/parts/as"; +export import library "prelude/parts/copy"; diff --git a/toolchain/testing/testdata/min_prelude/facet_types.carbon b/toolchain/testing/testdata/min_prelude/facet_types.carbon index 72122afdbaaa..3a000dad7df6 100644 --- a/toolchain/testing/testdata/min_prelude/facet_types.carbon +++ b/toolchain/testing/testdata/min_prelude/facet_types.carbon @@ -3,6 +3,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/as.carbon +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/copy.carbon // EXTRA-ARGS: --custom-core --exclude-dump-file-prefix=min_prelude/ // --- min_prelude/facet_types.carbon @@ -12,6 +13,7 @@ package Core library "prelude"; export import library "prelude/parts/as"; +export import library "prelude/parts/copy"; interface BitAndWith(Other:! type) { fn Op[self: Self](other: Other) -> Self; diff --git a/toolchain/testing/testdata/min_prelude/for.carbon b/toolchain/testing/testdata/min_prelude/for.carbon index e6049d6470a2..2a31f892fc34 100644 --- a/toolchain/testing/testdata/min_prelude/for.carbon +++ b/toolchain/testing/testdata/min_prelude/for.carbon @@ -5,6 +5,7 @@ // EXTRA-ARGS: --custom-core --exclude-dump-file-prefix=min_prelude/ // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/as.carbon // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/bool.carbon +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/copy.carbon // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/iterate.carbon // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/optional.carbon @@ -15,5 +16,6 @@ package Core library "prelude"; export import library "prelude/parts/as"; export import library "prelude/parts/bool"; +export import library "prelude/parts/copy"; export import library "prelude/parts/iterate"; export import library "prelude/parts/optional"; diff --git a/toolchain/testing/testdata/min_prelude/parts/bool.carbon b/toolchain/testing/testdata/min_prelude/parts/bool.carbon index eb3210713d1f..d28f0a52da3e 100644 --- a/toolchain/testing/testdata/min_prelude/parts/bool.carbon +++ b/toolchain/testing/testdata/min_prelude/parts/bool.carbon @@ -1,9 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/copy.carbon // --- min_prelude/parts/bool.carbon package Core library "prelude/parts/bool"; +export import library "prelude/parts/copy"; + fn Bool() -> type = "bool.make_type"; diff --git a/toolchain/testing/testdata/min_prelude/parts/copy.carbon b/toolchain/testing/testdata/min_prelude/parts/copy.carbon new file mode 100644 index 000000000000..e17c75e68452 --- /dev/null +++ b/toolchain/testing/testdata/min_prelude/parts/copy.carbon @@ -0,0 +1,50 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +// --- min_prelude/parts/copy.carbon + +package Core library "prelude/parts/copy"; + +// Copying an object, which is a conversion from a value representation to an +// initializing representation. +interface Copy { + fn Op[self: Self]() -> Self; +} + +private fn Bool() -> type = "bool.make_type"; +private fn CharLiteral() -> type = "char_literal.make_type"; +private fn FloatLiteral() -> type = "float_literal.make_type"; +private fn IntLiteral() -> type = "int_literal.make_type"; + +impl Bool() as Copy { + fn Op[self: Self]() -> Self = "primitive_copy"; +} + +impl CharLiteral() as Copy { + fn Op[self: Self]() -> Self = "primitive_copy"; +} + +impl FloatLiteral() as Copy { + fn Op[self: Self]() -> Self = "primitive_copy"; +} + +impl IntLiteral() as Copy { + fn Op[self: Self]() -> Self = "primitive_copy"; +} + +impl forall [T:! type] T* as Copy { + fn Op[self: Self]() -> Self = "primitive_copy"; +} + +impl type as Copy { + fn Op[self: Self]() -> Self = "primitive_copy"; +} + +impl () as Copy { + fn Op[self: Self]() -> Self = "no_op"; +} + +impl forall [T:! Copy, U:! Copy] (T, U) as Copy { + fn Op[self: Self]() -> Self { return (self.0.Op(), self.1.Op()); } +} diff --git a/toolchain/testing/testdata/min_prelude/parts/float.carbon b/toolchain/testing/testdata/min_prelude/parts/float.carbon index 0bf5204a4cfb..4f03ede5a3b0 100644 --- a/toolchain/testing/testdata/min_prelude/parts/float.carbon +++ b/toolchain/testing/testdata/min_prelude/parts/float.carbon @@ -3,6 +3,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/as.carbon +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/copy.carbon // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/float_literal.carbon // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/int_literal.carbon @@ -11,6 +12,7 @@ package Core library "prelude/parts/float"; export import library "prelude/parts/as"; +export import library "prelude/parts/copy"; export import library "prelude/parts/float_literal"; export import library "prelude/parts/int_literal"; @@ -20,6 +22,10 @@ class Float(N:! IntLiteral()) { adapt MakeFloat(N); } +impl forall [N:! IntLiteral()] Float(N) as Copy { + fn Op[self: Self]() -> Self = "primitive_copy"; +} + impl forall [To:! IntLiteral()] FloatLiteral() as ImplicitAs(Float(To)) { fn Convert[self: Self]() -> Float(To) = "float.convert_checked"; } diff --git a/toolchain/testing/testdata/min_prelude/parts/int.carbon b/toolchain/testing/testdata/min_prelude/parts/int.carbon index c96c190d6962..5186c50cc73b 100644 --- a/toolchain/testing/testdata/min_prelude/parts/int.carbon +++ b/toolchain/testing/testdata/min_prelude/parts/int.carbon @@ -3,6 +3,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/as.carbon +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/copy.carbon // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/int_literal.carbon // --- min_prelude/parts/int.carbon @@ -10,6 +11,7 @@ package Core library "prelude/parts/int"; export import library "prelude/parts/as"; +export import library "prelude/parts/copy"; export import library "prelude/parts/int_literal"; private fn MakeInt(size: IntLiteral()) -> type = "int.make_type_signed"; @@ -18,6 +20,12 @@ class Int(N:! IntLiteral()) { adapt MakeInt(N); } +// Copy. + +impl forall [N:! IntLiteral()] Int(N) as Copy { + fn Op[self: Self]() -> Self = "primitive_copy"; +} + // Conversions. impl forall [To:! IntLiteral()] IntLiteral() as ImplicitAs(Int(To)) { diff --git a/toolchain/testing/testdata/min_prelude/parts/iterate.carbon b/toolchain/testing/testdata/min_prelude/parts/iterate.carbon index 507787bc117b..0aae03be0c5d 100644 --- a/toolchain/testing/testdata/min_prelude/parts/iterate.carbon +++ b/toolchain/testing/testdata/min_prelude/parts/iterate.carbon @@ -2,16 +2,18 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/copy.carbon // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/optional.carbon // --- min_prelude/parts/iterate.carbon package Core library "prelude/parts/iterate"; +import library "prelude/parts/copy"; import library "prelude/parts/optional"; interface Iterate { - let ElementType:! type; + let ElementType:! Copy; let CursorType:! type; fn NewCursor[self: Self]() -> CursorType; fn Next[self: Self](cursor: CursorType*) -> Optional(ElementType); diff --git a/toolchain/testing/testdata/min_prelude/parts/optional.carbon b/toolchain/testing/testdata/min_prelude/parts/optional.carbon index e5cf5e77a263..5339171ca53f 100644 --- a/toolchain/testing/testdata/min_prelude/parts/optional.carbon +++ b/toolchain/testing/testdata/min_prelude/parts/optional.carbon @@ -3,6 +3,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/bool.carbon +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/copy.carbon // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/destroy.carbon // --- min_prelude/parts/optional.carbon @@ -10,9 +11,10 @@ package Core library "prelude/parts/optional"; import library "prelude/parts/bool"; +import library "prelude/parts/copy"; import library "prelude/parts/destroy"; -class Optional(T:! type) { +class Optional(T:! Copy) { fn None() -> Self { returned var me: Self; me.has_value = false; diff --git a/toolchain/testing/testdata/min_prelude/parts/uint.carbon b/toolchain/testing/testdata/min_prelude/parts/uint.carbon index 2c9427fc1622..e4e08602730c 100644 --- a/toolchain/testing/testdata/min_prelude/parts/uint.carbon +++ b/toolchain/testing/testdata/min_prelude/parts/uint.carbon @@ -3,6 +3,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/as.carbon +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/copy.carbon // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/int_literal.carbon // --- min_prelude/parts/uint.carbon @@ -10,6 +11,7 @@ package Core library "prelude/parts/uint"; export import library "prelude/parts/as"; +export import library "prelude/parts/copy"; export import library "prelude/parts/int_literal"; private fn MakeUInt(size: IntLiteral()) -> type = "int.make_type_unsigned"; @@ -18,6 +20,12 @@ class UInt(N:! IntLiteral()) { adapt MakeUInt(N); } +// Copy. + +impl forall [N:! IntLiteral()] UInt(N) as Copy { + fn Op[self: Self]() -> Self = "primitive_copy"; +} + // Conversions. impl forall [To:! IntLiteral()] IntLiteral() as ImplicitAs(UInt(To)) { diff --git a/toolchain/testing/testdata/min_prelude/primitives.carbon b/toolchain/testing/testdata/min_prelude/primitives.carbon index f6cf39d2788c..bccc42a4ac4f 100644 --- a/toolchain/testing/testdata/min_prelude/primitives.carbon +++ b/toolchain/testing/testdata/min_prelude/primitives.carbon @@ -3,6 +3,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/bool.carbon +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/copy.carbon // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/float.carbon // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/int.carbon // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/string.carbon @@ -15,6 +16,7 @@ package Core library "prelude"; export import library "prelude/parts/bool"; +export import library "prelude/parts/copy"; export import library "prelude/parts/float"; export import library "prelude/parts/int"; export import library "prelude/parts/string";